text:
import argparse
import logging
import threading
import github_explorer

"""This python file drives multiple GitHub Explorer program concurrently

Multiple GitHub Explorer processes are started at the same time and given a
specific process number that dictates what repository page intervals it should
handle. Each process will have it's own logger that will log the progress in
individual log files. It's still possible to manually orchestrate the multiple
GitHub Explorer programs by making use of the -p and -m parameters in the
GitHub Explorer program.

"""

def _task(language, keywords, sourceStatements, clone, processNumber,
         maxProcesses):
  """This task is a single execution of the GitHub Explorer program

  This function is used in the threading approach to running multiple GitHub
  Explorer programs. A specific logger is created for the new execution of the
  GitHub Explorer.

  Args:
    language: A filter of the primary language for the repositories
    keywords: Filter of keywords for the repositories
    sourceStatements: Filter of source statements for the repositories
    clone: Flag that indicates repositories should be cloned
    processNumber: The current processNumber of this concurrent execution
    maxProcesses: The maximum number of concurrent processes executing

  """

  # Create custom logger to be used within new GitHub Explorer process
  logger = logging.getLogger("logger" + str(processNumber))
  handler = logging.FileHandler("worker_log_" + str(processNumber), "w")
  logger.setLevel(logging.DEBUG)
  formatter = logging.Formatter("%(asctime)s %(levelname)-8s P" +
                                str(processNumber) +
                                " %(message)s", datefmt="%d %b %H:%M:%S")
  handler.setFormatter(formatter)
  logger.addHandler(handler)

  # Create the GitHub Explorer which starts the process
  gitHubExplorer = github_explorer.GitHubExplorer(language, keywords,
      sourceStatements, clone, processNumber, maxProcesses, True, logger)

# If this module is ran as main
if __name__ == '__main__':

  # Define the argument options to be parsed
  parser = argparse.ArgumentParser(
      description="<https://github.com/kevinjalbert/github_explorer>",
      version="github_explorer_driver 0.3.0")
  parser.add_argument(
      '-m',
      action='store',
      default=1,
      dest='maxProcesses',
      help="The maximum number of concurrent executions (Manually done, or "
           "through the driver.py interface)")
  parser.add_argument(
      '-c',
      action='store_true',
      default=False,
      dest='clone',
      help="Enables repositories to be cloned for analysis and more accuracy "
           "(source statements can only be search if this is enabled)")
  parser.add_argument(
      '-l',
      action='store',
      default="",
      dest='language',
      help="Primary language to search for using GitHub's defined set of "
           "languages (ex: Python)")
  parser.add_argument(
      '-k',
      action='store',
      default="",
      dest='keywords',
      help="Keywords to be used in the search (ex: \"Testing Concurrency "
           "Android\")")
  parser.add_argument(
      '-s',
      action='store',
      default="",
      dest='sourceStatements',
      help="Source Statements to be used in the detailed search (ex: "
           "\"java.util synchronized latch\"), able to search with multiple "
           "terms (this-or-that)")

  userArgs = parser.parse_args()

  workers = []
  for processNumber in range(int(userArgs.maxProcesses)):
    worker = threading.Thread(target=_task, args=(userArgs.language,
                              userArgs.keywords, userArgs.sourceStatements,
                              userArgs.clone, processNumber + 1,
                              int(userArgs.maxProcesses)))
    workers.append(worker)
    worker.start()


text:
#ifndef InjectedBundleRangeHandle_h
#define InjectedBundleRangeHandle_h

#include "APIObject.h"
#include <JavaScriptCore/JSBase.h>
#include <wtf/PassRefPtr.h>
#include <wtf/RefPtr.h>

namespace WebCore {
    class Range;
}

namespace WebKit {

class InjectedBundleScriptWorld;

class InjectedBundleRangeHandle : public TypedAPIObject<APIObject::TypeBundleRangeHandle> {
public:
    static PassRefPtr<InjectedBundleRangeHandle> getOrCreate(JSContextRef, JSObjectRef);
    static PassRefPtr<InjectedBundleRangeHandle> getOrCreate(WebCore::Range*);

    virtual ~InjectedBundleRangeHandle();

    WebCore::Range* coreRange() const;

private:
    static PassRefPtr<InjectedBundleRangeHandle> create(WebCore::Range*);
    InjectedBundleRangeHandle(WebCore::Range*);

    RefPtr<WebCore::Range> m_range;
};

} // namespace WebKit

#endif // InjectedBundleRangeHandle_h

redpajama_set_name: RedPajamaGithub


text:
module xlib.ui.element.elements.ol {

  import IEvent = elements.IEvent;

  export interface IElement<T> extends elements.IElement<T> {
    getTitle(): string;
    setTitle(value: any): void;
    getLang(): string;
    setLang(value: any): void;
    getXmlLang(): string;
    setXmlLang(value: any): void;
    getDir(): string;
    setDir(value: any): void;
    getType(): string;
    setType(value: any): void;
    getReversed(): string;
    setReversed(value: any): void;
    getStart(): string;
    setStart(value: any): void;
    onClick(listener: (event?: IEvent<T>) => void): void;
    onDblClick(listener: (event?: IEvent<T>) => void): void;
    onMouseDown(listener: (event?: IEvent<T>) => void): void;
    onMouseUp(listener: (event?: IEvent<T>) => void): void;
    onMouseOver(listener: (event?: IEvent<T>) => void): void;
    onMouseMove(listener: (event?: IEvent<T>) => void): void;
    onMouseOut(listener: (event?: IEvent<T>) => void): void;
    onKeyPress(listener: (event?: IEvent<T>) => void): void;
    onKeyDown(listener: (event?: IEvent<T>) => void): void;
    onKeyUp(listener: (event?: IEvent<T>) => void): void;
  }

}


text:
package ezbake.groups.graph;

import com.thinkaurelius.titan.diskstorage.StorageException;
import com.thinkaurelius.titan.graphdb.configuration.GraphDatabaseConfiguration;
import com.tinkerpop.blueprints.Vertex;
import ezbake.configuration.ClasspathConfigurationLoader;
import ezbake.configuration.EzConfiguration;
import ezbake.configuration.EzConfigurationLoaderException;
import ezbake.groups.graph.exception.*;
import ezbake.groups.graph.frames.vertex.BaseVertex;
import ezbake.groups.graph.frames.vertex.Group;
import ezbake.groups.graph.frames.vertex.User;
import ezbake.groups.graph.impl.TitanGraphProvider;
import ezbake.groups.graph.query.GroupQuery;
import ezbake.groups.graph.query.SpecialAppGroupQuery;
import org.junit.*;
import org.junit.rules.TemporaryFolder;

import java.io.IOException;
import java.util.Iterator;

public class TransactionRollbackTest extends GraphCommonSetup {

    public EzGroupsGraphImpl graph;
    public StubIDProvider idProvider;
    public SpecialAppGroupQuery query;

    @Before
    public void setUpTests() throws EzConfigurationLoaderException {
        idProvider = new StubIDProvider();
        GroupQuery groupQuery = new GroupQuery(framedTitanGraph);
        graph = new EzGroupsGraphImpl(titanGraph, idProvider, groupQuery);
        query = new SpecialAppGroupQuery(groupQuery.getBaseQuery());
    }

    @After
    public void closeGraph() throws StorageException, IOException {
        if (graph != null) {
            graph.close();
        }
    }

    @Test
    public void testRollbackIfIdUnavailableForAddUser() throws InvalidVertexTypeException, AccessDeniedException, IndexUnavailableException, UserNotFoundException, VertexExistsException, InvalidGroupNameException {
        idProvider.id = -1;
        try {
            graph.addUser(BaseVertex.VertexType.USER, "user1", "");
        } catch (IndexUnavailableException e) {
            Iterator<Vertex> v = graph.getGraph().query().has(User.PRINCIPAL, "user1").vertices().iterator();
            Assert.assertFalse(v.hasNext());
        }
    }

