text:
/**
 *
 */
package com.sc.tool;

/**
 * @author advance
 *
 */
/*
 * Convenience methods for executing non-Java processes.
 * Copyright (C) 2005 Stephen Ostermiller
 * http://ostermiller.org/contact.pl?regarding=Java+Utilities
 *
 * 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.
 *
 * See COPYING.TXT for details.
 */

import java.io.*;

/**
 * Convenience methods for executing non-Java processes.
 * More information about this class is available from ostermiller.org.
 *
 * @author Stephen Ostermiller http://ostermiller.org/contact.pl?regarding=Java+Utilities
 * @since ostermillerutils 1.06.00
 */
public final class ExecHelper {

	/**
	 * Executes the specified command and arguments in a separate process, and waits for the
	 * process to finish.
	 *

	 * Output from the process is expected to be text in the system's default character set.
	 *

	 * No input is passed to the process on STDIN.
	 *
	 * @param cmdarray array containing the command to call and its arguments.
	 * @return The results of the execution in an ExecHelper object.
	 * @throws SecurityException if a security manager exists and its checkExec method doesn't allow creation of a subprocess.
	 * @throws IOException - if an I/O error occurs
	 * @throws NullPointerException - if cmdarray is null
	 * @throws IndexOutOfBoundsException - if cmdarray is an empty array (has length 0).
	 *
	 * @since ostermillerutils 1.06.00
	 */
	public static ExecHelper exec(String[] cmdarray) throws IOException {
		return new ExecHelper(Runtime.getRuntime().exec(cmdarray), null);
	}

	/**
	 * Executes the specified command and arguments in a separate process, and waits for the
	 * process to finish.
	 *

	 * Output from the process is expected to be text in the system's default character set.
	 *

	 * No input is passed to the process on STDIN.
	 *
	 * @param cmdarray array containing the command to call and its arguments.
	 * @param envp array of strings, each element of which has environment variable settings in format name=value.
	 * @return The results of the execution in an ExecHelper object.
	 * @throws SecurityException if a security manager exists and its checkExec method doesn't allow creation of a subprocess.
	 * @throws IOException - if an I/O error occurs
	 * @throws NullPointerException - if cmdarray is null
	 * @throws IndexOutOfBoundsException - if cmdarray is an empty array (has length 0).
	 *
	 * @since ostermillerutils 1.06.00
	 */
	public static ExecHelper exec(String[] cmdarray, String[] envp) throws IOException {
		return new ExecHelper(Runtime.getRuntime().exec(cmdarray, envp), null);
	}

	/**
	 * Executes the specified command and arguments in a separate process, and waits for the
	 * process to finish.
	 *

	 * Output from the process is expected to be text in the system's default character set.
	 *

	 * No input is passed to the process on STDIN.
	 *
	 * @param cmdarray array containing the command to call and its arguments.
	 * @param envp array of strings, each element of which has environment variable settings in format name=value.
	 * @param dir the working directory of the subprocess, or null if the subprocess should inherit the working directory of the current process.
	 * @return The results of the execution in an ExecHelper object.
	 * @throws SecurityException if a security manager exists and its checkExec method doesn't allow creation of a subprocess.
	 * @throws IOException - if an I/O error occurs
	 * @throws NullPointerException - if cmdarray is null
	 * @throws IndexOutOfBoundsException - if cmdarray is an empty array (has length 0).
	 *
	 * @since ostermillerutils 1.06.00
	 */
	public static ExecHelper exec(String[] cmdarray, String[] envp, File dir) throws IOException {
		return new ExecHelper(Runtime.getRuntime().exec(cmdarray, envp), null);
	}

	/**
	 * Executes the specified command and arguments in a separate process, and waits for the
	 * process to finish.
	 *

	 * No input is passed to the process on STDIN.
	 *
	 * @param cmdarray array containing the command to call and its arguments.
	 * @param charset Output from the executed command is expected to be in this character set.
	 * @return The results of the execution in an ExecHelper object.
	 * @throws SecurityException if a security manager exists and its checkExec method doesn't allow creation of a subprocess.
	 * @throws IOException - if an I/O error occurs
	 * @throws NullPointerException - if cmdarray is null
	 * @throws IndexOutOfBoundsException - if cmdarray is an empty array (has length 0).
	 *
	 * @since ostermillerutils 1.06.00
	 */
	public static ExecHelper exec(String[] cmdarray, String charset) throws IOException {
		return new ExecHelper(Runtime.getRuntime().exec(cmdarray), charset);
	}

	/**
	 * Executes the specified command and arguments in a separate process, and waits for the
	 * process to finish.
	 *

	 * No input is passed to the process on STDIN.
	 *
	 * @param cmdarray array containing the command to call and its arguments.
	 * @param envp array of strings, each element of which has environment variable settings in format name=value.
	 * @param charset Output from the executed command is expected to be in this character set.
	 * @return The results of the execution in an ExecHelper object.
	 * @throws SecurityException if a security manager exists and its checkExec method doesn't allow creation of a subprocess.
	 * @throws IOException - if an I/O error occurs
	 * @throws NullPointerException - if cmdarray is null
	 * @throws IndexOutOfBoundsException - if cmdarray is an empty array (has length 0).
	 *
	 * @since ostermillerutils 1.06.00
	 */
	public static ExecHelper exec(String[] cmdarray, String[] envp, String charset) throws IOException {
		return new ExecHelper(Runtime.getRuntime().exec(cmdarray, envp), charset);
	}

	/**
	 * Executes the specified command and arguments in a separate process, and waits for the
	 * process to finish.
	 *

	 * No input is passed to the process on STDIN.
	 *
	 * @param cmdarray array containing the command to call and its arguments.
	 * @param envp array of strings, each element of which has environment variable settings in format name=value.
	 * @param dir the working directory of the subprocess, or null if the subprocess should inherit the working directory of the current process.
	 * @param charset Output from the executed command is expected to be in this character set.
	 * @return The results of the execution in an ExecHelper object.
	 * @throws SecurityException if a security manager exists and its checkExec method doesn't allow creation of a subprocess.
	 * @throws IOException - if an I/O error occurs
	 * @throws NullPointerException - if cmdarray is null
	 * @throws IndexOutOfBoundsException - if cmdarray is an empty array (has length 0).
	 *
	 * @since ostermillerutils 1.06.00
	 */
	public static ExecHelper exec(String[] cmdarray, String[] envp, File dir, String charset) throws IOException {
		return new ExecHelper(Runtime.getRuntime().exec(cmdarray, envp), charset);
	}

	/**
	 * Executes the specified command using a shell.  On windows uses cmd.exe or command.exe.
	 * On other platforms it uses /bin/sh.
	 *

	 * A shell should be used to execute commands when features such as file redirection, pipes,
	 * argument parsing are desired.
	 *

	 * Output from the process is expected to be text in the system's default character set.
	 *

	 * No input is passed to the process on STDIN.
	 *
	 * @param command String containing a command to be parsed by the shell and executed.
	 * @return The results of the execution in an ExecHelper object.
	 * @throws SecurityException if a security manager exists and its checkExec method doesn't allow creation of a subprocess.
	 * @throws IOException - if an I/O error occurs
	 * @throws NullPointerException - if command is null
	 *
	 * @since ostermillerutils 1.06.00
	 */
	public static ExecHelper execUsingShell(String command) throws IOException {
		return execUsingShell(command, null);
	}

	/**
	 * Executes the specified command using a shell.  On windows uses cmd.exe or command.exe.
	 * On other platforms it uses /bin/sh.
	 *

	 * A shell should be used to execute commands when features such as file redirection, pipes,
	 * argument parsing are desired.
	 *

	 * No input is passed to the process on STDIN.
	 *
	 * @param command String containing a command to be parsed by the shell and executed.
	 * @param charset Output from the executed command is expected to be in this character set.
	 * @return The results of the execution in an ExecHelper object.
	 * @throws SecurityException if a security manager exists and its checkExec method doesn't allow creation of a subprocess.
	 * @throws IOException - if an I/O error occurs
	 * @throws NullPointerException - if command is null
	 *
	 * @since ostermillerutils 1.06.00
	 */
	public static ExecHelper execUsingShell(String command, String charset) throws IOException {
		if (command == null) throw new NullPointerException();
		String[] cmdarray;
		String os = System.getProperty("os.name");
		if (os.equals("Windows 95") || os.equals("Windows 98") || os.equals("Windows ME")){
			cmdarray = new String[]{"command.exe", "/C", command};
		} else if (os.startsWith("Windows")){
			cmdarray = new String[]{"cmd.exe", "/C", command};
		} else {
			cmdarray = new String[]{"/bin/sh", "-c", command};
		}
		return new ExecHelper(Runtime.getRuntime().exec(cmdarray), charset);
	}

