text:
package alec_wam.CrystalMod.tiles.pipes.wireless;

import alec_wam.CrystalMod.CrystalMod;
import alec_wam.CrystalMod.blocks.ICustomModel;
import alec_wam.CrystalMod.items.ModItems;
import alec_wam.CrystalMod.tiles.machine.elevator.ItemMiscCard.CardType;
import alec_wam.CrystalMod.tiles.pipes.IPipeWrapper;
import alec_wam.CrystalMod.util.BlockUtil;
import alec_wam.CrystalMod.util.ChatUtil;
import alec_wam.CrystalMod.util.ItemNBTHelper;
import alec_wam.CrystalMod.util.ItemStackTools;
import alec_wam.CrystalMod.util.StringUtils;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
import net.minecraft.block.properties.IProperty;
import net.minecraft.block.properties.PropertyBool;
import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumBlockRenderType;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.client.model.ModelLoader;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

public class BlockWirelessPipeWrapper extends BlockContainer implements ICustomModel {

	public static final PropertyBool SENDER = PropertyBool.create("sender");
	public BlockWirelessPipeWrapper() {
		super(Material.IRON);
		this.setHardness(2f).setResistance(10F);
		this.setCreativeTab(CrystalMod.tabBlocks);
		this.setDefaultState(getDefaultState().withProperty(SENDER, Boolean.valueOf(false)));
	}

	@Override
    public EnumBlockRenderType getRenderType(IBlockState state){
    	return EnumBlockRenderType.MODEL;
    }

	public static final String NBT_CON_X = "CrystalMod.PipeWrapper.ConX";
	public static final String NBT_CON_Y = "CrystalMod.PipeWrapper.ConY";
	public static final String NBT_CON_Z = "CrystalMod.PipeWrapper.ConZ";
	public static final String NBT_CON_D = "CrystalMod.PipeWrapper.ConD";

	@Override
	@SideOnly(Side.CLIENT)
    public void initModel() {
		ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(this), this.getMetaFromState(getDefaultState().withProperty(SENDER, Boolean.valueOf(false))), new ModelResourceLocation(this.getRegistryName(), "sender=false"));
		ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(this), this.getMetaFromState(getDefaultState().withProperty(SENDER, Boolean.valueOf(true))), new ModelResourceLocation(this.getRegistryName(), "sender=true"));
	}

	@Override
    public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ) {
    	TileEntity tile = world.getTileEntity(pos);
        if (tile !=null && (tile instanceof TileEntityPipeWrapper)) {
        	TileEntityPipeWrapper wrapper = (TileEntityPipeWrapper) tile;
        	ItemStack held = player.getHeldItem(hand);

        	if(!ItemStackTools.isNullStack(held) && held.getItem() == ModItems.miscCard && CardType.byMetadata(held.getMetadata()) == CardType.EPORTAL){
        		if(ItemNBTHelper.verifyExistance(held, NBT_CON_X)){
        			if(!world.isRemote){
        				int x = ItemNBTHelper.getInteger(held, NBT_CON_X, pos.getX());
            			int y = ItemNBTHelper.getInteger(held, NBT_CON_Y, pos.getY());
            			int z = ItemNBTHelper.getInteger(held, NBT_CON_Z, pos.getZ());
            			BlockPos newCon = new BlockPos(x, y, z);
            			int dim = ItemNBTHelper.getInteger(held, NBT_CON_D, player.dimension);
            			if(newCon != pos && newCon !=wrapper.connectionPos){
            				wrapper.connectionPos = newCon;
            				wrapper.connectionDim = dim;
            				BlockUtil.markBlockForUpdate(world, pos);
            			}
            			ChatUtil.sendChat(player, "Linked to "+x+" "+y+" "+z+" Dimension: "+ dim/*StringUtils.getDimensionName(player.getUniqueID(), dim)*/);
        			}
        			return true;
        		}else{
        			ItemNBTHelper.setInteger(held, BlockWirelessPipeWrapper.NBT_CON_X, pos.getX());
        			ItemNBTHelper.setInteger(held, BlockWirelessPipeWrapper.NBT_CON_Y, pos.getY());
        			ItemNBTHelper.setInteger(held, BlockWirelessPipeWrapper.NBT_CON_Z, pos.getZ());
        			int dim = world.provider.getDimension();
        			ItemNBTHelper.setInteger(held, BlockWirelessPipeWrapper.NBT_CON_D, dim);
    				if(!world.isRemote){
    					ChatUtil.sendChat(player, "Card set to "+pos.getX()+" "+pos.getY()+" "+pos.getZ()+" Dimension: "+ dim/*StringUtils.getDimensionName(player.getUniqueID(), dim)*/);
    				}
    				return true;
        		}
        	}
        }
    	return false;
    }

	@Override
	public TileEntity createNewTileEntity(World worldIn, int meta) {
		return new TileEntityPipeWrapper();
	}

	@Override
    public IBlockState getStateFromMeta(int meta)
    {
        return getDefaultState();
    }

    /**
     * Convert the BlockState into the correct metadata value
     */
	@Override
    public int getMetaFromState(IBlockState state)
    {
        return 0;
    }

	@Override
	public IBlockState getActualState(IBlockState state, IBlockAccess world, BlockPos pos){
		TileEntity tile = world.getTileEntity(pos);
		if(tile !=null && tile instanceof IPipeWrapper){
			return state.withProperty(SENDER, !((IPipeWrapper)tile).isSender());
		}
		return state.withProperty(SENDER, true);
	}

	@Override
    protected BlockStateContainer createBlockState()
    {
        return new BlockStateContainer(this, new IProperty[] {SENDER});
    }

}


text:
// Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.

package com.intellij.codeInspection.dataFlow.lang.ir;

import com.intellij.codeInspection.dataFlow.interpreter.DataFlowInterpreter;
import com.intellij.codeInspection.dataFlow.memory.DfaMemoryState;
import org.jetbrains.annotations.NotNull;

/**
 * Flush all non-stable fields
 */
public class FlushFieldsInstruction extends Instruction {
  @Override
  public DfaInstructionState[] accept(@NotNull DataFlowInterpreter interpreter, @NotNull DfaMemoryState stateBefore) {
    stateBefore.flushFields();
    return nextStates(interpreter, stateBefore);
  }

  public String toString() {
    return "FLUSH_ALL_FIELDS";
  }
}

redpajama_set_name: RedPajamaGithub