    @Test
    public void testRollbackIfAddGroup() throws InvalidVertexTypeException, AccessDeniedException, IndexUnavailableException, UserNotFoundException, VertexExistsException, InvalidGroupNameException {
        graph.addUser(BaseVertex.VertexType.USER, "user1", "");

        idProvider.id = -1;
        try {
            graph.addGroup(BaseVertex.VertexType.USER, "user1", "test");
        } catch (IndexUnavailableException e) {
            Iterator<Vertex> v = graph.getGraph().query().has(Group.GROUP_NAME, "root.test").vertices().iterator();
            Assert.assertFalse(v.hasNext());
        }

    }
}


text:
<?php

namespace PhpGitHooks\Module\Files\Contract\Query;

use PhpGitHooks\Infrastructure\CommandBus\QueryBus\QueryInterface;

class PhpFilesExtractorQuery implements QueryInterface
{
    /**
     * @var array
     */
    private $files;

    /**
     * PhpFilesExtractorQuery constructor.
     *
     * @param array $files
     */
    public function __construct(array $files)
    {
        $this->files = $files;
    }

    /**
     * @return array
     */
    public function getFiles()
    {
        return $this->files;
    }
}


text:
// Type definitions for node-forge 0.6.43
// Project: https://github.com/digitalbazaar/forge
// Definitions by: Seth Westphal <https://github.com/westy92>
//                 Kay Schecker <https://github.com/flynetworks>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

declare module "node-forge" {
    type Byte = string;
    type Bytes = string;
    type Hex = string;
    type Base64 = string;
    type Utf8 = string;
    type OID = string;

    namespace pki {

        type PEM = string;
        type Key = any;

        interface KeyPair {
            publicKey: Key;
            privateKey: Key;
        }

        function privateKeyToPem(key: Key, maxline?: number): PEM;
        function publicKeyToPem(key: Key, maxline?: number): PEM;
        function publicKeyFromPem(pem: PEM): Key;
        function certificateToPem(cert: Certificate, maxline?: number): PEM;

        interface oids {
            [key: string]: string;
        }
        var oids: oids;

        namespace rsa {

            interface GenerateKeyPairOptions {
                bits?: number;
                e?: number;
                workerScript?: string;
                workers?: number;
                workLoad?: number;
                prng?: any;
                algorithm?: string;
            }

            function generateKeyPair(bits?: number, e?: number, callback?: (err: Error, keypair: KeyPair) => void): KeyPair;
            function generateKeyPair(options?: GenerateKeyPairOptions, callback?: (err: Error, keypair: KeyPair) => void): KeyPair;
        }

        interface CertificateFieldOptions {
            name?: string;
            type?: string;
            shortName?: string;
        }

        interface CertificateField extends CertificateFieldOptions {
            valueConstructed?: boolean;
            valueTagClass?: asn1.Class;
            value?: any[];
            extensions?: any[];
        }

        interface Certificate {
            version: number;
            serialNumber: string;
            signature: any;
            siginfo: any;
            validity: {
                notBefore: Date;
                notAfter: Date;
            };
            issuer: {
                getField(sn: string | CertificateFieldOptions): any;
                addField(attr: CertificateField): void;
                attributes: any[];
                hash: any;
            };
            subject: {
                getField(sn: string | CertificateFieldOptions): any;
                addField(attr: CertificateField): void;
                attributes: any[];
                hash: any;
            };
            extensions: any[];
            publicKey: any;
            md: any;
        }

        function certificateFromAsn1(obj: asn1.Asn1, computeHash?: boolean): Certificate;

        function decryptRsaPrivateKey(pem: PEM, passphrase?: string): Key;
    }

    namespace ssh {
        /**
         * Encodes a private RSA key as an OpenSSH file.
         */
        function privateKeyToOpenSSH(privateKey?: string, passphrase?: string): string;
    }

    namespace asn1 {
        enum Class {
            UNIVERSAL = 0x00,
            APPLICATION = 0x40,
            CONTEXT_SPECIFIC = 0x80,
            PRIVATE = 0xC0,
        }

        enum Type {
            NONE = 0,
            BOOLEAN = 1,
            INTEGER = 2,
            BITSTRING = 3,
            OCTETSTRING = 4,
            NULL = 5,
            OID = 6,
            ODESC = 7,
            EXTERNAL = 8,
            REAL = 9,
            ENUMERATED = 10,
            EMBEDDED = 11,
            UTF8 = 12,
            ROID = 13,
            SEQUENCE = 16,
            SET = 17,
            PRINTABLESTRING = 19,
            IA5STRING = 22,
            UTCTIME = 23,
            GENERALIZEDTIME = 24,
            BMPSTRING = 30,
        }

        interface Asn1 {
            tagClass: Class;
            type: Type;
            constructed: boolean;
            composed: boolean;
            value: Asn1[];
        }

        function create(tagClass: Class, type: Type, constructed: boolean, value: string | Asn1[]): Asn1;
        function fromDer(bytes: Bytes | util.ByteBuffer, strict?: boolean): Asn1;
        function toDer(obj: Asn1): util.ByteBuffer;
        function oidToDer(oid: OID): util.ByteStringBuffer;
        function derToOid(der: util.ByteStringBuffer): OID;
    }

    namespace util {
        function isArray(x: any): boolean;
        function isArrayBuffer(x: any): boolean;
        function isArrayBufferView(x: any): boolean;

        interface ArrayBufferView {
            buffer: ArrayBuffer;
            byteLength: number;
        }

        type ByteBuffer = ByteStringBuffer;
        class ByteStringBuffer {
            constructor(bytes?: Bytes | ArrayBuffer | ArrayBufferView | ByteStringBuffer);
            data: string;
            read: number;
            length(): number;
            isEmpty(): boolean;
            putByte(byte: Byte): ByteStringBuffer;
            fillWithByte(byte: Byte, n: number): ByteStringBuffer;
            putBytes(bytes: Bytes): ByteStringBuffer;
            putString(str: string): ByteStringBuffer;
            putInt16(int: number): ByteStringBuffer;
            putInt24(int: number): ByteStringBuffer;
            putInt32(int: number): ByteStringBuffer;
            putInt16Le(int: number): ByteStringBuffer;
            putInt24Le(int: number): ByteStringBuffer;
            putInt32Le(int: number): ByteStringBuffer;
            putInt(int: number, numOfBits: number): ByteStringBuffer;
            putSignedInt(int: number, numOfBits: number): ByteStringBuffer;
            putBuffer(buffer: ByteStringBuffer): ByteStringBuffer;
            getByte(): number;
            getInt16(): number;
            getInt24(): number;
            getInt32(): number;
            getInt16Le(): number;
            getInt24Le(): number;
            getInt32Le(): number;
            getInt(numOfBits: number): number;
            getSignedInt(numOfBits: number): number;
            getBytes(count?: number): Bytes;
            bytes(count?: number): Bytes;
            at(index: number): Byte;
            setAt(index: number, byte: number): ByteStringBuffer;
            last(): Byte;
            copy(): ByteStringBuffer;
            compact(): ByteStringBuffer;
            clear(): ByteStringBuffer;
            truncate(): ByteStringBuffer;
            toHex(): Hex;
            toString(): string;
        }

        function fillString(char: string, count: number): string;
        function xorBytes(bytes1: string, bytes2: string, count: number): string;
        function hexToBytes(hex: Hex): Bytes;
        function bytesToHex(bytes: Bytes): Hex;
        function int32ToBytes(int: number): Bytes;
        function encode64(bytes: Bytes, maxline?: number): Base64;
        function decode64(encoded: Base64): Bytes;
        function encodeUtf8(str: string): Utf8;
        function decodeUtf8(encoded: Utf8): string;

        function createBuffer(): ByteBuffer;
        function createBuffer(input: string, encode: string): ByteBuffer;

        namespace binary {
            namespace raw {
                function encode(x: Uint8Array): Bytes;
                function decode(str: Bytes, output?: Uint8Array, offset?: number): Uint8Array;
            }
            namespace hex {
                function encode(bytes: Bytes | ArrayBuffer | ArrayBufferView | ByteStringBuffer): Hex;
                function decode(hex: Hex, output?: Uint8Array, offset?: number): Uint8Array;
            }
            namespace base64 {
                function encode(input: Uint8Array, maxline?: number): Base64;
                function decode(input: Base64, output?: Uint8Array, offset?: number): Uint8Array;
            }
        }