	/**
	 * Take a process, record its standard error and standard out streams, wait for it to finish
	 *
	 * @param process process to watch
	 * @throws SecurityException if a security manager exists and its checkExec method doesn't allow creation of a subprocess.
	 * @throws IOException - if an I/O error occurs
	 * @throws NullPointerException - if cmdarray is null
	 * @throws IndexOutOfBoundsException - if cmdarray is an empty array (has length 0).
	 *
	 * @since ostermillerutils 1.06.00
	 */
	private ExecHelper(Process process, String charset) throws IOException {
		StringBuffer output = new StringBuffer();
		StringBuffer error = new StringBuffer();

		Reader stdout;
		Reader stderr;

		if (charset == null){
			// This is one time that the system charset is appropriate,
			// don't specify a character set.
			stdout = new InputStreamReader(process.getInputStream());
			stderr = new InputStreamReader(process.getErrorStream());
		} else {
			stdout = new InputStreamReader(process.getInputStream(), charset);
			stderr = new InputStreamReader(process.getErrorStream(), charset);
		}
		char[] buffer = new char[1024];

		boolean done = false;
		boolean stdoutclosed = false;
		boolean stderrclosed = false;
		while (!done){
			boolean readSomething = false;
			// read from the process's standard output
			if (!stdoutclosed && stdout.ready()){
				readSomething = true;
				int read = stdout.read(buffer, 0, buffer.length);
				if (read < 0){
					readSomething = true;
					stdoutclosed = true;
				} else if (read > 0){
					readSomething = true;
					output.append(buffer, 0, read);
				}
			}
			// read from the process's standard error
			if (!stderrclosed && stderr.ready()){
				int read = stderr.read(buffer, 0, buffer.length);
				if (read < 0){
					readSomething = true;
					stderrclosed = true;
				} else if (read > 0){
					readSomething = true;
					error.append(buffer, 0, read);
				}
			}
			// Check the exit status only we haven't read anything,
			// if something has been read, the process is obviously not dead yet.
			if (!readSomething){
				try {
					this.status = process.exitValue();
					done = true;
				} catch (IllegalThreadStateException itx){
					// Exit status not ready yet.
					// Give the process a little breathing room.
					try {
						Thread.sleep(100);
					} catch (InterruptedException ix){
						process.destroy();
						throw new IOException("Interrupted - processes killed");
					}
				}
			}
		}

		this.output = output.toString();
		this.error = error.toString();
	}

	/**
	 * The output of the job that ran.
	 *
	 * @since ostermillerutils 1.06.00
	 */
	private String output;

	/**
	 * Get the output of the job that ran.
	 *
	 * @return Everything the executed process wrote to its standard output as a String.
	 *
	 * @since ostermillerutils 1.06.00
	 */
	public String getOutput(){
		return output;
	}

	/**
	 * The error output of the job that ran.
	 *
	 * @since ostermillerutils 1.06.00
	 */
	private String error;

	/**
	 * Get the error output of the job that ran.
	 *
	 * @return Everything the executed process wrote to its standard error as a String.
	 *
	 * @since ostermillerutils 1.06.00
	 */
	public String getError(){
		return error;
	}

	/**
	 * The status of the job that ran.
	 *
	 * @since ostermillerutils 1.06.00
	 */
	private int status;

	/**
	 * Get the status of the job that ran.
	 *
	 * @return exit status of the executed process, by convention, the value 0 indicates normal termination.
	 *
	 * @since ostermillerutils 1.06.00
	 */
	public int getStatus(){
		return status;
	}
}


text:
namespace Cayley.Net.ApiModels
{
    public class CayleyResponse
    {
        public string Content { get; set; }
    }
}

redpajama_set_name: RedPajamaGithub


text:
package com.amazonaws.services.servicediscovery.model.transform;

import javax.annotation.Generated;

import com.amazonaws.SdkClientException;
import com.amazonaws.services.servicediscovery.model.*;

import com.amazonaws.protocol.*;
import com.amazonaws.annotation.SdkInternalApi;

/**
 * NamespaceSummaryMarshaller
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
@SdkInternalApi
public class NamespaceSummaryMarshaller {

    private static final MarshallingInfo<String> ID_BINDING = MarshallingInfo.builder(MarshallingType.STRING).marshallLocation(MarshallLocation.PAYLOAD)
            .marshallLocationName("Id").build();
    private static final MarshallingInfo<String> ARN_BINDING = MarshallingInfo.builder(MarshallingType.STRING).marshallLocation(MarshallLocation.PAYLOAD)
            .marshallLocationName("Arn").build();
    private static final MarshallingInfo<String> NAME_BINDING = MarshallingInfo.builder(MarshallingType.STRING).marshallLocation(MarshallLocation.PAYLOAD)
            .marshallLocationName("Name").build();
    private static final MarshallingInfo<String> TYPE_BINDING = MarshallingInfo.builder(MarshallingType.STRING).marshallLocation(MarshallLocation.PAYLOAD)
            .marshallLocationName("Type").build();
    private static final MarshallingInfo<String> DESCRIPTION_BINDING = MarshallingInfo.builder(MarshallingType.STRING)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("Description").build();
    private static final MarshallingInfo<Integer> SERVICECOUNT_BINDING = MarshallingInfo.builder(MarshallingType.INTEGER)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("ServiceCount").build();
    private static final MarshallingInfo<StructuredPojo> PROPERTIES_BINDING = MarshallingInfo.builder(MarshallingType.STRUCTURED)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("Properties").build();
    private static final MarshallingInfo<java.util.Date> CREATEDATE_BINDING = MarshallingInfo.builder(MarshallingType.DATE)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("CreateDate").timestampFormat("unixTimestamp").build();

    private static final NamespaceSummaryMarshaller instance = new NamespaceSummaryMarshaller();

    public static NamespaceSummaryMarshaller getInstance() {
        return instance;
    }

    /**
     * Marshall the given parameter object.
     */
    public void marshall(NamespaceSummary namespaceSummary, ProtocolMarshaller protocolMarshaller) {

        if (namespaceSummary == null) {
            throw new SdkClientException("Invalid argument passed to marshall(...)");
        }

        try {
            protocolMarshaller.marshall(namespaceSummary.getId(), ID_BINDING);
            protocolMarshaller.marshall(namespaceSummary.getArn(), ARN_BINDING);
            protocolMarshaller.marshall(namespaceSummary.getName(), NAME_BINDING);
            protocolMarshaller.marshall(namespaceSummary.getType(), TYPE_BINDING);
            protocolMarshaller.marshall(namespaceSummary.getDescription(), DESCRIPTION_BINDING);
            protocolMarshaller.marshall(namespaceSummary.getServiceCount(), SERVICECOUNT_BINDING);
            protocolMarshaller.marshall(namespaceSummary.getProperties(), PROPERTIES_BINDING);
            protocolMarshaller.marshall(namespaceSummary.getCreateDate(), CREATEDATE_BINDING);
        } catch (Exception e) {
            throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
        }
    }

}


text:
package com.tns;

import com.tns.system.classes.loading.ClassStorageService;

import java.io.IOException;

class ClassResolver {
    private final ClassStorageService classStorageService;

    ClassResolver(ClassStorageService classStorageService) {
        this.classStorageService = classStorageService;
    }

    Class<?> resolveClass(String baseClassName, String fullClassName, DexFactory dexFactory, String[] methodOverrides, String[] implementedInterfaces, boolean isInterface) throws ClassNotFoundException, IOException {
        String canonicalClassName = fullClassName.replace('/', '.');
        String canonicalBaseClassName = baseClassName.replace('/', '.');
        String name = "";
        String className = canonicalClassName;

        Class<?> clazz = null;
        boolean isBindingClass = canonicalClassName.startsWith("com.tns.gen") && !canonicalClassName.startsWith("com.tns.tests.");

        // if binding generate proxy or load pregenerated
        if (isBindingClass) {
            clazz = dexFactory.resolveClass(canonicalBaseClassName, name, className, methodOverrides, implementedInterfaces, isInterface);
        }

        if (clazz == null) {
            clazz = classStorageService.retrieveClass(className);
        }

        return clazz;
    }
}


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

<TITLE>
V-Index
</TITLE>

<META NAME="date" CONTENT="2013-04-12">

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

      Overview
      Package
      Class
      Use
      Tree
      Deprecated
    Index
      Help

 PREV LETTER
 NEXT LETTER

  FRAMES
 NO FRAMES

  All Classes

A B C D E F G H I L M N O P R S T U V W

V

valueOf(String) -
Static method in enum com.oregonscientific.meep.msm.MessageService.Environment

Returns the enum constant of this type with the specified name.

values() -
Static method in enum com.oregonscientific.meep.msm.MessageService.Environment

Returns an array containing the constants of this enum type, in
the order they are declared.

verifyServerHandshakeHeaders(HashMap<String, String>) -
Method in class de.roderick.weberknecht.WebSocketHandshake

verifyServerResponse(byte[]) -
Method in class de.roderick.weberknecht.WebSocketHandshake

verifyServerStatusLine(String) -
Method in class de.roderick.weberknecht.WebSocketHandshake

      Overview
      Package
      Class
      Use
      Tree
      Deprecated
    Index
      Help

 PREV LETTER
 NEXT LETTER

  FRAMES
 NO FRAMES

  All Classes

A B C D E F G H I L M N O P R S T U V W


text:
package org.quattor.pan.dml.operators;

import static org.quattor.pan.utils.MessageUtils.MSG_INVALID_LOOP_TEST;
import static org.quattor.pan.utils.MessageUtils.MSG_LOOP_ITERATION_LIMIT;

import org.quattor.pan.dml.AbstractOperation;
import org.quattor.pan.dml.Operation;
import org.quattor.pan.dml.data.BooleanProperty;
import org.quattor.pan.dml.data.Element;
import org.quattor.pan.exceptions.EvaluationException;
import org.quattor.pan.ttemplate.Context;
import org.quattor.pan.ttemplate.SourceRange;
import org.quattor.pan.utils.MessageUtils;

/**
 * Implements a for loop that allows iteration over all elements in a resource
 * without having to explicitly create an iterator. Structural changes to the
 * resource during the iteration are not permitted.
 *
 * @author loomis
 *
 */
final public class For extends AbstractOperation {

	public For(SourceRange sourceRange, Operation... ops) {
		super(sourceRange, ops);
		assert (ops.length == 4);
	}

