text:
namespace {

// This is a short-term solution to grant camera and/or microphone access to
// extensions:
// 1. Virtual keyboard extension.
// 2. Flutter gesture recognition extension.
// 3. TODO(smus): Airbender experiment 1.
// 4. TODO(smus): Airbender experiment 2.
// 5. Hotwording component extension.
// 6. XKB input method component extension.
// 7. M17n/T13n/CJK input method component extension.
// Once http://crbug.com/292856 is fixed, remove this whitelist.
bool IsMediaRequestWhitelistedForExtension(
    const extensions::Extension* extension) {
  return extension->id() == "mppnpdlheglhdfmldimlhpnegondlapf" ||
         extension->id() == "jokbpnebhdcladagohdnfgjcpejggllo" ||
         extension->id() == "clffjmdilanldobdnedchkdbofoimcgb" ||
         extension->id() == "nnckehldicaciogcbchegobnafnjkcne" ||
         extension->id() == "nbpagnldghgfoolbancepceaanlmhfmd" ||
         extension->id() == "jkghodnilhceideoidjikpgommlajknk" ||
         extension->id() == "gjaehgfemfahhmlgpdfknkhdnemmolop";
}

}  // namespace

ExtensionMediaAccessHandler::ExtensionMediaAccessHandler() {
}

ExtensionMediaAccessHandler::~ExtensionMediaAccessHandler() {
}

bool ExtensionMediaAccessHandler::SupportsStreamType(
    const content::MediaStreamType type,
    const extensions::Extension* extension) {
  return extension && (extension->is_platform_app() ||
                       IsMediaRequestWhitelistedForExtension(extension)) &&
         (type == content::MEDIA_DEVICE_AUDIO_CAPTURE ||
          type == content::MEDIA_DEVICE_VIDEO_CAPTURE);
}

bool ExtensionMediaAccessHandler::CheckMediaAccessPermission(
    content::WebContents* web_contents,
    const GURL& security_origin,
    content::MediaStreamType type,
    const extensions::Extension* extension) {
  return extension->permissions_data()->HasAPIPermission(
      type == content::MEDIA_DEVICE_AUDIO_CAPTURE
          ? extensions::APIPermission::kAudioCapture
          : extensions::APIPermission::kVideoCapture);
}

void ExtensionMediaAccessHandler::HandleRequest(
    content::WebContents* web_contents,
    const content::MediaStreamRequest& request,
    const content::MediaResponseCallback& callback,
    const extensions::Extension* extension) {
  // TODO(vrk): This code is largely duplicated in
  // MediaStreamDevicesController::Accept(). Move this code into a shared method
  // between the two classes.

  Profile* profile =
      Profile::FromBrowserContext(web_contents->GetBrowserContext());

  bool audio_allowed =
      request.audio_type == content::MEDIA_DEVICE_AUDIO_CAPTURE &&
      extension->permissions_data()->HasAPIPermission(
          extensions::APIPermission::kAudioCapture) &&
      GetDevicePolicy(profile, extension->url(), prefs::kAudioCaptureAllowed,
                      prefs::kAudioCaptureAllowedUrls) != ALWAYS_DENY;
  bool video_allowed =
      request.video_type == content::MEDIA_DEVICE_VIDEO_CAPTURE &&
      extension->permissions_data()->HasAPIPermission(
          extensions::APIPermission::kVideoCapture) &&
      GetDevicePolicy(profile, extension->url(), prefs::kVideoCaptureAllowed,
                      prefs::kVideoCaptureAllowedUrls) != ALWAYS_DENY;

  bool get_default_audio_device = audio_allowed;
  bool get_default_video_device = video_allowed;

  content::MediaStreamDevices devices;

  // Set an initial error result. If neither audio or video is allowed, we'll
  // never try to get any device below but will just create |ui| and return an
  // empty list with "invalid state" result. If at least one is allowed, we'll
  // try to get device(s), and if failure, we want to return "no hardware"
  // result.
  // TODO(grunell): The invalid state result should be changed to a new denied
  // result + a dcheck to ensure at least one of audio or video types is
  // capture.
  content::MediaStreamRequestResult result =
      (audio_allowed || video_allowed) ? content::MEDIA_DEVICE_NO_HARDWARE
                                       : content::MEDIA_DEVICE_INVALID_STATE;

  // Get the exact audio or video device if an id is specified.
  // We only set any error result here and before running the callback change
  // it to OK if we have any device.
  if (audio_allowed && !request.requested_audio_device_id.empty()) {
    const content::MediaStreamDevice* audio_device =
        MediaCaptureDevicesDispatcher::GetInstance()->GetRequestedAudioDevice(
            request.requested_audio_device_id);
    if (audio_device) {
      devices.push_back(*audio_device);
      get_default_audio_device = false;
    }
  }
  if (video_allowed && !request.requested_video_device_id.empty()) {
    const content::MediaStreamDevice* video_device =
        MediaCaptureDevicesDispatcher::GetInstance()->GetRequestedVideoDevice(
            request.requested_video_device_id);
    if (video_device) {
      devices.push_back(*video_device);
      get_default_video_device = false;
    }
  }

  // If either or both audio and video devices were requested but not
  // specified by id, get the default devices.
  if (get_default_audio_device || get_default_video_device) {
    MediaCaptureDevicesDispatcher::GetInstance()->GetDefaultDevicesForProfile(
        profile, get_default_audio_device, get_default_video_device, &devices);
  }

  std::unique_ptr<content::MediaStreamUI> ui;
  if (!devices.empty()) {
    result = content::MEDIA_DEVICE_OK;
    ui = MediaCaptureDevicesDispatcher::GetInstance()
             ->GetMediaStreamCaptureIndicator()
             ->RegisterMediaStream(web_contents, devices);
  }

  callback.Run(devices, result, std::move(ui));
}


text:
package me.thetimelord.trees;

import java.util.ArrayList;
import java.util.List;

import org.bukkit.Location;
import org.bukkit.World;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.configuration.file.FileConfiguration;

public class StarQuestTreesAndMobs extends org.bukkit.plugin.java.JavaPlugin
{
  public static FileConfiguration config;

  public void onEnable()
  {
    new TreeListener(this);

    getConfiguration();
    saveConfig();
    TreeListener.readConfig();
  }

  public void getConfiguration()
  {
    config = getConfig();
  }

  @SuppressWarnings("deprecation")
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
    if (!sender.hasPermission("starquest.trees"))
    {
      sender.sendMessage("You don't have permissions to do this");
    }

    if (sender.hasPermission("starquest.trees"))
    {
      if (cmd.getName().equalsIgnoreCase("readtreesconfig"))
      {
        TreeListener.readConfig();
      }
      if (cmd.getName().equalsIgnoreCase("preptree"))
      {
        if (args.length == 4)
        {
          List<String> dataString = new ArrayList<String>();
          for (int q = 0; q < Integer.parseInt(args[0]); q++)
          {
            for (int w = 0; w < Integer.parseInt(args[1]); w++)
            {
              String line = "";
              for (int e = 0; e < Integer.parseInt(args[2]); e++)
              {
                if (e > 0)
                {
                  line = line + ",";
                }
                line = line + "0";
              }

              dataString.add(line);
            }
          }
          getConfig().set("schematics." + args[3] + ".data", dataString);
          getConfig().set("schematics." + args[3] + ".meta", dataString);
          saveConfig();

          return true;
        }
        return false;
      }
      if (cmd.getName().equalsIgnoreCase("readtree"))
      {
        if (args.length == 5)
        {
          int treeX = Integer.parseInt(args[0]);
          int treeY = Integer.parseInt(args[1]);
          int treeZ = Integer.parseInt(args[2]);
          String schematicName = args[3];
          String treeWorld = args[4];
          World world = sender.getServer().getWorld(treeWorld);
          //Location treeCenter = new Location(world, treeX, treeY, treeZ);

          for (int i = 0; i < TreeListener.Schematics.size(); i++)
          {
            if (((schematic)TreeListener.Schematics.get(i)).name.equalsIgnoreCase(schematicName))
            {

              schematic s = (schematic)TreeListener.Schematics.get(i);
              Location treeLowCorner = new Location(world, treeX - s.schematicOffset.getBlockX(), treeY - s.schematicOffset.getBlockY(), treeZ - s.schematicOffset.getBlockZ());
              List<String> dataString = new ArrayList<String>();

              for (int q = 0; q < s.schematicDimensions.getBlockX(); q++)
              {
                for (int w = 0; w < s.schematicDimensions.getBlockY(); w++)
                {
                  String line = "";
                  for (int e = 0; e < s.schematicDimensions.getBlockZ(); e++)
                  {
                    if (e > 0)
                    {
                      line = line + ",";
                    }
                    line = line + Integer.toString(world.getBlockAt(treeLowCorner.getBlockX() + q, treeLowCorner.getBlockY() + w, treeLowCorner.getBlockZ() + e).getTypeId());
                  }

                  dataString.add(line);
                }
              }

              for (int u = 0; u < dataString.size(); u++) {}

              getConfig().set("schematics." + s.name + ".data", dataString);

              List<String> metaString = new ArrayList<String>();
              for (int q = 0; q < s.schematicDimensions.getBlockX(); q++)
              {
                for (int w = 0; w < s.schematicDimensions.getBlockY(); w++)
                {
                  String line = "";
                  for (int e = 0; e < s.schematicDimensions.getBlockZ(); e++)
                  {
                    if (e > 0)
                    {
                      line = line + ",";
                    }
                    line = line + Integer.toString(world.getBlockAt(treeLowCorner.getBlockX() + q, treeLowCorner.getBlockY() + w, treeLowCorner.getBlockZ() + e).getData());
                  }

                  metaString.add(line);
                }
              }

              getConfig().set("schematics." + s.name + ".meta", metaString);
            }
          }

          saveConfig();

          return true;
        }
      }
    }

    return false;
  }
}

redpajama_set_name: RedPajamaGithub


text:
/**
 * Created by artem on 11/9/15.
 */
define(['../module'], function (module) {
    module.service('DockerWebUI.Auth.Authentication',[function(){
        var service = {};
        service.logIn = function(){};
        service.signUp = function(){};
        return service
    }]);
});


text:
#define LOG_TAG "ObbFile_test"
#include <androidfw/ObbFile.h>
#include <utils/Log.h>
#include <utils/RefBase.h>
#include <utils/String8.h>

#include <gtest/gtest.h>

#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <string.h>

namespace android {

#define TEST_FILENAME "/test.obb"

class ObbFileTest : public testing::Test {
protected:
    sp<ObbFile> mObbFile;
    char* mExternalStorage;
    char* mFileName;

    virtual void SetUp() {
        mObbFile = new ObbFile();
        mExternalStorage = getenv("EXTERNAL_STORAGE");

        const int totalLen = strlen(mExternalStorage) + strlen(TEST_FILENAME) + 1;
        mFileName = new char[totalLen];
        snprintf(mFileName, totalLen, "%s%s", mExternalStorage, TEST_FILENAME);

        int fd = ::open(mFileName, O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR);
        if (fd < 0) {
            FAIL() << "Couldn't create " << mFileName << " for tests";
        }
    }

    virtual void TearDown() {
    }
};

TEST_F(ObbFileTest, ReadFailure) {
    EXPECT_FALSE(mObbFile->readFrom(-1))
            << "No failure on invalid file descriptor";
}

TEST_F(ObbFileTest, WriteThenRead) {
    const char* packageName = "com.example.obbfile";
    const int32_t versionNum = 1;

    mObbFile->setPackageName(String8(packageName));
    mObbFile->setVersion(versionNum);
#define SALT_SIZE 8
    unsigned char salt[SALT_SIZE] = {0x01, 0x10, 0x55, 0xAA, 0xFF, 0x00, 0x5A, 0xA5};
    EXPECT_TRUE(mObbFile->setSalt(salt, SALT_SIZE))
            << "Salt should be successfully set";

    EXPECT_TRUE(mObbFile->writeTo(mFileName))
            << "couldn't write to fake .obb file";

    mObbFile = new ObbFile();

    EXPECT_TRUE(mObbFile->readFrom(mFileName))
            << "couldn't read from fake .obb file";

    EXPECT_EQ(versionNum, mObbFile->getVersion())
            << "version didn't come out the same as it went in";
    const char* currentPackageName = mObbFile->getPackageName().string();
    EXPECT_STREQ(packageName, currentPackageName)
            << "package name didn't come out the same as it went in";

    size_t saltLen;
    const unsigned char* newSalt = mObbFile->getSalt(&saltLen);

    EXPECT_EQ(sizeof(salt), saltLen)
            << "salt sizes were not the same";

    for (int i = 0; i < sizeof(salt); i++) {
        EXPECT_EQ(salt[i], newSalt[i])
                << "salt character " << i << " should be equal";
    }
    EXPECT_TRUE(memcmp(newSalt, salt, sizeof(salt)) == 0)
            << "salts should be the same";
}

}