text:
This container works together with [symfony-standard](https://github.com/webplates/symfony-standard) and its derivatives.

The Docker images can be found in the [images](https://github.com/webplates/docker-symfony-php-dev/tree/images) branch.


text:
package com.prt2121.githubsdk.model.request;

/**
 * Created by Bernat on 17/05/2015.
 */
public class EditIssueTitleRequestDTO extends EditIssueRequestDTO {
  public String title;
}


text:
#ifndef _DIRENT_
#define _DIRENT_

#include <sys/types.h>
#include "types/FILE.h"

/* Always set this to the processor word size */
typedef FILE DIR;

struct dirent {
    ino_t  d_ino;       /**< file serial number */
    char   d_name[];    /**< name of entry */
};

int            closedir(DIR*);
DIR*           opendir(const char*);
struct dirent* readdir(DIR*);
int            readdir_r(DIR*, struct dirent*, struct dirent**);
void           rewinddir(DIR*);
void           seekdir(DIR*, long int);
long int       telldir(DIR*);

#endif /* _DIRENT_ */


text:
(function() {
    var container = document.getElementById('container'),
        output = document.getElementById('output'),
        console = (window.console || (window.console = {}));

    function bind(func, context) {
        if (typeof func.bind === 'function') {
            // ES5 browsers
            return func.bind(context);
        } else if (typeof func.apply === 'function') {
            // Pre-ES5 browsers
            return function() { func.apply(context, arguments); };
        } else {


text:
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
    return new (P || (P = Promise))(function (resolve, reject) {
        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
        function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
        step((generator = generator.apply(thisArg, _arguments || [])).next());
    });
};
Object.defineProperty(exports, "__esModule", { value: true });
const vscode = require("vscode");
const path = require("path");
const svgPreview_1 = require("./svgPreview");
const fs = require("pn/fs");
class SvgExport extends svgPreview_1.SvgView {
    constructor(webview, resource, contentProvider) {
        super(webview, resource, contentProvider);
        this.contentProvider = contentProvider;
        this.editor.webview.onDidReceiveMessage((e) => {
            if (e.body.resource !== this._resource.toString()) {
                return;
            }
            switch (e.command) {
                case 'exportData':
                    let data = Buffer.from(e.body.dataUrl.split(',')[1], 'base64');
                    fs.writeFileSync(e.body.output, data);
                    vscode.window.showInformationMessage('export done. ' + e.body.output);
                    break;
            }
        }, null, super.disposables);
    }
    static viewTitle(resource) {
        return `Export ${path.basename(resource.fsPath)}`;
    }
    static revive(webview, state, contentProvider) {
        return __awaiter(this, void 0, void 0, function* () {
            const resource = vscode.Uri.parse(state.resource);
            const exp = new SvgExport(webview, resource, contentProvider);
            exp.editor.webview.options = svgPreview_1.SvgView.getWebviewOptions(contentProvider);
            yield exp.doUpdate();
            return exp;
        });
    }
    get state() {
        return {
            resource: this.resource.toString()
        };
    }
    doUpdate() {
        return __awaiter(this, void 0, void 0, function* () {
            const resource = this._resource;
            clearTimeout(this.throttleTimer);
            this.throttleTimer = undefined;
            const document = yield vscode.workspace.openTextDocument(resource);
            const content = yield this.contentProvider.provideTextDocumentContent(document.uri, this.state);
            if (this._resource === resource) {
                this.editor.title = SvgExport.viewTitle(this._resource);
                this.editor.webview.options = svgPreview_1.SvgPreview.getWebviewOptions(this.contentProvider);
                this.editor.webview.html = content;
            }
        });
    }
    static create(resource, previewColumn, contentProvider) {
        const webview = vscode.window.createWebviewPanel(SvgExport.viewType, SvgExport.viewTitle(resource), previewColumn, {
            enableFindWidget: true,
            localResourceRoots: contentProvider.localResourceRoots
        });
        return new SvgExport(webview, resource, contentProvider);
    }
}
SvgExport.viewType = 'svg.export';
exports.SvgExport = SvgExport;
//# sourceMappingURL=svgExport.js.map


text:
#
#
# /* Revised by Paul Mensonides (2002) */
#
# /* See http://www.boost.org for most recent version. */
#
# ifndef AUTOBOOST_PREPROCESSOR_LOGICAL_NOR_HPP
# define AUTOBOOST_PREPROCESSOR_LOGICAL_NOR_HPP
#
# include <autoboost/preprocessor/config/config.hpp>
# include <autoboost/preprocessor/logical/bool.hpp>
# include <autoboost/preprocessor/logical/bitnor.hpp>
#
# /* AUTOBOOST_PP_NOR */
#
# if ~AUTOBOOST_PP_CONFIG_FLAGS() & AUTOBOOST_PP_CONFIG_EDG()
#    define AUTOBOOST_PP_NOR(p, q) AUTOBOOST_PP_BITNOR(AUTOBOOST_PP_BOOL(p), AUTOBOOST_PP_BOOL(q))
# else
#    define AUTOBOOST_PP_NOR(p, q) AUTOBOOST_PP_NOR_I(p, q)
#    define AUTOBOOST_PP_NOR_I(p, q) AUTOBOOST_PP_BITNOR(AUTOBOOST_PP_BOOL(p), AUTOBOOST_PP_BOOL(q))
# endif
#
# endif


text:
import os
import json
try:
    unicode
except NameError:
    unicode = str

JSON = os.path.join(os.path.dirname(__file__), '../data/hr/hr.json')

with open(JSON) as stream:
    citydb = json.load(stream)

def u2s(data):
    if isinstance(data, unicode):
        return str(data)
    if isinstance(data, list):
        return [u2s(item) for item in data]
    if isinstance(data, dict):
        return dict([(str(key), u2s(item)) for key, item in data.items()])
    return data

citydb = u2s(citydb)


text:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Auth extends CI_Controller {

    public function __construct(){
        parent::__construct();
        $this->load->model('users_model');
        $this->load->model('statistics_model');
        $this->load->library('form_validation');
        $this->load->library('user_agent');
        $this->load->helper('email');
        $this->load->helper('string');
        $this->load->helper('captcha');
        $this->load->helper('security');
        $this->load->helper('date');
        $this->load->helper('auth_check');
        $this->load->helper('gravatar');
    }

    public function register(){
        logout_required();

        if($this->form_validation->run() === FALSE){
            $data['title'] = "加入PHPCNC";
            $data['csrf_token'] = $this->security->get_csrf_hash();
            $data['csrf_name'] = $this->security->get_csrf_token_name();
            $data['registered'] = $this->session->flashdata('registered');
            $this->load->view('auth/register', $data);
        }else{
            $email = $this->input->post('email');
            $active_code = random_string('sha1');
            $id = $this->users_model->add_user($email, $active_code);
            if($id){
                send_active_email($email, $id, $active_code);
                $this->session->set_flashdata('registered', 'ok');
                redirect('register');
            }else{
                show_error('OOPS!TIGER IS COMING!');
            }
        }
    }

    public function login(){
       logout_required();

        if($this->form_validation->run() === FALSE){
            if($this->agent->is_referral()){
                $referrer = $this->agent->referrer();
                if($referrer != base_url(uri_string()) && strpos($referrer, base_url()) !== FALSE){
                    $this->session->set_userdata('referrer', $referrer);
                }
            }
            $data['title'] = "冒泡";
            $data['csrf_token'] = $this->security->get_csrf_hash();
            $data['csrf_name'] = $this->security->get_csrf_token_name();
            $data['login'] = $this->session->flashdata('login');
            $data['reset_password'] = $this->session->flashdata('reset_password');
            $this->load->view('auth/login', $data);
        }else{
            $email = $this->input->post('email');
            $password = do_hash($this->input->post('password'));
            if($user = $this->users_model->verify_user($email, $password)){
                $this->users_model->update_login_time($user['id']);
                $user['created_on'] = mdate('%Y-%m-%d', $user['created_on']);
                $this->session->set_userdata('current_user', $user);
                if($referrer = $this->session->userdata('referrer')){
                    $this->session->unset_userdata('referrer');
                    redirect($referrer);
                }else{
                    redirect('/');
                }
            }else{
                $this->session->set_flashdata('login', 'fail');
                redirect('login');
            }
        }
    }

    public function logout(){
        login_required();
        $this->session->sess_destroy();
        redirect('/');
    }

    public function active($id = '', $activation_code = ''){
        logout_required();

        if($id && $activation_code){
            if($user = $this->users_model->check_activation_code($id, $activation_code)){
                $this->session->set_userdata('user', $user);
                redirect('active');
            }else{
                show_404(uri_string());
            }
        }else{
            $user = $this->session->userdata('user');
            if($user){
                if($this->form_validation->run() === FALSE){
                    $data['title'] = '激活账户';
                    $data['csrf_token'] = $this->security->get_csrf_hash();
                    $data['csrf_name'] = $this->security->get_csrf_token_name();
                    $this->load->view('auth/active', $data);
                }else{
                    $username = $this->input->post('username');
                    $password = do_hash($this->input->post('password'));
                    $avatar = get_gravatar_hash($user['email']);

                    $this->db->trans_start();
                    $user = $this->users_model->active_user($user['id'], $username, $password, $avatar);
                    $this->statistics_model->increment_user_count();
                    $this->db->trans_complete();

                    if($this->db->trans_status() === FALSE){
                        show_error('OOPS!TIGER IS COMING!');
                    }else{
                        $this->session->set_userdata('current_user', $user);
                        $this->session->unset_userdata('user');
                        redirect('/');
                    }
                }
            }else{
                show_404(uri_string());
            }
        }

    }

    public function forgotten_password(){
        logout_required();

        if($this->form_validation->run() === FALSE){
            $data['title'] = "忘记密码";
            $data['csrf_token'] = $this->security->get_csrf_hash();
            $data['csrf_name'] = $this->security->get_csrf_token_name();
            $data['send_email'] = $this->session->flashdata('send_email');
            $this->load->view('auth/forgotten_password', $data);
        }else{
            $email = $this->input->post('email');
            $forgotten_password_code = random_string('sha1');
            if($id = $this->users_model->set_forgotten_password_code($email, $forgotten_password_code)){
                send_reset_password_email($email, $id, $forgotten_password_code);
                $this->session->set_flashdata('send_email', 'ok');
            }
            redirect('forgotten/password');
        }
    }

    public function reset_password($id = '', $forgotten_password_code = ''){
        logout_required();

        if($id && $forgotten_password_code){
            if($this->users_model->check_forgotten_password_code($id, $forgotten_password_code)){
                $this->session->set_userdata('user_id', $id);
                redirect('reset/password');
            }else{
                show_404(uri_string());
            }
        }else{
            $user_id = $this->session->userdata('user_id');
            if($user_id){
                if($this->form_validation->run() === FALSE){
                    $data['title'] = '重置密码';
                    $data['csrf_token'] = $this->security->get_csrf_hash();
                    $data['csrf_name'] = $this->security->get_csrf_token_name();
                    $this->load->view('auth/reset_password', $data);
                }else{
                    $password = do_hash($this->input->post('password'));
                    $this->users_model->reset_password($user_id, $password);
                    $this->session->unset_userdata('user_id');
                    $this->session->set_flashdata('reset_password', 'ok');
                    redirect('login');
                }
            }else{
                show_404(uri_string());
            }

        }
    }

    public function captcha(){
        $option = array(
            'img_path' => './static/img/captcha/',
            'img_url' => $this->config->item('base_url').'static/img/captcha/',
            'expiration' => 60
        );
        $cap = create_captcha($option);
        $this->session->set_flashdata('captcha', strtolower($cap['word']));
        $this->output->set_output( $cap['image']);
    }

    public function _check_captcha($captcha){
        if(strtolower($captcha) === $this->session->flashdata('captcha')){
            return true;
        }else{
            return false;
        }
    }

    public function _email_valid($email){
        return $this->users_model->email_valid($email);
    }
}


text:
class IDigitalIO;
class ILogger;

class IProgrammer
{
public:
  virtual bool Program() = 0;

protected:
  virtual ~IProgrammer() {}
};

class CSTM32F4x7 : public IProgrammer
{
public:
  CSTM32F4x7(IDigitalIO* swd, ILogger* report, int size, bool dualBank)
    : mSwd(swd), mReport(report), mSize(size), mDualBank(dualBank)
  {
    std::cout << "Created F437 with size=" << size << std::endl;
  }

  bool Program() override
  {
    std::cout << "Programmed F437" << std::endl;
    return true;
  }

private:
  IDigitalIO* mSwd;
  ILogger* mReport;
  int mSize;
  bool mDualBank;
};

class CSPC56 : public IProgrammer
{
public:
  CSPC56(IDigitalIO* swd, ILogger* report, int size)
    : mSwd(swd), mReport(report), mSize(size)
  {

  }

  bool Program() override
  {
    std::cout << "Programmed SPC56" << std::endl;
    return true;
  }

private:
  IDigitalIO* mSwd;
  ILogger* mReport;
  int mSize;
};


text:
import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { routing, appRoutingProviders }  from './app.routing';
import { FormsModule }    from '@angular/forms';
import { RouterModule } from '@angular/router'
import { HttpModule, JsonpModule }  from '@angular/http';

//Egenproduserte components
import { AppComponent }  from './app.component';
import { SkoleListeComponent} from './velgSkole/velg-skole.component';
import { SkoleruterComponent } from './routing/skoleruter.component';
import { PageNotFoundComponent} from './page-not-found.component';
import { NavbarComponent } from './navbar/navbar.component'
import { SkoleListeFilterPipe} from'./velgSkole/skole-liste-filter.pipe';
import { SkoleDataService } from './velgSkole/skole-data.service';
import { ValgteSkolerService } from './valgte-skoler.service';
import { NesteFridagComponent } from './nestefridag/neste-fridag.component';
import { KortDatoPipe } from './kort-Dato.pipe';
import { ListeComponent } from './listevisning/liste.component';
import { Liste1Component } from './listevisning/liste1.component';
import { Liste2Component } from './listevisning/liste2.component';
import { Liste3Component } from './listevisning/liste3.component';
import { Liste4Component } from './listevisning/liste4.component';
import { Liste5Component } from './listevisning/liste5.component';
import { SkoleruteModule } from './routing/skoleruter.module';
import { NesteFridagModule } from './nestefridag/neste-fridag.module';
import { ListeModule } from './listevisning/liste.module';
import { LeggIKalenderComponent } from './leggikalender/legg-i-kalender.component';
import { LeggIKalenderService } from './leggikalender/legg-i-kalender.service';
import { InfoModule } from './info/info.module';
import { VarslingKomponent } from './varsling/varsling.component';
import { VarslingModule } from './varsling/varsling.module';
import { VarslingService } from './varsling/varsling.service';

@NgModule({
  imports:
  [ BrowserModule,
  FormsModule,
  routing,
  SkoleruteModule,
  RouterModule,
  HttpModule,
  JsonpModule,
  NesteFridagModule,
  ListeModule,
  InfoModule,
  VarslingModule
  ],
  declarations:
  [
    AppComponent,
    SkoleListeComponent,
    SkoleruterComponent,
    PageNotFoundComponent,
    NavbarComponent,
    SkoleListeFilterPipe,
    NesteFridagComponent,
    KortDatoPipe,
    LeggIKalenderComponent,
    ListeComponent,
    Liste1Component,
    Liste2Component,
    Liste3Component,
    Liste4Component,
    Liste5Component,
    VarslingKomponent
  ],
    providers: [ appRoutingProviders, SkoleDataService, ValgteSkolerService, LeggIKalenderService, VarslingService ],
    bootstrap: [ AppComponent ],
    schemas: [ CUSTOM_ELEMENTS_SCHEMA ]

})

export class AppModule { }


text:
'use strict';

const Enumeration = require( '../system/enumeration.js' );

/**
 * Specifies the operations of models to authorize. Members:
 *
 *    * fetchObject
 *    * createObject
 *    * updateObject
 *    * removeObject
 *    * executeCommand
 *    * executeMethod
 *    * readProperty
 *    * writeProperty
 *
 * @memberof bo.rules
 * @extends bo.system.Enumeration
 */
class AuthorizationAction extends Enumeration {

  /**
   * Creates a new enumeration to define the authorization actions.
   */
  constructor() {
    super();

    /**
     * The user tries to retrieve the values of a model from the repository.
     * @constant {number} bo.rules.AuthorizationAction#fetchObject
     * @default 0
     */
    this.fetchObject = 0;
    /**
     * The user tries to save the values of a new model to the repository.
     * @constant {number} bo.rules.AuthorizationAction#createObject
     * @default 1
     */
    this.createObject = 1;
    /**
     * The user tries to save the changed values of a model to the repository.
     * @constant {number} bo.rules.AuthorizationAction#updateObject
     * @default 2
     */
    this.updateObject = 2;
    /**
     * The user tries to delete the values of a model from the repository.
     * @constant {number} bo.rules.AuthorizationAction#removeObject
     * @default 3
     */
    this.removeObject = 3;

    /**
     * The user tries to execute a command in the repository.
     * @constant {number} bo.rules.AuthorizationAction#executeCommand
     * @default 4
     */
    this.executeCommand = 4;
    /**
     * The user tries to execute a custom action in the repository.
     * @constant {number} bo.rules.AuthorizationAction#executeMethod
     * @type {number}
     * @default 5
     */
    this.executeMethod = 5;

    /**
     * The user tries to get the value of a property.
     * @constant {number} bo.rules.AuthorizationAction#readProperty
     * @default 6
     */
    this.readProperty = 6;
    /**
     * The user tries to set the value of a property.
     * @constant {number} bo.rules.AuthorizationAction#writeProperty
     * @default 7
     */
    this.writeProperty = 7;

    // Immutable object.
    Object.freeze( this );
  }
}

module.exports = new AuthorizationAction();


text:
@class QCMemObject;

@interface QCStreamProvider_QCMemObject : QCStreamProvider
{
	QCMemObject *_provider;	// 36 = 0x24
	unsigned int _isArray:1;	// 40 = 0x28
	unsigned int _isTexture3D:1;	// 40 = 0x28
}

+ (BOOL)isCompatibleWithSource:(id)fp8 sourceMD5:(QCMD5Sum *)fp12;
+ (id)createProviderWithSource:(id)fp8 options:(id)fp12;
- (id)initWithMemObject:(id)fp8 options:(id)fp12;
- (void)dealloc;
- (id)sourceRepresentationType;
- (id)sourceRepresentation;
- (NSUInteger)count;
- (NSUInteger)elementSize;
- (int)type;
- (NSUInteger)pixelsWide;
- (NSUInteger)pixelsHigh;
- (NSUInteger)pixelsDeep;
- (id)pixelFormat;
- (id)createArrayMemObjectForManager:(id)fp8 withCount:(NSUInteger)fp12 elementSize:(NSUInteger)fp16 type:(int)fp20 options:(id)fp24;
- (id)createImage2DMemObjectForManager:(id)fp8 withFormat:(id)fp12 options:(id)fp16;
@end


text:
1. [How and why I built a real-time state synchronisation service](https://www.codementor.io/pmbanugo/how-and-why-i-built-a-real-time-state-synchronisation-service-hx7y1wpi0#.WraKPLR3nCM.twitter)
1. [Modern Frontend Developer in 2018](https://medium.com/tech-tajawal/modern-frontend-developer-in-2018-4c2072fa2b9c)
1. [GraphQL with ASP.NET Core (Part- I Hello World)](http://fiyazhasan.me/graphql-with-asp-net-core/)
1. [Scaffolding ASP.NET Core API Controllers](https://mattmillican.com/blog/aspnetcore-controller-scaffolding)
1. [The WebAssembly Revolution Has Begun](https://www.infoq.com/presentations/webassembly-wasm-intro)
1. [React Code Style Guide](https://css-tricks.com/react-code-style-guide/)

## Tooling & Libraries

1. [Incident report - NuGet.org downtime on March 22, 2018](https://blog.nuget.org/20180322/Incident-Report-NuGet-org-downtime-March-22.html)
1. [BenchmarkDotNet - Support private builds of .NET Runtime](https://github.com/dotnet/BenchmarkDotNet/issues/706)
1. [MS Orleans v2.0.0 released!](https://github.com/dotnet/orleans/releases/tag/v2.0.0)
1. [Announcing 1.1.1.1 - the fastest, privacy-first consumer DNS service](https://blog.cloudflare.com/announcing-1111/)
1. [NHibernate supports .NET Core 2.0](http://enterprisecraftsmanship.com/2018/03/26/nhibernate-now-supports-net-core-2-0/)

## Architecture & Databases

1. [The Mistakes I Made As a Beginner Programmer](https://medium.com/@samerbuna/the-mistakes-i-made-as-a-beginner-programmer-ac8b3e54c312)
1. [7 things I learnt from one of the best startups you'll find](https://theburningmonk.com/2018/03/7-things-i-learnt-from-one-of-the-best-startups-youll-find/)
1. [Designing Reactive Systems Using DDD, Event Storming and Actors](https://www.infoq.com/news/2018/03/reactive-actors-eventstorming)
1. [Chaos Architecture](https://www.infoq.com/presentations/chaos-architecture-mindset)
1. [How to Build Observable Distributed Systems](https://www.infoq.com/presentations/observable-distributed-ststems)

## Programming Languages

1. [The Maybe functor](http://blog.ploeh.dk/2018/03/26/the-maybe-functor/)
1. [Exploring 4 Languages - Integrity and Consistency](http://www.chriskrycho.com/2018/exploring-4-languages-integrity-and-consistency.html)
1. [Announcing TypeScript 2.8](https://blogs.msdn.microsoft.com/typescript/2018/03/27/announcing-typescript-2-8/)
1. [How I Test My Java Classes for Thread-Safety](http://www.yegor256.com/2018/03/27/how-to-test-thread-safety.html)
1. [Nullable types arithmetic and null-coalescing operator precedence](https://blogs.msdn.microsoft.com/seteplia/2018/03/30/nullable-types-arithmetic-and-null-coalescing-operator-precedence/)
1. [Eliminating Annoying Space Characters Via Check Constraints](https://www.red-gate.com/simple-talk/blogs/eliminating-annoying-space-characters-via-check-constraints/)

## Runtime

1. [SIMD and Vectorization in .NET - .NET Concept of the Week - Episode 11](https://www.youtube.com/watch?v=wPT6iu3MZP0&feature=youtu.be)
1. [Project Bedrock update](https://github.com/aspnet/KestrelHttpServer/issues/1980#issuecomment-377123245)
1. [Looking inside a .NET core process using windbg](https://blogs.msdn.microsoft.com/rohithrajan/2018/03/26/looking-inside-a-net-core-process-using-windbg/)

## Other

1. [M. Fowler - Announcing the Second Edition of "Refactoring"](https://martinfowler.com/articles/201803-refactoring-2nd-ed.html)
1. [Microsoft's Brainwave makes Bing's AI over 10 times faster](https://venturebeat.com/2018/03/26/microsofts-brainwave-makes-bings-ai-over-10-times-faster/)
1. [Open Sourcing a WSL Sample for Linux Distribution Maintainers and Sideloading Custom Linux Distributions](https://blogs.msdn.microsoft.com/commandline/2018/03/26/wsl-distro-launcher/)
1. [Announcing Rust 1.25](https://blog.rust-lang.org/2018/03/29/Rust-1.25.html)
1. [Releasing the Unity C# source code](https://blogs.unity3d.com/2018/03/26/releasing-the-unity-c-source-code/)


text:
package fr.openwide.core.commons.util.functional.builder.function.generic;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.text.WordUtils;

import com.google.common.base.CharMatcher;
import com.google.common.base.Function;
import com.google.common.base.Strings;

import fr.openwide.core.commons.util.functional.builder.function.BigDecimalFunctionBuildState;
import fr.openwide.core.commons.util.functional.builder.function.BooleanFunctionBuildState;
import fr.openwide.core.commons.util.functional.builder.function.DateFunctionBuildState;
import fr.openwide.core.commons.util.functional.builder.function.DoubleFunctionBuildState;
import fr.openwide.core.commons.util.functional.builder.function.IntegerFunctionBuildState;
import fr.openwide.core.commons.util.functional.builder.function.LongFunctionBuildState;
import fr.openwide.core.commons.util.functional.builder.function.StringFunctionBuildState;

public abstract class GenericStringFunctionBuildStateImpl
		<
		TBuildResult,
		TStateSwitcher extends FunctionBuildStateSwitcher<TBuildResult, String, TBooleanState, TDateState, TIntegerState, TLongState, TDoubleState, TBigDecimalState, TStringState>,
		TBooleanState extends BooleanFunctionBuildState<?, TBooleanState, TDateState, TIntegerState, TLongState, TDoubleState, TBigDecimalState, TStringState>,
		TDateState extends DateFunctionBuildState<?, TBooleanState, TDateState, TIntegerState, TLongState, TDoubleState, TBigDecimalState, TStringState>,
		TIntegerState extends IntegerFunctionBuildState<?, TBooleanState, TDateState, TIntegerState, TLongState, TDoubleState, TBigDecimalState, TStringState>,
		TLongState extends LongFunctionBuildState<?, TBooleanState, TDateState, TIntegerState, TLongState, TDoubleState, TBigDecimalState, TStringState>,
		TDoubleState extends DoubleFunctionBuildState<?, TBooleanState, TDateState, TIntegerState, TLongState, TDoubleState, TBigDecimalState, TStringState>,
		TBigDecimalState extends BigDecimalFunctionBuildState<?, TBooleanState, TDateState, TIntegerState, TLongState, TDoubleState, TBigDecimalState, TStringState>,
		TStringState extends StringFunctionBuildState<TBuildResult, TBooleanState, TDateState, TIntegerState, TLongState, TDoubleState, TBigDecimalState, TStringState>
		>
		extends GenericFunctionBuildStateImpl<TBuildResult, String, TStateSwitcher, TBooleanState, TDateState, TIntegerState, TLongState, TDoubleState, TBigDecimalState, TStringState>
		implements StringFunctionBuildState<TBuildResult, TBooleanState, TDateState, TIntegerState, TLongState, TDoubleState, TBigDecimalState, TStringState> {

	private static final char[] DEFAULT_WORD_DELIMITERS =  { ' ', '\t', '\'' };

	private static String stripToNull(CharSequence charSequence) {
		if (charSequence == null) {
			return null;
		}
		return Strings.emptyToNull(CharMatcher.whitespace().trimFrom(charSequence));
	}

	@Override
	public TBuildResult withDefault(final String defaultValue) {
		return toString(new Function<String, String>() {
			@Override
			public String apply(String input) {
				return StringUtils.defaultIfEmpty(input, defaultValue);
			}
		}).build();
	}

	@Override
	public TStringState strip() {
		return toString(new Function<String, String>() {
			@Override
			public String apply(String input) {
				return stripToNull(input);
			}
		});
	}

	@Override
	public TStringState trim() {
		return toString(new Function<String, String>() {
			@Override
			public String apply(String input) {
				return StringUtils.trimToNull(input);
			}
		});
	}

	@Override
	public TStringState clean() {
		return toString(new Function<String, String>() {
			@Override
			public String apply(String input) {
				return stripToNull(StringUtils.trimToNull(input));
			}
		});
	}

	@Override
	public TStringState capitalize(char... delimiters) {
		final char[] actualDelimiters = (delimiters == null || delimiters.length == 0) ? DEFAULT_WORD_DELIMITERS : delimiters;
		return toString(new Function<String, String>() {
			@Override
			public String apply(String input) {
				return WordUtils.capitalize(input, actualDelimiters);
			}
		});
	}

	@Override
	public TStringState capitalizeFully(char... delimiters) {
		final char[] actualDelimiters = (delimiters == null || delimiters.length == 0) ? DEFAULT_WORD_DELIMITERS : delimiters;
		return toString(new Function<String, String>() {
			@Override
			public String apply(String input) {
				return WordUtils.capitalizeFully(input, actualDelimiters);
			}
		});
	}

	@Override
	public TStringState replaceAll(final Pattern pattern, final String replacement) {
		return toString(new Function<String, String>() {
			@Override
			public String apply(String input) {
				if (input == null) {
					return null;
				} else {
					Matcher matcher = pattern.matcher(input);
					return matcher.replaceAll(replacement);
				}
			}
		});
	}

	@Override
	public TStringState replaceAll(final CharMatcher charMatcher, final CharSequence replacement) {
		return toString(new Function<String, String>() {
			@Override
			public String apply(String input) {
				if (input == null) {
					return null;
				} else {
					return charMatcher.replaceFrom(input, replacement);
				}
			}
		});
	}

	@Override
	public TStringState removeAll(Pattern pattern) {
		return replaceAll(pattern, "");
	}

	@Override
	public TStringState removeAll(final CharMatcher charMatcher) {
		return toString(new Function<String, String>() {
			@Override
			public String apply(String input) {
				if (input == null) {
					return null;
				} else {
					return charMatcher.removeFrom(input);
				}
			}
		});
	}

	@Override
	public TStringState extract(Pattern pattern) {
		return extract(pattern, 0);
	}

	@Override
	public TStringState extract(final Pattern pattern, final int group) {
		return toString(new Function<String, String>() {
			@Override
			public String apply(String input) {
				if (input == null) {
					return null;
				} else {
					Matcher matcher = pattern.matcher(input);
					if (matcher.find()) {
						return matcher.group(group);
					} else {
						return null;
					}
				}
			}
		});
	}

	@Override
	public TStringState stripLineBreaks() {
		return toString(new Function<String, String>() {
			@Override
			public String apply(String input) {
				if (input == null) {
					return null;
				}

				String cleanString = input.replace(StringUtils.CR + StringUtils.LF, " ");
				cleanString = cleanString.replace(StringUtils.LF, " ");
				cleanString = cleanString.replace(StringUtils.CR, " ");

				return cleanString;
			}
		});
	}

}


text:
package edu.hm.cs.jenkins.notifier.view;

import javax.inject.Inject;
import javax.inject.Named;
import java.awt.*;
import java.awt.event.ActionListener;
import java.awt.event.ItemListener;
import java.util.ResourceBundle;

/**
 * Menu which is displayed if the user performs a right click on the tray icon.
 *
 * @author Tobias Wochinger
 */
public class TrayMenu extends PopupMenu {

    private ResourceBundle bundle;

    private MenuItem about;

    private Menu settings;

    private MenuItem openSettings;

    private CheckboxMenuItem disable;

    private MenuItem exit;

    /**
     * Creates a tray menu.
     *
     * @param bundle bundle which contains the menu captions
     */
    @Inject
    public TrayMenu(final ResourceBundle bundle) {
        this.bundle = bundle;

        createAboutItem();
        createSettingsMenu();
        createExitItem();
        addComponents();
    }

    private void createAboutItem() {
        String aboutText = bundle.getString("menu.about");
        about = new MenuItem(aboutText);
    }

    private void createSettingsMenu() {
        String settingsText = bundle.getString("menu.settings");
        settings = new Menu(settingsText);

        createOpenSettingsItem();
        createDisableItem();

        settings.add(openSettings);
        settings.add(disable);
    }

    private void createDisableItem() {
        String disableText = bundle.getString("menu.item.disable");
        disable = new CheckboxMenuItem(disableText);
    }

    private void createOpenSettingsItem() {
        String openSettingsText = bundle.getString("menu.item.open_settings");
        openSettings = new MenuItem(openSettingsText);
    }

    private void createExitItem() {
        String exitText = bundle.getString("menu.exit");
        exit = new MenuItem(exitText);
    }

    private void addComponents() {
        add(about);
        addSeparator();

        add(settings);
        addSeparator();

        add(exit);
    }

    /**
     * Sets the controller to react if the user clicks on the exit item.
     *
     * @param controller controller which handles the event
     */
    @Inject
    public void setExitController(@Named("exit") final ActionListener controller) {
        exit.addActionListener(controller);
    }

    /**
     * Sets the controller to react if the user clicks on the about item.
     *
     * @param controller controller which handles the event
     */
    @Inject
    public void setAboutController(@Named("about") final ActionListener controller) {
        about.addActionListener(controller);
    }

    /**
     * Sets the controller to react if the user clicks on the disable item.
     *
     * @param controller controller which handles the event
     */
    @Inject
    public void setDisableController(@Named("disable") final ItemListener controller) {
        disable.addItemListener(controller);
    }

    /**
     * Sets the controller to react if the user clicks on the show settings
     * item.
     *
     * @param controller controller which handles the event
     */
    @Inject
    public void setShowSettingsController(@Named("open") final ActionListener controller) {
        openSettings.addActionListener(controller);
    }
}


text:
package captchaController

import (
	"github.com/NyaaPantsu/nyaa/controllers/router"
	"github.com/NyaaPantsu/nyaa/utils/captcha"
)

func init() {
	router.Get().Any("/captcha/*hash", captcha.ServeFiles)
}


text:
var calculator = function () {
  var calculator = Object.preventExtensions({
    result: 0,
    add: function (x) {
      calculator.result += x;
      return calculator;
    },
    subtract: function (x) {
      calculator.result -= x;
      return calculator;
    },
    showResult: function () {
      console.log('The result is: ' + calculator.result);
      return calculator;
    }
  });

  return {
    get: function () {
      return calculator;
    }
  };
} ();

calculator.get()
  .add(7)
  .subtract(17)
  .showResult();

calculator.get()
  .add(111)
  .showResult();


text:
<!DOCTYPE html>

        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <meta content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0' name='viewport' />
        <title></title>
        <meta name="description" content="">

        <link rel="stylesheet" href="css/normalize.min.css">
        <link rel="stylesheet" href="css/main.css">

A

Z

E

            <button id="record-start">Start recording</button>
            <button id="record-stop" class="hide">Stop recording</button>
            <button id="replay" class="hide">Replay</button>
            <button id="try" class="hide">Challenge yourself!</button>

            Comment tester ?

Utilisez a-z-e pour jouer un beat

Cliquez sur "Start recording" pour commencer à enregistrer votre séquence

Cliquez sur "Stop recording" lorsque vous avez fini

Cliquez sur Replay pour réécouter votre séquence

Cliquez sur "Challenge yourself!" pour lancer le "jeu solo" : vous devez reproduire votre séquence. Un score vous sera attribué en fonction de vos performances.

            Quoi ? C'est tout ? Pour le moment ! L'objectif est de challenger ses amis, pas de jouer en solo. Mais ça ça viendra plus tard :)


text:
angular.module('spHome', ['ui.bootstrap','ui.utils','ui.router','ngAnimate', 'spApi', 'spotify']);

angular.module('spHome').config(function($stateProvider) {

    $stateProvider.state('sp-home', {
        url: '/home',
        templateUrl: 'sp-home/partial/sp-home/sp-home.html'
    });
    /* Add New States Above */

});


text:
require "set"
require "uri"

class Content < ApplicationRecord
  include ContentBase
  include StringLengthLimit

  belongs_to :user, optional: true, touch: true
  belongs_to :blog

  has_one :redirect, dependent: :destroy, inverse_of: :content

  has_many :triggers, as: :pending_item, dependent: :delete_all
  has_many :resources, inverse_of: :content, dependent: :nullify
  has_and_belongs_to_many :tags

  scope :user_id, ->(user_id) { where(user_id: user_id) }
  scope :published, -> { where(state: "published").order(default_order) }
  scope :published_at, lambda { |time_params|
                         published.where(published_at: PublifyTime.delta(*time_params))
                       }
  scope :not_published, -> { where.not(state: "published") }
  scope :drafts, -> { where(state: "draft").order("created_at DESC") }
  scope :no_draft, -> { where.not(state: "draft").order("published_at DESC") }
  scope :searchstring, lambda { |search_string|
    tokens = search_string.split(" ").map { |c| "%#{c.downcase}%" }
    matcher = "(LOWER(body) LIKE ? OR LOWER(extended) LIKE ? OR LOWER(title) LIKE ?)"
    template = "state = ? AND #{([matcher] * tokens.size).join(" AND ")}"
    where(template, "published", *tokens.map { |token| [token] * 3 }.flatten)
  }

  scope :published_at_like, lambda { |date_at|
                              where(published_at: PublifyTime.delta_like(date_at))
                            }

  serialize :whiteboard

  validates_default_string_length :title, :author, :permalink, :name,
                                  :post_type, :text_filter_name

  def author=(user)
    if user.respond_to?(:login)
      self[:author] = user.login
      self.user = user
    elsif user.is_a?(String)
      self[:author] = user
    end
  end

  def author_name
    if user.present? && user.name.present?
      user.name
    else
      author
    end
  end

  def shorten_url
    return unless published?

    if redirect.present?
      return if redirect.to_path == permalink_url

      redirect.to_path = permalink_url
      redirect.save
    else
      r = Redirect.new(blog: blog)
      r.from_path = r.shorten
      r.to_path = permalink_url
      self.redirect = r
    end
  end

  # TODO: Inline this method
  def self.find_already_published(limit)
    published.limit(limit)
  end

  def self.search_with(params)
    params ||= {}
    scoped = unscoped
    scoped = scoped.searchstring(params[:searchstring]) if params[:searchstring].present?

    if params[:published_at].present? && /(\d\d\d\d)-(\d\d)/ =~ params[:published_at]
      scoped = scoped.published_at_like(params[:published_at])
    end

    if params[:user_id].present? && params[:user_id].to_i > 0
      scoped = scoped.user_id(params[:user_id])
    end

    if params[:published].present?
      scoped = scoped.published if params[:published].to_s == "1"
      scoped = scoped.not_published if params[:published].to_s == "0"
    end

    scoped
  end

  def whiteboard
    self[:whiteboard] ||= {}
  end

  def rss_description
    return "" unless blog.rss_description

    rss_desc = blog.rss_description_text
    rss_desc.gsub!("%author%", author_name)
    rss_desc.gsub!("%blog_url%", blog.base_url)
    rss_desc.gsub!("%blog_name%", blog.blog_name)
    rss_desc.gsub!("%permalink_url%", permalink_url)
    rss_desc
  end

  def short_url
    redirect.from_url if redirect.present?
  end
end


text:
<?php

class Permitsrecognition extends CI_Controller
{
	public function __construct()
	{
		parent::__construct();
		//check hei or ro
		$this->session;
		$utype = $this->session->userdata('usertype');
		$this->load->helper('date');
		if($utype=='Encoder'){
			redirect('login');
		}

		$this->load->model('permitsrecognition_model');
		$this->session;
		 $this->data = array(
            'title' => 'Permit & Recognition',
			'heiclass' => 'active',
			'heilist' => '',
			'programlist' => '',
			'deanslist' => '',
			'programapplication' => '',
			'accounts' => '',
			'contacts' => '',
			'permits' => 'active',
			'scholarship' => '',
			'scholarslist' => '',
			'accreditedhei' => '',
			'scholarshipapplicant' => '',
			'paymentlist' => '',
			'settingsclass' => '',
			'voucherlist' => 'active',
			'breadcrumb' =>array('bc'=>"Permit & Recognition List")
			);
			$this->js = array(
            'jsfile' => 'permitsrecognition.js'
			);
	}

	public function index()
	{
		$data = $this->data;
		$js = $this->js;
		$data['page'] = "index";
		$data['details'] =array('instname'=>"Permit & Recognition") ;
		$data['current_year'] = date('Y');
		$data['permits_list'] = $this->permitsrecognition_model->get();
		$data['hei_list'] = $this->permitsrecognition_model->gethei();
		//$data['hei_list'] = $this->contacts_model->gethei();
		//$data['contact_list'] = $this->contacts_model->getaccount();
		//print_r($data['details']);
		$data['permit_category_list'] = $this->permitsrecognition_model->categorylist();

		$this->load->view('inc/header_view');
		if($this->session->userdata('usertype')=="Staff"){
			$this->load->view('heidirectory/permitsrecognition_staff_view',$data);
		}else{
			$this->load->view('heidirectory/permitsrecognition_view',$data);
		}

		$this->load->view('inc/footer_view',$js);

	}

	public function deletepermit($permitid){

		$this->permitsrecognition_model->deletepermit($permitid);

	}

	public function generatepermitno(){

		$spcode = $this->input->post('specialpermit');
		$seriesyear = $this->input->post('seriesyear');

		$this->permitsrecognition_model->generatepermitno($spcode,$seriesyear);

	}

	public function savepermits(){

		$instcode = $this->input->post('instcode');
		$permitdate = $this->input->post('permitdate');
		$programname = $this->input->post('programname');
		$specialpermit = $this->input->post('specialpermit');
		$permitno = $this->input->post('permitno');
		$seriesyear = $this->input->post('seriesyear');
		$effectivitydate = $this->input->post('effectivitydate');
		$programlevel = $this->input->post('programlevel');
		$major = $this->input->post('major');

		$this->permitsrecognition_model->savepermits($instcode,$permitdate,$programname,$specialpermit,$permitno,$seriesyear,$effectivitydate,$programlevel,$major);

	}

	public function updatepermit(){

		$permitid = $this->input->post('permitid');
		$instcode = $this->input->post('instcode');
		$permitdate = $this->input->post('permitdate');
		$programname = $this->input->post('programname');
		$specialpermit = $this->input->post('specialpermit');
		$permitno = $this->input->post('permitno');
		$seriesyear = $this->input->post('seriesyear');
		$effectivitydate = $this->input->post('effectivitydate');
		$programlevel = $this->input->post('programlevel');

		$this->permitsrecognition_model->updatepermit($permitid,$instcode,$permitdate,$programname,$specialpermit,$permitno,$seriesyear,$effectivitydate,$programlevel);

	}

	public function permitsxls(){
		$this->load->library('excel');
		$this->excel->setActiveSheetIndex(0);
		$this->excel->getActiveSheet()->setTitle('Permit List');

		//$objPHPExcel->setActiveSheetIndex(0);
		 $this->excel->getActiveSheet()->setCellValue('A1','Date');
		 $this->excel->getActiveSheet()->setCellValue('B1','InstCode');
		 $this->excel->getActiveSheet()->setCellValue('C1','HEI Name');
		 $this->excel->getActiveSheet()->setCellValue('D1','Program');
		 $this->excel->getActiveSheet()->setCellValue('E1','Special Permit');
		 $this->excel->getActiveSheet()->setCellValue('F1','Permit No');
		 $this->excel->getActiveSheet()->setCellValue('G1','Series Year');
		 $this->excel->getActiveSheet()->setCellValue('H1','Complete #');
		 $this->excel->getActiveSheet()->setCellValue('I1','Effectivity');
		 $this->excel->getActiveSheet()->setCellValue('J1','Program Level');

		$this->load->model('permitsrecognition_model');
		$permit_list = $this->permitsrecognition_model->getxls();
		$this->excel->getActiveSheet()->fromArray($permit_list,NULL,'A2');

		$filename='permit_list.xls';
		header('Content-Type: application/vnd.ms-excel');
		header('Content-Disposition: attachment;filename="'.$filename.'"');
		header('Cache-Control: max-age=0');
		 $objWriter = PHPExcel_IOFactory::createWriter($this->excel, 'Excel5');
		 $objWriter->save('php://output');

	}

	public function editpermit(){

		$permitid = $this->input->post('permitid');

		$permit_details = $this->permitsrecognition_model->editpermit($permitid);

		echo json_encode($permit_details[0]);
	}

	public function showprograms(){

		$instcode = $this->input->post('instcode');

		$program_list = $this->permitsrecognition_model->showprograms($instcode);

		echo json_encode($program_list);
	}

	public function showauthority(){

		$programid = $this->input->post('programid');

		$program_list = $this->permitsrecognition_model->showauthority($programid);

		echo json_encode($program_list[0]);
	}

	public function permitupload() {

		 $fileattachmentid_permit = $this->input->post('fileattachmentid_permit');
		// $course = $this->input->post('course');
		 //$semester = $this->input->post('semester');
		// $yearlevel = $this->input->post('yearlevel');
		 //$schoolyear = $this->input->post('schoolyear');

		 $time_stamp = now();
		 //$newfilename = $fileid."jpg";
         $config['upload_path']   = './uploads/permits_recognition/';
         $config['allowed_types'] = 'wmv|flv|mp4|mov|gif|jpg|png|jpeg|pdf';
         $config['max_size']      = 100000;
         $config['max_width']     = 5000;
         $config['max_height']    = 5000;
         $config['overwrite']    = true;
         $config['file_name']    = $fileattachmentid_permit."_".$time_stamp;
         //$filename    = $config['file_name'];
         $this->load->library('upload', $config);

         if ( ! $this->upload->do_upload('fileattachment_permit')) {
            $error = array('error' => $this->upload->display_errors());
            //$this->load->view('upload_form', $error);
			//print_r($error);
			echo "No File Uploaded";
         }

         else {
            $data = array('upload_data' => $this->upload->data());
            //$this->load->view('upload_success', $data);
			$fileattachmentid_permit = $this->input->post('fileattachmentid_permit');
			$filename = $this->upload->data('file_name');
			//$file_type = $this->upload->data('file_type');
			$this->permitsrecognition_model->updatepermitfile($filename,$fileattachmentid_permit);
			//$this->enrollmentlist_model->save_el($instcode,$course,$schoolyear,$filename,$uid,$file_type,$semester);
			//header('Location:details/'.$ticketfileid);
         }
      }

	  public function deletefile(){

		$permitid = $this->input->post('permitid');
		$filename = $this->input->post('filename');
		//get filename
		//$file_name = $this->employees_model->getfilename($filesid);
		$this->load->helper("url");
		//delete_files("uploads/201_files".$filesid.".pdf");
		unlink("uploads/permits_recognition/" . $filename);
		//$this->db->delete('employee_educational_background', array('educbackgroundid' => $educbackgroundid));
		$this->permitsrecognition_model->updatefilename($permitid);

	  }

}


text:
package com.bj58.oceanus.core.loadbalance.ha;

import java.sql.Connection;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.Iterator;
import java.util.Map;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.bj58.oceanus.core.alarm.AlarmExcutor;
import com.bj58.oceanus.core.alarm.AlarmType;
import com.bj58.oceanus.core.exception.ConfigurationException;
import com.bj58.oceanus.core.resource.DataNode;
import com.bj58.oceanus.core.utils.JdbcUtil;
import com.google.common.collect.Maps;

/**
 * 用户检测配置中的DataNode是否可用
 *
 * @author Service Platform Architecture Team (spat@58.com)
 */
public final class DataNodeChecker {

	private DataNodeChecker() {}

	private static Logger logger = LoggerFactory.getLogger(DataNodeChecker.class);

	// 存储DataNode可用状态
	private static final Map<String, AtomicBoolean> dataNodeAliveMap = Maps.newHashMap();

	// 定时调度线程池,用于循环监测DataNode可用性
	private static final ScheduledExecutorService schedulerService = Executors.newSingleThreadScheduledExecutor();

	// 该缓存线程池用于执行确认DataNode可用性的线程
	private static final ExecutorService executorService = Executors.newCachedThreadPool();

	// 只启动一次的判断条件,防止重复开启线程
	private static final AtomicBoolean onceCondition = new AtomicBoolean(false);

	// 根据这个sql监测DataNode是否可用,一般可用 SELECT 1
	protected static String checkSql;

	protected static Map<String, DataNode> dataNodeMap;

	public static void startChecker(String checkSql, Map<String, DataNode> dataNodeMap){
		if(!onceCondition.compareAndSet(false, true)){
			throw new ConfigurationException("DataNode Checker can only start once");
		}

		DataNodeChecker.checkSql = checkSql;
		DataNodeChecker.dataNodeMap = dataNodeMap;

		for(Iterator<String> it = DataNodeChecker.dataNodeMap.keySet().iterator(); it.hasNext();)
			dataNodeAliveMap.put(it.next(), new AtomicBoolean(true));

		// 目前两次检测是串行执行,数据源太多的时候不能保证及时更新状态,后期可以根据数据源数量改为自动适配,多线程检测
		schedulerService.scheduleAtFixedRate(new FirstChecker(), 1, 30, TimeUnit.SECONDS);
	}

	public static void stopChecker(){
		schedulerService.shutdownNow();
		onceCondition.compareAndSet(true, false);
	}

	/**
	 * 从状态映射map中查看DataNode是否可用
	 * @param dataNode
	 * @return
	 */
	public static boolean dataNodeAlive(DataNode dataNode){
		if(dataNode==null || dataNode.getId()==null)
			return true;

		if(!dataNodeAliveMap.containsKey(dataNode.getId())){
			logger.error("DataNode ["+dataNode.getId()+"] is not in the check list !!");
			return true;
		}

		return dataNodeAliveMap.get(dataNode.getId()).get();
	}

	/**
	 * 使用check sql来尝试DataNode是否可用,该方法只提供内部线程类使用
	 * @param dataNode
	 * @return
	 */
	private static boolean checkDataNodeAlive(DataNode dataNode) {
		Connection connection = null;
		Statement statement = null;

		try {
			connection = dataNode.getConnection();
			statement = connection.createStatement();
			return statement.execute(checkSql);
		} catch (SQLException e) {
			e.printStackTrace();
		} finally {
			JdbcUtil.closeStatement(statement);
			JdbcUtil.closeConnection(connection);
		}
		return false;
	}

	/**
	 * 该线程用于轮询检测全部DataSource状态,初步判断数据源是否可用,如果不可用,交给ConfirmChecker(确认线程)延时处理
	 */
	private static class FirstChecker implements Runnable{

		@Override
		public void run() {
			logger.debug("dataNodeMap:"+DataNodeChecker.dataNodeMap);
			if (DataNodeChecker.dataNodeMap.size()<1) {
				logger.error("no datanode need to check");
				return;
			}

			for (Iterator<DataNode> it = DataNodeChecker.dataNodeMap.values().iterator(); it.hasNext();) {
				DataNode dataNode = it.next();
				if (checkDataNodeAlive(dataNode)) {
					if (dataNodeAliveMap.get(dataNode.getId()).compareAndSet(false, true)) {
						logger.error("DataNode ["+dataNode.getId()+"] has been restored !!");

						// 调用配置中约定的警报实现类,通知DB已恢复
						AlarmExcutor.doAlarm(AlarmType.DB_AVALIABLE, dataNode);
					}
				} else {
					logger.info("DataNode ["+dataNode.getId()+"] start confirm checker !!");
					executorService.execute(new ConfirmChecker(dataNode));
				}
			}

		}
	}

	/**
	 * 该线程用于确认数据源是否真的已经不可用,尝试5次,间隔1秒
	 */
	private static class ConfirmChecker implements Runnable{

		private DataNode dataNode;

		ConfirmChecker(DataNode dataNode) {
			this.dataNode = dataNode;
		}

		@Override
		public void run() {
			int countDown = 5;
			try {
				while(countDown-- > 0){
					TimeUnit.SECONDS.sleep(1);
					if(checkDataNodeAlive(dataNode))
						return;
				}

				dataNodeAliveMap.get(dataNode.getId()).set(false);
				logger.error("DataNode ["+dataNode.getId()+"] is died !!");

				// 调用配置中约定的警报实现类,通知DB已不可用
				AlarmExcutor.doAlarm(AlarmType.DB_NOTAVALIABLE, dataNode);
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
		}

	}

}


text:
/**
 * Distributed-Memory Programming with MPI #7
 * Other Functions
 */

// startup and termination
int MPI_Abort(MPI_Comm communicator, int error_code);

// profiling calls
double MPI_Wtime();

// non-blocking point-to-point communication
int MPI_Irecv(void *message, int count, MPI_Datatype type,
              int src, int tag, MPI_Comm communicator, MPI_Request *request);

int MPI_Isend(void *message, int count, MPI_Datatype type,
              int dest, int tag, MPI_Comm communicator, MPI_Request *request);

int MPI_Wait(MPI_Request *request, MPI_Status *status);


text:
#!/usr/bin/env perl

#########################################################################################
#                                       stepIGVTDF.pl
#########################################################################################
#
#  Converts bam files for IGV visualization.
#
#########################################################################################
# AUTHORS:
#
# Alper Kucukural, PhD
#
#########################################################################################

############## LIBRARIES AND PRAGMAS ################

 use List::Util qw[min max];
 use strict;
 use File::Basename;
 use Getopt::Long;
 use Pod::Usage;

#################### VARIABLES ######################
 my $genome           = "";
 my $type             = "";
 my $pair             = "";
 my $insertlen        = "";
 my $outdir           = "";
 my $pubdir           = "";
 my $extfactor        = "";
 my $wkey             = "";
 my $samtools         = "";
 my $igvtools         = "";
 my $jobsubmit        = "";
 my $servicename      = "";
 my $help             = "";
 my $print_version    = "";
 my $version          = "1.0.0";
################### PARAMETER PARSING ####################

my $cmd=$0." ".join(" ",@ARGV); ####command line copy

GetOptions(
    'outdir=s'       => \$outdir,
    'type=s'         => \$type,
    'samtools=s'     => \$samtools,
    'igvtools=s'     => \$igvtools,
    'len=s'          => \$insertlen,
    'pair=s'         => \$pair,
    'pubdir=s'       => \$pubdir,
    'extfactor=s'    => \$extfactor,
    'wkey=s'         => \$wkey,
    'jobsubmit=s'    => \$jobsubmit,
    'servicename=s'  => \$servicename,
    'genome=s'       => \$genome,
	'help'           => \$help,
	'version'        => \$print_version,
) or die("Unrecognized optioins.\nFor help, run this script with -help option.\n");

if($help){
    pod2usage( {
		'-verbose' => 2,
		'-exitval' => 1,
	} );
}

if($print_version){
  print "Version ".$version."\n";
  exit;
}

pod2usage( {'-verbose' => 0, '-exitval' => 1,} ) if ( ($samtools eq "") or ($genome eq "") or ($outdir eq "") );

################### MAIN PROGRAM ####################
#   converts the mapped reads for IGV visualization

my $outd  = "$outdir/tdf_$type";
`mkdir -p $outd`;
die "Error 15: Cannot create the directory:$outd" if ($?);

#my $puboutdir   = "$pubdir/$wkey/tdf_$type";
#`mkdir -p $puboutdir`;
#die "Error 15: Cannot create the directory:$puboutdir" if ($?);

my @files=();
print $type."\n";
my $sorted=".sorted";
if ($type eq "RSEM")
{
   my $indir   = "$outdir/rsem";
   @files = <$indir/pipe*/*.genome$sorted.bam>;
   if (@files==0){
      $sorted="";
      @files = <$indir/pipe*/*.genome.bam>
   }
}
elsif ($type eq "tophat")
{
   my $indir   = "$outdir/tophat";
   @files = <$indir/pipe*/*.sorted.bam>;
}
elsif ($type eq "chip")
{
   my $indir   = "$outdir/seqmapping/chip";
   @files = <$indir/*.sorted.bam>;
}
else
{
  my $indir = "$outdir/$type";
  @files = <$indir/*.bam>;
}

my $param="";
if ($extfactor!~/^$/ && $extfactor>0)
{
  $param=" -e $extfactor ";
}
if ($pair eq "paired")
{
  $param.=" --pairs ";
}

foreach my $d (@files){
  my ($com, $libname, $dirname)=();
  print $d." HERE\n";

  if ($type eq "RSEM")
  {
     $libname=basename($d, ".genome$sorted.bam");
     $dirname=dirname($d);
     $libname=~s/rsem.out.//g;
     if ($sorted=~/^$/)
     {
       $com=": \\\$( $samtools sort $dirname/rsem.out.$libname.genome.bam $outd/$libname ) && ";
       $com.=": \\\$( $samtools index $outd/$libname.bam ) && ";
     }
     else
     {
       $com="cp $dirname/rsem.out.$libname.genome$sorted.bam $outd/$libname.bam && ";
       $com.="cp $dirname/rsem.out.$libname.genome$sorted.bam.bai $outd/$libname.bam.bai && ";
     }
  }
  else
  {
     $dirname=dirname($d);
     $libname=basename($d, ".sorted.bam") if ($libname =~ /\.sorted.bam/);
     $libname=basename($d, ".bam") if ($libname !~ /\.sorted.bam/);

     $com="cp $d $outd/$libname.bam && ";
     $com.="cp $d.bai $outd/$libname.bam.bai && ";
  }

  $com.="cd $outdir && $igvtools count -w 5 $param $outd/$libname.bam  $outd/$libname.tdf $genome ";
 # $com.="cp -R $outd/$libname.* $puboutdir/.";
  my $job=$jobsubmit." -n ".$servicename."_".$libname." -c \"$com\"";
  print $job."\n";
  `$job`;
  die "Error 25: Cannot run the job:".$job if ($?);
}

__END__

=head1 NAME

stepIGVTDF.pl

=head1 SYNOPSIS

stepIGVTDF.pl
            -o outdir <output directory>
            -g genome <genome files>
            -s samtools <samtools fullpath>

stepIGVTDF.pl -help

stepIGVTDF.pl -version

For help, run this script with -help option.

=head1 OPTIONS

=head2 -o outdir <output directory>

the output files will be "$outdir/after_ribosome/tdf"

=head2  -g genome <genome files>

Genome fasta file. (Full path)

=head2   -t samtools <samtools fullpath>

Samtools full path

=head2 -help

Display this documentation.

=head2 -version

Display the version

=head1 DESCRIPTION

 This program maps the reads using tophat2

=head1 EXAMPLE

stepIGVTDF.pl
            -o outdir <output directory>
            -g genome <genome files>
            -s samtools <samtools fullpath>

=head1 AUTHORS

 Alper Kucukural, PhD

=head1 LICENSE AND COPYING

 This program 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 2 of the License, or
 (at your option) any later version.

 This program 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 this program; if not, a copy is available at
 http://www.gnu.org/licenses/licenses.html


text:
using System;
using System.Management.Automation;
using System.Threading;
using Dbg = System.Management.Automation;

namespace Microsoft.PowerShell.Commands
{
    /// <summary>
    /// Suspend shell, script, or runspace activity for the specified period of time.
    /// </summary>
    [Cmdlet(VerbsLifecycle.Start, "Sleep", DefaultParameterSetName = "Seconds", HelpUri = "https://go.microsoft.com/fwlink/?LinkID=113407")]
    public sealed class StartSleepCommand : PSCmdlet, IDisposable
    {
        private bool _disposed = false;

        #region IDisposable
        /// <summary>
        /// Dispose method of IDisposable interface.
        /// </summary>
        public void Dispose()
        {
            if (_disposed == false)
            {
                if (_waitHandle != null)
                {
                    _waitHandle.Dispose();
                    _waitHandle = null;
                }

                _disposed = true;
            }
        }

        #endregion

        #region parameters

        /// <summary>
        /// Allows sleep time to be specified in seconds.
        /// </summary>
        [Parameter(Position = 0, Mandatory = true, ParameterSetName = "Seconds", ValueFromPipeline = true,
                   ValueFromPipelineByPropertyName = true)]
        [ValidateRangeAttribute(0.0, (double)(int.MaxValue / 1000))]
        public double Seconds { get; set; }

        /// <summary>
        /// Allows sleep time to be specified in milliseconds.
        /// </summary>
        [Parameter(Mandatory = true, ParameterSetName = "Milliseconds", ValueFromPipelineByPropertyName = true)]
        [ValidateRangeAttribute(0, int.MaxValue)]
        [Alias("ms")]
        public int Milliseconds { get; set; }

        #endregion

        #region methods

        // Wait handle which is used by thread to sleep.
        private ManualResetEvent _waitHandle;

        // object used for synchronizes pipeline thread and stop thread
        // access to waitHandle
        private object _syncObject = new object();

        // this is set to true by stopProcessing
        private bool _stopping = false;

        /// <summary>
        /// This method causes calling thread to sleep for specified milliseconds.
        /// </summary>
        private void Sleep(int milliSecondsToSleep)
        {
            lock (_syncObject)
            {
                if (_stopping == false)
                {
                    _waitHandle = new ManualResetEvent(false);
                }
            }

            if (_waitHandle != null)
            {
                _waitHandle.WaitOne(milliSecondsToSleep, true);
            }
        }

        /// <summary>
        /// ProcessRecord method.
        /// </summary>
        protected override void ProcessRecord()
        {
            int sleepTime = 0;

            switch (ParameterSetName)
            {
                case "Seconds":
                    sleepTime = (int)(Seconds * 1000);
                    break;

                case "Milliseconds":
                    sleepTime = Milliseconds;
                    break;

                default:
                    Dbg.Diagnostics.Assert(false, "Only one of the specified parameter sets should be called.");
                    break;
            }

            Sleep(sleepTime);
        }

        /// <summary>
        /// StopProcessing override.
        /// </summary>
        protected override void StopProcessing()
        {
            lock (_syncObject)
            {
                _stopping = true;
                if (_waitHandle != null)
                {
                    _waitHandle.Set();
                }
            }
        }

        #endregion
    }
}


text:
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>ip::network_v6::prefix_length</title>
<link rel="stylesheet" href="../../../boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
<link rel="home" href="../../../index.html" title="Asio">
<link rel="up" href="../ip__network_v6.html" title="ip::network_v6">
<link rel="prev" href="operator_eq__eq_.html" title="ip::network_v6::operator==">
<link rel="next" href="to_string.html" title="ip::network_v6::to_string">

ip::network_v6::prefix_length

Obtain the prefix length that was specified
          when the network object was created.

unsigned short prefix_length() const;

Copyright © 2003-2015 Christopher M.
      Kohlhoff

        Distributed under the Boost Software License, Version 1.0. (See accompanying
        file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)


text:
var basics = {
    add: function(left, right){
        return left + right;
    },

    substract: function(left, right) {
        return left - right;
    },

    multiply: function(left, right) {
        return left * right;
    },

    divide: function(left, right) {
        return left / right;
    },

    sum: function(list) {
        return list.reduce(this.add);
    },

    flux: function(inc, exp) {
        return inc - exp;
    },

    leverageRatio: function(debtp, inc) {
        return debt / inc;
    },

    leverageCapitalRatio: function(tdebt, tcap) {
        return tdebt / tcap;
    },

    priceVariance: function (curprice, buyprice) {
        return (curprice - buyprice) / buyprice;
    },

    rule72: function(irate) {
        return 72 / irate;
    },

    inflactionRate: function(ivestrate, iflurate) {
        return ((1 +  ivestrate) / ((1 + iflurate) - 1)) * 100;
    },
};

module.exports = basics;


text:
using System.Collections.Generic;
using System.Linq;
using Portal.Application.Roles.Dto;

namespace Portal.Web.Models.Roles
{
    public class EditRoleModalViewModel
    {
        public RoleDto Role { get; set; }

        public IReadOnlyList<PermissionDto> Permissions { get; set; }

        public bool HasPermission(PermissionDto permission)
        {
            return Permissions != null && Role.Permissions.Any(p => p == permission.Name);
        }
    }
}


text:
<form method="post">

            Username:
            <input type="text" minlength="4" name="username" required/>

            Password:
            <input type="password" minlength="6" name="password" required/>

            Confirm password:
            <input type="password" minlength="6" name="confirm_password" required/>

            First name:
            <input type="text" minlength="3" name="first_name" required/>

            Last name:
            <input type="text" minlength="3" name="last_name" required/>

        <input type="submit" name="registar" value="Register!" />

</form>


text:
service mysql restart
echo "GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'mysql' WITH GRANT OPTION; FLUSH PRIVILEGES;" | mysql -uroot -pmysql


text:
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.Test.Utilities;
using static TestReferences;
using static Roslyn.Test.Utilities.TestMetadata;

namespace Roslyn.Test.Utilities
{
    public enum TargetFramework
    {
        /// <summary>
        /// Explicit pick a target framework that has no references
        /// </summary>
        Empty,

        NetStandard20,
        NetCoreApp30,
        NetStandardLatest = NetCoreApp30,
        WinRT,

        /// <summary>
        /// Eventually this will be deleted and replaced with NetStandard20. Short term this creates the "standard"
        /// API set across desktop and coreclr
        /// </summary>
        Standard,
        StandardLatest,
        StandardAndCSharp,
        StandardAndVBRuntime,

        /// <summary>
        /// This is represents the set of tests which must be mscorlib40 on desktop but full net standard on coreclr.
        /// </summary>
        StandardCompat,

        /// <summary>
        /// Compat framework for the default set of references many vb compilations get.
        /// </summary>
        DefaultVb,

        // The flavors of mscorlib we support + extending them with LINQ and dynamic.
        Mscorlib40,
        Mscorlib40Extended,
        Mscorlib40AndSystemCore,
        Mscorlib40AndVBRuntime,
        Mscorlib45,
        Mscorlib45Extended,
        Mscorlib45AndCSharp,
        Mscorlib45AndVBRuntime,
        Mscorlib46,
        Mscorlib46Extended,
        Mscorlib461,
        Mscorlib461Extended,
        DesktopLatestExtended = Mscorlib461Extended,

        /// <summary>
        /// Minimal set of required types (<see cref="NetFx.Minimal.mincorlib"/>).
        /// </summary>
        Minimal,

        /// <summary>
        /// Minimal set of required types and Task implementation (<see cref="NetFx.Minimal.minasync"/>).
        /// </summary>
        MinimalAsync,
    }

    public static class TargetFrameworkUtil
    {
        public static MetadataReference StandardCSharpReference => RuntimeUtilities.IsCoreClrRuntime ? MicrosoftCSharp.Netstandard13Lib : Net451.MicrosoftCSharp;

        /*
         * ⚠ Dev note ⚠: properties in TestBase are backed by Lazy<T>. Avoid changes to the following properties
         * which would force the initialization of these properties in the static constructor, since the stack traces
         * for a TypeLoadException are missing important information for resolving problems if/when they occur.
         * https://github.com/dotnet/roslyn/issues/25961
         */

        public static ImmutableArray<MetadataReference> Mscorlib40References => ImmutableArray.Create<MetadataReference>(Net40.mscorlib);
        public static ImmutableArray<MetadataReference> Mscorlib40ExtendedReferences => ImmutableArray.Create<MetadataReference>(Net40.mscorlib, Net40.System, Net40.SystemCore);
        public static ImmutableArray<MetadataReference> Mscorlib40andSystemCoreReferences => ImmutableArray.Create<MetadataReference>(Net40.mscorlib, Net40.SystemCore);
        public static ImmutableArray<MetadataReference> Mscorlib40andVBRuntimeReferences => ImmutableArray.Create<MetadataReference>(Net40.mscorlib, Net40.System, Net40.MicrosoftVisualBasic);
        public static ImmutableArray<MetadataReference> Mscorlib45References => ImmutableArray.Create<MetadataReference>(Net451.mscorlib);
        public static ImmutableArray<MetadataReference> Mscorlib45ExtendedReferences => ImmutableArray.Create<MetadataReference>(Net451.mscorlib, Net451.System, Net451.SystemCore, TestBase.ValueTupleRef, Net451.SystemRuntime);
        public static ImmutableArray<MetadataReference> Mscorlib45AndCSharpReferences => ImmutableArray.Create<MetadataReference>(Net451.mscorlib, Net451.SystemCore, Net451.MicrosoftCSharp);
        public static ImmutableArray<MetadataReference> Mscorlib45AndVBRuntimeReferences => ImmutableArray.Create<MetadataReference>(Net451.mscorlib, Net451.System, Net451.MicrosoftVisualBasic);
        public static ImmutableArray<MetadataReference> Mscorlib46References => ImmutableArray.Create<MetadataReference>(Net461.mscorlib);
        public static ImmutableArray<MetadataReference> Mscorlib46ExtendedReferences => ImmutableArray.Create<MetadataReference>(Net461.mscorlib, Net461.System, TestMetadata.Net461.SystemCore, TestBase.ValueTupleRef, Net461.SystemRuntime);
        public static ImmutableArray<MetadataReference> Mscorlib461References => ImmutableArray.Create<MetadataReference>(Net461.mscorlib);
        public static ImmutableArray<MetadataReference> Mscorlib461ExtendedReferences => ImmutableArray.Create<MetadataReference>(Net461.mscorlib, Net461.System, Net461.SystemCore, NetFx.ValueTuple.tuplelib, Net461.SystemRuntime);
        public static ImmutableArray<MetadataReference> NetStandard20References => ImmutableArray.Create<MetadataReference>(NetStandard20.netstandard, NetStandard20.mscorlib, NetStandard20.SystemRuntime, NetStandard20.SystemCore, NetStandard20.SystemDynamicRuntime, NetStandard20.SystemLinq, NetStandard20.SystemLinqExpressions);
        public static ImmutableArray<MetadataReference> NetCoreApp30References => ImmutableArray.Create<MetadataReference>(NetCoreApp31.netstandard, NetCoreApp31.mscorlib, NetCoreApp31.SystemRuntime, NetCoreApp31.SystemCore,
                                                                                NetCoreApp31.SystemConsole, NetCoreApp31.SystemLinq, NetCoreApp31.SystemLinqExpressions, NetCoreApp31.SystemThreadingTasks,
                                                                                NetCoreApp31.SystemCollections, NetCoreApp31.SystemRuntimeInteropServicesWindowsRuntime);
        public static ImmutableArray<MetadataReference> WinRTReferences => ImmutableArray.Create(TestBase.WinRtRefs);
        public static ImmutableArray<MetadataReference> StandardReferences => RuntimeUtilities.IsCoreClrRuntime ? NetStandard20References : Mscorlib46ExtendedReferences;
        public static ImmutableArray<MetadataReference> StandardLatestReferences => RuntimeUtilities.IsCoreClrRuntime ? NetCoreApp30References : Mscorlib46ExtendedReferences;
        public static ImmutableArray<MetadataReference> StandardAndCSharpReferences => StandardReferences.Add(StandardCSharpReference);
        public static ImmutableArray<MetadataReference> StandardAndVBRuntimeReferences => RuntimeUtilities.IsCoreClrRuntime ? NetStandard20References.Add(MicrosoftVisualBasic.Netstandard11) : Mscorlib46ExtendedReferences.Add(Net461.MicrosoftVisualBasic);
        public static ImmutableArray<MetadataReference> StandardCompatReferences => RuntimeUtilities.IsCoreClrRuntime ? NetStandard20References : Mscorlib40References;
        public static ImmutableArray<MetadataReference> DefaultVbReferences => ImmutableArray.Create<MetadataReference>(Net451.mscorlib, Net451.System, Net451.SystemCore, Net451.MicrosoftVisualBasic);
        public static ImmutableArray<MetadataReference> MinimalReferences => ImmutableArray.Create(TestBase.MinCorlibRef);
        public static ImmutableArray<MetadataReference> MinimalAsyncReferences => ImmutableArray.Create(TestBase.MinAsyncCorlibRef);

        public static ImmutableArray<MetadataReference> GetReferences(TargetFramework targetFramework) => targetFramework switch
        {
            TargetFramework.Empty => ImmutableArray<MetadataReference>.Empty,
            TargetFramework.Mscorlib40 => Mscorlib40References,
            TargetFramework.Mscorlib40Extended => Mscorlib40ExtendedReferences,
            TargetFramework.Mscorlib40AndSystemCore => Mscorlib40andSystemCoreReferences,
            TargetFramework.Mscorlib40AndVBRuntime => Mscorlib40andVBRuntimeReferences,
            TargetFramework.Mscorlib45 => Mscorlib45References,
            TargetFramework.Mscorlib45Extended => Mscorlib45ExtendedReferences,
            TargetFramework.Mscorlib45AndCSharp => Mscorlib45AndCSharpReferences,
            TargetFramework.Mscorlib45AndVBRuntime => Mscorlib45AndVBRuntimeReferences,
            TargetFramework.Mscorlib46 => Mscorlib46References,
            TargetFramework.Mscorlib46Extended => Mscorlib46ExtendedReferences,
            TargetFramework.Mscorlib461 => Mscorlib46References,
            TargetFramework.Mscorlib461Extended => Mscorlib461ExtendedReferences,
            TargetFramework.NetStandard20 => NetStandard20References,
            TargetFramework.NetCoreApp30 => NetCoreApp30References,
            TargetFramework.WinRT => WinRTReferences,
            TargetFramework.Standard => StandardReferences,
            TargetFramework.StandardLatest => StandardLatestReferences,
            TargetFramework.StandardAndCSharp => StandardAndCSharpReferences,
            TargetFramework.StandardAndVBRuntime => StandardAndVBRuntimeReferences,
            TargetFramework.StandardCompat => StandardCompatReferences,
            TargetFramework.DefaultVb => DefaultVbReferences,
            TargetFramework.Minimal => MinimalReferences,
            TargetFramework.MinimalAsync => MinimalAsyncReferences,
            _ => throw new InvalidOperationException($"Unexpected target framework {targetFramework}"),
        };

        public static ImmutableArray<MetadataReference> GetReferences(TargetFramework tf, IEnumerable<MetadataReference> additionalReferences)
        {
            var references = GetReferences(tf);
            if (additionalReferences == null)
            {
                return references;
            }

            checkForDuplicateReferences();
            return references.AddRange(additionalReferences);

            // Check to see if there are any duplicate references. This guards against tests inadvertently passing multiple copies of
            // say System.Core to the tests and implicitly depending on the higher one to win. The few tests which actually mean to
            // pass multiple versions of a DLL should manually construct the reference list and not use this helper.
            void checkForDuplicateReferences()
            {
                var nameSet = new HashSet<string>(getNames(references), StringComparer.OrdinalIgnoreCase);
                foreach (var r in additionalReferences)
                {
                    if (references.Contains(r))
                    {
                        throw new Exception($"Duplicate reference detected {r.Display}");
                    }

                    var name = getName(r);
                    if (name != null && !nameSet.Add(name))
                    {
                        throw new Exception($"Duplicate reference detected {r.Display} - {name}");
                    }
                }
            }

            IEnumerable<string> getNames(IEnumerable<MetadataReference> e)
            {
                foreach (var r in e)
                {
                    var name = getName(r);
                    if (name != null)
                    {
                        yield return name;
                    }
                }
            }

            string getName(MetadataReference m)
            {
                if (m is PortableExecutableReference p &&
                    p.GetMetadata() is AssemblyMetadata assemblyMetadata)
                {
                    try
                    {
                        var identity = assemblyMetadata.GetAssembly().Identity;
                        return identity?.Name;
                    }
                    catch (BadImageFormatException)
                    {
                        // Happens when a native image is incorrectly passed as a PE.
                        return null;
                    }
                }

                return null;
            }
        }
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<java version="1.5.0_07" class="java.beans.XMLDecoder">
 <object class="gov.va.med.imaging.storage.cache.memento.CacheConfigurationMemento">
  <void property="evictionStrategyMementoes">
   <object class="java.util.ArrayList">
    <void method="add">
     <object class="gov.va.med.imaging.storage.cache.impl.eviction.LastAccessedEvictionStrategyMemento">
      <void property="initialized">
       <boolean>true</boolean>
      </void>
      <void property="maximumTimeSinceLastAccess">
       <long>3600000</long>
      </void>
      <void property="name">
       <string>one-hour-lifespan</string>
      </void>
     </object>
    </void>
    <void method="add">
     <object class="gov.va.med.imaging.storage.cache.impl.eviction.LastAccessedEvictionStrategyMemento">
      <void property="initialized">
       <boolean>true</boolean>
      </void>
      <void property="maximumTimeSinceLastAccess">
       <long>86400000</long>
      </void>
      <void property="name">
       <string>one-day-lifespan</string>
      </void>
     </object>
    </void>
    <void method="add">
     <object class="gov.va.med.imaging.storage.cache.impl.eviction.LastAccessedEvictionStrategyMemento">
      <void property="initialized">
       <boolean>true</boolean>
      </void>
      <void property="maximumTimeSinceLastAccess">
       <long>604800000</long>
      </void>
      <void property="name">
       <string>seven-day-lifespan</string>
      </void>
     </object>
    </void>
    <void method="add">
     <object class="gov.va.med.imaging.storage.cache.impl.eviction.LastAccessedEvictionStrategyMemento">
      <void property="initialized">
       <boolean>true</boolean>
      </void>
      <void property="maximumTimeSinceLastAccess">
       <long>2592000000</long>
      </void>
      <void property="name">
       <string>thirty-day-lifespan</string>
      </void>
     </object>
    </void>
   </object>
  </void>
  <void property="regionMementoes">
   <object class="java.util.ArrayList">
    <void method="add">
     <object class="gov.va.med.imaging.storage.cache.impl.memento.PersistentRegionMemento">
      <void property="evictionStrategyNames">
       <array class="java.lang.String" length="1">
        <void index="0">
         <string>one-hour-lifespan</string>
        </void>
       </array>
      </void>
      <void property="name">
       <string>va-metadata-region</string>
      </void>
      <void property="secondsReadWaitsForWriteCompletion">
       <int>60</int>
      </void>
     </object>
    </void>
    <void method="add">
     <object class="gov.va.med.imaging.storage.cache.impl.memento.PersistentRegionMemento">
      <void property="evictionStrategyNames">
       <array class="java.lang.String" length="1">
        <void index="0">
         <string>thirty-day-lifespan</string>
        </void>
       </array>
      </void>
      <void property="name">
       <string>va-image-region</string>
      </void>
      <void property="secondsReadWaitsForWriteCompletion">
       <int>60</int>
      </void>
     </object>
    </void>
    <void method="add">
     <object class="gov.va.med.imaging.storage.cache.impl.memento.PersistentRegionMemento">
      <void property="evictionStrategyNames">
       <array class="java.lang.String" length="1">
        <void index="0">
         <string>thirty-day-lifespan</string>
        </void>
       </array>
      </void>
      <void property="name">
       <string>dod-image-region</string>
      </void>
      <void property="secondsReadWaitsForWriteCompletion">
       <int>60</int>
      </void>
     </object>
    </void>
    <void method="add">
     <object class="gov.va.med.imaging.storage.cache.impl.memento.PersistentRegionMemento">
      <void property="evictionStrategyNames">
       <array class="java.lang.String" length="1">
        <void index="0">
         <string>one-day-lifespan</string>
        </void>
       </array>
      </void>
      <void property="name">
       <string>dod-metadata-region</string>
      </void>
      <void property="secondsReadWaitsForWriteCompletion">
       <int>60</int>
      </void>
     </object>
    </void>
   </object>
  </void>
 </object>
</java>


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

using System;
using System.Text;

namespace Microsoft.Identity.Core.Cache
{
    /// <summary>
    /// An object representing the key of the token cache RT dictionary. The
    /// format of the key is not important for this library, as long as it is unique.
    /// </summary>
    internal class MsalRefreshTokenCacheKey
    {
        private readonly string _environment;
        private readonly string _homeAccountId;
        private readonly string _clientId;

        internal MsalRefreshTokenCacheKey(string environment, string clientId, string userIdentifier)
        {
            if (string.IsNullOrEmpty(environment))
            {
                throw new ArgumentNullException(nameof(environment));
            }

            if (string.IsNullOrEmpty(clientId))
            {
                throw new ArgumentNullException(nameof(clientId));
            }

            _environment = environment;
            _homeAccountId = userIdentifier;
            _clientId = clientId;
        }

        public override string ToString()
        {
            return MsalCacheCommon.GetCredentialKey(
                _homeAccountId,
                _environment,
                MsalCacheCommon.RefreshToken,
                _clientId,
                tenantId: null,
                scopes: null);
        }

        #region iOS

        public string GetiOSAccountKey()
        {
            return MsalCacheCommon.GetiOSAccountKey(_homeAccountId, _environment);
        }

        public string GetiOSServiceKey()
        {
            return MsalCacheCommon.GetiOSServiceKey(MsalCacheCommon.RefreshToken, _clientId, tenantId: null, scopes: null);
        }

        public string GetiOSGenericKey()
        {
            return MsalCacheCommon.GetiOSGenericKey(MsalCacheCommon.RefreshToken, _clientId, tenantId: null);
        }

        #endregion
    }
}


text:
#include "tensorflow/core/kernels/cwise_ops_common.h"

namespace tensorflow {

// REGISTER# macros ignore all but first type (assumed to be float) when
// __ANDROID_TYPES_SLIM__ is defined.  Since this file is the second of two
// sharded files, only make its register calls when not __ANDROID_TYPES_SLIM__.
#if !defined(__ANDROID_TYPES_SLIM__)

REGISTER6(BinaryOp, CPU, "Mul", functor::mul, int8, uint16, int16, int64,
          complex64, complex128);
#if GOOGLE_CUDA || TENSORFLOW_USE_ROCM
#if !defined(MLIR_GENERATED_GPU_KERNELS_ENABLED) || \
    !defined(MLIR_GENERATED_EXPERIMENTAL_GPU_KERNELS_ENABLED)
REGISTER6(BinaryOp, GPU, "Mul", functor::mul, int8, uint16, int16, int64,
          complex64, complex128);
#else
REGISTER3(BinaryOp, GPU, "Mul", functor::mul, uint16, complex64, complex128);
#endif

#endif  // GOOGLE_CUDA || TENSORFLOW_USE_ROCM

#endif  // !defined(__ANDROID_TYPES_SLIM__)

}  // namespace tensorflow


text:
require 'puppet'
require 'spec_helper'

gce_disk = Puppet::Type.type(:gce_disk)

describe gce_disk do

  let :params do
    [
     :name,
     :zone,
     :size_gb,
     :source_image,
     :wait_until_complete,
     :description
    ]
  end

  it "should have expected parameters" do
    params.each do |param|
      gce_disk.parameters.should be_include(param)
    end
  end
end


text:
title: cloudflareHelper.ps1
description: Details about the cloudflareHelper.ps1 script
linkText: cloudflareHelper.ps1
---

# cloudflareHelper.ps1

## Overview

The `cloudflareHelper.ps1` script has functionality to assist interacting with the cloudflare API in order to create DNS entries

## Functions

{% include childPages.html %}


text:
module Hanami
  class CLI
    module Commands
      module Destroy
        # @since 1.1.0
        # @api private
        class Model < Command
          requires "environment"

          desc "Destroy a model"

          argument :model, required: true, desc: "The model name (eg. `user`)"

          example [
            "user # Destroy `User` entity and `UserRepository` repository"
          ]

          # @since 1.1.0
          # @api private
          def call(model:, **options)
            model   = Utils::String.transform(model, :underscore, :singularize)
            context = Context.new(model: model, options: options)

            assert_valid_model!(context)

            destroy_repository_spec(context)
            destroy_entity_spec(context)
            destroy_repository(context)
            destroy_entity(context)
          end

          private

          # @since 1.1.0
          # @api private
          def assert_valid_model!(context)
            destination = project.entity(context)
            return if files.exist?(destination)

            destination = project.entities(context)
            warn "cannot find `#{context.model}' model. Please have a look at `#{destination}' directory to find an existing model."
            exit(1)
          end

          # @since 1.1.0
          # @api private
          def destroy_repository_spec(context)
            destination = project.repository_spec(context)

            files.delete(destination)
            say(:remove, destination)
          end

          # @since 1.1.0
          # @api private
          def destroy_entity_spec(context)
            destination = project.entity_spec(context)

            files.delete(destination)
            say(:remove, destination)
          end

          # @since 1.1.0
          # @api private
          def destroy_repository(context)
            destination = project.repository(context)

            files.delete(destination)
            say(:remove, destination)
          end

          # @since 1.1.0
          # @api private
          def destroy_entity(context)
            destination = project.entity(context)

            files.delete(destination)
            say(:remove, destination)
          end
        end
      end
    end
  end
end


text:
| Function          | Trigger           | Document                                                                                |
| ----------------- | ----------------- | ---------------------------------------------------------------------------------------------------------------------------- |
| `onCommentCreate` | `document.create` | comments/{docId} |
| `onCommentUpdate` | `document.update` | comments/{docId} |

### `onCommentCreate():`

1. Only runs when a `commentDoc` is of type `Comment` (immediately returns if type is `Comment Thread`)
1. Creates two objects: Email details for tagged users, and email details for the comment thread owner
1. Publishes a message with those details to `Cloud PubSub`.

### `onCommentUpdate():`

1. If the update is the result of resolving a thread, sends an email to those affected (tagged users, thread owner)
1. If the update is a result of a user being added to an _existing_ comment, sends an email to that user.

> _NOTE: Both scenarios use the same `PubSub` mechanism described in [onCommentCreate](#oncommentcreate)_

---

## Comment Count Changes (`comment-count.ts`)

| Function                               | Trigger           | Document                                                                                |
| -------------------------------------- | ----------------- | ---------------------------------------------------------------------------------------------------------------------------- |
| `onCommentCreateUpdateCount`           | `document.create` | [comments/{docId} |
| `onCommentDeleteUpdateCount`           | `document.create` | [comments/{docId} |
| `onCommentResolutionChangeUpdateCount` | `document.create` | [comments/{docId} |

### `onCommentCreateUpdateCount()`,

### `onCommentResolutionChangeUpdateCount()`,

### `onCommentDeleteUpdateCount():`

1. Gets the project doc for a given comment
1. Updates `numComments` with the current number of comments based on a previous action (create, delete, resolve, unresolve)