        namespace text {
            namespace utf8 {
                function encode(str: string, output?: Uint8Array, offset?: number): Uint8Array;
                function decode(bytes: Uint8Array): Utf8;
            }
            namespace utf16 {
                function encode(str: string, output?: Uint8Array, offset?: number): Uint8Array;
                function decode(bytes: Uint8Array): string;
            }
        }
    }

    namespace pkcs12 {

        interface BagsFilter {
            localKeyId?: string;
            localKeyIdHex?: string;
            friendlyName?: string;
            bagType?: string;
        }

        interface Bag {
            type: string;
            attributes: any;
            key?: pki.Key;
            cert?: pki.Certificate;
            asn1: asn1.Asn1
        }

        interface Pkcs12Pfx {
            version: string;
            safeContents: [{
                encrypted: boolean;
                safeBags: Bag[];
            }];
            getBags: (filter: BagsFilter) => {
                [key: string]: Bag[]|undefined;
                localKeyId?: Bag[];
                friendlyName?: Bag[];
            };
            getBagsByFriendlyName: (fiendlyName: string, bagType: string) => Bag[]
            getBagsByLocalKeyId: (localKeyId: string, bagType: string) => Bag[]
        }

        function pkcs12FromAsn1(obj: any, strict?: boolean, password?: string) : Pkcs12Pfx;
        function pkcs12FromAsn1(obj: any, password?: string) : Pkcs12Pfx;
    }
}


text:
require "delfos"
require "delfos/neo4j"

RSpec.describe "integration with default neo4j logging" do
  let(:result) do
    Delfos::Neo4j.flush!
    Delfos::Neo4j.execute_sync(query).first
  end

  before(:each) do
    wipe_db!

    Delfos.configure do |c|
      c.include = "fixtures"
      c.logger = DelfosSpecs.logger
    end
    Delfos.start!
    load "fixtures/a_usage.rb"
  end

  context "recording instance methods" do
    let(:query) do
      <<-QUERY
     MATCH (a:Class{name: "A"})  -  [:OWNS]
       -> (ma:Method{type: "InstanceMethod", name: "some_method"})
     MATCH (b:Class{name: "B"})  -  [:OWNS]
       ->  (mb:Method{type: "InstanceMethod", name: "another_method"})
     MATCH (c:Class{name: "C"})  -  [:OWNS]
       ->  (mc:Method{type: "InstanceMethod", name: "method_with_no_more_method_calls"})

     RETURN
       count(ma), ma,
       count(mb), mb,
       count(mc), mc
      QUERY
    end

    it do
      a_method_count, method_a, b_method_count, _, c_method_count, = result

      expect(a_method_count).to eq 1

      expect(method_a).to eq(
        "file"        => "fixtures/a.rb",
        "line_number" => 5,
        "name"        => "some_method",
        "type"        => "InstanceMethod",
      )

      expect(b_method_count).to eq 1
      expect(c_method_count).to eq 1
    end
  end
end


text:
using TestAssembly.Lifetimes.TestObjects;
using Xunit;

namespace Photosphere.Di.IntegrationTests.Main
{
    public class GetInstanceTests : IntegrationTestsBase
    {
        public GetInstanceTests() : base(typeof(IPerRequestFoo)) {}

        [Fact]
        internal void GetInstance_ByInterface_NotNull()
        {
            var result = NewContainer.GetInstance<IPerRequestFoo>();
            Assert.NotNull(result);
        }

        [Fact]
        internal void GetInstance_ByInterface_SingleImplementation()
        {
            var result = NewContainer.GetInstance<IPerRequestFoo>();
            Assert.IsType<PerRequestFoo>(result);
        }

        [Fact]
        internal void GetInstance_WithDependencies_NotNull()
        {
            var result = NewContainer.GetInstance<IPerRequestDependencies>();
            Assert.NotNull(result);
        }

        [Fact]
        internal void GetInstance_WithDependencies_SingleImplementation()
        {
            var result = NewContainer.GetInstance<IPerRequestDependencies>();
            Assert.IsType<PerRequestDependencies>(result);
        }

        [Fact]
        internal void GetInstance_WithDependencies_DependenciesNotNull()
        {
            var result = NewContainer.GetInstance<IPerRequestDependencies>();

            Assert.NotNull(result.Foo);
            Assert.NotNull(result.Bar);
        }
    }
}


text:
package org.swtk.eng.stanford.dto;

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

import com.google.gson.annotations.Expose;

public class DepResults implements Iterable<DepResult> {

	@Expose private Line			line;

	@Expose private List<DepResult>	results;

	public void addResults(DepResult... results) {
		for (DepResult result : results)
			getResults().add(result);
	}

	public Line getLine() {
		return line;
	}

	public List<DepResult> getResults() {
		if (null == results) setResults(new ArrayList<DepResult>());
		return results;
	}

	public boolean hasResults() {
		return !getResults().isEmpty();
	}

	@Override public Iterator<DepResult> iterator() {
		return getResults().iterator();
	}

	public void setLine(Line line) {
		this.line = line;
	}

	public void setResults(List<DepResult> results) {
		this.results = results;
	}

	public int size() {
		return getResults().size();
	}
}


text:
package Proverb;

use strict;
use warnings;

sub proverb {
  my ( $items, $qualifier ) = @_;

  return undef;
}

__PACKAGE__;


text:
<Project DefaultTargets="Build">

	<PropertyGroup>
		<SourceRevisionId>build$([System.DateTime]::UtcNow.ToString("yyyyMMddHHmmss"))</SourceRevisionId>
		<TargetFramework>net6.0</TargetFramework>
		<ImplicitUsings>enable</ImplicitUsings>
		<!--<Nullable>enable</Nullable>-->
    <!--
    <RuntimeIdentifiers>win-x64;win-x86;win-arm;win-arm64;osx-x64;linux-x64;linux-arm;linux-arm64</RuntimeIdentifiers>
		-->
    <Company>Threshold Secrets LLC.</Company>
		<GenerateAssemblyVersionAttribute>false</GenerateAssemblyVersionAttribute>
		<GenerateAssemblyFileVersionAttribute>false</GenerateAssemblyFileVersionAttribute>
		<Configurations>Debug;Release;Sandcastle;Github</Configurations>
		<DocumentationFile>xml\Documentation.xml</DocumentationFile>
    <UseSharedCompilation>false</UseSharedCompilation>
	</PropertyGroup>

	<Target Name="PreBuild" BeforeTargets="PreBuildEvent" Condition="'$(Configuration)'!='Github'">
		<Exec Command="VSPreBuild" />
	</Target>
	<Target Name="PostBuild" AfterTargets="PostBuildEvent" Condition="'$(Configuration)'!='Github'">
		<Exec Command="VSPostBuild" />
	</Target>

	<PropertyGroup Condition="'$(Configuration)'=='Github'">
		<DefineConstants>TRACE;_Github_</DefineConstants>
	</PropertyGroup>

	<PropertyGroup>
		<NoWarn>1701;1702;cs8632</NoWarn>
	</PropertyGroup>
</Project>


text:
namespace anki {

/// @addtogroup util_file
/// @{

/// Return true if a file exists
Bool fileExists(const CString& filename);

/// Get file extension
/// @param[in] filename The file to open
/// @return nullptr on failure and if the dot is the last character
CString getFileExtension(const CString& filename);

/// Return true if directory exists?
Bool directoryExists(const CString& dir);

/// Equivalent to: rm -rf dir
void removeDirectory(const CString& dir);

/// Equivalent to: mkdir dir
void createDirectory(const CString& dir);

/// Get the home directory.
/// Write the home directory to @a buff. The @a buffSize is the size of the
/// @a buff. If the @buffSize is not enough the function will throw
/// an exception.
String getHomeDirectory(HeapAllocator<U8>& alloc);

/// @}

} // end namespace anki