text:
package com.bison.app.commons.utils;

import android.annotation.SuppressLint;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;

/**
 * This class is used for conversion between Date and String;
 * @author oeager
 */
public class DateUtil {

	/**
	 *
yyyy-MM-dd HH:mm:ss

	 */
	public final static ThreadLocal<SimpleDateFormat> ymdhmsFormater = new ThreadLocal<SimpleDateFormat>() {
		@SuppressLint("SimpleDateFormat")
		@Override
		protected SimpleDateFormat initialValue() {
			return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		}
	};

	/**
	 *
yyyy-MM-dd

	 */
	public final static ThreadLocal<SimpleDateFormat> ymdFormater = new ThreadLocal<SimpleDateFormat>() {
		@SuppressLint("SimpleDateFormat")
		@Override
		protected SimpleDateFormat initialValue() {
			return new SimpleDateFormat("yyyy-MM-dd");
		}
	};
	/**
	 * Description: * gets a string that represents the current date and time.
	 * @param format format string, such as: "yyyy-MM-dd HH:mm:ss"
	 * the current date and time of type String @return String
	 */
	@SuppressLint("SimpleDateFormat")
	public static String getCurrentDate(String format) {

		String curDateTime = null;
		try {
			SimpleDateFormat mSimpleDateFormat = new SimpleDateFormat(format);
			Calendar c = new GregorianCalendar();
			curDateTime = mSimpleDateFormat.format(c.getTime());
		} catch (Exception e) {
			e.printStackTrace();
		}
		return curDateTime;

	}
	/**
	 * convert the String str to Date type;
	 *
	 * @param sdate
	 * @return format date
just like: 2014-12-12:12:12:56

	 */
	public static Date toDate(String sdate) {
		try {
			return ymdhmsFormater.get().parse(sdate);
		} catch (ParseException e) {
			return null;
		}
	}

	/**
	 * determine time is today for the given string;
	 * @param sdate
	 * @return boolean
	 */
	public static boolean isToday(String sdate){
		boolean b = false;
		Date time = toDate(sdate);
		Date today = new Date();
		if(time != null){
			String nowDate = ymdFormater.get().format(today);
			String timeDate = ymdFormater.get().format(time);
			if(nowDate.equals(timeDate)){
				b = true;
			}
		}
		return b;
	}
	/**
	 * Number of days between two dates calculated difference
	 */
	public static int getOffectDay(long date1, long date2) {
		Calendar calendar1 = Calendar.getInstance();
		calendar1.setTimeInMillis(date1);
		Calendar calendar2 = Calendar.getInstance();
		calendar2.setTimeInMillis(date2);
		int y1 = calendar1.get(Calendar.YEAR);
		int y2 = calendar2.get(Calendar.YEAR);
		int d1 = calendar1.get(Calendar.DAY_OF_YEAR);
		int d2 = calendar2.get(Calendar.DAY_OF_YEAR);
		int maxDays = 0;
		int day = 0;
		if (y1 - y2 > 0) {
			maxDays = calendar2.getActualMaximum(Calendar.DAY_OF_YEAR);
			day = d1 - d2 + maxDays;
		} else if (y1 - y2 < 0) {
			maxDays = calendar1.getActualMaximum(Calendar.DAY_OF_YEAR);
			day = d1 - d2 - maxDays;
		} else {
			day = d1 - d2;
		}
		return day;
	}

	/**
	 *	calculate the number of hours between two difference dates;
	 */
	public static int getOffectHour(long date1, long date2) {
		Calendar calendar1 = Calendar.getInstance();
		calendar1.setTimeInMillis(date1);
		Calendar calendar2 = Calendar.getInstance();
		calendar2.setTimeInMillis(date2);
		int h1 = calendar1.get(Calendar.HOUR_OF_DAY);
		int h2 = calendar2.get(Calendar.HOUR_OF_DAY);
		int h = 0;
		int day = getOffectDay(date1, date2);
		h = h1-h2+day*24;
		return h;
	}

	/**
	 * the offset minutes between two dates
	 */
	public static int getOffectMinutes(long date1, long date2) {
		Calendar calendar1 = Calendar.getInstance();
		calendar1.setTimeInMillis(date1);
		Calendar calendar2 = Calendar.getInstance();
		calendar2.setTimeInMillis(date2);
		int m1 = calendar1.get(Calendar.MINUTE);
		int m2 = calendar2.get(Calendar.MINUTE);
		int h = getOffectHour(date1, date2);
		int m = 0;
		m = m1-m2+h*60;
		return m;
	}/**
	 * to determine a year is Leap or not
	 */
	public static boolean isLeapYear(int year) {
		if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) {
			return true;
		} else {
			return false;
		}
	}
	/**
	 * determine whether the date is greater than today
	 * @param time:the string str must formated {"yyyy-MM-dd HH:mm:ss"}
	 * @return
	 */
	public static boolean isEndofToday(String time){
		Date times = toDate(time);
		Date today = new Date();
		return today.before(times);

	}

	public static String  getCurrentDate(SimpleDateFormat format){
		Date date = new Date();
		return format.format(date);
	}

}


text:
class BindAndCleanup
{
public:
    // This class can also be used also prevent leaks.
    // Where you would call glActiveTextureUnit() and glBindTexture(), you bind a lambda.
    // Where you would call glBindBuffer() or glBindBufferBase() or glBindVertexArray().

    // NOTE: Cleanup functions are not called when the object is destructed. You must call Cleanup().

    // For example:
    //  AddBindFunction( [=](){ glBindVertexArray( VAO ); } );
    //  AddCleanupFunction( [=](){ glDeleteVertexArrays( 1, &VAO ); } );
    // or
    //  AddBindFunction( [=](){ glBindBufferBase( GL_TRANSFORM_FEEDBACK_BUFFER, 0, TBO ); } );
    //  AddCleanupFunction( [=](){ glDeleteBuffers( 1, &TBO ); } );
    // or
    //  AddBindFunction( [=](){ glActiveTexture( GL_TEXTURE0 + offset ); glBindTexture( GL_TEXTURE_2D, tex ); } );
    //  AddCleanupFunction( [=](){ glDeleteTextures( 1, &tex ); } );

    // constructor
    BindAndCleanup() {}

    void AddBindFunction( std::function< void(void) > f );
    void AddCleanupFunction( std::function< void(void) > f );

    // Calls all functions passed to AddBindFunction().
    void Bind();
    // Calls all functions passed to AddCleanupFunction().
    void Cleanup();

private:
    // Bind() will call these.
    std::vector< std::function< void(void) > > m_bind_functions;
    // Cleanup() will call these.
    std::vector< std::function< void(void) > > m_cleanup_functions;
};

#endif


text:
import { CLEAR_QUERY_WAS_CLICKED }          from '../actions';
import { INITIATE_BUILD_QUERY }             from '../actions';
import { STORE_QUERY_WAS_CLICKED }          from '../actions';
import { OPEN_BUILD_QUERY_DIALOG }          from '../actions';
import { OPEN_CLEAR_QUERY_DIALOG }          from '../actions';
import { CLOSE_BUILD_QUERY_DIALOG }         from '../actions';
import { CLOSE_CLEAR_QUERY_DIALOG }         from '../actions';
import { QUERY_TEXT_CHANGED }               from '../actions';
import { CLEAR_ALL_QUERIES_WAS_CLICKED }    from '../actions';
import { REBUILD_DATABASE_WAS_CLICKED }     from '../actions';
import { OPEN_CLEAR_ALL_QUERIES_DIALOG }    from '../actions';
import { CLOSE_CLEAR_ALL_QUERIES_DIALOG }   from '../actions';
import { OPEN_REBUILD_DATABASE_DIALOG }     from '../actions';
import { CLOSE_REBUILD_DATABASE_DIALOG }    from '../actions';
import { PASSWORD_TEXT_CHANGED }            from '../actions';
import { USERNAME_TEXT_CHANGED }            from '../actions';
import { LIMIT_CHANGED }                    from '../actions';

import { collections }    from '../config';
import { GenericAction }  from '../types';
import { Node }           from '../types';
import { Selected }       from '../types';

const initstate: any = {
    isQueryBuildDialogOpen: false,
    isQueryClearDialogOpen: false,
    isClearAllQueriesDialogOpen: false,
    isRebuildDatabaseDialogOpen: false,
    selectedMentionCount: 0,
    username: 'defaultuser',
    queryString: '',
    mention_limit: 100
};

function aggregateSelected(nodes : any, node: Node) : Node[] {
    if (node.selected === Selected.All) {
        return [node];
    } else if (node.selected === Selected.None) {
        return [];
    } else { // selectionState must be partial
        const childIDs = node.children;

        let result : Node[] = [];
        if (! childIDs) {
          result = [];
        } else {
          childIDs.forEach((childID: number) => {
              const childNode = nodes[childID];
              result = result.concat(aggregateSelected(nodes, childNode));
          });
        }

        return result;
    }
}

function countMentions(state: any) : number {
    const counts: number[] = [0];

    collections.forEach((collection: string) => {
        if (state[collection].length > 0) {
            let temp = 0;
            state[collection].forEach((thing: any) => {
                temp += thing.mentioncount;
            });
            counts.push(temp);
        }
    });

    const min = counts.filter((x: any) => { return x !== 0; })
        .reduce((a: any, b: any) => { return Math.min(a, b); }, Infinity);

    const max = counts.reduce((a: any, b: any) => { return Math.max(a, b); }, -Infinity);

    if (min < max) {
        return -min;
    } else {
        return max;
    }
}

function getTypesFromSlice(stateSlice: any) : string[] {
    const types : string[] = [];
    stateSlice.forEach((entity: any) => {
        if (types.indexOf(entity.queryType) < 0) {
            types.push(entity.queryType);
        }
    });

    return types;
}

function concatQueriesOfType(stateSlice: any, type: string) : string {
    let result : string = '';

    stateSlice.forEach((entity: any) => {
        if (entity.queryType === type) {
            result += ' ' + entity.query + ';';
        }
    });

    return result;
}

function createSingleTypeQueryString(stateSlice: any) : string {
    let result : string = '';

    if (stateSlice && stateSlice.length > 0) {
        const types : string[] = getTypesFromSlice(stateSlice);

        types.forEach((type: string) => {
            result += ' --' + type;
            result += concatQueriesOfType(stateSlice, type);
        });
    }

    return result;
}

function createQueryString(state: any) : string {
    let result : string = '';
    result += createSingleTypeQueryString(state.light);
    result += createSingleTypeQueryString(state.dark);
    result += createSingleTypeQueryString(state.concepts);
    result += createSingleTypeQueryString(state.events);
    result += createSingleTypeQueryString(state.authors);
    result += createSingleTypeQueryString(state.cited);
    result += createSingleTypeQueryString(state.topics);
    result += createSingleTypeQueryString(state.perspectives);

    return result;
}