	@Override
	public Element execute(Context context) {

		Operation initialization = ops[0];
		Operation condition = ops[1];
		Operation increment = ops[2];
		Operation body = ops[3];

		// The initial result is set to the initialization value. If the check
		// fails immediately and no iterations are done, then this is the value
		// of the loop.
		Element result = initialization.execute(context);

		// Get the result of the condition.
		boolean test = false;
		try {
			test = ((BooleanProperty) condition.execute(context)).getValue()
					.booleanValue();
		} catch (ClassCastException cce) {
			throw new EvaluationException(MessageUtils
					.format(MSG_INVALID_LOOP_TEST), sourceRange, context);
		}

		// Retrieve the iteration limit from the context.
		int limit = context.getIterationLimit();

		// Now actually do the loop.
		int count = 0;
		while (test) {

			// Increment the counter and ensure that the iteration limit hasn't
			// been exceeded.
			count++;
			if (count > limit) {
				throw new EvaluationException(MessageUtils.format(
						MSG_LOOP_ITERATION_LIMIT, Long.valueOf(limit)),
						sourceRange, context);
			}

			// Execute the body of the loop.
			result = body.execute(context);

			// Execute the iteration DML block.
			increment.execute(context);

			// Re-evaluate the loop condition.
			try {
				test = ((BooleanProperty) condition.execute(context))
						.getValue().booleanValue();
			} catch (ClassCastException cce) {
				throw new EvaluationException(MessageUtils
						.format(MSG_INVALID_LOOP_TEST), sourceRange, context);
			}

		}

		return result;
	}
}


text:
/*
Problem 4. Appearance count• Write a method that counts how many times given number appears in given array.
• Write a test program to check if the method is workings correctly.
*/

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

class AppearanceCount
{
    static void Main()
    {
        int[] arr = { 1, 2, 3, 56, 87, 3, 99, 56, 3, 78, 3, 5, 9, 3 };
        int number = 3;
        Console.WriteLine(CountNumberInArray(arr, number));
    }

    static int CountNumberInArray(int[] numbers, int number)
    {
        int count = 0;
        for (int i = 0; i < numbers.Length; i++)
        {
            if (number == numbers[i])
            {
                count++;
            }
        }
        return count;
    }

}


text:
package com.nulabinc.backlog.r2b.mapping.collector.core

import com.nulabinc.backlog.r2b.redmine.domain.RedmineProjectId
import com.nulabinc.backlog.r2b.redmine.service.{IssueService, UserService, WikiService}

case class MappingContext(
    projectId: RedmineProjectId,
    issueService: IssueService,
    wikiService: WikiService,
    userService: UserService
)


text:
Your courses

{{course.Name}} - {{course.NameEN}}

Your evaluations

{{eval.CourseName}} - {{eval.CourseNameEN}}

{{eval.Semester}}


text:
<!doctype html>

	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no" />
	<meta content="yes"name="apple-mobile-web-app-capable"/>
 	<meta content="black"name="apple-mobile-web-app-status-bar-style"/>
	<meta name="format-detection"content="telphone=no"/>
	<link rel="stylesheet" href="css/global.css">
	<title>form</title>

form

form表单填写

            <form class="form">

                    用户名

                        <input type="text" class="f-text">

                    电话

                        <input type="text" class="f-text">

                    <icon class="icon-v-right"></icon>

                    证件

                        <input type="text" class="f-text">

                    身份证
                    <icon class="icon-v-right"></icon>

                    到店时间

22:00之前

                    <icon class="icon-v-right"></icon>

                    到店时间

24小时制

                    <icon class="icon-v-right"></icon>

            </form>

placeholder作为label

            <form action="" class="form form--no-label">

                    <input type="text" class="f-text" placeholder="placeholder作为label">

                    <input type="text" class="f-text" placeholder="hello the world">

                    <textarea class="f-textarea" placeholder="请输入备注"></textarea>

            </form>


text:
#include "DeskWindow.h"

#include <vector>

#include <gl\gl.h>
#include <gl\glu.h>
//#include <gl\glaux.h>		// Header File For The Glaux Library

const char* const DeskWindow::c_pWindowClassName = "LivingDeskWindow";

const char* const c_pVertexShaderBase =
"void main() {\n"
"	gl_Position = gl_ProjectionMatrix * gl_ModelViewMatrix * gl_Vertex;\n"
"	gl_TexCoord[0] = gl_MultiTexCoord0;\n"
"}\n"
;

const char* const c_pFragmentShaderBase0 =
"uniform vec3 iResolution;"
"uniform float iGlobalTime;"
"uniform float iTimeDelta;"
"uniform float iGlobalFrame;"
"uniform float iChannelTime[4];"
"uniform vec4 iMouse;"
"uniform vec4 iDate;"
"uniform float iSampleRate;"
"uniform vec3 iChannelResolution[4];"
"uniform sampler2D iChannel0;"
;

const char* const c_pFragmentShaderBase1 =
"void main() {\n"
"	mainImage( gl_FragColor, gl_TexCoord[0].xy * iResolution.xy );"
"}"
;

LRESULT CALLBACK DeskWindow::WinProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
	switch (uMsg)
	{

	}
	return DefWindowProc(hWnd, uMsg, wParam, lParam);
}

void DeskWindow::RegisterWindowClass()
{
	WNDCLASSEX ex;

	ex.cbSize = sizeof(WNDCLASSEX);
	ex.style = CS_HREDRAW | CS_VREDRAW | CS_OWNDC;
	ex.lpfnWndProc = WinProc;
	ex.cbClsExtra = 0;
	ex.cbWndExtra = 0;
	ex.hInstance = GetModuleHandle(NULL);
	ex.hIcon = LoadIcon(NULL, IDI_APPLICATION);
	//ex.hCursor = LoadCursor(NULL, IDC_ARROW);
	ex.hCursor = NULL;
	ex.hbrBackground = NULL;
	ex.lpszMenuName = NULL;
	ex.lpszClassName = c_pWindowClassName;
	ex.hIconSm = NULL;

	RegisterClassEx(&ex);
}

void DeskWindow::UnregisterWindowClass()
{
	UnregisterClass( c_pWindowClassName, GetModuleHandle(NULL) );
}

DeskWindow::DeskWindow(HMONITOR oLinkToMonitor, int iX, int iY, int iWidth, int iHeight, HWND oParent)
{
	m_pHWND = CreateWindow( c_pWindowClassName, "DeskWindow", 0, iX, iY, iWidth, iHeight, NULL, NULL, NULL, NULL );

	SetWindowLong(m_pHWND, GWL_STYLE, WS_VISIBLE );
	SetWindowLong(m_pHWND, GWL_EXSTYLE, WS_EX_TRANSPARENT );
	SetParent( m_pHWND, oParent );
	ShowWindow( m_pHWND, SW_SHOW );

	static	PIXELFORMATDESCRIPTOR pfd =				// pfd Tells Windows How We Want Things To Be
	{
		sizeof(PIXELFORMATDESCRIPTOR),				// Size Of This Pixel Format Descriptor
		1,											// Version Number
		PFD_DRAW_TO_WINDOW |						// Format Must Support Window
		PFD_SUPPORT_OPENGL |						// Format Must Support OpenGL
		PFD_DOUBLEBUFFER,							// Must Support Double Buffering
		PFD_TYPE_RGBA,								// Request An RGBA Format
		32,											// Select Our Color Depth
		0, 0, 0, 0, 0, 0,							// Color Bits Ignored
		0,											// No Alpha Buffer
		0,											// Shift Bit Ignored
		0,											// No Accumulation Buffer
		0, 0, 0, 0,									// Accumulation Bits Ignored
		16,											// 16Bit Z-Buffer (Depth Buffer)
		0,											// No Stencil Buffer
		0,											// No Auxiliary Buffer
		PFD_MAIN_PLANE,								// Main Drawing Layer
		0,											// Reserved
		0, 0, 0										// Layer Masks Ignored
	};

	if (!(m_pDC = GetDC(m_pHWND)))							// Did We Get A Device Context?
	{
		MessageBox(NULL, "Can't Create A GL Device Context.", "ERROR", MB_OK | MB_ICONEXCLAMATION);
		return;								// Return FALSE
	}

	GLuint iPixelFormat;
	if (!(iPixelFormat = ChoosePixelFormat(m_pDC, &pfd)))	// Did Windows Find A Matching Pixel Format?
	{
		MessageBox(NULL, "Can't Find A Suitable PixelFormat.", "ERROR", MB_OK | MB_ICONEXCLAMATION);
		return;								// Return FALSE
	}

	if (!SetPixelFormat(m_pDC, iPixelFormat, &pfd))		// Are We Able To Set The Pixel Format?
	{
		MessageBox(NULL, "Can't Set The PixelFormat.", "ERROR", MB_OK | MB_ICONEXCLAMATION);
		return;								// Return FALSE
	}

	if (!(m_pGLRC = wglCreateContext(m_pDC)))				// Are We Able To Get A Rendering Context?
	{
		MessageBox(NULL, "Can't Create A GL Rendering Context.", "ERROR", MB_OK | MB_ICONEXCLAMATION);
		return;								// Return FALSE
	}

	if (!wglMakeCurrent(m_pDC, m_pGLRC))					// Try To Activate The Rendering Context
	{
		MessageBox(NULL, "Can't Activate The GL Rendering Context.", "ERROR", MB_OK | MB_ICONEXCLAMATION);
		return;								// Return FALSE
	}

	GLenum err = glewInit();
	if (GLEW_OK != err)
	{
		/* Problem: glewInit failed, something is seriously wrong. */
		fprintf(stderr, "Error: %s\n", glewGetErrorString(err));
	}
	fprintf(stdout, "Status: Using GLEW %s\n", glewGetString(GLEW_VERSION));

	glShadeModel(GL_SMOOTH);							// Enable Smooth Shading
	glClearColor(0.0f, 0.0f, 0.0f, 0.f);				// Black Background
	glClearDepth(1.0f);									// Depth Buffer Setup
	glEnable(GL_DEPTH_TEST);							// Enables Depth Testing
	glDepthFunc(GL_LEQUAL);								// The Type Of Depth Testing To Do
	glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);	// Really Nice Perspective Calculations

	Resize(iWidth, iHeight);

	std::string sFragmentShader;
	sFragmentShader += c_pFragmentShaderBase0;
	FILE* pFile = fopen("fragment.shader", "r");
	if (pFile != NULL)
	{
		fseek(pFile, 0, SEEK_END);
		size_t iSize = ftell(pFile);
		fseek(pFile, 0, SEEK_SET);
		std::vector<char> sFileContent(iSize + 1);
		fread(&sFileContent[0], iSize, 1, pFile);
		sFileContent[sFileContent.size() - 1] = 0;
		sFragmentShader += &sFileContent[0];
	}
	sFragmentShader += c_pFragmentShaderBase1;

	m_pVertexShader = new GLShader(GLShader::E_TYPE_VERTEX, c_pVertexShaderBase);
	m_pVertexShader->Compile();
	m_pFragmentShader = new GLShader(GLShader::E_TYPE_FRAGMENT, sFragmentShader.c_str());
	m_pFragmentShader->Compile();
	m_pShaderProgram = new GLShaderProgram(m_pVertexShader, m_pFragmentShader);
	m_pShaderProgram->Compile();

	m_iLastTickCount = GetTickCount64();
	m_fTime = 0.f;
}