#endif


text:
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-2
// See http://java.sun.com/xml/jaxb
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2013.07.27 at 08:11:57 PM EEST
//

package eu.datex2.schema._1_0._1_0;

import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlEnumValue;
import javax.xml.bind.annotation.XmlType;

/**
 *
Java class for WinterEquipmentAdviceEnum.
 *
 *
The following schema fragment specifies the expected content contained within this class.
 *

 *

 * <simpleType name="WinterEquipmentAdviceEnum">
 *   <restriction base="{http://www.w3.org/2001/XMLSchema}string">
 *     <enumeration value="snowChainsOrTyresRecommended"/>
 *     <enumeration value="snowChainsRecommended"/>
 *     <enumeration value="snowTyresRecommended"/>
 *     <enumeration value="studTyresMayBeUsed"/>
 *     <enumeration value="winterEquipmentRecommended"/>
 *     <enumeration value="other"/>
 *   </restriction>
 * </simpleType>
 *

 *
 */
@XmlType(name = "WinterEquipmentAdviceEnum")
@XmlEnum
public enum WinterEquipmentAdviceEnum {

    /**
     * Snow chains or tyres are recommended.
     *
     */
    @XmlEnumValue("snowChainsOrTyresRecommended")
    SNOW_CHAINS_OR_TYRES_RECOMMENDED("snowChainsOrTyresRecommended"),

    /**
     * Snow chains are recommended.
     *
     */
    @XmlEnumValue("snowChainsRecommended")
    SNOW_CHAINS_RECOMMENDED("snowChainsRecommended"),

    /**
     * Snow tyres are recommended.
     *
     */
    @XmlEnumValue("snowTyresRecommended")
    SNOW_TYRES_RECOMMENDED("snowTyresRecommended"),

    /**
     * Stud tyres may be used.
     *
     */
    @XmlEnumValue("studTyresMayBeUsed")
    STUD_TYRES_MAY_BE_USED("studTyresMayBeUsed"),

    /**
     * Carrying of winter equipment (snow chains and/or snow tyres) is recommended.
     *
     */
    @XmlEnumValue("winterEquipmentRecommended")
    WINTER_EQUIPMENT_RECOMMENDED("winterEquipmentRecommended"),

    /**
     * Other than as defined in this enumeration.
     *
     */
    @XmlEnumValue("other")
    OTHER("other");
    private final String value;

    WinterEquipmentAdviceEnum(String v) {
        value = v;
    }

    public String value() {
        return value;
    }

    public static WinterEquipmentAdviceEnum fromValue(String v) {
        for (WinterEquipmentAdviceEnum c: WinterEquipmentAdviceEnum.values()) {
            if (c.value.equals(v)) {
                return c;
            }
        }
        throw new IllegalArgumentException(v);
    }

}


text:
use super::Offset;
use byteorder::{ByteOrder, LittleEndian};
use bytes::BufMut;
use crc32c::{crc32c, crc32c_append};
use log::trace;
use std::{
    io::{self, Read},
    iter::{FromIterator, IntoIterator},
    u16,
};

/// Error for the message encoding or decoding.
#[derive(Debug)]
pub enum MessageError {
    /// `std::io` Error
    IoError(io::Error),
    /// Invalid crc32c hash encountered
    InvalidHash,
    /// Message payload is mismatched by the size field.
    InvalidPayloadLength,
}

#[derive(Debug, Copy, Clone)]
pub enum MessageSerializationError {
    /// The Metdata is too large to serialize
    MetadataExceedsLimit,
    /// The payload and metadata exceed the buffer size
    TotalSizeExceedsBuffer,
}

impl From<io::Error> for MessageError {
    fn from(e: io::Error) -> MessageError {
        MessageError::IoError(e)
    }
}

macro_rules! read_n {
    ($reader:expr, $buf:expr, $size:expr, $err_msg:expr) => {{
        match $reader.read(&mut $buf) {
            Ok(s) if s == $size => (),
            Ok(_) => {
                return Err(MessageError::IoError(io::Error::new(
                    io::ErrorKind::UnexpectedEof,
                    $err_msg,
                )));
            }
            Err(e) => return Err(MessageError::IoError(e)),
        }
    }};
    ($reader:expr, $buf:expr, $size:expr) => {{
        match $reader.read(&mut $buf) {
            Ok(s) if s == $size => (),
            Ok(_) => return Err(MessageError::InvalidPayloadLength),
            Err(e) => return Err(MessageError::IoError(e)),
        }
    }};
}

pub const HEADER_SIZE: usize = 20;

macro_rules! read_header {
    (offset, $buf:expr) => {
        LittleEndian::read_u64(&$buf[0..8])
    };
    (size, $buf:expr) => {
        LittleEndian::read_u32(&$buf[8..12])
    };
    (hash, $buf:expr) => {
        LittleEndian::read_u32(&$buf[12..16])
    };
    (meta_size, $buf:expr) => {
        LittleEndian::read_u16(&$buf[18..20])
    };
}

macro_rules! set_header {
    (offset, $buf:expr, $v:expr) => {
        LittleEndian::write_u64(&mut $buf[0..8], $v)
    };
    (size, $buf:expr, $v:expr) => {
        LittleEndian::write_u32(&mut $buf[8..12], $v)
    };
    (hash, $buf:expr, $v:expr) => {
        LittleEndian::write_u32(&mut $buf[12..16], $v)
    };
    (meta_size, $buf:expr, $v:expr) => {
        LittleEndian::write_u16(&mut $buf[18..20], $v)
    };
}

/// Serializes a new message into a buffer
pub fn serialize<B: BufMut, M: AsRef<[u8]>, P: AsRef<[u8]>>(
    mut bytes: B,
    offset: u64,
    meta: M,
    payload: P,
) -> Result<(), MessageSerializationError> {
    let payload_slice = payload.as_ref();
    let meta_slice = meta.as_ref();
    if meta_slice.len() > (u16::MAX) as usize {
        return Err(MessageSerializationError::MetadataExceedsLimit);
    }

    let append_size = HEADER_SIZE + meta_slice.len() + payload_slice.len();
    if bytes.remaining_mut() < append_size {
        return Err(MessageSerializationError::TotalSizeExceedsBuffer);
    }

    let mut buf = [0; HEADER_SIZE];
    set_header!(offset, buf, offset);
    set_header!(size, buf, (meta_slice.len() + payload_slice.len()) as u32);
    set_header!(hash, buf, crc32c_append(crc32c(meta_slice), payload_slice));
    set_header!(meta_size, buf, meta_slice.len() as u16);

    // add the header
    bytes.put_slice(&buf);

    // metadata
    bytes.put_slice(meta_slice);

    // payload
    bytes.put_slice(payload_slice);

    Ok(())
}

/// Messages contain finite-sized binary values with an offset from
/// the beginning of the log.
///
/// | Bytes       | Encoding          | Value                          |
/// | ---------   | ----------------- | ------------------------------ |
/// | 0-7         | Little Endian u64 | Offset                         |
/// | 8-11        | Little Endian u32 | Payload and Metadata Size      |
/// | 12-15       | Little Endian u32 | CRC32C of payload and metadata |
/// | 16-17       |                   | Reserved                       |
/// | m: 18-19    | Little Endian u16 | Size of metadata               |
/// | 20-(20+m-1) |                   | Metadata                       |
/// | (20+m)      |                   | Payload                        |
#[derive(Debug)]
pub struct Message<'a> {
    bytes: &'a [u8],
}

impl<'a> Message<'a> {
    /// crc32c of the payload.
    #[inline]
    pub fn hash(&self) -> u32 {
        read_header!(hash, self.bytes)
    }

    /// Size of the payload.
    #[inline]
    pub fn size(&self) -> u32 {
        read_header!(size, self.bytes)
    }

    pub(crate) fn total_bytes(&self) -> usize {
        self.bytes.len()
    }

    /// Offset of the message in the log.
    #[inline]
    pub fn offset(&self) -> Offset {
        read_header!(offset, self.bytes)
    }