export const queryReducer = (state: any = initstate, action: GenericAction) => {
    if (action.type === CLEAR_QUERY_WAS_CLICKED) {
        return Object.assign({}, initstate);
    } else if (action.type === INITIATE_BUILD_QUERY) {
        const newquery = Object.assign({}, state.query);

        collections.forEach((collection: string) => {
            newquery[collection] = aggregateSelected(state[collection], state[collection][-1]);
        });

        newquery.selectedMentionCount = countMentions(newquery);
        newquery.queryString = createQueryString(newquery);

        return newquery;
    } else if (action.type === OPEN_BUILD_QUERY_DIALOG) {
        return Object.assign({}, state.query, {isQueryBuildDialogOpen: true});
    } else if (action.type === OPEN_CLEAR_QUERY_DIALOG) {
        return Object.assign({}, state.query, {isQueryClearDialogOpen: true});
    } else if (action.type === OPEN_CLEAR_ALL_QUERIES_DIALOG) {
        return Object.assign({}, state.query, {isClearAllQueriesDialogOpen: true});
    } else if (action.type === OPEN_REBUILD_DATABASE_DIALOG) {
        return Object.assign({}, state.query, {isRebuildDatabaseDialogOpen: true});
    } else if (action.type === CLOSE_BUILD_QUERY_DIALOG) {
        return Object.assign({}, state.query, {isQueryBuildDialogOpen: false});
    } else if (action.type === CLOSE_CLEAR_QUERY_DIALOG) {
        return Object.assign({}, state.query, {isQueryClearDialogOpen: false});
    } else if (action.type === CLOSE_CLEAR_ALL_QUERIES_DIALOG) {
        return Object.assign({}, state.query, {isClearAllQueriesDialogOpen: false});
    } else if (action.type === CLOSE_REBUILD_DATABASE_DIALOG) {
        return Object.assign({}, state.query, {isRebuildDatabaseDialogOpen: false});
    } else if (action.type === QUERY_TEXT_CHANGED) {
        const { newtext } = action.payload;
        return Object.assign({}, state.query, {queryString: newtext});
    } else if (action.type === PASSWORD_TEXT_CHANGED) {
        const { password } = action.payload;
        return Object.assign({}, state.query, {password});
    } else if (action.type === USERNAME_TEXT_CHANGED) {
        const { username } = action.payload;
        return Object.assign({}, state.query, {username});
    } else if (action.type === LIMIT_CHANGED) {
        const { mention_limit } = action.payload;
        return Object.assign({}, state.query, {mention_limit});
    } else if (action.type === STORE_QUERY_WAS_CLICKED) {
        //Needs something done, like a spinner or something.
        return state.query;
    } else if (action.type === CLEAR_ALL_QUERIES_WAS_CLICKED) {
        //Needs something done, like a spinner or something.
        return state.query;
    } else if (action.type === REBUILD_DATABASE_WAS_CLICKED) {
        //Needs something done, like a spinner or something.
        return state.query;
    } else {
        if (!state.query || !state.query.queryString) {
            return Object.assign({}, initstate);
        } else {
            return state.query;
        }
    }
};


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Cloudlab.Controllers.Filters
{
    public class APIAuthorizationFilter
    {
    }
}


text:
This gem is an Azure Active Directory B2C Strategy for [OmniAuth][omniauth].

# Usage

In your `Gemfile` add `gem 'omniauth-azure_active_directory_b2c'`.

In your codebase add `require 'omniauth-azure_active_directory_b2c'`.

# Configuration

Configuration depends on your stack... are you using a vanilla Rack application?  Are you using Rails with the Devise and OmniAuth module?  Are you using Rails directly with the OmniAuth gem? Are you using Sinatra?

## Rails, Devise, and the OmniAuth module

In `config/initializers/devise.rb`:

```ruby
config.omniauth :azure_active_directory_b2c, strategy_options
```

Head over to the [Devise repo][devise] and the [OmniAuth Module Overview][devise_omniauth] for further instructions on how to set up routes, controllers, etc.

See the next section for the strategy options.

## Rails and the OmniAuth gem

In `config/initializers/omniauth.rb`:

```ruby
Rails.application.config.middleware.use OmniAuth::Builder do
  provider :azure_active_directory_b2c, strategy_options
end
```

Head over to [the OmniAuth repo][omniauth] and its [wiki][omniauth_wiki] for further background info and instructions.

See the next section for the strategy options.

## Sinatra

```ruby
class MyApp < Sinatra::Base
  use Rack::Session::Cookie
  use OmniAuth::Builder do
    provider :azure_active_directory_b2c, strategy_options
  end

  get '/auth/:provider' do
    raise "OmniAuth provider has not been configured: %s" % params['provider']
  end

  get '/auth/:provider/callback' do
    env['omniauth.auth']
  end

end
```

Head over to [the OmniAuth repo][omniauth] and its [wiki][omniauth_wiki] for further background info and instructions.

See the next section for the strategy options.

# Strategy Options

This strategy accepts the following options:

Option | Required | Description |
------ | -------- | ----------- |
`:name` | Optional | Sets the provider name used in the request and callback URLs.  Defaults to `'azure_active_directory_b2c'`.
`:redirect_uri` | Required | The absolute url sent to the Azure AD B2C policy to initiate the callback phase.
`:policy_options` | Required | A hash used to initialize an `OmniAuth::Strategies::AzureActiveDirectoryB2C::Policy object`.

Additional info for each option will follow.

This is a complete example:

```ruby
use OmniAuth::Builder do
  provider :azure_active_directory_b2c, {
    redirect_uri: ->(strategy) { 'http://localhost:9292/auth/%s/callback' % strategy.optionsname },
    policy_options: {
      application_identifier: '00000000-0000-0000-0000-000000000000',
      application_secret: '****************',
      tenant_name: 'example.onmicrosoft.com',
      policy_name: 'b2c_1_signupin',
      scope: [
          :openid,
          'https://example.onmicrosoft.com/example-api/user_impersonation',
          'https://example.onmicrosoft.com/example-api/read',
          'https://example.onmicrosoft.com/example-api/write',
        ],
      jwk_signing_keys: { 'keys' => [{ 'kid' => '...', 'n' => '...' }]},
    }
  }
end
```

## `:name`

By default, `:name` is set to `azure_active_directory_b2c`.

This tells the OmniAuth gem what to name the request and callback URLs.

Eg. `GET /auth/:name` and `GET /auth/:name/callback`.

When you direct a user to `GET /auth/azure_active_directory_b2c`, the `request_phase` of this strategy will be initiated and the user will be redirected to the `authorize` endpoint of the Azure AD B2C Policy.

When the Azure AD B2C Policy returns, it will return to the given `redirect_url` which should, by default, match up to `GET /auth/azure_active_directory_b2c/callback`.  This will initiate the `callback_phase` of this strategy.  The strategy uses the `code` returned from the policy to request an `access_code` and `id_token` from the policy.

The unencrypted user information will be available from the environment: `env['omniauth.auth']`.

## `:redirect_uri`

This is required as the URI must be absolute.  The option can be used in one of two ways:

Pass in a String:
```ruby
provider :azure_active_directory_b2c, redirect_uri: 'https://localhost:9292/auth/azure_active_directory_b2c/callback'
```

Pass in a Proc that returns a String:
```ruby
provider :azure_active_directory_b2c, {
  redirect_uri: ->(strategy) {
    'https://localhost:9292/auth/%s/callback' % strategy.options.name
  }
}
```

You must ensure that `redirect_uri` is registered with the Application in the Azure AD B2C tennant otherwise you will get errors.

## `:policy_options`

These options provide the configuation for the Azure AD B2C Tenant, Application, and Policy being used as the Identity Provider.

A hash can be passed to `policy_options` specifying the following:
- `:application_identifier`
- `:application_secret`
- `:tenant_name`: This is the Domain Name or Resource name found in the Overview blade in the Azure AD B2C portal.
- `:policy_name`: The name of the policy that the user should be redirected to and authenticated against
- `:scope`: Defaults to `[:openid]`, but can be overriden to request specific api permissions.  Eg. `[:openid, 'https://example.onmicrosoft.com/example-api/user_impersonation']`.  See the microsoft docs form more info: [here][ms_scopes] and [here][ms_oauth_code].
- `:jwk_signing_keys`: This is required to decode the `id_token` returned from the `token` endpoint.  The key can be found by going to the url that is specified in `jwks_uri` parameter at the policy's `.well-known/openid-configuration` page.  Eg: `https://login.microsoftonline.com/te/example.onmicrosoft.com/b2c_1_signupin/discovery/v2.0/keys`.

# Advanced configuration

An alternative approach to integration is to create a subclass of `OmniAuth::Strategies::AzureActiveDirectoryB2C`.

## Basic example

```ruby
module OmniAuth
  module Strategies
    class CustomB2CStrategy < AzureActiveDirectoryB2C

      option :name, 'custom_b2c_strategy'

      def redirect_uri
        'http://localhost:9292/auth/%s/callback' % options.name
      end

      def policy_options
        { application_identifier: '...', application_secret: '***', etc: '...' }
      end
    end
  end
end
OmniAuth.config.add_camelization('custom_b2c_strategy', 'CustomB2C')

use OmniAuth::Builder do
  provider :custom_b2c_strategy
end
```

## Dynamically load policy options to use multiple Azure AD B2C Policies from multiple tenants (Rails example):

```ruby
# app/models/policy.rb
class Policy < ActiveRecord::Base
  include OmniAuth::Strategies::AzureActiveDirectoryB2C::PolicyOptions
end

# lib/custom_b2c_strategy.rb
module OmniAuth
  module Strategies
    class CustomB2CStrategy < AzureActiveDirectoryB2C

      option :name, 'custom_b2c_strategy'

      def redirect_uri
        'http://localhost:9292/auth/%s/callback' % options.name
      end

      def policy_name
        @policy_name ||= begin
            stored_policy_name = session['omniauth.policy_name']
            session['omniauth.policy_name'] = request.params['policy_name']
            session['omniauth.policy_name'] || stored_policy_name
          end
      end

      # override
      def policy
        @policy ||= Policy.find_by(name: policy_name)
      end
    end
  end
end
OmniAuth.config.add_camelization('custom_b2c_strategy', 'CustomB2C')

# config/initializers/devise.rb
require 'lib/custom_b2c_strategy.rb'

use OmniAuth::Builder do
  provider :custom_b2c_strategy
end
```

This example is overriding the `policy` method.

The object returned can be either:
* a subclass of `OmniAuth::Strategies::AzureActiveDirectoryB2C::Policy`, or;
* include the module `OmniAuth::Strategies::AzureActiveDirectoryB2C::PolicyOptions`

 In this case an `ActiveRecord` model that implements the `OmniAuth::Strategies::AzureActiveDirectoryB2C::PolicyOptions` is being returned.

The `policy_name` is expected to be provided as an URL parameter to the request URL. Eg: `GET /auth/azure_active_directory_b2c?policy_name=test`

## Overriding `authentication_request` and `authentication_response`

These two methods can be overriden to allow the developer to provide their own implementation of `OmniAuth::Strategies::AzureActiveDirectoryB2C::AuthenticationRequest` and `OmniAuth::Strategies::AzureActiveDirectoryB2C::AuthenticationResponse`.

This may be necessary if the developer wants to
- use an unsupported authorization flow
- use a different decoding algorithm for the access code and id token
- access different claims returned in the id_token

## Overriding `validate_callback_response!`

This allows develops to either override, or add to the validation provided by this gem.

# Known Limitations

* The strategy only supports the `code` authorization flow.
* The gem doesn't support discovery, but neither does Azure AD B2C as far as I can tell.

[devise]: https://github.com/plataformatec/devise
[devise_omniauth]: https://github.com/plataformatec/devise/wiki/OmniAuth:-Overview
[omniauth]: https://github.com/omniauth/omniauth
[omniauth_wiki]: https://github.com/omniauth/omniauth/wiki
[ms_scopes]: https://docs.microsoft.com/en-us/azure/active-directory-b2c/active-directory-b2c-access-tokens
[ms_oauth_code]: https://docs.microsoft.com/en-us/azure/active-directory-b2c/active-directory-b2c-reference-oauth-code


text:
var Q = require('q');
var _ = require('lodash');

var SCHEDULE_QUEUE_KEY = 'or2:resource:scheduleq';