DeskWindow::~DeskWindow()
{
	DestroyWindow(m_pHWND);
}

void DeskWindow::Refresh()
{
	MSG oMsg;
	if (PeekMessage(&oMsg, m_pHWND, 0, 0, PM_REMOVE))	// Is There A Message Waiting?
	{
		TranslateMessage(&oMsg);
		DispatchMessage(&oMsg);
	}
	else
	{
		if (wglMakeCurrent(m_pDC, m_pGLRC))
		{
			Draw();
			SwapBuffers();
		}
	}
}

void DeskWindow::Resize(int iWidth, int iHeight)
{
	glViewport(0, 0, iWidth, iHeight);						// Reset The Current Viewport

	glMatrixMode(GL_PROJECTION);						// Select The Projection Matrix
	glLoadIdentity();									// Reset The Projection Matrix

														// Calculate The Aspect Ratio Of The Window
	//gluPerspective(45.0f, (GLfloat)iWidth / (GLfloat)iHeight, 0.1f, 100.0f);

	gluOrtho2D( 0.f, 1.f, 0.f, 1.f );

	glMatrixMode(GL_MODELVIEW);							// Select The Modelview Matrix
	glLoadIdentity();									// Reset The Modelview Matrix

	m_iWidth = iWidth;
	m_iHeight = iHeight;
}

void DeskWindow::Draw()
{
	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);	// Clear Screen And Depth Buffer

	glLoadIdentity();									// Reset The Current Modelview Matrix

	m_pShaderProgram->Use();
	/*
	uniform vec3 iResolution;
	uniform float iGlobalTime;
	uniform float iGlobalDelta;
	uniform float iGlobalFrame;
	uniform float iChannelTime[4];
	uniform vec4 iMouse;
	uniform vec4 iDate;
	uniform float iSampleRate;
	uniform vec3 iChannelResolution[4];
	uniform samplerXX iChanneli;
	*/

	ULONGLONG iTick = GetTickCount64();

	float fDelta = (iTick - m_iLastTickCount) / 1000.f;
	m_iLastTickCount = iTick;

	m_pShaderProgram->SetVec3("iResolution", m_iWidth, m_iHeight, 1.f);
	m_pShaderProgram->SetFloat("iGlobalTime", m_fTime);
	m_pShaderProgram->SetFloat("iTimelDelta", fDelta);

	m_fTime += fDelta;

	/*char sLog[256];
	sprintf(sLog,"Delta %f => %f\n", fDelta, fTime);
	OutputDebugString(sLog);*/

	glBegin(GL_QUADS);
		glColor3f(1.0f, 1.0f, 1.0f);
		glTexCoord2f(0.0f, 0.0f);
		glVertex2f(0.0f, 0.0f);
		glTexCoord2f(0.0f, 1.0f);
		glVertex2f(0.0f, 1.0f);
		glTexCoord2f(1.0f, 1.0f);
		glVertex2f(1.0f, 1.0f);
		glTexCoord2f(1.0f, 0.0f);
		glVertex2f(1.0f, 0.0f);
	glEnd();
}

void DeskWindow::SwapBuffers()
{
	::SwapBuffers(m_pDC);
}


text:
namespace content {

class RenderViewImpl;

class CONTENT_EXPORT RenderFrameImpl
    : public RenderFrame,
      NON_EXPORTED_BASE(public blink::WebFrameClient) {
 public:
  // Creates a new RenderFrame. |render_view| is the RenderView object that this
  // frame belongs to.
  static RenderFrameImpl* Create(RenderViewImpl* render_view, int32 routing_id);

  // Used by content_layouttest_support to hook into the creation of
  // RenderFrameImpls.
  static void InstallCreateHook(
      RenderFrameImpl* (*create_render_frame_impl)(RenderViewImpl*, int32));

  virtual ~RenderFrameImpl();

  // IPC::Sender
  virtual bool Send(IPC::Message* msg) OVERRIDE;

  // IPC::Listener
  virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE;

  // blink::WebFrameClient implementation -------------------------------------
  virtual blink::WebPlugin* createPlugin(
      blink::WebFrame* frame,
      const blink::WebPluginParams& params);
  virtual blink::WebMediaPlayer* createMediaPlayer(
      blink::WebFrame* frame,
      const blink::WebURL& url,
      blink::WebMediaPlayerClient* client);
  virtual blink::WebApplicationCacheHost* createApplicationCacheHost(
      blink::WebFrame* frame,
      blink::WebApplicationCacheHostClient* client);
  virtual blink::WebWorkerPermissionClientProxy*
      createWorkerPermissionClientProxy(blink::WebFrame* frame);
  virtual blink::WebCookieJar* cookieJar(blink::WebFrame* frame);
  virtual blink::WebServiceWorkerProvider* createServiceWorkerProvider(
      blink::WebFrame* frame,
      blink::WebServiceWorkerProviderClient*);
  virtual void didAccessInitialDocument(blink::WebFrame* frame);
  virtual blink::WebFrame* createChildFrame(blink::WebFrame* parent,
                                             const blink::WebString& name);
  virtual void didDisownOpener(blink::WebFrame* frame);
  virtual void frameDetached(blink::WebFrame* frame);
  virtual void willClose(blink::WebFrame* frame);
  virtual void didChangeName(blink::WebFrame* frame,
                             const blink::WebString& name);
  virtual void didMatchCSS(
      blink::WebFrame* frame,
      const blink::WebVector<blink::WebString>& newly_matching_selectors,
      const blink::WebVector<blink::WebString>& stopped_matching_selectors);
  virtual void loadURLExternally(blink::WebFrame* frame,
                                 const blink::WebURLRequest& request,
                                 blink::WebNavigationPolicy policy);
  virtual void loadURLExternally(
      blink::WebFrame* frame,
      const blink::WebURLRequest& request,
      blink::WebNavigationPolicy policy,
      const blink::WebString& suggested_name);
  virtual blink::WebNavigationPolicy decidePolicyForNavigation(
      blink::WebFrame* frame,
      blink::WebDataSource::ExtraData* extra_data,
      const blink::WebURLRequest& request,
      blink::WebNavigationType type,
      blink::WebNavigationPolicy default_policy,
      bool is_redirect);
  // DEPRECATED
  virtual blink::WebNavigationPolicy decidePolicyForNavigation(
      blink::WebFrame* frame,
      const blink::WebURLRequest& request,
      blink::WebNavigationType type,
      blink::WebNavigationPolicy default_policy,
      bool is_redirect);
  virtual void willSendSubmitEvent(blink::WebFrame* frame,
                                   const blink::WebFormElement& form);
  virtual void willSubmitForm(blink::WebFrame* frame,
                              const blink::WebFormElement& form);
  virtual void didCreateDataSource(blink::WebFrame* frame,
                                   blink::WebDataSource* datasource);
  virtual void didStartProvisionalLoad(blink::WebFrame* frame);
  virtual void didReceiveServerRedirectForProvisionalLoad(
      blink::WebFrame* frame);
  virtual void didFailProvisionalLoad(
      blink::WebFrame* frame,
      const blink::WebURLError& error);
  virtual void didCommitProvisionalLoad(blink::WebFrame* frame,
                                        bool is_new_navigation);
  virtual void didClearWindowObject(blink::WebFrame* frame);
  virtual void didCreateDocumentElement(blink::WebFrame* frame);
  virtual void didReceiveTitle(blink::WebFrame* frame,
                               const blink::WebString& title,
                               blink::WebTextDirection direction);
  virtual void didChangeIcon(blink::WebFrame* frame,
                             blink::WebIconURL::Type icon_type);
  virtual void didFinishDocumentLoad(blink::WebFrame* frame);
  virtual void didHandleOnloadEvents(blink::WebFrame* frame);
  virtual void didFailLoad(blink::WebFrame* frame,
                           const blink::WebURLError& error);
  virtual void didFinishLoad(blink::WebFrame* frame);
  virtual void didNavigateWithinPage(blink::WebFrame* frame,
                                     bool is_new_navigation);
  virtual void didUpdateCurrentHistoryItem(blink::WebFrame* frame);
  virtual void willRequestAfterPreconnect(blink::WebFrame* frame,
                                          blink::WebURLRequest& request);
  virtual void willSendRequest(
      blink::WebFrame* frame,
      unsigned identifier,
      blink::WebURLRequest& request,
      const blink::WebURLResponse& redirect_response);
  virtual void didReceiveResponse(
      blink::WebFrame* frame,
      unsigned identifier,
      const blink::WebURLResponse& response);
  virtual void didFinishResourceLoad(blink::WebFrame* frame,
                                     unsigned identifier);
  virtual void didLoadResourceFromMemoryCache(
      blink::WebFrame* frame,
      const blink::WebURLRequest& request,
      const blink::WebURLResponse& response);
  virtual void didDisplayInsecureContent(blink::WebFrame* frame);
  virtual void didRunInsecureContent(blink::WebFrame* frame,
                                     const blink::WebSecurityOrigin& origin,
                                     const blink::WebURL& target);
  virtual void didAbortLoading(blink::WebFrame* frame);
  virtual void didExhaustMemoryAvailableForScript(
      blink::WebFrame* frame);
  virtual void didCreateScriptContext(blink::WebFrame* frame,
                                      v8::Handle<v8::Context> context,
                                      int extension_group,
                                      int world_id);
  virtual void willReleaseScriptContext(blink::WebFrame* frame,
                                        v8::Handle<v8::Context> context,
                                        int world_id);
  virtual void didFirstVisuallyNonEmptyLayout(blink::WebFrame* frame);
  virtual void didChangeContentsSize(blink::WebFrame* frame,
                                     const blink::WebSize& size);
  virtual void didChangeScrollOffset(blink::WebFrame* frame);
  virtual void willInsertBody(blink::WebFrame* frame);
  virtual void reportFindInPageMatchCount(int request_id,
                                          int count,
                                          bool final_update);
  virtual void reportFindInPageSelection(int request_id,
                                         int active_match_ordinal,
                                         const blink::WebRect& sel);
  virtual void requestStorageQuota(
      blink::WebFrame* frame,
      blink::WebStorageQuotaType type,
      unsigned long long requested_size,
      blink::WebStorageQuotaCallbacks* callbacks);
  virtual void willOpenSocketStream(
      blink::WebSocketStreamHandle* handle);
  virtual void willStartUsingPeerConnectionHandler(
      blink::WebFrame* frame,
      blink::WebRTCPeerConnectionHandler* handler);
  virtual bool willCheckAndDispatchMessageEvent(
      blink::WebFrame* sourceFrame,
      blink::WebFrame* targetFrame,
      blink::WebSecurityOrigin targetOrigin,
      blink::WebDOMMessageEvent event);
  virtual blink::WebString userAgentOverride(
      blink::WebFrame* frame,
      const blink::WebURL& url);
  virtual blink::WebString doNotTrackValue(blink::WebFrame* frame);
  virtual bool allowWebGL(blink::WebFrame* frame, bool default_value);
  virtual void didLoseWebGLContext(blink::WebFrame* frame,
                                   int arb_robustness_status_code);

 protected:
  RenderFrameImpl(RenderViewImpl* render_view, int32 routing_id);

 private:
  int GetRoutingID() const;

  RenderViewImpl* render_view_;
  int routing_id_;
  bool is_swapped_out_;
  bool is_detaching_;

  DISALLOW_COPY_AND_ASSIGN(RenderFrameImpl);
};

}  // namespace content