    /// Payload of the message.
    #[inline]
    pub fn payload(&self) -> &[u8] {
        &self.bytes[(HEADER_SIZE + self.metadata_size() as usize)..]
    }

    /// Size of the metadata bytes.
    #[inline]
    pub fn metadata_size(&self) -> u16 {
        read_header!(meta_size, self.bytes)
    }

    /// Metadata bytes of hte message.
    #[inline]
    pub fn metadata(&self) -> &[u8] {
        &self.bytes[HEADER_SIZE..(HEADER_SIZE + self.metadata_size() as usize)]
    }

    /// Check that the hash matches the hash of the payload.
    #[inline]
    pub fn verify_hash(&self) -> bool {
        self.hash() == crc32c(&self.bytes[HEADER_SIZE..])
    }
}

/// Iterator for Messages allowing mutation of offsets
#[derive(Debug)]
pub struct MessageMut<'a> {
    bytes: &'a mut [u8],
}

impl<'a> MessageMut<'a> {
    /// crc32c of the payload.
    #[inline]
    pub fn hash(&self) -> u32 {
        read_header!(hash, self.bytes)
    }

    /// Size of the payload.
    #[inline]
    pub fn size(&self) -> u32 {
        read_header!(size, self.bytes)
    }

    /// Offset of the message in the log.
    #[inline]
    pub fn offset(&self) -> Offset {
        read_header!(offset, self.bytes)
    }

    /// Payload of the message.
    #[inline]
    pub fn payload(&self) -> &[u8] {
        &self.bytes[(HEADER_SIZE + self.metadata_size() as usize)..]
    }

    /// Size of the metadata bytes.
    #[inline]
    pub fn metadata_size(&self) -> u16 {
        read_header!(meta_size, self.bytes)
    }

    /// Metadata bytes of hte message.
    #[inline]
    pub fn metadata(&self) -> &[u8] {
        &self.bytes[HEADER_SIZE..(HEADER_SIZE + self.metadata_size() as usize)]
    }

    /// Check that the hash matches the hash of the payload.
    #[inline]
    pub fn verify_hash(&self) -> bool {
        self.hash() == crc32c(&self.bytes[HEADER_SIZE..])
    }

    /// Sets the offset of the message
    #[inline]
    pub fn set_offset(&mut self, offset: u64) {
        set_header!(offset, self.bytes, offset);
    }
}

/// Iterator for `Message` within a `MessageSet`.
pub struct MessageIter<'a> {
    bytes: &'a [u8],
}

impl<'a> Iterator for MessageIter<'a> {
    type Item = Message<'a>;

    fn next(&mut self) -> Option<Message<'a>> {
        if self.bytes.len() < HEADER_SIZE {
            return None;
        }

        let size = read_header!(size, self.bytes) as usize;

        trace!("message iterator: size {} bytes", size);
        assert!(self.bytes.len() >= HEADER_SIZE + size);

        let message_slice = &self.bytes[0..HEADER_SIZE + size];
        self.bytes = &self.bytes[HEADER_SIZE + size..];
        Some(Message {
            bytes: message_slice,
        })
    }
}

/// Iterator for `Message` within a `MessageSet`.
pub struct MessageMutIter<'a> {
    bytes: &'a mut [u8],
}

impl<'a> Iterator for MessageMutIter<'a> {
    type Item = MessageMut<'a>;

    fn next(&mut self) -> Option<MessageMut<'a>> {
        let slice = std::mem::take(&mut self.bytes);
        if slice.len() < HEADER_SIZE {
            return None;
        }

        let size = read_header!(size, slice) as usize;

        trace!("message iterator: size {} bytes", size);
        assert!(slice.len() >= HEADER_SIZE + size);

        let (message_slice, rest) = slice.split_at_mut(HEADER_SIZE + size);
        self.bytes = rest;
        Some(MessageMut {
            bytes: message_slice,
        })
    }
}

/// Serialized log message set.
///
/// The bytes must be serialized in the format defined by `Message`.
pub trait MessageSet {
    /// Bytes that make up the serialized message set.
    fn bytes(&self) -> &[u8];

    /// Iterator on the messages in the message set.
    fn iter(&self) -> MessageIter {
        MessageIter {
            bytes: self.bytes(),
        }
    }

    /// Number of messages in the message set.
    fn len(&self) -> usize {
        self.iter().count()
    }

    /// Indicator of whether there are messages within the `MessageSet`.
    fn is_empty(&self) -> bool {
        self.bytes().is_empty()
    }

    /// Verifies the hashes of all the messages, returning the
    /// index of a corrupt message when found.
    fn verify_hashes(&self) -> Result<(), usize> {
        for (i, msg) in self.iter().enumerate() {
            if !msg.verify_hash() {
                return Err(i);
            }
        }
        Ok(())
    }
}

/// Message set that can be mutated.
///
/// The mutation occurs once the `MessageSet` has been appended to the log. The
/// messages will contain the absolute offsets after the append opperation.
pub trait MessageSetMut: MessageSet {
    /// Bytes of the buffer for mutation.
    fn bytes_mut(&mut self) -> &mut [u8];

    /// Mutable iterator
    fn iter_mut(&mut self) -> MessageMutIter {
        MessageMutIter {
            bytes: self.bytes_mut(),
        }
    }
}

/// Mutable message buffer.
///
/// The buffer will handle the serialization of the message into the proper
/// format expected by the `CommitLog`.
#[derive(Default)]
pub struct MessageBuf {
    bytes: Vec<u8>,
    len: usize,
}

impl MessageSet for MessageBuf {
    /// Bytes that make up the serialized message set.
    fn bytes(&self) -> &[u8] {
        &self.bytes
    }

    /// Number of messages in the message set.
    fn len(&self) -> usize {
        self.len
    }
}

impl MessageSetMut for MessageBuf {
    fn bytes_mut(&mut self) -> &mut [u8] {
        &mut self.bytes
    }
}

impl<R: AsRef<[u8]>> FromIterator<R> for MessageBuf {
    fn from_iter<T>(iter: T) -> MessageBuf
    where
        T: IntoIterator<Item = R>,
    {
        let mut buf = MessageBuf::default();
        for v in iter.into_iter() {
            buf.push(v)
                .expect("Total size of messages exceeds usize::MAX");
        }
        buf
    }
}

impl MessageBuf {
    /// Creates a message buffer from a previously serialized vector of bytes.
    /// Integrity checking is performed on the vector to ensure that it was
    /// properly serialized.
    pub fn from_bytes(bytes: Vec<u8>) -> Result<MessageBuf, MessageError> {
        let mut msgs = 0usize;

        // iterate over the bytes to initialize size and ensure we have
        // a properly formed message set
        {
            let mut bytes = bytes.as_slice();
            while !bytes.is_empty() {
                // check that the offset, size and hash are present
                if bytes.len() < HEADER_SIZE {
                    return Err(MessageError::InvalidPayloadLength);
                }

                let size = read_header!(size, bytes) as usize;
                let hash = read_header!(hash, bytes);

                let next_msg_offset = HEADER_SIZE + size;
                if bytes.len() < next_msg_offset {
                    return Err(MessageError::InvalidPayloadLength);
                }

                // check the hash
                let payload_hash = crc32c(&bytes[HEADER_SIZE..next_msg_offset]);
                if payload_hash != hash {
                    return Err(MessageError::InvalidHash);
                }

                // update metadata
                msgs += 1;

                // move the slice along
                bytes = &bytes[next_msg_offset..];
            }
        }
        Ok(MessageBuf { bytes, len: msgs })
    }

    /// Clears the message buffer.
    pub fn clear(&mut self) {
        self.bytes.clear();
        self.len = 0;
    }

    /// Clears the message buffer without dropping the contents.
    ///
    /// # Safety
    /// The bytes within the message buffer will remain. Implementations that
    /// wish to clear the buffer for security reasons should use `clear()`.
    pub unsafe fn unsafe_clear(&mut self) {
        self.bytes.set_len(0);
        self.len = 0;
    }