module.exports = function(opts, users, queries, objects) {

  var redis = opts.redisClient;

  // Schedule all the queries for a socket to be rechecked
  function scheduleQueriesForSocket(socket) {
    return Q.ninvoke(redis,
                     'zunionstore',
                     SCHEDULE_QUEUE_KEY,
                     2,
                     SCHEDULE_QUEUE_KEY,
                     queries.SOCKET_TO_QRYIDS_KEY(socket),
                     'WEIGHTS',
                     1,
                     2,
                     'AGGREGATE',
                     'MAX');
  }

  // Schedule all the queries to be rechecked.
  function scheduleQueriesForModel(model) {
    return users.getModels().then(function(models) {
      // We now merge in all the queries for each model into the queue. The score on the query
      // relates to whether we check the query even if the filters haven't changed (> 0 indicates
      // this, 0 says don't check unless the filter has changed)

      var noCheckKeys = [];
      models.forEach(function(_model) {
        if (!(model && (_model === model))) {
          noCheckKeys.push(queries.MODEL_TO_QRYIDS_KEY(_model));
        }
      });

      // (the number of nocheck plus 1 for the schedule q itself)
      var numKeysToMerge = noCheckKeys + 1;

      // If we have the model don't forget to include that
      if (model) {
        numKeysToMerge++;
      }

      // Merge all the no check queries into the queue. Build the arguments
      // 1. Add the destination (shedule queue)
      // 2. Add the number of keys
      // 3. Add the schedule queue
      var args = [SCHEDULE_QUEUE_KEY, numKeysToMerge, SCHEDULE_QUEUE_KEY];

      // 4. Add the keys that we don't want to check
      args.push.apply(args, noCheckKeys);

      // 5. If we have a model then add its key
      if (model) {
        args.push(queries.MODEL_TO_QRYIDS_KEY(model));
      }

      // 6. Now add in the weights. The first weight is 1 for the schedule queue
      args.push('WEIGHTS', 1);
      // Add in the nocheck weighting of 0 (we don't want to check)
      for (var ii = noCheckKeys.length - 1; ii >= 0; ii--) {
        args.push(0);
      }
      // If there is a model then add in the weighting of 1 for the model set
      if (model) {
        args.push(1);
      }

      // 7. Add in the aggregate (we want the max)
      args.push('AGGREGATE', 'MAX');

      // Now do the ZUNIONSTORE
      return Q.npost(redis, 'zunionstore', args);
    });
  }

  function scheduleObjectsForSocket(socket) {
    return Q.ninvoke(redis,
                     'zunionstore',
                     SCHEDULE_QUEUE_KEY,
                     2,
                     SCHEDULE_QUEUE_KEY,
                     objects.SOCKET_TO_OBJIDS_KEY(socket),
                     'WEIGHTS',
                     1,
                     2,
                     'AGGREGATE',
                     'MAX');
  }

  /**
   * Reschedule all objects
   * @return {[type]} a promise
   */
  function scheduleObjects() {
    // Merge the objects into the schedule queue
    return Q.ninvoke(redis,
                     'zunionstore',
                     SCHEDULE_QUEUE_KEY,
                     2,
                     SCHEDULE_QUEUE_KEY,
                     objects.ALL_OBJIDS_KEY,
                     'AGGREGATE',
                     'MAX');
  }

  function handleScheduledItem() {
    // Get a scheduled item. We get those with a score of 1 first because
    // we assume they are more likely to change (the 0s are just sanity checks really)
    // We have to use a multi because there is no such thing as zpop (sadly)
    var multi = redis.multi();
    multi.zrange(SCHEDULE_QUEUE_KEY, -1, -1, 'WITHSCORES');
    multi.zremrangebyrank(SCHEDULE_QUEUE_KEY, -1, -1);
    return Q.ninvoke(multi, 'exec').then(function(results) {
      // The zrange returns an array
      var keyToHandle = results[0][0];
      var score = results[0][1];

      // If we don't have a key then just exit
      if (!keyToHandle) {
        return;
      }

      if (queries.isQryKey(keyToHandle)) {
        // A score  > 0 indicates we should always recheck the query
        return handleScheduledQuery(keyToHandle, score > 0);

      } else if (objects.isObjIdKey(keyToHandle)) {
        return handleScheduledObject(keyToHandle);
      }
    });
  }

  function handleScheduledObject(objKey) {
    return objects.checkObject(objKey);
  }

  function handleScheduledQuery(qryKey, alwaysCheckQry) {
    return queries.checkQuery(qryKey, alwaysCheckQry);
  }

  function objectUpdated(model, socket) {
    scheduleQueriesForSocket(socket);
    scheduleObjectsForSocket(socket);
    scheduleObjects();
    scheduleQueriesForModel(model);
  }

  return {
    handleScheduledItem: handleScheduledItem,
    objectUpdated: objectUpdated
  };
};


text:
OS := $(shell uname -s)
ifeq ("$(OS)", "Darwin")
	PCSC_CFLAGS := -framework PCSC
else
	PCSC_CFLAGS ?= $(shell pkg-config libpcsclite --cflags)
	PCSC_LDLIBS ?= $(shell pkg-config libpcsclite --libs)
endif

CFLAGS := -Wall -O2 -g -DVERSION=\"$(VERSION)\" $(PCSC_CFLAGS)
LDLIBS := $(PCSC_LDLIBS)

PROGRAMS := SCardBeginTransaction \
	BufferOverflow

all: $(PROGRAMS)

clean:
	rm -f $(PROGRAMS)


text:
actions :unpack
default_action :unpack
provides :msys_archive

attribute :source, kind_of: String, name_attribute: true
attribute :root_dir, kind_of: String, required: true
attribute :mingw, kind_of: [TrueClass, FalseClass], default: false
attribute :checksum, kind_of: String


text:
import React from 'react';
import Layout from '../../components/Layout';
import Page from '../../components/Page';
import about from './about.md';

function action() {
  return {
    chunks: ['about'],
    title: about.title,
    component: (
      <Layout>
        <Page {...about} />
      </Layout>
    ),
  };
}

export default action;


text:
package com.facebook.buck.cxx;

import com.facebook.buck.core.cell.CellPathResolver;
import com.facebook.buck.core.description.MetadataProvidingDescription;
import com.facebook.buck.core.description.arg.HasContacts;
import com.facebook.buck.core.description.arg.HasTestTimeout;
import com.facebook.buck.core.description.attr.ImplicitDepsInferringDescription;
import com.facebook.buck.core.model.BuildTarget;
import com.facebook.buck.core.model.Flavor;
import com.facebook.buck.core.model.FlavorDomain;
import com.facebook.buck.core.model.Flavored;
import com.facebook.buck.core.model.targetgraph.BuildRuleCreationContextWithTargetGraph;
import com.facebook.buck.core.model.targetgraph.DescriptionWithTargetGraph;
import com.facebook.buck.core.rules.ActionGraphBuilder;
import com.facebook.buck.core.rules.BuildRule;
import com.facebook.buck.core.rules.BuildRuleParams;
import com.facebook.buck.core.rules.SourcePathRuleFinder;
import com.facebook.buck.core.rules.common.BuildableSupport;
import com.facebook.buck.core.sourcepath.PathSourcePath;
import com.facebook.buck.core.sourcepath.SourcePath;
import com.facebook.buck.core.toolchain.ToolchainProvider;
import com.facebook.buck.core.util.immutables.BuckStyleImmutable;
import com.facebook.buck.cxx.toolchain.CxxBuckConfig;
import com.facebook.buck.cxx.toolchain.CxxPlatform;
import com.facebook.buck.cxx.toolchain.CxxPlatforms;
import com.facebook.buck.cxx.toolchain.CxxPlatformsProvider;
import com.facebook.buck.cxx.toolchain.LinkerMapMode;
import com.facebook.buck.cxx.toolchain.StripStyle;
import com.facebook.buck.io.filesystem.ProjectFilesystem;
import com.facebook.buck.rules.args.Arg;
import com.facebook.buck.rules.macros.LocationMacroExpander;
import com.facebook.buck.rules.macros.StringWithMacros;
import com.facebook.buck.rules.macros.StringWithMacrosConverter;
import com.facebook.buck.rules.query.QueryUtils;
import com.facebook.buck.versions.Version;
import com.facebook.buck.versions.VersionRoot;
import com.google.common.base.Preconditions;
import com.google.common.collect.FluentIterable;
import com.google.common.collect.ImmutableCollection;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.ImmutableSortedSet;
import com.google.common.collect.Iterables;
import com.google.common.collect.Maps;
import com.google.common.collect.Ordering;
import com.google.common.collect.Sets;
import java.nio.file.Path;
import java.util.Optional;
import java.util.function.Function;
import org.immutables.value.Value;