#endif  // CONTENT_RENDERER_RENDER_FRAME_IMPL_H_


text:
            <alert ng-repeat="notification in notifications" type="{{notification.type}}" close="notification.close($index)">

            </alert>
            <form class="form-horizontal" name="userPublishAdForm">
                <fieldset>
                    <legend>Publish New Ad</legend>

                                Title

                                    <input type="text" ng-model="newAd.title" class="form-control" id="title" placeholder="Title" required />

                                Text

                                    <textarea ng-model="newAd.text" class="form-control" id="text" placeholder="Text" required >
                                    </textarea>

                                Image

                                        Browse...
                                        <input type="file" id="image" onchange="angular.element(this).scope().fileSelected(this)" />

                                Category

                                    <select ng-model="newAd.categoryId" class="form-control" id="category">
                                        <option value="null">(None)</option>
                                        <option ng-repeat="category in categories" value="{{ category.id }}">{{ category.name }}</option>
                                    </select>

                                Town

                                    <select ng-model="newAd.townId" class="form-control" id="town">
                                        <option value="null">(None)</option>
                                        <option ng-repeat="town in towns" value="{{ town.id }}">{{ town.name }}</option>
                                    </select>

                                    <button type="submit" class="btn btn-primary" ng-click="publishAd(newAd)" ng-disabled="!userPublishAdForm.$valid">Publish</button>
                                    <button type="reset" class="btn btn-default" ng-click="cancel()">Cancel</button>

                </fieldset>
            </form>


text:
using namespace VideoStream;

ReadDcDifferential::ReadDcDifferential()
: m_channel(0)
, m_size(0)
{

}

ReadDcDifferential::~ReadDcDifferential()
{

}

void ReadDcDifferential::SetChannel(unsigned int channel)
{
	m_channel = channel;
}

void ReadDcDifferential::Reset()
{
	m_size = 0;
	m_programState = STATE_READSIZE;
}

void ReadDcDifferential::Execute(void* context, Framework::CBitStream& stream)
{
	MPEG_VIDEO_STATE* state(reinterpret_cast<MPEG_VIDEO_STATE*>(context));
	BLOCK_DECODER_STATE& decoderState(state->blockDecoderState);

	while(1)
	{
		switch(m_programState)
		{
		case STATE_READSIZE:				goto Label_ReadSize;
		case STATE_READDIFF:				goto Label_ReadDiff;
		case STATE_DONE:					goto Label_Done;
		default:							assert(0);
		}

Label_ReadSize:
		switch(m_channel)
		{
		case 0:
			m_size = static_cast<uint8>(MPEG2::CDcSizeLuminanceTable::GetInstance()->GetSymbol(&stream));
			break;
		case 1:
		case 2:
			m_size = static_cast<uint8>(MPEG2::CDcSizeChrominanceTable::GetInstance()->GetSymbol(&stream));
			break;
		}
		m_programState = STATE_READDIFF;
		continue;

Label_ReadDiff:
		if(m_size == 0)
		{
			decoderState.dcDifferential = 0;
		}
		else
		{
			int16 nHalfRange = (1 << (m_size - 1));
			int16 result = static_cast<int16>(stream.GetBits_MSBF(m_size));

			if(result < nHalfRange)
			{
				result = (result + 1) - (2 * nHalfRange);
			}

			decoderState.dcDifferential = result;
		}
		m_programState = STATE_DONE;
		continue;

Label_Done:
		return;
	}
}


text:
'use strict';
var gulp = require('gulp');
var runSequence = require('run-sequence');
var eslint = require('gulp-eslint');
var mocha = require('gulp-mocha');
var istanbul = require('gulp-istanbul');

require('gulp-help')(gulp);

gulp.task('test', 'Run the application tests', function () {
    // Modules used in tests must be loaded in this task
    require('must');
    return gulp.src(['./examples/**/test.js'])
        .pipe(mocha({
            reporter: 'spec'
        }));
});

gulp.task('test-unit', 'run all unit tests.', function() {
    return gulp.src('./test/unit/**/*.js')
    .pipe(mocha({ reporter: 'spec' }));
});

gulp.task('lint', 'Lint all js files.', function() {
    return gulp.src([
        './**/*.js',
        '!./node_modules/**/*.js',
        '!./coverage/**/*.js',
        '!./report/**/*.js'
    ])
    .pipe(eslint())
    .pipe(eslint.format())
    .pipe(eslint.failOnError());
});

gulp.task('coverage', 'Create code coverage reports.', function(callback) {
    runSequence(
        'setup-istanbul',
        'test',
        'report-istanbul',
        callback
    );
});

gulp.task('setup-istanbul', false, function(callback) {
    gulp.src(['lib/**/*.js'])
    .pipe(istanbul())
    .pipe(istanbul.hookRequire())
    .on('finish', callback);
});

gulp.task('report-istanbul', false, function() {
    return gulp.src(['lib/**/*.js'])
    .pipe(istanbul.writeReports({
        dir: './coverage',
        reporters: ['lcovonly', 'html', 'cobertura', 'text']
    }));
});


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

namespace XlsxStream
{
    public class XlsxStream:IDisposable
    {
        ZipArchive xlsxArchive;
        XlsxGenerationSettings settings;
        List<string> sheetNames = new List<string>();

        public XlsxStream(Stream outputStream)
        {
            xlsxArchive = new ZipArchive(outputStream, ZipArchiveMode.Create);
            settings = new XlsxGenerationSettings();
        }

        public XlsxStream(Stream outputStream, XlsxGenerationSettings settings)
        {
            xlsxArchive = new ZipArchive(outputStream, ZipArchiveMode.Create);
            this.settings = settings;
        }

        public void Finalise()
        {
            WriteRelsFile(@"_rels\.rels",settings.BaseRelationships);
            WriteWorkbookFile();
            WriteRelsFile(@"xl\_rels\workbook.xml.rels", sheetNames.Select(ToWorksheetRelationship).Concat( settings.XlRelationships));
            WriteContentTypesFile();
        }

        private Relationship ToWorksheetRelationship(string wsName)
        {
            return new Relationship
            {
                Target = $@"worksheets/sheet{sheetNames.IndexOf(wsName) + 1}.xml",
                Type = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet"
            };
        }