    /// Moves the underlying serialized bytes into a vector.
    pub fn into_bytes(self) -> Vec<u8> {
        self.bytes
    }

    /// Adds a new message to the buffer.
    pub fn push<B: AsRef<[u8]>>(&mut self, payload: B) -> Result<(), MessageSerializationError> {
        // blank offset, expect the log to set the offsets
        // empty metadata
        let meta = [0u8; 0];
        serialize(&mut self.bytes, 0u64, &meta, payload)?;
        self.len += 1;
        Ok(())
    }

    /// Adds a new message with metadata.
    pub fn push_with_metadata<M: AsRef<[u8]>, B: AsRef<[u8]>>(
        &mut self,
        metadata: M,
        payload: B,
    ) -> Result<(), MessageSerializationError> {
        // blank offset, expect the log to set the offsets
        // empty metadata
        serialize(&mut self.bytes, 0u64, metadata, payload)?;
        self.len += 1;
        Ok(())
    }

    /// Reads a single message. The reader is expected to have a full message
    /// serialized.
    pub fn read<R: Read>(&mut self, reader: &mut R) -> Result<(), MessageError> {
        let mut buf = [0; HEADER_SIZE];
        read_n!(reader, buf, HEADER_SIZE, "Unable to read header");

        let size = read_header!(size, buf) as usize;
        let hash = read_header!(hash, buf);

        let mut bytes = vec![0; size];
        read_n!(reader, bytes, size);

        let payload_hash = crc32c(&bytes);
        if payload_hash != hash {
            return Err(MessageError::InvalidHash);
        }

        self.bytes.extend_from_slice(&buf);
        self.bytes.extend(bytes);

        self.len += 1;

        Ok(())
    }
}

/// Mutates the buffer with starting offset
pub fn set_offsets<S: MessageSetMut>(msg_set: &mut S, starting_offset: u64) {
    let mut offset = starting_offset;

    for mut msg in msg_set.iter_mut() {
        msg.set_offset(offset);
        offset += 1;
    }
}

#[cfg(test)]
mod tests {
    use super::*;
    use env_logger;
    use std::io;

    #[test]
    fn message_construction() {
        env_logger::try_init().unwrap_or(());
        let mut msg_buf = MessageBuf::default();
        msg_buf.push("123456789").unwrap();
        msg_buf.push("000000000").unwrap();

        set_offsets(&mut msg_buf, 100);

        let mut msg_it = msg_buf.iter();
        {
            let msg = msg_it.next().unwrap();
            assert_eq!(msg.payload(), b"123456789");
            assert_eq!(msg.hash(), 3808858755);
            assert_eq!(msg.size(), 9u32);
            assert_eq!(msg.offset(), 100);
            assert!(msg.verify_hash());
        }
        {
            let msg = msg_it.next().unwrap();
            assert_eq!(msg.payload(), b"000000000");
            assert_eq!(msg.hash(), 49759193);
            assert_eq!(msg.size(), 9u32);
            assert_eq!(msg.offset(), 101);
            assert!(msg.verify_hash());
        }

        assert!(msg_it.next().is_none());
    }

    #[test]
    fn message_read() {
        let mut buf = Vec::new();
        serialize(&mut buf, 120, b"", b"123456789").unwrap();
        let mut buf_reader = io::BufReader::new(buf.as_slice());

        let mut reader = MessageBuf::default();
        let read_msg_result = reader.read(&mut buf_reader);
        assert!(read_msg_result.is_ok(), "result = {:?}", read_msg_result);

        let read_msg = reader.iter().next().unwrap();
        assert_eq!(read_msg.payload(), b"123456789");
        assert_eq!(read_msg.size(), 9u32);
        assert_eq!(read_msg.offset(), 120);
    }

    #[test]
    fn message_construction_with_metadata() {
        let mut buf = Vec::new();
        serialize(&mut buf, 120, b"123", b"456789").unwrap();
        let res = MessageBuf::from_bytes(buf).unwrap();
        let msg = res.iter().next().unwrap();
        assert_eq!(b"123", msg.metadata());
        assert_eq!(b"456789", msg.payload());
    }

    #[test]
    fn message_buf_push_with_meta() {
        let mut buf = MessageBuf::default();
        buf.push_with_metadata(b"123", b"456789").unwrap();
        let msg = buf.iter().next().unwrap();
        assert_eq!(b"123", msg.metadata());
        assert_eq!(b"456789", msg.payload());
    }

    #[test]
    fn message_read_invalid_hash() {
        let mut buf = Vec::new();
        serialize(&mut buf, 120, b"", b"123456789").unwrap();
        // mess with the payload such that the hash does not match
        let last_ind = buf.len() - 1;
        buf[last_ind] ^= buf[last_ind] + 1;
        let mut buf_reader = io::BufReader::new(buf.as_slice());

        let mut reader = MessageBuf::default();
        let read_msg_result = reader.read(&mut buf_reader);
        let matches_invalid_hash = match read_msg_result {
            Err(MessageError::InvalidHash) => true,
            _ => false,
        };
        assert!(
            matches_invalid_hash,
            "Invalid result, not Hash error. Result = {:?}",
            read_msg_result
        );
    }

    #[test]
    fn message_read_invalid_payload_length() {
        let mut buf = Vec::new();
        serialize(&mut buf, 120, b"", b"123456789").unwrap();
        // pop the last byte
        buf.pop();

        let mut buf_reader = io::BufReader::new(buf.as_slice());
        let mut msg_reader = MessageBuf::default();
        let read_msg_result = msg_reader.read(&mut buf_reader);
        let matches_invalid_hash = match read_msg_result {
            Err(MessageError::InvalidPayloadLength) => true,
            _ => false,
        };
        assert!(
            matches_invalid_hash,
            "Invalid result, not Hasherror. Result = {:?}",
            read_msg_result
        );
    }

    #[test]
    pub fn messagebuf_fromiterator() {
        let buf = vec!["test", "123"].iter().collect::<MessageBuf>();
        assert_eq!(2, buf.len());
    }

    #[test]
    pub fn messageset_deserialize() {
        let bytes = {
            let mut buf = MessageBuf::default();
            buf.push("foo").unwrap();
            buf.push("bar").unwrap();
            buf.push("baz").unwrap();
            set_offsets(&mut buf, 10);
            buf.into_bytes()
        };

        let bytes_copy = bytes;

        // deserialize it
        let res = MessageBuf::from_bytes(bytes_copy);
        assert!(res.is_ok());
        let res = res.unwrap();
        assert_eq!(3, res.len());

        let mut it = res.iter();

        {
            let m0 = it.next().unwrap();
            assert_eq!(10, m0.offset());
            assert_eq!(b"foo", m0.payload());
        }

        {
            let m1 = it.next().unwrap();
            assert_eq!(11, m1.offset());
            assert_eq!(b"bar", m1.payload());
        }

        {
            let m2 = it.next().unwrap();
            assert_eq!(12, m2.offset());
            assert_eq!(b"baz", m2.payload());
        }

        let n = it.next();
        assert!(n.is_none());
    }
}


text:
import pyramid_dogpile_cache2
import pytest

@pytest.fixture
def empty_config(request):
    request.addfinalizer(pyramid_dogpile_cache2.CACHE_REGIONS.clear)


text:
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Entity;
using System.Data.Entity.Validation;
using System.Linq;
using System.Net;
using System.Web;
using System.Web.Mvc;
using WebApplication13.Models;

using System.Data.Entity.Core.Objects;

namespace WebApplication13.Controllers
{
    [Authorize]
    public class JobsController : Controller
    {
        private nextdhoomEntities db = new nextdhoomEntities();

        // GET: /Jobs/
        public ActionResult Index(int? page, jobsbyPaging jp)
        {
            int currentPageIndex = page.HasValue ? page.Value : 1;
            string criteria = "";

            criteria = "joblistn.isApproved = 'Y' ";

            System.Data.Entity.Core.Objects.ObjectParameter Count = new System.Data.Entity.Core.Objects.ObjectParameter("Count", typeof(int));
            // output = 0;

            jp.data = db.jobbySearchnpage(currentPageIndex, defaultPageSize, criteria, Count).ToList();

            jp.pagesize = defaultPageSize;

            jp.TotalCount = Convert.ToInt64(Count.Value);

            return View(jp);

        }