public class CxxTestDescription
    implements DescriptionWithTargetGraph<CxxTestDescriptionArg>,
        Flavored,
        ImplicitDepsInferringDescription<CxxTestDescription.AbstractCxxTestDescriptionArg>,
        MetadataProvidingDescription<CxxTestDescriptionArg>,
        VersionRoot<CxxTestDescriptionArg> {

  private static final CxxTestType DEFAULT_TEST_TYPE = CxxTestType.GTEST;

  private final ToolchainProvider toolchainProvider;
  private final CxxBuckConfig cxxBuckConfig;
  private final ImmutableSet<Flavor> declaredPlatforms;
  private final CxxBinaryMetadataFactory cxxBinaryMetadataFactory;

  public CxxTestDescription(
      ToolchainProvider toolchainProvider,
      CxxBuckConfig cxxBuckConfig,
      CxxBinaryMetadataFactory cxxBinaryMetadataFactory) {
    this.toolchainProvider = toolchainProvider;
    this.cxxBuckConfig = cxxBuckConfig;
    this.declaredPlatforms = cxxBuckConfig.getDeclaredPlatforms();
    this.cxxBinaryMetadataFactory = cxxBinaryMetadataFactory;
  }

  private ImmutableSet<BuildTarget> getImplicitFrameworkDeps(
      AbstractCxxTestDescriptionArg constructorArg) {
    ImmutableSet.Builder<BuildTarget> deps = ImmutableSet.builder();

    CxxTestType type = constructorArg.getFramework().orElse(getDefaultTestType());
    switch (type) {
      case GTEST:
        {
          cxxBuckConfig.getGtestDep().ifPresent(deps::add);
          if (constructorArg.getUseDefaultTestMain().orElse(true)) {
            cxxBuckConfig.getGtestDefaultTestMainDep().ifPresent(deps::add);
          }
          break;
        }
      case BOOST:
        {
          cxxBuckConfig.getBoostTestDep().ifPresent(deps::add);
          break;
        }
      default:
        {
          break;
        }
    }

    return deps.build();
  }

  private CxxPlatform getCxxPlatform(
      BuildTarget target, CxxBinaryDescription.CommonArg constructorArg) {
    CxxPlatformsProvider cxxPlatformsProvider = getCxxPlatformsProvider();
    FlavorDomain<CxxPlatform> cxxPlatforms = cxxPlatformsProvider.getCxxPlatforms();

    // First check if the build target is setting a particular target.
    Optional<CxxPlatform> targetPlatform = cxxPlatforms.getValue(target.getFlavors());
    if (targetPlatform.isPresent()) {
      return targetPlatform.get();
    }

    // Next, check for a constructor arg level default platform.
    if (constructorArg.getDefaultPlatform().isPresent()) {
      return cxxPlatforms.getValue(constructorArg.getDefaultPlatform().get());
    }

    // Otherwise, fallback to the description-level default platform.
    return cxxPlatforms.getValue(cxxPlatformsProvider.getDefaultCxxPlatform().getFlavor());
  }

  @Override
  public Class<CxxTestDescriptionArg> getConstructorArgType() {
    return CxxTestDescriptionArg.class;
  }

  @SuppressWarnings("PMD.PrematureDeclaration")
  @Override
  public BuildRule createBuildRule(
      BuildRuleCreationContextWithTargetGraph context,
      BuildTarget inputBuildTarget,
      BuildRuleParams params,
      CxxTestDescriptionArg args) {
    Optional<StripStyle> flavoredStripStyle = StripStyle.FLAVOR_DOMAIN.getValue(inputBuildTarget);
    Optional<LinkerMapMode> flavoredLinkerMapMode =
        LinkerMapMode.FLAVOR_DOMAIN.getValue(inputBuildTarget);
    inputBuildTarget =
        CxxStrip.removeStripStyleFlavorInTarget(inputBuildTarget, flavoredStripStyle);
    inputBuildTarget =
        LinkerMapMode.removeLinkerMapModeFlavorInTarget(inputBuildTarget, flavoredLinkerMapMode);
    BuildTarget buildTarget = inputBuildTarget;

    CxxPlatform cxxPlatform = getCxxPlatform(buildTarget, args);
    ActionGraphBuilder graphBuilder = context.getActionGraphBuilder();
    SourcePathRuleFinder ruleFinder = new SourcePathRuleFinder(graphBuilder);
    ProjectFilesystem projectFilesystem = context.getProjectFilesystem();
    CellPathResolver cellRoots = context.getCellPathResolver();

    if (buildTarget.getFlavors().contains(CxxCompilationDatabase.COMPILATION_DATABASE)) {
      CxxLinkAndCompileRules cxxLinkAndCompileRules =
          CxxDescriptionEnhancer.createBuildRulesForCxxBinaryDescriptionArg(
              buildTarget.withoutFlavors(CxxCompilationDatabase.COMPILATION_DATABASE),
              projectFilesystem,
              graphBuilder,
              cellRoots,
              cxxBuckConfig,
              cxxPlatform,
              args,
              getImplicitFrameworkDeps(args),
              flavoredStripStyle,
              flavoredLinkerMapMode);
      return CxxCompilationDatabase.createCompilationDatabase(
          buildTarget, projectFilesystem, cxxLinkAndCompileRules.compileRules);
    }

    if (buildTarget.getFlavors().contains(CxxCompilationDatabase.UBER_COMPILATION_DATABASE)) {
      return CxxDescriptionEnhancer.createUberCompilationDatabase(
          getCxxPlatformsProvider().getCxxPlatforms().getValue(buildTarget).isPresent()
              ? buildTarget
              : buildTarget.withAppendedFlavors(cxxPlatform.getFlavor()),
          projectFilesystem,
          graphBuilder);
    }

    // Generate the link rule that builds the test binary.
    CxxLinkAndCompileRules cxxLinkAndCompileRules =
        CxxDescriptionEnhancer.createBuildRulesForCxxBinaryDescriptionArg(
            buildTarget,
            projectFilesystem,
            graphBuilder,
            cellRoots,
            cxxBuckConfig,
            cxxPlatform,
            args,
            getImplicitFrameworkDeps(args),
            flavoredStripStyle,
            flavoredLinkerMapMode);

    // Construct the actual build params we'll use, notably with an added dependency on the
    // CxxLink rule above which builds the test binary.
    BuildTarget testBuildTarget =
        CxxStrip.restoreStripStyleFlavorInTarget(buildTarget, flavoredStripStyle);
    testBuildTarget =
        LinkerMapMode.restoreLinkerMapModeFlavorInTarget(testBuildTarget, flavoredLinkerMapMode);
    BuildRuleParams testParams =
        params
            .withDeclaredDeps(cxxLinkAndCompileRules.deps)
            .copyAppendingExtraDeps(
                BuildableSupport.getDepsCollection(cxxLinkAndCompileRules.executable, ruleFinder));

    StringWithMacrosConverter macrosConverter =
        StringWithMacrosConverter.builder()
            .setBuildTarget(buildTarget)
            .setCellPathResolver(cellRoots)
            .addExpanders(new LocationMacroExpander())
            .build();

    // Supplier which expands macros in the passed in test environment.
    ImmutableMap<String, Arg> testEnv =
        ImmutableMap.copyOf(
            Maps.transformValues(args.getEnv(), x -> macrosConverter.convert(x, graphBuilder)));

    ImmutableList<Arg> testArgs =
        args.getArgs()
            .stream()
            .map(x -> macrosConverter.convert(x, graphBuilder))
            .collect(ImmutableList.toImmutableList());

    Function<SourcePathRuleFinder, ImmutableSortedSet<BuildRule>> additionalDeps =
        ruleFinderInner -> {
          ImmutableSortedSet.Builder<BuildRule> deps = ImmutableSortedSet.naturalOrder();

          // It's not uncommon for users to add dependencies onto other binaries that they run
          // during the test, so make sure to add them as runtime deps.
          deps.addAll(
              Sets.difference(
                  params.getBuildDeps(), cxxLinkAndCompileRules.getBinaryRule().getBuildDeps()));

          // Add any build-time from any macros embedded in the `env` or `args` parameter.
          for (Arg part : Iterables.concat(testArgs, testEnv.values())) {
            deps.addAll(BuildableSupport.getDepsCollection(part, ruleFinderInner));
          }

          return deps.build();
        };

    CxxTest test;

    CxxTestType type = args.getFramework().orElse(getDefaultTestType());
    switch (type) {
      case GTEST:
        {
          test =
              new CxxGtestTest(
                  testBuildTarget,
                  projectFilesystem,
                  testParams,
                  cxxLinkAndCompileRules.getBinaryRule(),
                  cxxLinkAndCompileRules.executable,
                  testEnv,
                  testArgs,
                  FluentIterable.from(args.getResources())
                      .transform(p -> PathSourcePath.of(projectFilesystem, p))
                      .toSortedSet(Ordering.natural()),
                  args.getAdditionalCoverageTargets(),
                  additionalDeps,
                  args.getLabels(),
                  args.getContacts(),
                  args.getRunTestSeparately().orElse(false),
                  args.getTestRuleTimeoutMs()
                      .map(Optional::of)
                      .orElse(cxxBuckConfig.getDelegate().getDefaultTestRuleTimeoutMs()),
                  cxxBuckConfig.getMaximumTestOutputSize());
          break;
        }
      case BOOST:
        {
          test =
              new CxxBoostTest(
                  testBuildTarget,
                  projectFilesystem,
                  testParams,
                  cxxLinkAndCompileRules.getBinaryRule(),
                  cxxLinkAndCompileRules.executable,
                  testEnv,
                  testArgs,
                  FluentIterable.from(args.getResources())
                      .transform(p -> PathSourcePath.of(projectFilesystem, p))
                      .toSortedSet(Ordering.natural()),
                  args.getAdditionalCoverageTargets(),
                  additionalDeps,
                  args.getLabels(),
                  args.getContacts(),
                  args.getRunTestSeparately().orElse(false),
                  args.getTestRuleTimeoutMs()
                      .map(Optional::of)
                      .orElse(cxxBuckConfig.getDelegate().getDefaultTestRuleTimeoutMs()));
          break;
        }
      default:
        {
          Preconditions.checkState(false, "Unhandled C++ test type: %s", type);
          throw new RuntimeException();
        }
    }

    return test;
  }

  @Override
  public void findDepsForTargetFromConstructorArgs(
      BuildTarget buildTarget,
      CellPathResolver cellRoots,
      AbstractCxxTestDescriptionArg constructorArg,
      ImmutableCollection.Builder<BuildTarget> extraDepsBuilder,
      ImmutableCollection.Builder<BuildTarget> targetGraphOnlyDepsBuilder) {

    // Get any parse time deps from the C/C++ platforms.
    targetGraphOnlyDepsBuilder.addAll(
        CxxPlatforms.getParseTimeDeps(getCxxPlatform(buildTarget, constructorArg)));

    // Add in any implicit framework deps.
    extraDepsBuilder.addAll(getImplicitFrameworkDeps(constructorArg));

    constructorArg
        .getDepsQuery()
        .ifPresent(
            depsQuery ->
                QueryUtils.extractParseTimeTargets(buildTarget, cellRoots, depsQuery)
                    .forEach(extraDepsBuilder::add));
  }

  public CxxTestType getDefaultTestType() {
    return DEFAULT_TEST_TYPE;
  }

  @Override
  public boolean hasFlavors(ImmutableSet<Flavor> flavors) {

    if (flavors.isEmpty()) {
      return true;
    }

    if (flavors.contains(CxxCompilationDatabase.COMPILATION_DATABASE)) {
      return true;
    }

    if (flavors.contains(CxxCompilationDatabase.UBER_COMPILATION_DATABASE)) {
      return true;
    }

    if (StripStyle.FLAVOR_DOMAIN.containsAnyOf(flavors)) {
      return true;
    }

    if (LinkerMapMode.FLAVOR_DOMAIN.containsAnyOf(flavors)) {
      return true;
    }

    return getCxxPlatformsProvider().getCxxPlatforms().containsAnyOf(flavors)
        || !Sets.intersection(declaredPlatforms, flavors).isEmpty();
  }

  @Override
  public <U> Optional<U> createMetadata(
      BuildTarget buildTarget,
      ActionGraphBuilder graphBuilder,
      CellPathResolver cellRoots,
      CxxTestDescriptionArg args,
      Optional<ImmutableMap<BuildTarget, Version>> selectedVersions,
      Class<U> metadataClass) {
    return cxxBinaryMetadataFactory.createMetadata(
        buildTarget, graphBuilder, args.getDeps(), metadataClass);
  }

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

  private CxxPlatformsProvider getCxxPlatformsProvider() {
    return toolchainProvider.getByName(
        CxxPlatformsProvider.DEFAULT_NAME, CxxPlatformsProvider.class);
  }

  @BuckStyleImmutable
  @Value.Immutable(copy = true)
  interface AbstractCxxTestDescriptionArg
      extends CxxBinaryDescription.CommonArg, HasContacts, HasTestTimeout {
    Optional<CxxTestType> getFramework();

    ImmutableMap<String, StringWithMacros> getEnv();

    ImmutableList<StringWithMacros> getArgs();

    Optional<Boolean> getRunTestSeparately();

    Optional<Boolean> getUseDefaultTestMain();

    @Value.NaturalOrder
    ImmutableSortedSet<Path> getResources();

    ImmutableSet<SourcePath> getAdditionalCoverageTargets();
  }
}


text:
/**
 * Gerado por template generation
 * Diretiva de overwrite atual:
 * TemplateName:
 **/
package br.com.dlp.jazzomr.person;

import java.security.Principal;
import java.util.Date;
import java.util.List;

import javax.jws.WebMethod;

import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils;
import org.hibernate.criterion.DetachedCriteria;
import org.hibernate.criterion.Restrictions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.orm.hibernate3.HibernateTemplate;
import org.springframework.stereotype.Component;

import br.com.dlp.framework.dao.ExtraArgumentsDTO;
import br.com.dlp.framework.dao.IDAO;
import br.com.dlp.framework.exception.JazzBusinessException;
import br.com.dlp.framework.security.SecurityHelper;
import br.com.dlp.jazzomr.base.AbstractJazzOMRBusinessImpl;
import br.com.dlp.jazzomr.base.StatusEnum;
import br.com.dlp.jazzomr.empresa.EmpresaVO;

/**
 * Incluir arquivo com comentários
 *
 * Contrado de Business para o componente PessoaVO
 *
 **/
@Component
public class PessoaBusinessImpl extends AbstractJazzOMRBusinessImpl<PessoaVO> implements PessoaBusiness {

	private static final long serialVersionUID = -4018418907098545031L;

	@Autowired
	private HibernateTemplate hibernateTemplate;

	/**
	 *
	 */
	@Override
	public PessoaVO revogarAcesso(PessoaVO pessoaVO) throws JazzBusinessException {

		pessoaVO.setStatus(StatusEnum.INACTIVE);

		if(pessoaVO.getPK()!=null){
			pessoaVO = saveOrUpdate(pessoaVO);
		}

		return pessoaVO;
	}

	/**
	 * Checa se existe o login informado
	 */
	@Override
	public Boolean existsLogin(String login) {

		if(StringUtils.isBlank(login)){
			return false;
		}

		List<Long> pessoaPks = hibernateTemplate.findByNamedParam("select PK from PessoaVO where login = :login", "login", login);

		return CollectionUtils.isNotEmpty(pessoaPks);
	}

	/**
	 *
	 */
	@Override
	public void includeUpdateValidations(PessoaVO pessoaVO) throws JazzBusinessException {

		/*
		String queryString =
				" select 			eve.PK" +
				" from 				EventVO eve " +
				" inner join 	eve.participations par " +
				" inner join 	par.examVariantVO exv " +
				" inner join 	exv.examVO exa " +
				" where exa = :examVO ";

		List<Long> eventPKs = hibernateTemplate.findByNamedParam(queryString, "examVO", pessoaVO);

		if(CollectionUtils.isNotEmpty(eventPKs)){
			throw new JazzOMRBusinessConsistencyException("Este exame não pode ser alterado ou excluído porque está sendo utilizado pelos eventos a seguir "+eventPKs+"!");
		}
		*/
		super.includeUpdateValidations(pessoaVO);
	}

	/**
	 *
	 */
	@Override
	public void deleteValidations(PessoaVO pessoaVO) throws JazzBusinessException {
		this.includeUpdateValidations(pessoaVO);
		super.deleteValidations(pessoaVO);
	}

	@Autowired
	private PessoaDAO pessoaDAO;

	/**
	 * Pesquisa entidades do tipo PessoaVO
	 *
	 * @author darcio
	 *
	 * @param login
	 * @param email
	 * @param nome
	 * @param telefone
	 * @param dtIncFrom
	 * @param dtIncTo
	 * @param dtAltFrom
	 * @param dtAltTo
	 * @param status
	 * @returns Coleção de PessoaVO
	 */
	public List<PessoaVO> findPessoaVO(String login, String email, String nome, String telefone, Date dtIncFrom, Date dtIncTo, Date dtAltFrom, Date dtAltTo, StatusEnum status) {
		return pessoaDAO.findPessoaVO(login, email, nome, telefone, dtIncFrom, dtIncTo, dtAltFrom, dtAltTo, status);
	}

	@Override
	public PessoaVO saveOrUpdate(PessoaVO baseVO) throws JazzBusinessException {
		PessoaVO pessoa = super.saveOrUpdate(baseVO);
		pessoa.setNovo(false);

		return pessoa;
	}