        private void WriteWorkbookFile()
        {
            var entry = xlsxArchive.CreateEntry(@"xl\workbook.xml");
            using (var ctEntryStrm = entry.Open())
            using (var xmlWriter = XmlWriter.Create(ctEntryStrm))
            {
                xmlWriter.WriteStartDocument(true);
                xmlWriter.WriteStartElement("workbook", "http://schemas.openxmlformats.org/package/2006/content-types");
                xmlWriter.WriteAttributeString("xmlns", "r", null, "http://schemas.openxmlformats.org/officeDocument/2006/relationships");
                xmlWriter.WriteStartElement("bookViews");
                xmlWriter.WriteStartElement("workbookView");
                xmlWriter.WriteEndElement();
                xmlWriter.WriteEndElement();
                xmlWriter.WriteStartElement("sheets");
                for (var sheetId = 1; sheetId <= sheetNames.Count; sheetId++)
                {
                    xmlWriter.WriteStartElement("sheet");
                    xmlWriter.WriteAttributeString("name", sheetNames[sheetId - 1]);
                    xmlWriter.WriteAttributeString("sheetId", sheetId.ToString());
                    xmlWriter.WriteAttributeString("id", "http://schemas.openxmlformats.org/officeDocument/2006/relationships", $"rId{sheetId}");
                    xmlWriter.WriteEndElement();
                }
                xmlWriter.WriteEndElement();

                xmlWriter.WriteEndElement();
            }
        }

        public Worksheet AddWorksheet(string sheetName)
        {
            return AddWorksheet(sheetName, WorksheetSettings.Default);
        }

        public Worksheet AddWorksheet(string sheetName, WorksheetSettings worksheetSettings)
        {
            sheetNames.Add(sheetName);
            var entry = xlsxArchive.CreateEntry($@"xl\worksheets\sheet{sheetNames.Count}.xml");
            var ret = new Worksheet(entry, worksheetSettings);
            ret.Initialise();
            return ret;
        }

        private void WriteRelsFile(string path, IEnumerable<Relationship> relationships)
        {
            var entry = xlsxArchive.CreateEntry(path);
            using (var ctEntryStrm = entry.Open())
            using (var xmlWriter = XmlWriter.Create(ctEntryStrm))
            {
                xmlWriter.WriteStartDocument(true);
                xmlWriter.WriteStartElement("Relationships", "http://schemas.openxmlformats.org/package/2006/relationships");
                var id = 1;
                foreach (var rel in relationships)
                {
                    var idAttr = new Dictionary<string, string>
                    {
                        { "Id", $"rId{id}" }
                    };
                    xmlWriter.WriteEmptyElementWithTheseAttributes("Relationship", rel.ToAttributeKvps().Concat(idAttr));
                    id++;
                }

                xmlWriter.WriteEndElement();
            }
        }

        private void WriteContentTypesFile()
        {
            var entry = xlsxArchive.CreateEntry("[Content_Types].xml");
            using (var ctEntryStrm = entry.Open())
            using (var xmlWriter = XmlWriter.Create(ctEntryStrm))
            {
                xmlWriter.WriteStartDocument(true);
                xmlWriter.WriteStartElement("Types", "http://schemas.openxmlformats.org/package/2006/content-types");
                foreach (var ctDefault in settings.ContentTypeDefaults)
                {
                    xmlWriter.WriteEmptyElementWithTheseAttributes("Default", ctDefault.ToAttributeKvps());
                }
                foreach (var ovrrd in settings.ContentTypeOverrides)
                {
                    xmlWriter.WriteEmptyElementWithTheseAttributes("Override", ovrrd.ToAttributeKvps());
                }
                for (var i = 1; i <= sheetNames.Count; i++)
                {
                    var sheetOvrrd = new ContentTypeOverride
                    {
                        ContentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml",
                        PartName = $@"/xl/worksheets/sheet{i}.xml"
                    };
                    xmlWriter.WriteEmptyElementWithTheseAttributes("Override", sheetOvrrd.ToAttributeKvps());
                }
                xmlWriter.WriteEndElement();
            }
        }

        public void Dispose()
        {
            xlsxArchive.Dispose();
        }
    }

    public static class Extn
    {
        public static void WriteEmptyElementWithTheseAttributes(this XmlWriter xmlWriter, string localName, IEnumerable<KeyValuePair<string,string>> attrs)
        {
            xmlWriter.WriteStartElement(localName);
            foreach (var attr in attrs)
            {
                xmlWriter.WriteAttributeString(attr.Key, attr.Value);
            }
            xmlWriter.WriteEndElement();
        }
    }
}


text:
use std::{borrow::Cow, fs, path::Path};

use itertools::Itertools;
use stdx::format_to;
use test_utils::project_root;
use xshell::{cmd, Shell};

/// This clones rustc repo, and so is not worth to keep up-to-date. We update
/// manually by un-ignoring the test from time to time.
#[test]
#[ignore]
fn sourcegen_lint_completions() {
    let sh = &Shell::new().unwrap();

    let rust_repo = project_root().join("./target/rust");
    if !rust_repo.exists() {
        cmd!(sh, "git clone --depth=1 https://github.com/rust-lang/rust {rust_repo}")
            .run()
            .unwrap();
    }

    let mut contents = String::from(
        r"
#[derive(Clone)]
pub struct Lint {
    pub label: &'static str,
    pub description: &'static str,
}
pub struct LintGroup {
    pub lint: Lint,
    pub children: &'static [&'static str],
}
",
    );

    generate_lint_descriptor(sh, &mut contents);
    contents.push('\n');

    generate_feature_descriptor(&mut contents, &rust_repo.join("src/doc/unstable-book/src"));
    contents.push('\n');

    let lints_json = project_root().join("./target/clippy_lints.json");
    cmd!(
        sh,
        "curl https://rust-lang.github.io/rust-clippy/master/lints.json --output {lints_json}"
    )
    .run()
    .unwrap();
    generate_descriptor_clippy(&mut contents, &lints_json);

    let contents = sourcegen::add_preamble("sourcegen_lints", sourcegen::reformat(contents));

    let destination = project_root().join("crates/ide_db/src/generated/lints.rs");
    sourcegen::ensure_file_contents(destination.as_path(), &contents);
}