        // GET: /Jobs/Details/5
        public ActionResult Details(long? id)
        {
            if (id == null)
            {
                return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
            }
            joblistn joblistn = db.joblistns.Find(id);
            if (joblistn == null)
            {
                return HttpNotFound();
            }
            return View(joblistn);
        }

        // GET: /Jobs/Create
        public ActionResult Create()
        {
            ViewBag.cityid = new SelectList(db.citytables, "cityid", "cityname");
            ViewBag.jobcategoryid = new SelectList(db.jobcategories, "jobcategoryid", "category");
            //ViewBag.memsid = new SelectList(db.Mems, "memsid", "fname");
            ViewBag.stateid = new SelectList(db.states, "stateid", "statename");
            ViewBag.countryid = new SelectList(db.Countries, "COUNTRYID", "countryname");
            return View();
        }

        public ActionResult ManageJobs(int? page, jobsbyPaging jp)
        {
            int currentPageIndex = page.HasValue ? page.Value : 1;
            string criteria = "";
            long id;
            id = Convert.ToInt32(Request.Cookies["memsid"].Value);
            criteria = "joblistn.isApproved = 'Y' And   joblistn.memsid="+id  ;

            System.Data.Entity.Core.Objects.ObjectParameter Count = new System.Data.Entity.Core.Objects.ObjectParameter("Count", typeof(int));
            // output = 0;

            jp.data = db.jobbySearchnpage(currentPageIndex, defaultPageSize, criteria, Count).ToList();

            jp.pagesize = defaultPageSize;

            jp.TotalCount = Convert.ToInt64(Count.Value);

            return View(jp);

          }

        // POST: /Jobs/Create
        // To protect from overposting attacks, please enable the specific properties you want to bind to, for
        // more details see http://go.microsoft.com/fwlink/?LinkId=317598.
        [HttpPost]
        [ValidateAntiForgeryToken]
        public ActionResult Create([Bind(Include = "Jobid,memsid,jobcategoryid,sysentrydate,designation,jobdescription,minexp,maxexp,salary,countryid,stateid,cityid,contact,telephone,email,website")] joblistn joblistn)
        {
            joblistn jb = new joblistn();

            long kk;
            if (ModelState.IsValid)
            {
                try
                {
                    //joblistn.jobdescription=joblistn.jobdescription.Replace()
                    long memid = Convert.ToInt64(Request.Cookies["memsid"].Value);

                    joblistn.sysentrydate = System.DateTime.Now;
                    var cnt = db.joblistns.Where(c => c.memsid == memid && c.isApproved == "Y").Count();

                    if (cnt > 10)
                    {
                        joblistn.isApproved = "Y";
                    }
                    else
                    { joblistn.isApproved = "N"; }

                    db.joblistns.Add(joblistn);
                    db.SaveChanges();
                    kk = joblistn.Jobid;

                    ModelState.Clear();
                    ViewBag.success = true;
                    ViewBag.Message = "Job Posted Successfully";

                    //return RedirectToAction("Index");
                }
                catch (DbEntityValidationException ex)
                {
                    // Retrieve the error messages as a list of strings.
                    var errorMessages = ex.EntityValidationErrors
                            .SelectMany(x => x.ValidationErrors)
                            .Select(x => x.ErrorMessage);

                    // Join the list to a single string.
                    var fullErrorMessage = string.Join("; ", errorMessages);

                    // Combine the original exception message with the new one.
                    var exceptionMessage = string.Concat(ex.Message, " The validation errors are: ", fullErrorMessage);

                    // Throw a new DbEntityValidationException with the improved exception message.
                    throw new DbEntityValidationException(exceptionMessage, ex.EntityValidationErrors);
                    ViewBag.success = false;
                    ViewBag.Message = "Unable to post job";
                    return View(joblistn);
                }
            }
            else
            {
                ViewBag.success = false;
                ViewBag.Message = "Unable to post job";
                ViewBag.jobcategoryid = new SelectList(db.jobcategories, "jobcategoryid", "category", joblistn.jobcategoryid);
                //ViewBag.memsid = new SelectList(db.Mems, "memsid", "fname", joblistn.memsid);

                ViewBag.countryid = new SelectList(db.Countries, "COUNTRYID", "countryname", joblistn.countryid);
                ViewBag.stateid = new SelectList(db.states, "stateid", "statename", joblistn.stateid);
                ViewBag.cityid = new SelectList(db.citytables, "cityid", "cityname", joblistn.cityid);
                return View(joblistn);
            }

            //ViewBag.jobcategoryid = new SelectList(db.jobcategories, "jobcategoryid", "category", joblistn.jobcategoryid);
            ////ViewBag.memsid = new SelectList(db.Mems, "memsid", "fname", joblistn.memsid);

            //ViewBag.countryid = new SelectList(db.Countries, "COUNTRYID", "countryname", joblistn.countryid);
            //ViewBag.stateid = new SelectList(db.states, "stateid", "statename", joblistn.stateid);
            //ViewBag.cityid = new SelectList(db.citytables, "cityid", "cityname", joblistn.cityid);
            //return View(jb);

            return RedirectToAction("Details", "Jobs", new {id=kk });

        }

        // GET: /Jobs/Edit/5
        public ActionResult Edit(long? id)
        {
            if (id == null)
            {
                return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
            }
            joblistn joblistn = db.joblistns.Find(id);
            if (joblistn == null)
            {
                return HttpNotFound();
            }
            ViewBag.cityid = new SelectList(db.citytables, "cityid", "cityname", joblistn.cityid);
            ViewBag.jobcategoryid = new SelectList(db.jobcategories, "jobcategoryid", "category", joblistn.jobcategoryid);
            // ViewBag.memsid = new SelectList(db.Mems, "memsid", "fname", joblistn.memsid);
            ViewBag.stateid = new SelectList(db.states, "stateid", "statename", joblistn.stateid);
            ViewBag.countryid = new SelectList(db.Countries, "COUNTRYID", "countryname", joblistn.countryid);
            joblistn.memsid = Convert.ToInt64(Request.Cookies["memsid"].Value);
            return View(joblistn);
        }

        // POST: /Jobs/Edit/5
        // To protect from overposting attacks, please enable the specific properties you want to bind to, for
        // more details see http://go.microsoft.com/fwlink/?LinkId=317598.
        [HttpPost]
        [ValidateAntiForgeryToken]
        public ActionResult Edit([Bind(Include = "Jobid,memsid,jobcategoryid,sysentrydate,designation,jobdescription,minexp,maxexp,salary,countryid,stateid,cityid,contact,telephone,email,website")] joblistn joblistn)
        {
            if (ModelState.IsValid)
            {
                string app = db.joblistns.Where(c => c.Jobid == joblistn.Jobid).Select(c => c.isApproved).FirstOrDefault();
                joblistn.isApproved = app;
                db.Entry(joblistn).State = System.Data.Entity.EntityState.Modified;
                db.SaveChanges();
                return RedirectToAction("Index");
            }
            ViewBag.cityid = new SelectList(db.citytables, "cityid", "cityname", joblistn.cityid);
            ViewBag.jobcategoryid = new SelectList(db.jobcategories, "jobcategoryid", "category", joblistn.jobcategoryid);
            ViewBag.memsid = new SelectList(db.Mems, "memsid", "fname", joblistn.memsid);
            ViewBag.stateid = new SelectList(db.states, "stateid", "statename", joblistn.stateid);
            ViewBag.countryid = new SelectList(db.Countries, "COUNTRYID", "countryname", joblistn.countryid);
            return View(joblistn);
        }

        // GET: /Jobs/Delete/5
        public ActionResult Delete(long? id)
        {
            if (id == null)
            {
                return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
            }
            joblistn joblistn = db.joblistns.Find(id);
            if (joblistn == null)
            {
                return HttpNotFound();
            }
            return View(joblistn);
        }