	@Override
	public PessoaVO update(PessoaVO iBaseVO) throws JazzBusinessException {
		PessoaVO pessoa = super.update(iBaseVO);
		pessoa.setNovo(false);
		return pessoa;
	}

	@Override
	protected void logInsertUpdate(PessoaVO pessoaVO) {

		if(pessoaVO!=null){

			EmpresaVO empresaUsuarioLogado = getEmpresaUsuarioLogado();

			EmpresaVO empresaVOLogging = pessoaVO.getEmpresaVO();

			if(empresaVOLogging!=null && empresaUsuarioLogado!=null){
				//Se não é um acesso anonimo e já existe uma empresa definida para o vo, entao tem que ser a mesma empresa
				preventEnterpriseChange(empresaUsuarioLogado, empresaVOLogging);
			}

			if(empresaUsuarioLogado!=null){
				pessoaVO.setEmpresaVO(empresaUsuarioLogado);
			}

			//loga alteracoes de pessoa
			String loginName = SecurityHelper.getInstance().getLoginName();

			if(StringUtils.isNotBlank(loginName)){
				if(StringUtils.isBlank(pessoaVO.getCriadoPor())){
					pessoaVO.setCriadoPor(loginName);
				}
				pessoaVO.setAlteradoPor(loginName);
			}

			pessoaVO.setDtAlt(new Date());

		}
	}

	/**
	 * Retorna o registro de pessoa para o Principal logado
	 */
	@Override
	public PessoaVO findPessoa(Principal principal) {

		String loginName = SecurityHelper.getInstance().getLoginName(principal);

		if(loginName==null){
			return null;
		}

		DetachedCriteria criteria = createDetachedCriteria(PessoaVO.class);

		criteria.add(Restrictions.eq("login", loginName));

		List<PessoaVO> pessoas = hibernateTemplate.findByCriteria(criteria);

		PessoaVO pessoaVO = null;

		if (CollectionUtils.isNotEmpty(pessoas)) {
			pessoaVO = pessoas.get(0);
		}

		return pessoaVO;
	}

	/**
	 * Pesquisa entidades do tipo PessoaVO
	 *
	 * @author darcio
	 *
	 * @param login
	 * @param email
	 * @param nome
	 * @param telefone
	 * @param dtIncFrom
	 * @param dtIncTo
	 * @param dtAltFrom
	 * @param dtAltTo
	 * @param status
	 * @returns Coleção de PessoaVO
	 */
	public Long countPessoaVO(String login, String email, String nome, String telefone, Date dtIncFrom, Date dtIncTo, Date dtAltFrom, Date dtAltTo, StatusEnum status) {

		//Object principal = SecurityContextHolder.getContext().getAuthentication().getPrincipal();

		return pessoaDAO.countPessoaVO(login, email, nome, telefone, dtIncFrom, dtIncTo, dtAltFrom, dtAltTo, status);
	}

	/**
	 * Pesquisa entidades do tipo PessoaVO
	 *
	 * @author darcio
	 *
	 * @param login
	 * @param email
	 * @param nome
	 * @param telefone
	 * @param dtIncFrom
	 * @param dtIncTo
	 * @param dtAltFrom
	 * @param dtAltTo
	 * @param status
	 * @param extraArgumentsDTO
	 *          Paginacao e Ordenação de pesquisa
	 * @returns Coleção de PessoaVO
	 */
	public List<PessoaVO> findPessoaVO(String login, String email, String nome, String telefone, Date dtIncFrom, Date dtIncTo, Date dtAltFrom, Date dtAltTo, StatusEnum status,
			ExtraArgumentsDTO extraArgumentsDTO) {
		return pessoaDAO.findPessoaVO(login, email, nome, telefone, dtIncFrom, dtIncTo, dtAltFrom, dtAltTo, status, extraArgumentsDTO);
	}

	/*
	 * (non-Javadoc)
	 *
	 * @see br.com.dlp.framework.business.AbstractBusinessImpl#getDao()
	 */
	@Override
	protected IDAO<PessoaVO> getDao() {
		return pessoaDAO;
	}

	/*
	 * (non-Javadoc)
	 *
	 * @see br.com.dlp.framework.business.AbstractBusinessImpl#newVO()
	 */
	@Override
	public PessoaVO newVO() {
		return new PessoaVO();
	}

}


text:
package com.cloudera.sa.apptrans.streaming.ingestion.solr

import java.text.SimpleDateFormat
import java.util.Date

import com.cloudera.sa.apptrans.common.SolrSupport
import com.cloudera.sa.apptrans.model.{AppEvent, AppEventBuilder}
import kafka.serializer.StringDecoder
import org.apache.solr.common.SolrInputDocument
import org.apache.solr.common.cloud.ZooKeeperException
import org.apache.spark.streaming.kafka.KafkaUtils
import org.apache.spark.streaming.{Seconds, StreamingContext}
import org.apache.spark.{SparkConf, SparkContext}

object SparkStreamingAppEventToSolR {
  def main(args: Array[String]): Unit = {
    println("Java Version:" + System.getProperty("java.version"))
    println("Java Home:" + System.getProperties().getProperty("java.home"))

    val v: ZooKeeperException = null

    if (args.length == 0) {
      println("Args: <KafkaBrokerList> " +
        "<kafkaTopicList> " +
        "<checkpointDir>" +
        "<numberOfSeconds>" +
        "<runLocal>" +
        "<solrCollection>" +
        "<zkHost>")
      return
    }

    val kafkaBrokerList = args(0)
    val kafkaTopicList = args(1)
    val checkPointFolder = args(2)
    val numberOfSeconds = args(3).toInt
    val runLocal = args(4).equals("l")
    val solrCollection = args(5)
    val zkHost = args(6)

    println("kafkaBrokerList:" + kafkaBrokerList)
    println("kafkaTopicList:" + kafkaTopicList)
    println("numberOfSeconds:" + numberOfSeconds)
    println("runLocal:" + runLocal)
    println("solrCollection:" + solrCollection)
    println("zkHost:" + zkHost)

    val sc: SparkContext = if (runLocal) {
      val sparkConfig = new SparkConf()
      sparkConfig.set("spark.broadcast.compress", "false")
      sparkConfig.set("spark.shuffle.compress", "false")
      sparkConfig.set("spark.shuffle.spill.compress", "false")
      new SparkContext("local[2]", "TableStatsSinglePathMain", sparkConfig)
    } else {
      val sparkConf = new SparkConf().setAppName("Spark Streaming Ingestion to SolR")
      new SparkContext(sparkConf)
    }
    val ssc = new StreamingContext(sc, Seconds(numberOfSeconds))

    val topicsSet = kafkaTopicList.split(",").toSet
    val kafkaParams = Map[String, String]("metadata.broker.list" -> kafkaBrokerList)

    val messageStream = KafkaUtils.
      createDirectStream[String, String, StringDecoder, StringDecoder](ssc, kafkaParams, topicsSet)

    val appEventDStream = messageStream.map { case (key, value) => AppEventBuilder.build(value) }

    val solrDocumentDStream = appEventDStream.map(convertToSolRDocuments)

    SolrSupport.indexDStreamOfDocs(zkHost,
      solrCollection,
      100,
      solrDocumentDStream)

    ssc.checkpoint(checkPointFolder)
    ssc.start()
    ssc.awaitTermination()
  }

  def convertToSolRDocuments(appEvent:AppEvent): SolrInputDocument = {
    val dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'")

    val doc: SolrInputDocument = new SolrInputDocument
    doc.addField("id", appEvent.eventType + ":" + appEvent.eventId)
    doc.addField("account_id", appEvent.accountId)
    doc.addField("app_id", appEvent.appId)
    doc.addField("event_time_stamp", dateFormat.format(new Date(appEvent.eventTimestamp)))
    doc.addField("event_id", appEvent.eventId)
    doc.addField("event_type", appEvent.eventType)
    doc.addField("purchase", appEvent.purchase)
    doc.addField("payment_type", appEvent.paymentType)
    doc.addField("session_id", appEvent.sessionId)
    doc.addField("latitude", appEvent.latitude)
    doc.addField("longitude", appEvent.longitude)

    doc
  }
}


text:
import * as React from 'react';
import * as ReactDOM from 'react-dom';
import { HideAt, ShowAt } from '../src/index';

// Mock
window.matchMedia = jest.fn().mockImplementation(query => {
  return {
    matches: false,
    media: query,
    onchange: null,
    addListener: jest.fn(),
    removeListener: jest.fn(),
  };
});

describe('<HideAt>', () => {
  const div = document.createElement('div');
  ReactDOM.render(
    <HideAt breakpoint="(min-width: 10em)">

Anything here

    </HideAt>,
    div
  );

  it('should render its children', () => {
    expect(div).toMatchSnapshot();
  });
});

describe('<ShowAt>', () => {
  const div = document.createElement('div');
  ReactDOM.render(
    <ShowAt breakpoint="(min-width: 10em)">

Anything here

    </ShowAt>,
    div
  );

  it('should not render its children', () => {
    expect(div).toMatchSnapshot();
  });
});


text:
#pragma once

#include "il2cpp-config.h"

#ifndef _MSC_VER
# include <alloca.h>
#else
# include <malloc.h>
#endif

#include <stdint.h>

#include "mscorlib_System_ValueType4014882752.h"

#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif

// System.UInt64
struct  UInt64_t985925421
{
public:
	// System.UInt64 System.UInt64::m_value
	uint64_t ___m_value_0;

public:
	inline static int32_t get_offset_of_m_value_0() { return static_cast<int32_t>(offsetof(UInt64_t985925421, ___m_value_0)); }
	inline uint64_t get_m_value_0() const { return ___m_value_0; }
	inline uint64_t* get_address_of_m_value_0() { return &___m_value_0; }
	inline void set_m_value_0(uint64_t value)
	{
		___m_value_0 = value;
	}
};

#ifdef __clang__
#pragma clang diagnostic pop
#endif


text:
from copy import deepcopy
from typing import Any, Awaitable, TYPE_CHECKING

from azure.core.rest import AsyncHttpResponse, HttpRequest
from azure.mgmt.core import AsyncARMPipelineClient

from .. import models
from .._serialization import Deserializer, Serializer
from ._configuration import DevTestLabsClientConfiguration
from .operations import (
    ArmTemplatesOperations,
    ArtifactSourcesOperations,
    ArtifactsOperations,
    CostsOperations,
    CustomImagesOperations,
    DisksOperations,
    EnvironmentsOperations,
    FormulasOperations,
    GalleryImagesOperations,
    GlobalSchedulesOperations,
    LabsOperations,
    NotificationChannelsOperations,
    Operations,
    PoliciesOperations,
    PolicySetsOperations,
    ProviderOperationsOperations,
    SchedulesOperations,
    SecretsOperations,
    ServiceFabricSchedulesOperations,
    ServiceFabricsOperations,
    ServiceRunnersOperations,
    UsersOperations,
    VirtualMachineSchedulesOperations,
    VirtualMachinesOperations,
    VirtualNetworksOperations,
)

if TYPE_CHECKING:
    # pylint: disable=unused-import,ungrouped-imports
    from azure.core.credentials_async import AsyncTokenCredential