fn generate_lint_descriptor(sh: &Shell, buf: &mut String) {
    // FIXME: rustdoc currently requires an input file for -Whelp cc https://github.com/rust-lang/rust/pull/88831
    let file = project_root().join(file!());
    let stdout = cmd!(sh, "rustdoc -W help {file}").read().unwrap();
    let start_lints = stdout.find("----  -------  -------").unwrap();
    let start_lint_groups = stdout.find("----  ---------").unwrap();
    let start_lints_rustdoc =
        stdout.find("Lint checks provided by plugins loaded by this crate:").unwrap();
    let start_lint_groups_rustdoc =
        stdout.find("Lint groups provided by plugins loaded by this crate:").unwrap();

    buf.push_str(r#"pub const DEFAULT_LINTS: &[Lint] = &["#);
    buf.push('\n');

    let lints = stdout[start_lints..].lines().skip(1).take_while(|l| !l.is_empty()).map(|line| {
        let (name, rest) = line.trim().split_once(char::is_whitespace).unwrap();
        let (_default_level, description) = rest.trim().split_once(char::is_whitespace).unwrap();
        (name.trim(), Cow::Borrowed(description.trim()), vec![])
    });
    let lint_groups =
        stdout[start_lint_groups..].lines().skip(1).take_while(|l| !l.is_empty()).map(|line| {
            let (name, lints) = line.trim().split_once(char::is_whitespace).unwrap();
            (
                name.trim(),
                format!("lint group for: {}", lints.trim()).into(),
                lints
                    .split_ascii_whitespace()
                    .map(|s| s.trim().trim_matches(',').replace('-', "_"))
                    .collect(),
            )
        });

    let lints = lints
        .chain(lint_groups)
        .sorted_by(|(ident, ..), (ident2, ..)| ident.cmp(ident2))
        .collect::<Vec<_>>();
    for (name, description, ..) in &lints {
        push_lint_completion(buf, &name.replace('-', "_"), description);
    }
    buf.push_str("];\n");
    buf.push_str(r#"pub const DEFAULT_LINT_GROUPS: &[LintGroup] = &["#);
    for (name, description, children) in &lints {
        if !children.is_empty() {
            // HACK: warnings is emitted with a general description, not with its members
            if name == &"warnings" {
                push_lint_group(buf, name, description, &Vec::new());
                continue;
            }
            push_lint_group(buf, &name.replace('-', "_"), description, children);
        }
    }
    buf.push('\n');
    buf.push_str("];\n");

    // rustdoc

    buf.push('\n');
    buf.push_str(r#"pub const RUSTDOC_LINTS: &[Lint] = &["#);
    buf.push('\n');

    let lints_rustdoc =
        stdout[start_lints_rustdoc..].lines().skip(2).take_while(|l| !l.is_empty()).map(|line| {
            let (name, rest) = line.trim().split_once(char::is_whitespace).unwrap();
            let (_default_level, description) =
                rest.trim().split_once(char::is_whitespace).unwrap();
            (name.trim(), Cow::Borrowed(description.trim()), vec![])
        });
    let lint_groups_rustdoc =
        stdout[start_lint_groups_rustdoc..].lines().skip(2).take_while(|l| !l.is_empty()).map(
            |line| {
                let (name, lints) = line.trim().split_once(char::is_whitespace).unwrap();
                (
                    name.trim(),
                    format!("lint group for: {}", lints.trim()).into(),
                    lints
                        .split_ascii_whitespace()
                        .map(|s| s.trim().trim_matches(',').replace('-', "_"))
                        .collect(),
                )
            },
        );

    let lints_rustdoc = lints_rustdoc
        .chain(lint_groups_rustdoc)
        .sorted_by(|(ident, ..), (ident2, ..)| ident.cmp(ident2))
        .collect::<Vec<_>>();

    for (name, description, ..) in &lints_rustdoc {
        push_lint_completion(buf, &name.replace('-', "_"), description)
    }
    buf.push_str("];\n");

    buf.push_str(r#"pub const RUSTDOC_LINT_GROUPS: &[LintGroup] = &["#);
    for (name, description, children) in &lints_rustdoc {
        if !children.is_empty() {
            push_lint_group(buf, &name.replace('-', "_"), description, children);
        }
    }
    buf.push('\n');
    buf.push_str("];\n");
}

fn generate_feature_descriptor(buf: &mut String, src_dir: &Path) {
    let mut features = ["language-features", "library-features"]
        .into_iter()
        .flat_map(|it| sourcegen::list_files(&src_dir.join(it)))
        .filter(|path| {
            // Get all `.md ` files
            path.extension().unwrap_or_default().to_str().unwrap_or_default() == "md"
        })
        .map(|path| {
            let feature_ident = path.file_stem().unwrap().to_str().unwrap().replace('-', "_");
            let doc = fs::read_to_string(path).unwrap();
            (feature_ident, doc)
        })
        .collect::<Vec<_>>();
    features.sort_by(|(feature_ident, _), (feature_ident2, _)| feature_ident.cmp(feature_ident2));

    buf.push_str(r#"pub const FEATURES: &[Lint] = &["#);
    for (feature_ident, doc) in features.into_iter() {
        push_lint_completion(buf, &feature_ident, &doc)
    }
    buf.push('\n');
    buf.push_str("];\n");
}

#[derive(Default)]
struct ClippyLint {
    help: String,
    id: String,
}

fn unescape(s: &str) -> String {
    s.replace(r#"\""#, "").replace(r#"\n"#, "\n").replace(r#"\r"#, "")
}

fn generate_descriptor_clippy(buf: &mut String, path: &Path) {
    let file_content = std::fs::read_to_string(path).unwrap();
    let mut clippy_lints: Vec<ClippyLint> = Vec::new();
    let mut clippy_groups: std::collections::BTreeMap<String, Vec<String>> = Default::default();

    for line in file_content.lines().map(|line| line.trim()) {
        if let Some(line) = line.strip_prefix(r#""id": ""#) {
            let clippy_lint = ClippyLint {
                id: line.strip_suffix(r#"","#).expect("should be suffixed by comma").into(),
                help: String::new(),
            };
            clippy_lints.push(clippy_lint)
        } else if let Some(line) = line.strip_prefix(r#""group": ""#) {
            if let Some(group) = line.strip_suffix("\",") {
                clippy_groups
                    .entry(group.to_owned())
                    .or_default()
                    .push(clippy_lints.last().unwrap().id.clone());
            }
        } else if let Some(line) = line.strip_prefix(r#""docs": ""#) {
            let prefix_to_strip = r#" ### What it does"#;
            let line = match line.strip_prefix(prefix_to_strip) {
                Some(line) => line,
                None => {
                    eprintln!("unexpected clippy prefix for {}", clippy_lints.last().unwrap().id);
                    continue;
                }
            };
            // Only take the description, any more than this is a lot of additional data we would embed into the exe
            // which seems unnecessary
            let up_to = line.find(r#"###"#).expect("no second section found?");
            let line = &line[..up_to];

            let clippy_lint = clippy_lints.last_mut().expect("clippy lint must already exist");
            clippy_lint.help = unescape(line).trim().to_string();
        }
    }
    clippy_lints.sort_by(|lint, lint2| lint.id.cmp(&lint2.id));

    buf.push_str(r#"pub const CLIPPY_LINTS: &[Lint] = &["#);
    buf.push('\n');
    for clippy_lint in clippy_lints.into_iter() {
        let lint_ident = format!("clippy::{}", clippy_lint.id);
        let doc = clippy_lint.help;
        push_lint_completion(buf, &lint_ident, &doc);
    }
    buf.push_str("];\n");

    buf.push_str(r#"pub const CLIPPY_LINT_GROUPS: &[LintGroup] = &["#);
    for (id, children) in clippy_groups {
        let children = children.iter().map(|id| format!("clippy::{}", id)).collect::<Vec<_>>();
        if !children.is_empty() {
            let lint_ident = format!("clippy::{}", id);
            let description = format!("lint group for: {}", children.iter().join(", "));
            push_lint_group(buf, &lint_ident, &description, &children);
        }
    }
    buf.push('\n');
    buf.push_str("];\n");
}

fn push_lint_completion(buf: &mut String, label: &str, description: &str) {
    format_to!(
        buf,
        r###"    Lint {{
        label: "{}",
        description: r##"{}"##,
    }},"###,
        label,
        description,
    );
}

fn push_lint_group(buf: &mut String, label: &str, description: &str, children: &[String]) {
    buf.push_str(
        r###"    LintGroup {
        lint:
        "###,
    );

    push_lint_completion(buf, label, description);

    let children = format!("&[{}]", children.iter().map(|it| format!("\"{}\"", it)).join(", "));
    format_to!(
        buf,
        r###"
        children: {},
        }},"###,
        children,
    );
}


text:
**children** any

Content to display over the image.

**style** style

+ `property` type

Defaults:

```js
{
}
```

## Examples

```js
import React, { ScrollView } from 'react-native-web'

const { Component, PropTypes } = React;

class Example extends Component {
  static propTypes = {
  }

  static defaultProps = {
  }

  render() {
    return (
    )
  }
}
```


text:
"use strict";
var Contribution = (function () {
    function Contribution() {
    }
    return Contribution;
}());
exports.Contribution = Contribution;
//# sourceMappingURL=contribution.js.map


text:
package com.thebluealliance.androidclient.itemviews;

import android.content.Context;
import android.view.View;
import android.widget.TextView;

import com.thebluealliance.androidclient.R;
import com.thebluealliance.androidclient.listeners.GamedayTickerClickListener;
import com.thebluealliance.androidclient.viewmodels.ScheduleUpdatedNotificationViewModel;

import butterknife.BindView;
import butterknife.ButterKnife;
import io.nlopez.smartadapters.views.BindableFrameLayout;

public class ScheduleUpdatedNotificationItemView extends BindableFrameLayout<ScheduleUpdatedNotificationViewModel> {
    @BindView(R.id.card_header) TextView header;
    @BindView(R.id.details) TextView details;
    @BindView(R.id.notification_time) TextView time;
    @BindView(R.id.summary_container) View summaryContainer;

    public ScheduleUpdatedNotificationItemView(Context context) {
        super(context);
    }

    @Override
    public int getLayoutId() {
        return R.layout.list_item_notification_schedule_updated;
    }

    @Override
    public void onViewInflated() {
        ButterKnife.bind(this);
    }

    @Override
    public void bind(ScheduleUpdatedNotificationViewModel model) {
        header.setText(model.getTitle());
        details.setText(model.getDetails());
        time.setText(model.getTimeString());
        summaryContainer.setOnClickListener(new GamedayTickerClickListener(getContext(), model.getIntent()));
    }
}


text:
<title>What's new in Barcode Scanner</title>
<link rel="stylesheet" href="../style.css" type="text/css"/>

New in version 4.0:

Added new camera features like front light support.

Updated the app to require Android 2.1.

Wrote a new history screen.

Removed some unneeded permissions.

Made some WiFi improvements.

Many, many bug fixes.

Many translation fixes.


text:
package simpleapp.util;

public class Bytes {
    // https://stackoverflow.com/questions/3758606/how-to-convert-byte-size-into-human-readable-format-in-java
    public static String humanReadableByteCount(long bytes, boolean si) {
        int unit = si ? 1000 : 1024;
        if (bytes < unit) return bytes + " B";
        int exp = (int) (Math.log(bytes) / Math.log(unit));
        String pre = (si ? "kMGTPE" : "KMGTPE").charAt(exp-1) + (si ? "" : "i");
        return String.format("%.1f %sB", bytes / Math.pow(unit, exp), pre);
    }
    public static String humanReadableByteCount(long bytes) {
        return humanReadableByteCount(bytes, false);
    }
}


text:
UPDATE KRIM_ENTITY_EMAIL_T SET EMAIL_ADDR = 'kcnotification@gmail.com'
/


text:
using UnityEngine;
using System.Collections;

public class StartScript : MonoBehaviour {

   // public GoogleAnalyticsV3 googleAnalyticsV3;

	// Use this for initialization
	//void Start () {
 //       Application.targetFrameRate = 60;
	//}

    void Awake()
    {
        Application.targetFrameRate = 60;
    }

    /// <summary>
    /// 开始按钮事件
    /// </summary>
    void OnStartButtonClicked()
    {
        LeanTween.dispatchEvent((int)Events.MAINMENU,false);
    }

    public void OnStoryButtonClicked()
    {
        GameGlobalValue.s_CurrentGameType = GameType.Story;
        OnStartButtonClicked();
    }

    public void OnEndlessButtonClicked()
    {
        GameGlobalValue.s_CurrentGameType = GameType.Endless;
        OnStartButtonClicked();
    }

    public void OnHighScoreClicked()
    {
        SocialManager.Instance.ShowLeardBoardUI();
    }

    public void OnMoreAppClicked()
    {
        if(ChartboostUtil.Instance.HasMoreAppOnDefault())
        {
            ChartboostUtil.Instance.ShowMoreAppOnDefault();
        }
    }

	// Update is called once per frame
	void Update () {

	}
}


text:
<?xml version="1.0" encoding="utf-8"?>
<vector
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:width="36dp"
    android:height="36dp"
    android:viewportHeight="36"
    android:viewportWidth="36">
    <group>
        <path
            android:name="play"
            android:fillColor="#06fa0e"
            android:pathData="@string/path_play"/>
    </group>
</vector>


text:
TARGET = ktrw_usb_proxy

DEBUG ?= 0

CFLAGS = -O2 -Wall -Werror

ifneq ($(DEBUG),0)
CFLAGS += -DDEBUG=$(DEBUG)
endif

SOURCES = source/ktrw_usb_proxy.c

HEADERS =

FRAMEWORKS = -framework IOKit -framework CoreFoundation

$(TARGET): $(SOURCES) $(HEADERS)
	$(CC) $(CFLAGS) $(DEFINES) $(LDFLAGS) $(FRAMEWORKS) -o $@ $(SOURCES)

clean:
	rm -f -- $(TARGET)


text:
package id.rainey.master.utils.network;

import java.io.IOException;

/**
 * Created by riorizkyrainey on 13/10/17.
 */

public class NoConnectivityException extends IOException {
    @Override
    public String getMessage() {
        return "No connectivity exception";
    }

}


text:
package com.ebay.pulsar.analytics.query.request;

import java.util.List;

import org.joda.time.DateTime;
import org.joda.time.DateTimeZone;
import org.joda.time.format.DateTimeFormat;
import org.joda.time.format.DateTimeFormatter;
import org.joda.time.format.DateTimeFormatterBuilder;
import org.joda.time.format.DateTimeParser;
import org.joda.time.format.ISODateTimeFormat;
import org.joda.time.format.ISOPeriodFormat;
import org.joda.time.format.PeriodFormatter;

import com.google.common.collect.Lists;

/**
 *
 * @author mingmwang
 *
 */
public class PulsarDateTimeFormatter {

	private static DateTimeParser[] inputTimeFormats = {
			DateTimeFormat.forPattern("yyyy-MM-dd HH:mm:ss").getParser(),
			DateTimeFormat.forPattern("yyyy-MM-dd HH:mm").getParser(),
			DateTimeFormat.forPattern("yyyy-MM-dd").getParser() };

	public static DateTimeZone MST_TIMEZONE = DateTimeZone.forID("MST");

	public static DateTimeFormatter INPUTTIME_FORMATTER = new DateTimeFormatterBuilder()
			.append(null, inputTimeFormats).toFormatter().withZone(MST_TIMEZONE);

	public static DateTimeFormatter OUTPUTTIME_FORMATTER = DateTimeFormat
			.forPattern("yyyy-MM-dd HH:mm:ss").withZone(MST_TIMEZONE);

	public static DateTimeFormatter INPUT_DRUID_TIME_FORMATTER = DateTimeFormat
			.forPattern("yyyy-MM-dd'T'HH:mm:ss-07:00").withZone(MST_TIMEZONE);

	public static DateTimeFormatter OUTPUT_DRUID_TIME_FORMATTER = ISODateTimeFormat
			.dateTimeParser().withZone(MST_TIMEZONE);

	public static PeriodFormatter ISO_PERIOD_FORMATTER = ISOPeriodFormat.standard();

	public static List<String> buildStringIntervals(DateRange intervals) {
		List<String> strIntervals = Lists.newArrayList();
		DateTime start = intervals.getStart();
		DateTime end = intervals.getEnd();
		strIntervals.add(INPUT_DRUID_TIME_FORMATTER.print(start) + "/" + INPUT_DRUID_TIME_FORMATTER.print(end));
		return strIntervals;
	}

	public static DateRange parseIntevalsFromString(String strIntervals){
		String [] parts = strIntervals.split("/");
		DateTime start = INPUT_DRUID_TIME_FORMATTER.parseDateTime(parts[0]);
		DateTime end = INPUT_DRUID_TIME_FORMATTER.parseDateTime(parts[1]);
		DateRange range = new DateRange(start, end);
		return range;
	}
}


text:
//
//  NSMutableArray+VFoundation.h
//  VFoundation
//
//  Created by JessieYong on 14-3-10.
//  Copyright (c) 2014年 SJ. All rights reserved.
//

#import <Foundation/Foundation.h>

/**
 *  NSMutableArray' category in VFoundation
 */
@interface NSMutableArray (NSMutableArrayVFoundation)

/**
 *  move object
 *
 *  @return move Successful
 */
- (BOOL)moveObjectFromIndex:(NSUInteger)fromIndex toIndex:(NSUInteger)toIndex;

/*
 *  swap Objects in array
 *
 *  @return swap Successful
 */
- (BOOL)swapObjectAtIndex:(NSUInteger)fromIndex withObjectAtIndex:(NSUInteger)toIndex;

- (void)removeFirstObject;

@end


text:
using System;

namespace StackExchange.Opserver.Data.SQL
{
    public partial class SQLInstance
    {
        private Cache<SQLServerFeatures> _serverFeatures;
        public Cache<SQLServerFeatures> ServerFeatures => _serverFeatures ?? (_serverFeatures = SqlCacheSingle<SQLServerFeatures>(60.Minutes()));

        public class SQLServerFeatures : ISQLVersioned
        {
            public Version MinVersion => SQLServerVersions.SQL2000.RTM;

            public bool HasSPWhoIsActive { get; internal set; }
            public bool HasSPBlitz { get; internal set; }
            public bool HasSPBlitzIndex { get; internal set; }
            public bool HasSPAskBrent { get; internal set; }

            internal const string BatchFetchSQL = @"
Declare @Supported Table (name sysname, header varchar(200));
Insert Into @Supported
Select 'sp_whoIsActive', 'Who is Active?'
Union
Select 'sp_Blitz', 'sp_Blitz (TM)'
Union
Select 'sp_BlitzIndex', 'sp_BlitzIndex (TM)';

Select  o.name Collate Latin1_General_CI_AS as Name,
       SubString(sm.definition,
                 CharIndex(s.header, sm.definition),
                 CharIndex(char(13), sm.definition, CharIndex(s.header, sm.definition)) - CharIndex(s.header, sm.definition)) Header
  From sys.objects o
       Join sys.sql_modules sm On o.object_id = sm.object_id
       Join @Supported s On o.name = s.name
 Where type = 'P'
Union
Select o.name Collate Latin1_General_CI_AS,
       SubString(sm.definition,
                 CharIndex(s.header, sm.definition),
                 CharIndex(char(13), sm.definition, CharIndex(s.header, sm.definition)) - CharIndex(s.header, sm.definition))
  From master.sys.objects o
       Join master.sys.sql_modules sm On o.object_id = sm.object_id
       Join @Supported s On o.name = s.name
 Where type = 'P'";

            public string GetFetchSQL(Version v) => @"
With Procs (name) as (
Select name COLLATE Latin1_General_CI_AS From sys.objects Where type = 'P'
Union
Select name COLLATE Latin1_General_CI_AS From master.sys.objects Where type = 'P')

Select (Select Cast(Count(*) As BIT) From Procs Where name = 'sp_whoIsActive') as HasSPWhoIsActive,
       (Select Cast(Count(*) As BIT) From Procs Where name = 'sp_Blitz') as HasSPBlitz,
       (Select Cast(Count(*) As BIT) From Procs Where name = 'sp_BlitzIndex') as HasSPBlitzIndex,
       (Select Cast(Count(*) As BIT) From Procs Where name = 'sp_AskBrent') as HasSPAskBrent";
        }

    }
}


text:
from google.cloud import osconfig_v1alpha

def sample_list_os_policy_assignment_revisions():
    # Create a client
    client = osconfig_v1alpha.OsConfigZonalServiceClient()

    # Initialize request argument(s)
    request = osconfig_v1alpha.ListOSPolicyAssignmentRevisionsRequest(
        name="name_value",
    )

    # Make the request
    page_result = client.list_os_policy_assignment_revisions(request=request)

    # Handle the response
    for response in page_result:
        print(response)

# [END osconfig_v1alpha_generated_OsConfigZonalService_ListOSPolicyAssignmentRevisions_sync]


text:
title: Recommended Rollout Strategy
parent: Deployment
nav_order: 2
---

# Recommended Rollout Strategy

We recommend the following strategy to rollout Santa to an existing fleet of machines. This approach can help avoid too much disruption during the process.

As part of this strategy, we recommend using a sync server with Santa. For a list of open-source sync servers, see the [Sync Servers](sync-servers.md) page.

1. Configure the sync server to assign all clients to `MONITOR` mode and ensure that [event](../concepts/events.md) collection is working. See [Sync Server Provided Configuration](configuration.md#sync-server-provided-configuration) for a list of the configuration options.

1. Deploy to all hosts. Ideally, the deployment is a slow process over a reasonable period of time. That is, an incremental deployment to small groups of machines depending on your fleet size with enough time to monitor and manage the deployment. A slower deployment will allow you to catch incompatibilities early in the rollout before a full deployment is complete.

1. Leave the client in [`MONITOR` mode](../concepts/mode.md) for a defined period of time to allow event collection to take place.

1. Analyze the incoming events uploaded by the client in order to determine which applications you need to allow list.

1. Create allow rules as appropriate based on the previous analysis. See [Rules](../concepts/rules.md) for more explanation and examples of setting up rules.

1. Continue to analyze as you deploy the allow rules. The aim is to ensure that the number of incoming events is manageable.

1. Slowly move clients to `LOCKDOWN` mode. If possible, use the analysis to guide which hosts you move. For example, if a host is not uploading any block events, it's a good candidate for switching modes.