        // POST: /Jobs/Delete/5
        [HttpPost, ActionName("Delete")]
        [ValidateAntiForgeryToken]
        public ActionResult DeleteConfirmed(long id)
        {
            joblistn joblistn = db.joblistns.Find(id);
            db.joblistns.Remove(joblistn);
            db.SaveChanges();
            return RedirectToAction("ManageJobs");
        }

        private const int defaultPageSize = 10;
        public ActionResult SearchJobs(int? page, jobsbyPaging jp)
        {
            int currentPageIndex = page.HasValue ? page.Value : 1;
            string criteria = "";
            string country = "";
            string city = "";
            string state = "";
            string category = "";

            if (jp.countryid > 0)
            {
                country = " AND joblistn.countryid=" + jp.countryid;
            }
            if (jp.stateid > 0)
            {
                state = " AND joblistn.stateid=" + jp.stateid;
            }
            if (jp.cityid > 0)
            {
                city = " AND joblistn.cityid=" + jp.cityid;
            }
            if (jp.jobcategoryid > 0)
            {
                category = " AND joblistn.jobcategoryid=" + jp.jobcategoryid;
            }

            criteria = "joblistn.isApproved = 'Y'  " + city + country + state + category ;

            System.Data.Entity.Core.Objects.ObjectParameter Count = new System.Data.Entity.Core.Objects.ObjectParameter("Count", typeof(int));
            // output = 0;

            jp.data = db.jobbySearchnpage(currentPageIndex, defaultPageSize, criteria, Count).ToList();

            jp.pagesize = defaultPageSize;

            jp.TotalCount = Convert.ToInt64(Count.Value);

            // members = mm.OrderByDescending(p => p.pid).ToPagedList(currentPageIndex, defaultPageSize);

            ViewBag.cityid = new SelectList(db.citytables, "cityid", "cityname", ViewData["cityid"]);
            ViewBag.countryid = new SelectList(db.Countries, "COUNTRYID", "countryname", ViewData["countryid"]);
            ViewBag.stateid = new SelectList(db.states, "stateid", "statename", ViewData["stateid"]);
            ViewBag.jobcategoryid = new SelectList(db.jobcategories, "jobcategoryid", "category");

            return View(jp);

        }

        public ActionResult Sharethisjob()
        {

            return View();
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                db.Dispose();
            }
            base.Dispose(disposing);
        }
    }

}


text:
<?php
declare(strict_types=1);

namespace CosmonovaRnD\CasparCG\Command\Mixer\Builder;

use CosmonovaRnD\CasparCG\Command\Basic\Builder\BaseBuilder;
use CosmonovaRnD\CasparCG\Command\Tween;
use CosmonovaRnD\CasparCG\Exception\ParamException;

/**
 * Class SaturationBuilder
 *
 * @author  Aleksandr Besedin <bs@cosmonova.net>
 * @package CosmonovaRnD\CasparCG\Command\Mixer\Builder
 * Cosmonova | Research & Development
 *
 * @see     http://casparcg.com/wiki/CasparCG_2.0_AMCP_Protocol#MIXER_SATURATION
 */
class SaturationBuilder extends BaseBuilder
{
    /** @var float */
    protected $saturation;
    /** @var int */
    protected $duration = 0;
    /** @var string */
    protected $animation = 'linear';

    /**
     * Set saturation value
     *
     * @param float $value Brightness value (from 0 to 1)
     *
     * @return SaturationBuilder
     * @throws ParamException
     */
    public function saturation(float $value): SaturationBuilder
    {
        if ($value < 0 || $value > 1) {
            throw new ParamException('Saturation value must be in range from 0 to 1');
        }

        $this->saturation = $value;

        return $this;
    }

    /**
     * Set animation duration
     *
     * @param int $value
     *
     * @return SaturationBuilder
     * @throws ParamException
     */
    public function duration(int $value): SaturationBuilder
    {
        if ($value < 0) {
            throw new ParamException('Value must be unsigned integer');
        }

        $this->duration = $value;

        return $this;
    }

    /**
     * Set animation type
     *
     * @param string $type
     *
     * @return SaturationBuilder
     * @throws ParamException
     */
    public function animation(string $type): SaturationBuilder
    {
        if (!in_array($type, Tween::animationTypes())) {
            throw new ParamException("Unsupported animation type `$type`");
        }

        $this->animation = $type;

        return $this;
    }

    /**
     * @inheritDoc
     */
    public function build(bool $legacy = false): string
    {
        $channelAndLayer = $this->buildChannel();

        if (null === $this->saturation) {
            throw new ParamException('Saturation is required');
        }

        return "MIXER $channelAndLayer SATURATION {$this->saturation} {$this->duration} {$this->animation}";
    }
}


text:
package org.apache.activemq.artemis.selector.filter;

import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import java.util.Map;
import java.util.Properties;

/**
 * Used to evaluate an XPath Expression in a JMS selector.
 */
public final class XPathExpression implements BooleanExpression {

   private final String xpath;
   private final XPathEvaluator evaluator;

   private static DocumentBuilder builder;

   public static XPathEvaluatorFactory XPATH_EVALUATOR_FACTORY = null;
   public static final String DOCUMENT_BUILDER_FACTORY_FEATURE_PREFIX = "org.apache.activemq.documentBuilderFactory.feature:";

   static {
      DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
      factory.setNamespaceAware(true);
      factory.setIgnoringElementContentWhitespace(true);
      factory.setIgnoringComments(true);

      try {
         factory.setFeature("http://xml.org/sax/features/external-general-entities", false);
         factory.setFeature("http://xml.org/sax/features/external-parameter-entities", false);
         factory.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true);

         // setup features from system properties (if any)
         setupFeatures(factory);
         builder = factory.newDocumentBuilder();
      } catch (ParserConfigurationException e) {
         throw new RuntimeException(e);
      }

      new JAXPXPathEvaluator("//root", builder).evaluate("<root></root>");
      try {
         XPATH_EVALUATOR_FACTORY = xpath -> new JAXPXPathEvaluator(xpath, builder);
      } catch (Throwable e) {
      }
   }

   public interface XPathEvaluatorFactory {
      XPathEvaluator create(String xpath);
   }

   public interface XPathEvaluator {
      boolean evaluate(Filterable message) throws FilterException;
   }

   XPathExpression(String xpath) {
      if (XPATH_EVALUATOR_FACTORY == null) {
         throw new IllegalArgumentException("XPATH support not enabled.");
      }
      this.xpath = xpath;
      this.evaluator = XPATH_EVALUATOR_FACTORY.create(xpath);
   }

   @Override
   public Object evaluate(Filterable message) throws FilterException {
      return evaluator.evaluate(message) ? Boolean.TRUE : Boolean.FALSE;
   }

   @Override
   public String toString() {
      return "XPATH " + ConstantExpression.encodeString(xpath);
   }

   /**
    * @param message
    * @return true if the expression evaluates to Boolean.TRUE.
    * @throws FilterException
    */
   @Override
   public boolean matches(Filterable message) throws FilterException {
      Object object = evaluate(message);
      return object == Boolean.TRUE;
   }

   protected static void setupFeatures(DocumentBuilderFactory factory) throws ParserConfigurationException {
      Properties properties = System.getProperties();
      for (Map.Entry<Object, Object> prop : properties.entrySet()) {
         String key = (String) prop.getKey();
         if (key.startsWith(DOCUMENT_BUILDER_FACTORY_FEATURE_PREFIX)) {
            Boolean value = Boolean.valueOf((String)prop.getValue());
            factory.setFeature(key.substring(DOCUMENT_BUILDER_FACTORY_FEATURE_PREFIX.length()), value);
         }
      }
   }
}


text:
extern "C" void __cxa_pure_virtual() {
    panic("Pure virtual function call!");
}

void *operator new(size_t size) {
    return malloc(size);
}

void *operator new[](size_t size) {
    return  malloc(size);
}

void operator delete(void *p) {
     free(p);
}

void operator delete[](void *p) {
     free(p);
}