class DevTestLabsClient:  # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes
    """The DevTest Labs Client.

    :ivar provider_operations: ProviderOperationsOperations operations
    :vartype provider_operations:
     azure.mgmt.devtestlabs.aio.operations.ProviderOperationsOperations
    :ivar labs: LabsOperations operations
    :vartype labs: azure.mgmt.devtestlabs.aio.operations.LabsOperations
    :ivar operations: Operations operations
    :vartype operations: azure.mgmt.devtestlabs.aio.operations.Operations
    :ivar global_schedules: GlobalSchedulesOperations operations
    :vartype global_schedules: azure.mgmt.devtestlabs.aio.operations.GlobalSchedulesOperations
    :ivar artifact_sources: ArtifactSourcesOperations operations
    :vartype artifact_sources: azure.mgmt.devtestlabs.aio.operations.ArtifactSourcesOperations
    :ivar arm_templates: ArmTemplatesOperations operations
    :vartype arm_templates: azure.mgmt.devtestlabs.aio.operations.ArmTemplatesOperations
    :ivar artifacts: ArtifactsOperations operations
    :vartype artifacts: azure.mgmt.devtestlabs.aio.operations.ArtifactsOperations
    :ivar costs: CostsOperations operations
    :vartype costs: azure.mgmt.devtestlabs.aio.operations.CostsOperations
    :ivar custom_images: CustomImagesOperations operations
    :vartype custom_images: azure.mgmt.devtestlabs.aio.operations.CustomImagesOperations
    :ivar formulas: FormulasOperations operations
    :vartype formulas: azure.mgmt.devtestlabs.aio.operations.FormulasOperations
    :ivar gallery_images: GalleryImagesOperations operations
    :vartype gallery_images: azure.mgmt.devtestlabs.aio.operations.GalleryImagesOperations
    :ivar notification_channels: NotificationChannelsOperations operations
    :vartype notification_channels:
     azure.mgmt.devtestlabs.aio.operations.NotificationChannelsOperations
    :ivar policy_sets: PolicySetsOperations operations
    :vartype policy_sets: azure.mgmt.devtestlabs.aio.operations.PolicySetsOperations
    :ivar policies: PoliciesOperations operations
    :vartype policies: azure.mgmt.devtestlabs.aio.operations.PoliciesOperations
    :ivar schedules: SchedulesOperations operations
    :vartype schedules: azure.mgmt.devtestlabs.aio.operations.SchedulesOperations
    :ivar service_runners: ServiceRunnersOperations operations
    :vartype service_runners: azure.mgmt.devtestlabs.aio.operations.ServiceRunnersOperations
    :ivar users: UsersOperations operations
    :vartype users: azure.mgmt.devtestlabs.aio.operations.UsersOperations
    :ivar disks: DisksOperations operations
    :vartype disks: azure.mgmt.devtestlabs.aio.operations.DisksOperations
    :ivar environments: EnvironmentsOperations operations
    :vartype environments: azure.mgmt.devtestlabs.aio.operations.EnvironmentsOperations
    :ivar secrets: SecretsOperations operations
    :vartype secrets: azure.mgmt.devtestlabs.aio.operations.SecretsOperations
    :ivar service_fabrics: ServiceFabricsOperations operations
    :vartype service_fabrics: azure.mgmt.devtestlabs.aio.operations.ServiceFabricsOperations
    :ivar service_fabric_schedules: ServiceFabricSchedulesOperations operations
    :vartype service_fabric_schedules:
     azure.mgmt.devtestlabs.aio.operations.ServiceFabricSchedulesOperations
    :ivar virtual_machines: VirtualMachinesOperations operations
    :vartype virtual_machines: azure.mgmt.devtestlabs.aio.operations.VirtualMachinesOperations
    :ivar virtual_machine_schedules: VirtualMachineSchedulesOperations operations
    :vartype virtual_machine_schedules:
     azure.mgmt.devtestlabs.aio.operations.VirtualMachineSchedulesOperations
    :ivar virtual_networks: VirtualNetworksOperations operations
    :vartype virtual_networks: azure.mgmt.devtestlabs.aio.operations.VirtualNetworksOperations
    :param credential: Credential needed for the client to connect to Azure. Required.
    :type credential: ~azure.core.credentials_async.AsyncTokenCredential
    :param subscription_id: The subscription ID. Required.
    :type subscription_id: str
    :param base_url: Service URL. Default value is "https://management.azure.com".
    :type base_url: str
    :keyword api_version: Api Version. Default value is "2018-09-15". Note that overriding this
     default value may result in unsupported behavior.
    :paramtype api_version: str
    :keyword int polling_interval: Default waiting time between two polls for LRO operations if no
     Retry-After header is present.
    """

    def __init__(
        self,
        credential: "AsyncTokenCredential",
        subscription_id: str,
        base_url: str = "https://management.azure.com",
        **kwargs: Any
    ) -> None:
        self._config = DevTestLabsClientConfiguration(credential=credential, subscription_id=subscription_id, **kwargs)
        self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs)

        client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
        self._serialize = Serializer(client_models)
        self._deserialize = Deserializer(client_models)
        self._serialize.client_side_validation = False
        self.provider_operations = ProviderOperationsOperations(
            self._client, self._config, self._serialize, self._deserialize
        )
        self.labs = LabsOperations(self._client, self._config, self._serialize, self._deserialize)
        self.operations = Operations(self._client, self._config, self._serialize, self._deserialize)
        self.global_schedules = GlobalSchedulesOperations(
            self._client, self._config, self._serialize, self._deserialize
        )
        self.artifact_sources = ArtifactSourcesOperations(
            self._client, self._config, self._serialize, self._deserialize
        )
        self.arm_templates = ArmTemplatesOperations(self._client, self._config, self._serialize, self._deserialize)
        self.artifacts = ArtifactsOperations(self._client, self._config, self._serialize, self._deserialize)
        self.costs = CostsOperations(self._client, self._config, self._serialize, self._deserialize)
        self.custom_images = CustomImagesOperations(self._client, self._config, self._serialize, self._deserialize)
        self.formulas = FormulasOperations(self._client, self._config, self._serialize, self._deserialize)
        self.gallery_images = GalleryImagesOperations(self._client, self._config, self._serialize, self._deserialize)
        self.notification_channels = NotificationChannelsOperations(
            self._client, self._config, self._serialize, self._deserialize
        )
        self.policy_sets = PolicySetsOperations(self._client, self._config, self._serialize, self._deserialize)
        self.policies = PoliciesOperations(self._client, self._config, self._serialize, self._deserialize)
        self.schedules = SchedulesOperations(self._client, self._config, self._serialize, self._deserialize)
        self.service_runners = ServiceRunnersOperations(self._client, self._config, self._serialize, self._deserialize)
        self.users = UsersOperations(self._client, self._config, self._serialize, self._deserialize)
        self.disks = DisksOperations(self._client, self._config, self._serialize, self._deserialize)
        self.environments = EnvironmentsOperations(self._client, self._config, self._serialize, self._deserialize)
        self.secrets = SecretsOperations(self._client, self._config, self._serialize, self._deserialize)
        self.service_fabrics = ServiceFabricsOperations(self._client, self._config, self._serialize, self._deserialize)
        self.service_fabric_schedules = ServiceFabricSchedulesOperations(
            self._client, self._config, self._serialize, self._deserialize
        )
        self.virtual_machines = VirtualMachinesOperations(
            self._client, self._config, self._serialize, self._deserialize
        )
        self.virtual_machine_schedules = VirtualMachineSchedulesOperations(
            self._client, self._config, self._serialize, self._deserialize
        )
        self.virtual_networks = VirtualNetworksOperations(
            self._client, self._config, self._serialize, self._deserialize
        )

    def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncHttpResponse]:
        """Runs the network request through the client's chained policies.

        >>> from azure.core.rest import HttpRequest
        >>> request = HttpRequest("GET", "https://www.example.org/")
        <HttpRequest [GET], url: 'https://www.example.org/'>
        >>> response = await client._send_request(request)
        <AsyncHttpResponse: 200 OK>

        For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request

        :param request: The network request you want to make. Required.
        :type request: ~azure.core.rest.HttpRequest
        :keyword bool stream: Whether the response payload will be streamed. Defaults to False.
        :return: The response of your network call. Does not do error handling on your response.
        :rtype: ~azure.core.rest.AsyncHttpResponse
        """

        request_copy = deepcopy(request)
        request_copy.url = self._client.format_url(request_copy.url)
        return self._client.send_request(request_copy, **kwargs)

    async def close(self) -> None:
        await self._client.close()

    async def __aenter__(self) -> "DevTestLabsClient":
        await self._client.__aenter__()
        return self

    async def __aexit__(self, *exc_details) -> None:
        await self._client.__aexit__(*exc_details)


text:
'use strict';

var PixelRatio = {
  startDetecting: function () {
    // noop for our implementation
  },

  get: function() {
    return 2;
  },

  getPixelSizeForLayoutSize: function (layoutSize) {
    return Math.round(layoutSize * PixelRatio.get());
  }
};

module.exports = PixelRatio;


text:
DNA_LETTERS = 'ACTG'

def choose_dna():
    '''
    Generator for all DNA letters
    '''
    for dna_letter in DNA_LETTERS:
        yield dna_letter

def recurse_dna(letter_left):
    '''
    Generator that creates a dna strand of N length
    '''
    if letter_left == 0:
        return []
    elif letter_left == 1:
        # Base case for one letter, since it can't loop through and add to a zero length array
        yield from choose_dna()

    for letter in choose_dna():
        results = recurse_dna(letter_left - 1)

        for result in results:
            yield letter + result

# Note: technically better using string array
def increment_dna_point(strand, position):
    '''
    Increases the dna char at the given position

    :return:  (str, bool)  Returns a tuple with the modified strand, and whether it overflowed
    '''
    char = strand[position]
    overflow = False

    # Check if we're going to have overflow
    if char == DNA_LETTERS[-1]:
        overflow = True

    current_index = DNA_LETTERS.find(char) + 1

    # Choose the next letter
    current_index = current_index % 4

    # In case of index overflow the last part returns '' anyways
    return strand[:position] + DNA_LETTERS[current_index] + strand[position + 1:], overflow

def generate_dna(letters):
    '''
    Generator that creates a dna strand of N length
    '''

    # Base case, return no items
    if letters == 0:
        return

    # First create the starting dna strand
    strand = ''
    for i in range(letters):
        strand += DNA_LETTERS[0]

    while True:
        # Always reset the overflow:
        # We start rolling over the LAST char
        overflow = True
        overflow_position = letters - 1

        # Overflow each char
        while overflow is not False and overflow_position >= 0:
            strand, overflow = increment_dna_point(strand, overflow_position)
            if overflow is True:
                overflow_position -= 1

        yield strand

        # Base case when we overflow the entire string
        if overflow_position < 0:
            break

import unittest

class TestRecursion(unittest.TestCase):

    METHOD = staticmethod(recurse_dna)
    LIMIT = 100

    def test_zero(self):
        results = set(self.METHOD(0))

        self.assertEqual(len(results), 0)

    def test_single(self):
        results = set(self.METHOD(1))

        self.assertTrue('T' in results)
        self.assertTrue('G' in results)
        self.assertTrue('C' in results)
        self.assertTrue('A' in results)
        self.assertEqual(len(results), 4)

    def test_double(self):
        results = set(self.METHOD(2))

        self.assertTrue('GT' in results)
        self.assertTrue('AG' in results)
        self.assertTrue('AA' in results)
        self.assertEqual(len(results), 16)

    def test_triplet(self):
        results = set(self.METHOD(3))

        self.assertTrue('GTC' in results)
        self.assertTrue('AAG' in results)
        self.assertTrue('AAA' in results)
        self.assertEqual(len(results), 64)

    def test_huge(self):
        # Ensure this won't take forever to generate stuff, but still has the right values
        values = self.METHOD(self.LIMIT)

        # This assumes an existing order to them
        self.assertTrue(next(values), 'A' * self.LIMIT)
        self.assertTrue(next(values), 'A' * (self.LIMIT - 1) + 'C')
        self.assertTrue(next(values), 'A' * (self.LIMIT - 1) + 'T')

class TestGenerator(TestRecursion):
    '''
    Tests the alternative solution
    '''
    METHOD = staticmethod(generate_dna)
    LIMIT = 1000

if __name__ == '__main__':
    unittest.main()


text:
namespace Scripty.Core.Resolvers
{
    using System.ComponentModel;

    /// <summary>
    ///     The type of script directive
    /// </summary>
    public enum DirectiveType
    {
        /// <summary>
        ///     Load the following script into the global scope
        /// </summary>
        [Description("#load")] ScriptRef,

        /// <summary>
        ///     Load the assembly into the global scope
        /// </summary>
        [Description("#r")] AssemblyRef,
    }

    public enum ResolutionTargetType
    {
        Unknown,
        Cs,
        Csx,
        Other
    }

    /// <summary>
    ///     The assembly resolution GET method
    /// </summary>
    public enum AsmGet
    {
        /// <summary>
        ///     The entry assembly
        /// </summary>
        Entry,
        /// <summary>
        ///     The calling assembly
        /// </summary>
        Calling,
        /// <summary>
        ///     The executing assembly
        /// </summary>
        Executing,
        /// <summary>
        ///     The named assembly
        /// </summary>
        Named
    }

}


text:
using System;
using System.Diagnostics;
using Caliburn.Micro;
using Workbench.Core;
using Workbench.Core.Models;
using Workbench.Services;

namespace Workbench.ViewModels
{
    public class ModelValidatorViewModel
    {
        private readonly IWindowManager _windowManager;

        public WorkspaceModel WorkspaceModel { get; }

        /// <summary>
        /// Initialize a new model validator with a window manager and data service.
        /// </summary>
        /// <param name="theWindowManager"></param>
        /// <param name="theDataService"></param>
        public ModelValidatorViewModel(IWindowManager theWindowManager, IDataService theDataService)
        {
            _windowManager = theWindowManager;
            WorkspaceModel = theDataService.GetWorkspace();
        }

        /// <summary>
        /// Validate the model has no errors.
        /// </summary>
        public bool Validate()
        {
            var validationContext = new ModelValidationContext();
            var isModelValid = new ModelValidator(WorkspaceModel.Model).Validate(validationContext);
            if (isModelValid) return true;
            Debug.Assert(validationContext.HasErrors);
            DisplayErrorDialog(validationContext);

            return false;
        }

        /// <summary>
        /// Display a dialog box with a display of all of the model errors.
        /// </summary>
        /// <param name="theContext">Validation context.</param>
        private void DisplayErrorDialog(ModelValidationContext theContext)
        {
            var errorsViewModel = CreateModelErrorsFrom(theContext);
            _windowManager.ShowDialog(errorsViewModel);
        }

        /// <summary>
        /// Create a model errors view model from a model.
        /// </summary>
        /// <param name="theContext">Validation context.</param>
        /// <returns>View model with all errors in the model.</returns>
        private static ModelErrorsViewModel CreateModelErrorsFrom(ModelValidationContext theContext)
        {
            Debug.Assert(theContext.HasErrors);

            var errorsViewModel = new ModelErrorsViewModel();
            foreach (var error in theContext.Errors)
            {
                var errorViewModel = new ModelErrorViewModel
                {
                    Message = error
                };
                errorsViewModel.Errors.Add(errorViewModel);
            }

            return errorsViewModel;
        }
    }
}


text:
import os
import sys

import lit.formats
import lit.util

import lit.llvm

# Configuration file for the 'lit' test runner.
lit.llvm.initialize(lit_config, config)

# name: The name of this test suite.
config.name = "mlir-proto-opt tests"

config.test_format = lit.formats.ShTest(execute_external=True)

# suffixes: A list of file extensions to treat as test files.
config.suffixes = [".mlir"]

# test_source_root: The root path where tests are located.
config.test_source_root = os.path.dirname(__file__)

# test_exec_root: The path where tests shall execute.
build_dir = os.environ["IREE_LLVM_SANDBOX_BUILD_DIR"]
config.test_exec_root = os.path.join(build_dir, 'test')
lib_dir = os.path.join(build_dir, 'lib')

#config.use_default_substitutions()
config.excludes = [
  "lit.cfg.py",
  "lit.site.cfg.py",

  # Currently disabled tests.
  "tiling.mlir",
  "constant.mlir",
  "test_matmul_f32_cuda.mlir",
  "matmul-f32-mt-cpu.mlir",
  "pack-2d-to-4d-by-8x4-blocks.mlir",
  "test_matmul_f16_cuda_mma.mlir",
  "vector-distribution.mlir",
  "matmul-f32-base.mlir"
]

config.substitutions.extend([
    ("%PYTHON", sys.executable),
    ("%mlir_runner_utils_dir", lib_dir),
    ("%shlibext", ".so"),
])

# Pass through LLVM_SYMBOLIZER_PATH from environment
if "LLVM_SYMBOLIZER_PATH" in os.environ:
  config.environment["LLVM_SYMBOLIZER_PATH"] = \
      os.environ["LLVM_SYMBOLIZER_PATH"]

# Add the build/bin directory to the path.
sys.path.append(os.path.join(build_dir, "bin"))
config.environment["PYTHONPATH"] = ":".join(sys.path)
config.environment["PATH"] = ":".join(sys.path)
project_root = os.path.dirname(os.path.dirname(__file__))


text:
var mongoose = require('mongoose'),

    Schema = mongoose.Schema,

    Challenge = new Schema({
            title: {
                type: String,
                required: true
            },
            desc: {
                type: String,
                required: true
            },
            type: {
                type: String
            },
            issuer: {
                type: Schema.Types.ObjectId,
                ref: 'User',
                required: true

            }
        },
        {
            timestamps: true
        });

module.exports = mongoose.model('Challenge', Challenge);


text:
        <single-news [SingleNews]='SingleNews' [newsIdInput]='newsIdOutput'></single-news>
        <add-comment *ngIf="current_user" (commentBeenAdded)='loadComments()' [newsIdInput]='newsIdOutput'></add-comment>
        <comments [Comments]='Comments'></comments>


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Can. J. Bot. 50(3): 459 (1972)

#### Original name
Sporormia splendens Cain

### Remarks
null


text:
<?php

/**
 * This file is part of Linfo (c) 2010 Joseph Gillotti.
 *
 * Linfo is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * Linfo is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Linfo.  If not, see <http://www.gnu.org/licenses/>.
*/

/**
 * Keep out hackers...
 */
defined('IN_INFO') or exit;

/**
 * Use this class for all error handling
 */
class LinfoError {

	/**
	 * Store singleton instance here
	 *
	 * @var object
	 * @static
	 * @access protected
	 */
	protected static $_fledging;

	/**
	 * Fledging. Get singleton instance
	 *
	 * @param array $settings linfo settings
	 * @access public
	 * @return object LinfoError instance
	 */
	static public function Fledging($settings = null) {
		$c = __CLASS__;
		if (!isset(self::$_fledging))
			self::$_fledging = new $c($settings);
		return self::$_fledging;
	}

	/**
	 * Store error messages here
	 *
	 * @var array
	 * @access private
	 */
	private $_errors = array();

	/**
	 * Add an error message
	 *
	 * @access public
	 * @param string $whence name of error message source
	 * @param string $message error message text
	 */
	public function add($whence, $message) {
		$this->_errors[] = array($whence, $message);
	}

	/**
	 * Get all error messages
	 *
	 * @access public
	 * @return array of errors
	 */
	public function show() {
		return $this->_errors;
	}

	/**
	 * How many are there?
	 *
	 * @access public
	 * @return int number of errors
	 */
	public function num() {
		return count($this->_errors);
	}
}


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<title>TIFF Tools Overview</title>

TIFF Tools Overview

This software distribution comes with a small collection of
programs for converting non-TIFF format images to TIFF and for
manipulating and interrogating the contents of TIFF images. Several
of these tools are useful in their own right. Many of them however
are more intended to serve as programming examples for using the
TIFF library.

Device-dependent Programs

There are two device-dependent programs that serve as simple
examples for writing programs to display and save TIFF images.

<tt>tiffgt    </tt>
Display the contents of one or more TIFF images using OpenGL.
The software makes extensive use of the <tt>TIFFRGBAImage</tt>
facilities described elsewhere.

Device-independent Programs

The remaining programs should be device-independent:

<tt>fax2ps</tt>
Convert a Group 3- or Group 4- compressed TIFF to PostScript
that is significantly more compressed than is generated by
<tt>tiff2ps</tt> (unless <tt>tiff2ps</tt> writes PS Level II)

<tt>fax2tiff</tt>
Convert raw Group 3 or Group 4 facsimile data to TIFF

<tt>pal2rgb</tt>
Convert a Palette-style image to a full color RGB image by
applying the colormap

<tt>ppm2tiff</tt>
A quick hack that converts 8-bit PPM format images to TIFF

<tt>raw2tiff</tt>
Create a TIFF file from raw data

<tt>rgb2ycbcr</tt>
Convert an RGB, grayscale, or bilevel TIFF image to a YCbCr
TIFF image; it's mainly provided for testing

<tt>thumbnail</tt>
Copy a bilevel TIFF to one that includes 8-bit greyscale
"thumbnail images" for each page; it is provided as an example of
how one might use the <tt>SubIFD</tt> tag (and the library support
for it)

<tt>tiff2bw</tt>
A simple program to convert a color image to grayscale

<tt>tiff2pdf</tt>
Convert TIFF images to PDF

<tt>tiff2ps</tt>
Convert TIFF images to PostScript

<tt>tiff2rgba</tt>
Convert a TIFF image to RGBA color space

<tt>tiffcmp</tt>
Compare the contents of two TIFF files (it does not check all
the directory information, but does check all the data)

<tt>tiffcp</tt>
Copy, concatenate, and convert TIFF images (e.g. switching from
Compression=5 to Compression=1)

<tt>tiffcrop</tt>
Provides selection of images from within one or more multi-image
TIFF files, with orthogonal rotation, mirroring, cropping, and
extraction of multiple sections and exporting to one or more files.
It extends the functionality of tiffcp to support additional bit
depths in strips and tiles and enhances the selection capabilities of
tiffsplit. Bilevel images can be inverted and images may be split into
segments to fit on multiple /pages/ (standard paper sizes), plus other
functions described in the tiffcrop man page

<tt>tiffdither</tt>
Dither a b&w image into a bilevel image (suitable for use
in creating fax files)

<tt>tiffdump</tt>
Display the verbatim contents of the TIFF directory in a file
(it's very useful for debugging bogus files that you may get from
someone that claims they support TIFF)

<tt>tiffinfo</tt>
Display information about one or more TIFF files.

<tt>tiffmedian</tt>
A version of Paul Heckbert's median cut program that reads an
RGB TIFF image, and creates a TIFF palette file as a result

<tt>tiffset</tt>
Set a field in a TIFF header

<tt>tiffsplit</tt>
Create one or more single-image files from a (possibly)
multi-image file

Check out the manual pages for details about the above
programs.

Last updated: $Date: 2016-06-05 19:54:00 $


text:
layout: conference
title: Health Care Predictive Analytics Summit 2017
conference_url: http://www.worldcongress.com/events/HL17018/
location: Boston, MA
host: World Congress
host_url: http://www.worldcongress.com/
start_date: 2017-10-17
end_date: 2017-10-18
cost_information:
  - Standard - $1795-$2395
  - Health Plans - $1295-$1895
  - Hospital & Health Systems - $595-$1195
tags:
  - healthcare
  - health IT
  - boston
  - massachusetts
---

With the introduction of new technologies year after year, there is a constant buzz about Big Data and how it is changing many industries, including health care. However, the challenge becomes how to take Big Data and translate it into information that can be used in clinical decisions to improve outcomes and increase quality of care. The 4th Annual Health Care Predictive Analytics Summit brings together hospitals, health systems, and health plans to discuss strategies to efficiently access, share, and analyze data to impact the overall health of consumers.


text:
module Hyrax
  class CollectionThumbnailPathService < Hyrax::ThumbnailPathService
    class << self
      def default_image
        ActionController::Base.helpers.image_path 'collection.png'
      end
    end
  end
end


text:
package ru.furry.furview2.UI;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.text.Html;
import android.text.method.LinkMovementMethod;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

import ru.furry.furview2.InitialScreenActivity;
import ru.furry.furview2.R;

public class HelpScreenActivity extends AppCompatActivity {

    Button closeButton;
    TextView helpTextView;
    String source;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        if (!InitialScreenActivity.isStarted) {
            Intent intent = new Intent("ru.furry.furview2.InitialScreenActivity");
            intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP); // won't work on 10 API
            startActivity(intent);
            finish();
        } else {
            setContentView(R.layout.help_screen);
            closeButton = (Button) findViewById(R.id.closeButton);
            closeButton.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View view) {
                    finish();
                }
            });

            source = getIntent().getStringExtra("source");
            helpTextView = (TextView) findViewById(R.id.helpTextView);

            if (source.equals("InitialActivity")) {
                helpTextView.setText(Html.fromHtml(getApplicationContext().getResources().getString(getIntent().getIntExtra("helptextId", 0))));
                helpTextView.setMovementMethod(LinkMovementMethod.getInstance());
            }

            if (source.equals("BlackListActivity")) {
                helpTextView.setText(getResources().getString(R.string.blacklist_help));
            }

            if (source.equals("AliasesActivity")) {
                helpTextView.setText(getResources().getString(R.string.aliases_help));
            }
        }
    }
}


text: ![oyvu](oyvu-screenshot.png)


text:
ACCEPTED

#### According to
Interim Register of Marine and Nonmarine Genera

#### Published in
Arch. Naturgesch. , 87, A3, 263.

#### Original name
Stylactis Ehrenberg, 1872

### Remarks
null


text:
//
//  NSMutableArray+EYAddition.h
//  CategoryDemo
//
//  Created by gujiabin on 2017/8/8.
//  Copyright © 2017年 lieryang. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface NSMutableArray (EYAddition)

/**
 从数组中取值检测是否越界

 @param index 数组下标
 @return 元素
 */
- (id)safeObjectAtIndex:(NSUInteger)index;

@end