text:
using System.Reflection;

namespace ChilliCream.FluentConsole
{
    internal sealed class ArgumentDefinition
    {
        public PropertyInfo Property { get; set; }
        public string Name { get; set; }
        public char? Key { get; set; }
        public int? Position { get; set; }
        public bool IsSelected { get; set; }
        public string Value { get; set; }
        public bool IsMandatory { get; set; }
    }
}


text:
package userpreferences

import (
	"net/http"

	"github.com/rancher/apiserver/pkg/types"
	"github.com/rancher/steve/pkg/stores/proxy"
	"k8s.io/apiserver/pkg/authentication/user"
	"k8s.io/apiserver/pkg/endpoints/request"
)

type UserPreference struct {
	Data map[string]string `json:"data"`
}

func Register(schemas *types.APISchemas, cg proxy.ClientGetter) {
	schemas.InternalSchemas.TypeName("userpreference", UserPreference{})
	schemas.MustImportAndCustomize(UserPreference{}, func(schema *types.APISchema) {
		schema.CollectionMethods = []string{http.MethodGet}
		schema.ResourceMethods = []string{http.MethodGet, http.MethodPut, http.MethodDelete}
		schema.Store = &rancherPrefStore{
			cg: cg,
		}
	})
}

func getUser(apiOp *types.APIRequest) (user.Info, bool) {
	return request.UserFrom(apiOp.Context())
}

redpajama_set_name: RedPajamaGithub


text:
using NConsole.Internal;
using NUnit.Framework;

namespace NConsole.Tests.Internal
{
    [TestFixture]
    public class ArgumentDescriptorTests
    {
        [Test]
        public void TestInitialValues()
        {
            ArgumentDescriptor descriptor = new ArgumentDescriptor();

            Assert.That(descriptor.ArgumentType, Is.Null);
            Assert.That(descriptor.ShortNames, Is.Not.Null);
            Assert.That(descriptor.LongNames, Is.Not.Null);
        }
    }
}


text:
package git4idea;

import com.google.common.base.Function;
import com.google.common.collect.Collections2;
import com.intellij.dvcs.test.MockVcsHelper;
import com.intellij.dvcs.test.MockVirtualFile;
import com.intellij.openapi.components.ServiceManager;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.openapi.vcs.FilePathImpl;
import com.intellij.openapi.vcs.changes.Change;
import com.intellij.openapi.vcs.changes.LocalChangeList;
import com.intellij.openapi.vcs.history.VcsRevisionNumber;
import com.intellij.openapi.vfs.newvfs.impl.NullVirtualFile;
import com.intellij.testFramework.vcs.MockChangeListManager;
import com.intellij.testFramework.vcs.MockContentRevision;
import com.intellij.util.containers.ContainerUtil;
import com.intellij.vcs.log.Hash;
import com.intellij.vcs.log.VcsFullCommitDetails;
import com.intellij.vcs.log.VcsLogObjectsFactory;
import com.intellij.vcs.log.impl.HashImpl;
import cucumber.annotation.en.And;
import cucumber.annotation.en.Given;
import cucumber.annotation.en.Then;
import cucumber.annotation.en.When;
import git4idea.cherrypick.GitCherryPicker;
import git4idea.config.GitVersionSpecialty;
import git4idea.log.GitContentRevisionFactory;

import java.util.*;

import static com.intellij.openapi.vcs.Executor.echo;
import static git4idea.GitCucumberWorld.*;
import static git4idea.test.GitExecutor.git;
import static junit.framework.Assert.assertEquals;
import static junit.framework.Assert.assertTrue;
import static org.junit.Assert.assertFalse;

/**
 * @author Kirill Likhodedov
 */

public class GitCherryPickStepdefs {

  @Given("^(enabled|disabled) auto-commit in the settings$")
  public void auto_commit_in_the_settings(String state) {
    boolean enabled = state.equals("enabled");
    myPlatformFacade.getSettings(myProject).setAutoCommitOnCherryPick(enabled);
  }

  @When("^I cherry-pick the commit (\\w+)$")
  public void I_cherry_pick_the_commit(String hash) {
    cherryPick(hash);
  }

  @When("^I cherry-pick commits (.+) and (\\w+)$")
  public void I_cherry_pick_commits(String severalCommits, String hash2) throws Throwable {

    String[] hashes = severalCommits.split(",");
    String[] allHashes = new String[hashes.length + 1];
    for (int i = 0; i < allHashes.length - 1; i++) {
      allHashes[i] = hashes[i].trim();
    }
    allHashes[allHashes.length - 1] = hash2;
    cherryPick(allHashes);
  }

  @When("^I cherry-pick the commit (\\w+) and( don't)? resolve conflicts$")
  public void I_cherry_pick_the_commit_and_resolve_conflicts(String hash, String negation) throws Throwable {
    if (negation == null) {
      resolveConflictsInFuture();
    }
    cherryPick(hash);
  }

  private static void resolveConflictsInFuture() {
    myVcsHelper.registerHandler(new MockVcsHelper.MergeHandler() {
      @Override
      public void showMergeDialog() {
        git("add -u .");
      }
    });
  }

  private static void commitInFuture(final int times) {
    myVcsHelper.registerHandler(new MockVcsHelper.CommitHandler() {

      private int myCommitRequests;

      @Override
      public boolean commit(String commitMessage) {
        if (myCommitRequests >= times) {
          return false;
        }
        myCommitRequests++;
        git(String.format("commit -am '%s'", commitMessage));
        return true;
      }
    });
  }

  private static void commitInFuture() {
    commitInFuture(Integer.MAX_VALUE);
  }

  @When("^I cherry-pick the commit (.+), resolve conflicts and( don't)? commit$")
  public void I_cherry_pick_the_commit_resolve_conflicts_and_commit(String hash, String negation) throws Throwable {
    resolveConflictsInFuture();
    if (negation == null) {
      commitInFuture();
    }
    cherryPick(hash);
  }

  @When("^I cherry-pick the commit (\\w+) and( don't)? commit$")
  public void I_cherry_pick_the_commit_hash_and_commit(String hash, String negation) throws Throwable {
    if (negation == null) {
      commitInFuture();
    }
    cherryPick(hash);
  }

  @When("^I cherry-pick commits (.+) and commit both of them$")
  public void I_cherry_pick_commits_and_commit_both_of_them(String listOfHashes) throws Throwable {
    commitInFuture();
    cherryPick(GeneralStepdefs.splitByComma(listOfHashes));
  }

  @When("^I cherry-pick commits (.+), but commit only the first one$")
  public void I_cherry_pick_commits_but_commit_only_the_first_one(String listOfHashes) throws Throwable {
    commitInFuture(1);
    cherryPick(GeneralStepdefs.splitByComma(listOfHashes));
  }

  @Then("^the last commit is$")
  public void the_last_commit_is(String message) throws Throwable {
    git_log_should_return(1, message);
  }

  @Then("^the last commit is (.+)$")
  public void the_last_commit_is_hash(String hash) throws Throwable {
    assertEquals("The last commit hash doesn't match", virtualCommits.replaceVirtualHashes(hash), git("log -1 --pretty=%h"));
  }

  @Then("^`git log -(\\d+)` should return$")
  public void git_log_should_return(int commitNum, String messages) throws Throwable {
    List<String> expectedMessages = Arrays.asList(messages.split("-----"));

    final String RECORD_SEPARATOR = "@";
    boolean fullBody = GitVersionSpecialty.STARTED_USING_RAW_BODY_IN_FORMAT.existsIn(myVcs.getVersion());
    String data= fullBody ? "%B" : "%s%b";
    String output = git("log -%s --pretty=%s%s", String.valueOf(commitNum), data, RECORD_SEPARATOR);
    List<String> actualMessages = Arrays.asList(output.split(RECORD_SEPARATOR));

    for (int i = 0; i < expectedMessages.size(); i++) {
      String expectedMessage = StringUtil.convertLineSeparators(expectedMessages.get(i).trim());
      String actualMessage = StringUtil.convertLineSeparators(actualMessages.get(i).trim());
      if (!fullBody) {
        // the subject (%s) somehow contains both "fix #1" and "cherry-picked from <hash>" in a single line
        // which is probably Git misbehavior, so let's compare without taking line breaks and spaces into consideration
        expectedMessage = expectedMessage.replace("\n", "").replace(" ", "");
        actualMessage = actualMessage.replace("\n", "").replace(" ", "");
      }
      expectedMessage = virtualCommits.replaceVirtualHashes(expectedMessage);
      assertEquals("Commit doesn't match", expectedMessage, trimHash(actualMessage));
    }
  }

  @And("^no new changelists are created$")
  public void no_new_changelists_are_created() {
    assertOnlyDefaultChangelist();
  }

  @Given("^(.+) is locally modified:$")
  public void is_locally_modified(String filename, String content) {
    echo(filename, content);
  }

  String trimHash(String commitMessage) {
    return commitMessage.replaceAll("([a-fA-F0-9]{7})[a-fA-F0-9]{33}", "$1");
  }

  @Then("^nothing is committed$")
  public void nothing_is_committed() throws Throwable {
    working_tree_is_dirty();
  }

  @And("^working tree is dirty$")
  public void working_tree_is_dirty() throws Throwable {
    assertFalse("Working tree is unexpectedly clean", git("diff").trim().isEmpty() && git("diff --cached").trim().isEmpty());
  }

  @Then("^merge dialog should be shown$")
  public void merge_dialog_should_be_shown() throws Throwable {
    assertTrue("Merge dialog was not shown", myVcsHelper.mergeDialogWasShown());
  }

  @Then("^commit dialog should be shown$")
  public void commit_dialog_should_be_shown() throws Throwable {
    assertTrue("Commit dialog was not shown", myVcsHelper.commitDialogWasShown());
  }

  @Then("^active changelist is '(.+)'$")
  public void active_changelist_is(String name) throws Throwable {
    assertActiveChangeList(virtualCommits.replaceVirtualHashes(name));
  }

  private static void assertOnlyDefaultChangelist() {
    String DEFAULT = MockChangeListManager.DEFAULT_CHANGE_LIST_NAME;
    assertChangeLists(Collections.singleton(DEFAULT), DEFAULT);
  }

  private static void assertChangeLists(Collection<String> changeLists, String activeChangelist) {
    List<LocalChangeList> lists = myChangeListManager.getChangeLists();
    Collection<String> listNames = Collections2.transform(lists, new Function<LocalChangeList, String>() {
      @Override
      public String apply(LocalChangeList input) {
        return input.getName();
      }
    });
    assertEquals("Change lists are different", new ArrayList<String>(changeLists), new ArrayList<String>(listNames));
    assertActiveChangeList(activeChangelist);
  }

  private static void assertActiveChangeList(String name) {
    assertEquals("Wrong active changelist", name, myChangeListManager.getDefaultChangeList().getName());
  }

  private static void cherryPick(List<String> virtualHashes) {
    List<VcsFullCommitDetails> commits = ContainerUtil.newArrayList();
    for (String virtualHash : virtualHashes) {
      commits.add(createMockCommit(virtualHash));
    }
    new GitCherryPicker(myProject, myGit, myPlatformFacade, mySettings.isAutoCommitOnCherryPick())
      .cherryPick(Collections.singletonMap(myRepository, commits));
  }

  private static void cherryPick(String... virtualHashes) {
    cherryPick(Arrays.asList(virtualHashes));
  }

  private static VcsFullCommitDetails createMockCommit(String virtualHash) {
    CommitDetails realCommit = virtualCommits.getRealCommit(virtualHash);
    return mockCommit(realCommit.getHash(), realCommit.getMessage());
  }

  private static VcsFullCommitDetails mockCommit(String hash, String message) {
    List<Change> changes = new ArrayList<Change>();
    changes.add(new Change(null, new MockContentRevision(new FilePathImpl(new MockVirtualFile("name")), VcsRevisionNumber.NULL)));
    return ServiceManager.getService(myProject, VcsLogObjectsFactory.class).createFullDetails(
      HashImpl.build(hash), Collections.<Hash>emptyList(), 0, NullVirtualFile.INSTANCE, message, "John Smith", "john@mail.com", message,
      "John Smith", "john@mail.com", 0, changes, GitContentRevisionFactory.getInstance(myProject));
  }

}


text:
package dev.mikoto2000.study.vertx.mqtt;

import java.time.LocalDateTime;

import io.netty.handler.codec.mqtt.MqttQoS;
import io.vertx.core.AbstractVerticle;
import io.vertx.core.Promise;
import io.vertx.core.buffer.Buffer;
import io.vertx.mqtt.MqttClient;

public class MainVerticle extends AbstractVerticle {

  @Override
  public void start(Promise<Void> startPromise) throws Exception {
    MqttClient client = MqttClient.create(vertx);

    client.connect(1883, "localhost", s -> {
        System.out.println("connected localhost:1883.");

    client.publishHandler(topic -> {
        System.out.println(String.format("{ topic: %s, payload: %s }", topic.topicName(), topic.payload().toString()));
    }).subscribe("temperature", 2);

    vertx.setPeriodic(1000, id -> {
      client.publish("temperature",
        Buffer.buffer(LocalDateTime.now().toString()),
        MqttQoS.AT_LEAST_ONCE,
        false,
        false);
      });
    });
  }
}


text:
using System;
using System.IO;
using Starcounter;

namespace UniformDocs.ViewModels.HowTo
{
    partial class FileUploadPage : Json
    {
        protected override void OnData()
        {
            base.OnData();

            this.SessionId = Session.Current.SessionId;
        }

        public string GetFileSizeString(long inputSize)
        {
            string[] sizes = { "Bytes", "KB", "MB", "GB", "TB" };

            if (inputSize == 0)
            {
                return "0 Byte";
            }

            int i = (int)(Math.Floor(Math.Log(inputSize) / Math.Log(1024)));
            string size = Math.Round(inputSize / Math.Pow(1024, i), 2) + " " + sizes[i];

            return size;
        }

        [FileUploadPage_json.Files]
        partial class FileUploadFilePage : Json
        {
            static FileUploadFilePage()
            {
                DefaultTemplate.FileSizeString.Bind = nameof(FileSizeStringBind);
            }

            public FileUploadPage ParentPage => this.Parent.Parent as FileUploadPage;

            public string FileSizeStringBind => this.ParentPage.GetFileSizeString(this.FileSize);

            void Handle(Input.DeleteTrigger action)
            {
                if (File.Exists(this.FilePath))
                {
                    File.Delete(this.FilePath);
                }

                this.ParentPage.Files.Remove(this);
            }
        }

        [FileUploadPage_json.Tasks]
        partial class FileUploadTaskPage : Json
        {
            static FileUploadTaskPage()
            {
                DefaultTemplate.FileSizeString.Bind = "FileSizeStringBind";
            }

            public FileUploadPage ParentPage => this.Parent.Parent as FileUploadPage;

            public string FileSizeStringBind => this.ParentPage.GetFileSizeString(this.FileSize);
        }
    }
}


text:
Social Security Number

			Enter the last four digits of the primary wage earner's OR other adult household member's Social Security Number.

		Primary Wage Earner/Adult Household Member

		<select class="form-control input-lg" />
			<option>asdfsaf</option>
		</select>

		Does he/she have a Social Security Number?

		  <input type="radio" name="inlineRadioOptions" id="inlineRadio1" value="option1"> Yes

		  <input type="radio" name="inlineRadioOptions" id="inlineRadio2" value="option2"> No

		Last 4 digits of Social Security Number

		<input type="text" class="form-control input-lg" />


text:
```csharp
 public void ConfigureServices(IServiceCollection services)
        {
            services.AddRazorPages();
            services.AddControllers(); //add this
        }

 app.UseEndpoints(endpoints =>
            {
                endpoints.MapRazorPages();
                endpoints.MapControllers(); // add this
            });
```


text:
bool General::cmdMode = false;

void General::outputMsg(std::string message, int msgType)
{
	HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
	switch (msgType)
	{
	case 1:
		SetConsoleTextAttribute(hConsole, 10);
		std::cout << message << std::endl;
		SetConsoleTextAttribute(hConsole, 7);
		break;
	case 2:
		SetConsoleTextAttribute(hConsole, FOREGROUND_RED | FOREGROUND_INTENSITY);
		std::cout << "[ERROR] " << message << std::endl;
		SetConsoleTextAttribute(hConsole, FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE);
		break;
	case 3:
		//SetConsoleTextAttribute(hConsole, FOREGROUND_INTENSITY);
		std::cout << message;
		//SetConsoleTextAttribute(hConsole, FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE);
		break;
	}
}

bool General::processParameter(std::string &command, std::string compCommand)
{
	std::string::size_type i = command.find(compCommand);
	if (i != std::string::npos)
	{
		command.erase(i, compCommand.length() + 1);
		return true;
	}
	else
		return false;
}


text:
#include <sync/barriers.h>
#include <arch/arch_mmu.h>
#include <util/bits.h>
#include <mm/mmu.h>
#include <mm/mem.h>
#include <mm/mm.h>
#include <types.h>
#include <errno.h>
#include <stdbool.h>

#define MMU_PG_SHIFT	12
#define MMU_PGD_SHIFT	20

#define DIV_MULT_MB 	20
#define DIV_MULT_PGTB	10
#define DIV_MULT_PG	12

/* keep track of kernel page tables */
static struct mm_resv_reg mmu_pg_tbs;

static int mmu_create_pgtb_entry(addr_t, addr_t, mmu_acc_flags_t, mmu_entry_type_t, bool);

/* require a lock on any access to the kernel regions */

/**
 * mmu_interface_enable
 *
 * enables the mmu interface.
 *
 * @pg_tbs	reserved region containing the kernel page tables
 * @return errno
 **/
int mmu_interface_enable(struct mm_resv_reg *pg_tbs) {
    int ret = ESUCC;

    if (pg_tbs != NULL) {
	memcpy(&mmu_pg_tbs, pg_tbs, sizeof(struct mm_resv_reg));
    } else {
	ret = EINVAL;
    }

    return ret;
}

/**
 * mmu_set_user_page_dir
 *
 * sets the user page directory to new, specified page directory.
 * @page_dir	new page directory
 * @return errno
 **/
int mmu_set_user_page_dir(addr_t page_dir) {
    return arch_mmu_set_user_pg_dir(page_dir);
}

/**
 * mmu_invalidate_page
 *
 * invalidates a page by removing the virtual->physical mapping.
 * @virt_addr	virtual address to invalidate
 * @return errno
 **/
int mmu_invalidate_page(addr_t virt_addr) {
    addr_t 		kvaddr 	= arch_mmu_get_kern_vaddr();
    mmu_acc_flags_t	acc;

    if (virt_addr >= kvaddr) {
	acc = KERNEL;
    } else {
	acc = USER;
    }

    return mmu_create_pgtb_entry(virt_addr, 0x0, acc, PG_TAB_INVAL, true);
}

/**
 * mmu_invalidate_region
 * invalidates a region of virtual memory by removing the virtual->physical mapping.
 *
 * @virt_addr	base of virtual region to invalidate
 * @pg_cnt	number of pages to invalidate in region
 * @return errno
 **/
int mmu_invalidate_region(addr_t virt_addr, int pg_cnt) {
    int 		ret 	= ESUCC;
    int			i	= 0;
    addr_t		kvaddr	= arch_mmu_get_kern_vaddr();
    mmu_acc_flags_t	acc;

    if (pg_cnt > 0) {
	while ((ret == ESUCC) && (i < pg_cnt)) {
	    if (virt_addr >= kvaddr) {
		acc = KERNEL;
	    } else {
		acc = USER;
	    }

	    ret = mmu_create_pgtb_entry(virt_addr, 0x0, acc, PG_TAB_INVAL, false);
	    virt_addr += PG_SZ;
	}

	/* if successful, invalidate */
	if (ret == ESUCC) {
	    /*
	     * ensure all data is written
	     * prior to invalidating the tlb
	     */
	    arch_dsb();

	    /* invalidate */
	    arch_mmu_invalidate();
	}
    } else {
	ret = EINVAL;
    }

    return ret;
}

/**
 * mmu_create_pgtb_entry
 *
 * creates a page table entry based on the specified parameters.
 *
 * @virt_addr	virtual address
 * @phy_addr	physical address
 * @acc_flags	access flags
 * @type	entry type
 * @invalidate	whether or not the tlb should be invalidated after write
 * @return errno
 **/
static int mmu_create_pgtb_entry(addr_t virt_addr, addr_t phy_addr, mmu_acc_flags_t acc_flags, mmu_entry_type_t type, bool invalidate) {
    int 		ret 	= ESUCC;
    struct mmu_entry	entry	= {
	.phy_addr	= phy_addr,
	.virt_addr	= virt_addr,
	.type		= type,
	.acc_flags	= acc_flags
    };

    ret = arch_mmu_create_entry(&entry);

    if ((ret == ESUCC) && invalidate) {
	arch_mmu_invalidate();
    }

    return ret;
}

/**
 * arch_mmu_create_new_entry
 *
 * creates a new mmu entry based on the parameters given in entry.
 * if entry->type == PG_DIR, pg_base should be the base address of the page directory.
 * if entry->type == PG_TAB, pg_base should be the base address of the continuous region
 * of page tables.
 * if entry->type == PG_TAB, this function must calculate where the page table of the entry
 * exists within the specified region.
 * this function is intended for new (unmapped) page tables & directories and must not be
 * used on the current mmu.
 *
 * @pg_base	base address of either page directory or page tables
 * @entry	entry to add
 * @return errno
 **/
extern bool arch_mmu_is_enabled(void);
extern addr_t virt_to_phy(addr_t virt_addr);
extern int arch_mmu_set_user_pg_dir(addr_t page_dir);
extern int arch_mmu_create_entry(struct mmu_entry *entry);
extern int arch_mmu_create_new_entry(addr_t pg_base, struct mmu_entry *entry);
extern void arch_mmu_invalidate(void);
extern size_t arch_mmu_get_user_pgtb_reg_sz(void);
extern size_t arch_mmu_get_kern_pgtb_reg_sz(void);
extern size_t arch_mmu_get_user_pgd_sz(void);
extern bool arch_mmu_user_pgd_requires_alignment(void);
extern unsigned int arch_mmu_get_user_pgd_alignment(void);
extern addr_t arch_mmu_get_kern_vaddr(void);

/* int mmu_map_page(addr_t virt_addr, addr_t phy_addr, mmu_acc_flags_t acc_flags) */
/* int mmu_map_region(addr_t virt_addr, addr_t *phy_pages, int pg_cnt, mmu_acc_flags_t acc_flags); */
/* int mmu_map_new_page(addr_t pgtb_base, addr_t virt_addr, addr_t phy_addr, mmc_acc_flags_t acc_flags) */
/* int mmu_map_new_region(addr_t pgtb_base, addr_t virt_addr, addr_t *phy_pages, int pg_cnt, mmu_acc_flags_t acc_flags) */
/* int mmu_create_new_user_pgd_pgtb(addr_t pg_dir, addr_t pg_tbs_base); */


text:
using System;
using System.Runtime.Serialization;

namespace SerializationInspections.Sample.Highlighting
{
    public class SimpleClass
    {
    }

    public struct SimpleStruct
    {
    }

    public interface ISimpleInterface
    {
    }

    public interface IInterfaceDerivedFromISerializable : ISerializable
    {
    }

    public delegate void SimpleDelegate();

    [Serializable]
    public delegate void SerializableDelegate();

    public enum SimpleEnum
    {
    }

    [Serializable]
    public enum SerializableEnum
    {
    }
}


text:
"""Mixture model using EM"""
from typing import Tuple
import numpy as np
from common import GaussianMixture
import math

from scipy.stats import multivariate_normal

def Gaussian(X, mu, var):
    return multivariate_normal.pdf(X, mean=mu, cov=np.eye(mu.shape[0])*var)

def estep(X: np.ndarray, mixture: GaussianMixture) -> Tuple[np.ndarray, float]:
    """E-step: Softly assigns each datapoint to a gaussian component

    Args:
        X: (n, d) array holding the data
        mixture: the current gaussian mixture

    Returns:
        np.ndarray: (n, K) array holding the soft counts
            for all components for all examples
        float: log-likelihood of the assignment
    """
    softcounts = np.empty((X.shape[0], mixture.mu.shape[0]))

    for k in range(mixture.mu.shape[0]):
        l = Gaussian(X, mixture.mu[k], mixture.var[k])
        softcounts[:,k] = mixture.p[k]*l

    denominator = np.sum(softcounts, axis=1)
    log_likelihood = np.sum(np.log(denominator))

    denominator = denominator.repeat(mixture.mu.shape[0]).reshape((X.shape[0], mixture.mu.shape[0]))
    return (softcounts/denominator, log_likelihood)

def mstep(X: np.ndarray, post: np.ndarray) -> GaussianMixture:
    """M-step: Updates the gaussian mixture by maximizing the log-likelihood
    of the weighted dataset

    Args:
        X: (n, d) array holding the data
        post: (n, K) array holding the soft counts
            for all components for all examples

    Returns:
        GaussianMixture: the new gaussian mixture
    """
    new_mus = np.empty((post.shape[1], X.shape[1]))
    new_vars = np.empty((post.shape[1], ))
    new_ps = np.empty((post.shape[1], ))

    denominator = np.sum(post, axis=0)

    for k in range(post.shape[1]):
        new_ps[k] = denominator[k] / X.shape[0]
        probs = np.repeat(post[:,k], X.shape[1]).reshape(post.shape[0], X.shape[1])
        new_mus[k,:] = np.sum(X*probs, axis=0) / denominator[k]
        x = np.sum((X-new_mus[k,:])**2*probs / denominator[k], axis=0)
        new_vars[k] = np.mean(x)

    return GaussianMixture(new_mus, new_vars, new_ps)

def run(X: np.ndarray, mixture: GaussianMixture,
        post: np.ndarray) -> Tuple[GaussianMixture, np.ndarray, float]:
    """Runs the mixture model

    Args:
        X: (n, d) array holding the data
        post: (n, K) array holding the soft counts
            for all components for all examples

    Returns:
        GaussianMixture: the new gaussian mixture
        np.ndarray: (n, K) array holding the soft counts
            for all components for all examples
        float: log-likelihood of the current assignment
    """
    #print(mixture)
    old_log_likelihood = None
    max_steps = 1000
    converged = False
    while((not converged) and (max_steps > 0)):
        post, new_log_likelihood = estep(X, mixture)
        mixture = mstep(X, post)

        if(old_log_likelihood == None):
            old_log_likelihood = new_log_likelihood
        else:
            diff = new_log_likelihood - old_log_likelihood
            margin = 1e-6 * np.abs(new_log_likelihood)
            #print(diff, margin)
            if(diff <= margin):
                converged = True

        old_log_likelihood = new_log_likelihood
        max_steps -= 1
    return mixture, post, old_log_likelihood


text:
package net.ymate.platform.persistence.jdbc.query;

import net.ymate.platform.commons.util.ExpressionUtils;
import net.ymate.platform.core.persistence.Fields;
import net.ymate.platform.core.persistence.IFunction;
import net.ymate.platform.core.persistence.Params;
import net.ymate.platform.persistence.jdbc.IDatabase;
import net.ymate.platform.persistence.jdbc.JDBC;
import org.apache.commons.lang3.StringUtils;

import java.util.List;

/**
 * 排序对象
 *
 * @author 刘镇 (suninformation@163.com) on 15/5/7 上午10:55
 */
public final class OrderBy extends Query<OrderBy> {

    private final StringBuilder orderByBuilder;

    // TODO 若OrderBy中存在参数值,当分页查询count记录数量时可能产生参数下标越界异常!!! 需要单独获取OrderBy中参数完成赋值。
    private final Params params;

    public static OrderBy create() {
        return create(JDBC.get());
    }

    public static OrderBy create(IDatabase owner) {
        return new OrderBy(owner, owner.getConfig().getDefaultDataSourceName());
    }

    public static OrderBy create(IDatabase owner, String dataSourceName) {
        return new OrderBy(owner, dataSourceName);
    }

    public static OrderBy create(Query<?> query) {
        return new OrderBy(query.owner(), query.dataSourceName());
    }

    public OrderBy(IDatabase owner, String dataSourceName) {
        super(owner, dataSourceName);
        orderByBuilder = new StringBuilder();
        params = Params.create();
    }

    public OrderBy orderBy(OrderBy orderBy) {
        if (orderBy != null) {
            String newOrderBy = StringUtils.substringAfter(orderBy.toSQL(), "ORDER BY ");
            if (StringUtils.isNotBlank(newOrderBy)) {
                if (orderByBuilder.length() > 0) {
                    orderByBuilder.append(LINE_END_FLAG);
                }
                orderByBuilder.append(newOrderBy);
                params.add(orderBy.params);
            }
        }
        return this;
    }

    public OrderBy asc(String prefix, Fields fields, boolean wrapIdentifier) {
        if (fields != null && !fields.isEmpty()) {
            fields.fields().forEach(field -> asc(prefix, field, wrapIdentifier));
        }
        return this;
    }

    public OrderBy asc(String prefix, Fields fields) {
        return asc(prefix, fields, true);
    }

    public OrderBy asc(Fields fields) {
        return asc(null, fields);
    }

    public OrderBy asc(Fields fields, boolean wrapIdentifier) {
        return asc(null, fields, wrapIdentifier);
    }

    public OrderBy asc(String field) {
        return asc(null, field, true);
    }

    public OrderBy asc(String field, boolean wrapIdentifier) {
        return asc(null, field, wrapIdentifier);
    }

    public OrderBy asc(String prefix, String field) {
        return asc(prefix, field, true);
    }

    public OrderBy asc(String prefix, String field, boolean wrapIdentifier) {
        if (orderByBuilder.length() > 0) {
            orderByBuilder.append(LINE_END_FLAG);
        }
        if (StringUtils.isNotBlank(prefix)) {
            orderByBuilder.append(prefix).append(".");
        }
        orderByBuilder.append(wrapIdentifier ? wrapIdentifierField(field) : field);
        return this;
    }

    public OrderBy asc(IFunction func) {
        return asc(null, func.build(), false).param(func.params());
    }

    // ------

    public OrderBy desc(String prefix, Fields fields, boolean wrapIdentifier) {
        if (fields != null && !fields.isEmpty()) {
            fields.fields().forEach(field -> desc(prefix, field, wrapIdentifier));
        }
        return this;
    }

    public OrderBy desc(String prefix, Fields fields) {
        return desc(prefix, fields, true);
    }

    public OrderBy desc(Fields fields) {
        return desc(null, fields, true);
    }

    public OrderBy desc(Fields fields, boolean wrapIdentifier) {
        return desc(null, fields, wrapIdentifier);
    }

    public OrderBy desc(String field) {
        return desc(null, field, true);
    }

    public OrderBy desc(String field, boolean wrapIdentifier) {
        return desc(null, field, wrapIdentifier);
    }

    public OrderBy desc(String prefix, String field) {
        return desc(prefix, field, true);
    }

    public OrderBy desc(String prefix, String field, boolean wrapIdentifier) {
        if (orderByBuilder.length() > 0) {
            orderByBuilder.append(LINE_END_FLAG);
        }
        if (StringUtils.isNotBlank(prefix)) {
            orderByBuilder.append(prefix).append(".");
        }
        orderByBuilder.append(wrapIdentifier ? wrapIdentifierField(field) : field).append(" DESC");
        return this;
    }

    public OrderBy desc(IFunction func) {
        return desc(null, func.build(), false).param(func.params());
    }

    // ------

    public Params params() {
        return params;
    }

    public OrderBy param(Object param) {
        params.add(param);
        return this;
    }

    public OrderBy param(Params params) {
        this.params.add(params);
        return this;
    }

    public boolean isEmpty() {
        return orderByBuilder.length() == 0;
    }

    // ------

    public String toSQL() {
        ExpressionUtils expression = ExpressionUtils.bind(getExpressionStr("${orderBy}"));
        if (queryHandler() != null) {
            queryHandler().beforeBuild(expression, this);
        }
        List<String> variables = expression.getVariables();
        if (orderByBuilder.length() > 0 && variables.contains("orderBy")) {
            expression.set("orderBy", String.format("ORDER BY %s", orderByBuilder));
        }
        if (queryHandler() != null) {
            queryHandler().afterBuild(expression, this);
        }
        return StringUtils.trimToEmpty(expression.clean().getResult());
    }

    @Override
    public String toString() {
        return toSQL();
    }
}


text:
package lab11;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.function.Function;
import java.util.function.Predicate;
import java.util.stream.Collectors;

public class NumbersLambda {

    // Find numbers with certain properties in a unified form
    // The property is specified in Predicate

    public static List<Integer> findNumbers
            (List<Integer> list, Predicate<Integer> predicate) {
        List<Integer> results = new ArrayList<>();
        for (int n : list) {
            if (predicate.test(n)) {
                results.add(n);
            }
        }
        return results;
    }

    public static List<Integer> calculateScore
            (List<Integer> list, Function<Integer, Integer> function) {
        return list.stream().map(function).collect(Collectors.toList());
    }

    public static Function<Integer, Integer> policy() {
        return s -> {
            int score = 0;
            if (isOdd().test(s)) score += 1;
            if (isPrime().test(s)) score += 2;
            if (isPalindrome().test(s)) score += 4;
            return score;
        };
    }

    public static Predicate<Integer> isOdd() {
        return x -> x % 2 != 0;
    }

    public static Predicate<Integer> isPrime() {
        return x -> {
            for (int i = 2; i < x; i++) {
                if (x % i == 0) {
                    return false;
                }
            }
            return true;
        };
    }

    public static Predicate<Integer> isPalindrome() {
        return x -> {
            int rev = 0, i = x;
            while (i != 0) {
                rev *= 10;
                rev += i % 10;
                i /= 10;
            }
            return rev == x;
        };
    }

    public static void main(String[] args) {
        List<Integer> numbers = Arrays.asList(480,514,484,389,709,935,328,
                 169,649,300,685,429,243,532,308,87,25,282,91,415);

        System.out.println("The odd numbers are : "
                + findNumbers(numbers, isOdd()));
        System.out.println("The prime numbers are : "
                + findNumbers(numbers, isPrime()));
        System.out.println("The palindrome numbers are : "
                + findNumbers(numbers, isPalindrome()));

        System.out.println("The score of the all numbers are :"
                + calculateScore(numbers, policy()));
    }
}


text:
<?php
 session_start();
 if(isset($_SESSION["userinfo"])){
        if($_SESSION["logintype"]=='owner'){
            header('location:ownerhome.php');
        }
        if($_SESSION["logintype"]=='user'){
             header('location:userhome.php');
        }
    }
  else if(!isset($_SESSION["userinfo"])){
	session_destroy();
	echo"<script>alert('no records found')</script>";
        header("refresh:0; url=index.php");
    }
?>


text:
<?php

namespace Sculpin\Bundle\ThemeBundle\DependencyInjection;

use Symfony\Component\Config\FileLocator;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Loader;
use Symfony\Component\HttpKernel\DependencyInjection\Extension;

/**
 * Sculpin Theme Extension.
 *
 * @author Beau Simensen <beau@dflydev.com>
 */
class SculpinThemeExtension extends Extension
{
    /**
     * {@inheritdoc}
     */
    public function load(array $configs, ContainerBuilder $container)
    {
        $configuration = new Configuration;
        $config = $this->processConfiguration($configuration, $configs);

        $loader = new Loader\XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
        $loader->load('services.xml');

        $container->setParameter('sculpin_theme.directory', $config['directory']);
        $container->setParameter('sculpin_theme.theme', $config['theme']);
    }
}


text:
	#define _CRT_SECURE_NO_WARNINGS
	#pragma warning(disable:4996)
#endif

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <limits.h>
#include <assert.h>
#include <errno.h>

#include "pl_if.h"
#include "pl_pseudo_posix.h"
#include "pl_thread.h"
#include "pl_sock.h"

// ------------------------------------------------------------------------------------------------

extern void sub_bin2txt(const char* const bin_path, const char* const txt_path);
extern void sub_bin2stdout(const char* const bin_path);
extern int sub_print_record(const struct pl_print_data_st* const pd, void* param);

extern void sub1_write(const int loop_num, const char* const bin_path);
extern void sub2_write(const int loop_num, const char* const bin_path0, const char* const bin_path1);

extern void sub0(const int loop_num);
extern void sub1(const int loop_num, const int id);
extern void sub2(const int loop_num, const int id);
extern void sub3(const int loop_num, const int id);
extern void do_thr_sub4(const int loop_num);
extern void sub5(const int loop_num, const int id);
extern void sub6(const int loop_num);

extern void sub7(const int loop_num, const int id);
extern void do_thr_sub8(const int loop_num);

extern void sub9(const int loop_num);

#define log0_		pl_write0
#define log1_		pl_write1
#define log2_		pl_write2
#define log3_		pl_write3

// EOF


text:
<?php

namespace Drupal\Core\Messenger;

use Drupal\Component\Render\MarkupInterface;
use Drupal\Core\PageCache\ResponsePolicy\KillSwitch;
use Drupal\Core\Render\Markup;
use Symfony\Component\HttpFoundation\Session\Flash\FlashBagInterface;

/**
 * The messenger service.
 */
class Messenger implements MessengerInterface {

  /**
   * The flash bag.
   *
   * @var \Symfony\Component\HttpFoundation\Session\Flash\FlashBagInterface
   */
  protected $flashBag;

  /**
   * The kill switch.
   *
   * @var \Drupal\Core\PageCache\ResponsePolicy\KillSwitch
   */
  protected $killSwitch;

  /**
   * Messenger constructor.
   *
   * @param \Symfony\Component\HttpFoundation\Session\Flash\FlashBagInterface $flash_bag
   *   The flash bag.
   * @param \Drupal\Core\PageCache\ResponsePolicy\KillSwitch $killSwitch
   *   The kill switch.
   */
  public function __construct(FlashBagInterface $flash_bag, KillSwitch $killSwitch) {
    $this->flashBag = $flash_bag;
    $this->killSwitch = $killSwitch;
  }

  /**
   * {@inheritdoc}
   */
  public function addError($message, $repeat = FALSE) {
    return $this->addMessage($message, static::TYPE_ERROR, $repeat);
  }

  /**
   * {@inheritdoc}
   */
  public function addMessage($message, $type = self::TYPE_STATUS, $repeat = FALSE) {
    if (!($message instanceof Markup) && $message instanceof MarkupInterface) {
      $message = Markup::create((string) $message);
    }

    // Do not use strict type checking so that equivalent string and
    // MarkupInterface objects are detected.
    if ($repeat || !in_array($message, $this->flashBag->peek($type))) {
      $this->flashBag->add($type, $message);
    }

    // Mark this page as being uncacheable.
    $this->killSwitch->trigger();

    return $this;
  }

  /**
   * {@inheritdoc}
   */
  public function addStatus($message, $repeat = FALSE) {
    return $this->addMessage($message, static::TYPE_STATUS, $repeat);
  }

  /**
   * {@inheritdoc}
   */
  public function addWarning($message, $repeat = FALSE) {
    return $this->addMessage($message, static::TYPE_WARNING, $repeat);
  }

  /**
   * {@inheritdoc}
   */
  public function all() {
    return $this->flashBag->peekAll();
  }

  /**
   * {@inheritdoc}
   */
  public function deleteAll() {
    return $this->flashBag->clear();
  }

  /**
   * {@inheritdoc}
   */
  public function deleteByType($type) {
    // Flash bag gets and clears flash messages from the stack.
    return $this->flashBag->get($type);
  }

  /**
   * {@inheritdoc}
   */
  public function messagesByType($type) {
    return $this->flashBag->peek($type);
  }

}


text: - Go to [site](https://sidravi1.github.io/)


text:
(function($){
	$.entwine('ss', function($) {
		$('table.checkboxsetwithextrafield').entwine({
			UUID: null,
			onmatch: function() {
				this._super();
				this.tableDnD({
					onDragClass: "DnD_whiledragging",
					dragHandle: ".dragHandle",
					onDragStart: function(table, row) {
						indicator = document.createElement('div');
						$(indicator).html('Moving ...');
						$(row).append($(indicator));
					},
					onDrop:function(table, row){
						jQuery($(row).find(".dragHandle")[0]).empty();
					}
				});
			},
			onunmatch: function() {
				this._super();
			}
		});
		$('table.checkboxsetwithextrafield tbody tr').entwine({
			onmouseover: function() {
				jQuery($(this).children(".dragHandle")[0]).addClass('showDragHandle');
			},
			onmouseout: function() {
				jQuery($(this).children(".dragHandle")[0]).removeClass('showDragHandle');
			},
			onmouseup: function() {
				jQuery($(this).find(".dragHandle")[0]).empty();
			}
		});
	});
}(jQuery));


text:
from __future__ import print_function

import SimpleITK as sitk

import sys, time, os
import numpy as np

if len( sys.argv ) < 2:
    print( "Usage: python " + __file__ + "<output_directory>" )
    sys.exit ( 1 )

def writeSlices(series_tag_values, new_img, i):
    image_slice = new_img[:,:,i]

    # Tags shared by the series.
    list(map(lambda tag_value: image_slice.SetMetaData(tag_value[0], tag_value[1]), series_tag_values))

    # Slice specific tags.
    image_slice.SetMetaData("0008|0012", time.strftime("%Y%m%d")) # Instance Creation Date
    image_slice.SetMetaData("0008|0013", time.strftime("%H%M%S")) # Instance Creation Time

    # Setting the type to CT preserves the slice location.
    image_slice.SetMetaData("0008|0060", "CT")  # set the type to CT so the thickness is carried over

    # (0020, 0032) image position patient determines the 3D spacing between slices.
    image_slice.SetMetaData("0020|0032", '\\'.join(map(str,new_img.TransformIndexToPhysicalPoint((0,0,i))))) # Image Position (Patient)
    image_slice.SetMetaData("0020,0013", str(i)) # Instance Number

    # Write to the output directory and add the extension dcm, to force writing in DICOM format.
    writer.SetFileName(os.path.join(sys.argv[1],str(i)+'.dcm'))
    writer.Execute(image_slice)

# Create a new series from a numpy array
new_arr = np.random.uniform(-10, 10, size = (3,4,5)).astype(np.int16)
new_img = sitk.GetImageFromArray(new_arr)
new_img.SetSpacing([2.5,3.5,4.5])

# Write the 3D image as a series
# IMPORTANT: There are many DICOM tags that need to be updated when you modify an
#            original image. This is a delicate opration and requires knowlege of
#            the DICOM standard. This example only modifies some. For a more complete
#            list of tags that need to be modified see:
#                           http://gdcm.sourceforge.net/wiki/index.php/Writing_DICOM
#            If it is critical for your work to generate valid DICOM files,
#            It is recommended to use David Clunie's Dicom3tools to validate the files
#                           (http://www.dclunie.com/dicom3tools.html).

writer = sitk.ImageFileWriter()
# Use the study/series/frame of reference information given in the meta-data
# dictionary and not the automatically generated information from the file IO
writer.KeepOriginalImageUIDOn()

modification_time = time.strftime("%H%M%S")
modification_date = time.strftime("%Y%m%d")

# Copy some of the tags and add the relevant tags indicating the change.
# For the series instance UID (0020|000e), each of the components is a number, cannot start
# with zero, and separated by a '.' We create a unique series ID using the date and time.
# tags of interest:
direction = new_img.GetDirection()
series_tag_values = [("0008|0031",modification_time), # Series Time
                  ("0008|0021",modification_date), # Series Date
                  ("0008|0008","DERIVED\\SECONDARY"), # Image Type
                  ("0020|000e", "1.2.826.0.1.3680043.2.1125."+modification_date+".1"+modification_time), # Series Instance UID
                  ("0020|0037", '\\'.join(map(str, (direction[0], direction[3], direction[6],# Image Orientation (Patient)
                                                    direction[1],direction[4],direction[7])))),
                  ("0008|103e", "Created-SimpleITK")] # Series Description

# Write slices to output directory
list(map(lambda i: writeSlices(series_tag_values, new_img, i), range(new_img.GetDepth())))

# Re-read the series
# Read the original series. First obtain the series file names using the
# image series reader.
data_directory = sys.argv[1]
series_IDs = sitk.ImageSeriesReader.GetGDCMSeriesIDs(data_directory)
if not series_IDs:
    print("ERROR: given directory \""+data_directory+"\" does not contain a DICOM series.")
    sys.exit(1)
series_file_names = sitk.ImageSeriesReader.GetGDCMSeriesFileNames(data_directory, series_IDs[0])

series_reader = sitk.ImageSeriesReader()
series_reader.SetFileNames(series_file_names)

# Configure the reader to load all of the DICOM tags (public+private):
# By default tags are not loaded (saves time).
# By default if tags are loaded, the private tags are not loaded.
# We explicitly configure the reader to load tags, including the
# private ones.
series_reader.LoadPrivateTagsOn()
image3D = series_reader.Execute()
print(image3D.GetSpacing(),'vs',new_img.GetSpacing())
sys.exit( 0 )


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>MSA Family Reunion</title>

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

    <link href="css/grayscale.css" rel="stylesheet">

    <link href="font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
    <link href="http://fonts.googleapis.com/css?family=Lora:400,700,400italic,700italic" rel="stylesheet" type="text/css">
    <link href="http://fonts.googleapis.com/css?family=Montserrat:400,700" rel="stylesheet" type="text/css">

	<link href="bower_components/Bootflat/bootflat/css/bootflat.css" rel="stylesheet">

	<link rel='stylesheet' href='unitegallery/css/unite-gallery.css' type='text/css' />

	<link rel='stylesheet' href='unitegallery/themes/default/ug-theme-default.css' type='text/css' />

						<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-main-collapse">

						</button>

								About Us

								Prices

								Itinerary

								Travel

								Contact

								Facebook

 McElhaney, Simpson, Adams Family Reunion

2016
Hosted by Mississippi

Dedication to the Family

 The 2016 reunion will be dedicated to the late Lee & Delaura Adams and Mamie Brown.   The first family reunion was held in Gulfport, Mississippi in the early 1970's and still remains active today.  Their legacy will live in our hearts forever.  They challenged each of us to continue keeping the family unit together.   We will also celebrate the rich history of relatives who are no longer with us as we enjoy spending time with each other.  We are in the process of planning an exciting weekend and look forward to your stay with us.

Lee and Delaura Adams

Gulfport, MS

Mamie Brown

Detroit, MI

Pricing

$90

per Individual

Includes

Family Reception

Family Picnic

Family Banquet

All Ages 17+

$170

per Couple

Includes

Family Reception

Family Picnic

Family Banquet

$15 extra per additional child (max age 17)

 Again, ages 17+ must purchase a $90 individual ticket

												<button type="button" class="btn btn-info btn-sm" data-toggle="modal" data-target="#myModal">Order Now</button>

                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>

Order Form

                     <form id="requestacallform" method="POST" name="requestacallform">

                                    <input id="first_name" type="text" class="form-control" placeholder="First Name" name="first_name"/>

                                    <input id="last_name" type="text" class="form-control" placeholder="Last Name" name="last_name"/>

                                    <input id="email1" type="text" class="form-control" placeholder="Email" name="email1" onchange="validateEmailAdd();"/>

                                    <input id="company_name_c" type="text" class="form-control" placeholder="Company Name" name="company_name_c"/>

                                    <input id="phone_mobile" type="text" class="form-control" placeholder="Mobile" name="phone_mobile"/>

                                        <textarea id="description" type="text" name="description"  placeholder="Description"></textarea>

                            </form>

				<form action="" method="POST">

				</form>

$100

 Single Adult with child

Includes

Family Reception

Family Picnic

Family Banquet

$15 extra per additional child (max age 17)

2016 Family Reunion Agenda

July 2016

Arrive Wednesday, July 20th!!

July 21

Family Reception

Hospitality and Resort Center

Get reacquainted with family and friends on the beautiful Gulf Coast.  Enjoy the sunny beaches, food, family updates, and laughter.  Itineraries for the weekend will be provided.

5:30pm-8:30pm

July 22

New Orleans

Enjoy a day of fun in New Orleans, Louisiana. Visit the historical French Market, the French Quarters, Outlet Collection at Riverwalk (shopping), Mardi Gras World, museums, and other exciting landmarks.  You will enjoy the New Orleans atmosphere, indulge in the world famous "N'awlins" cuisine, enjoy beignets at the Café du Monde, jazz music, art, and shopping at the new Riverwalk Plaza.

11:00am-7:00pm Approx

July 23

Tee time for golfers.

The Great Southern Club is adjacent to the condo and close to the hotel.  Play 18 holes on this beautiful course before the Family Picnic.

7:00am-11:00am

July 23

Family Picnic

Gulf National Seashore Park

Enjoy  the beautiful Gulf of Mexico, park visitors center, great food, line dancing, music, games, door prizes and of course, the traditional family photo.

11:00am-2:00pm

July 23

Family Banquet

Keesler Air Force Base Event Center (ID required)

Make your last night memorable. Enjoy more food, dancing, and tales of old while overlooking the beautiful Gulf of Mexico. Remember our legacy and where it all started.  This night we will rekindle the love and memories of Lee & Delaura Adams and Mamie Brown, who made us understand the importance of family. In addition, rekindle the love and memories of our other loved ones who would certainly be proud of our commitment to family and the accomplishments we've all made.

7:00pm-9:00pm

July 24

Church Service

Come as a family and be blessed as we end the reunion with thanks and blessings from the Lord.

7:00am-10:00am

August 2016

Thanks Everyone, See you in 2018!!

Travel Info

									Start:
									<select id="start">
									<option value="30.394891,-88.894874">Double Tree Hotel</option>
									<option value="30.388913,-89.003790">Legacy Towers</option>
									<option value="29.962601,-90.064923">Bourbon Street</option>
									<option value="30.392299,-88.887497">Hard Rock Casino</option>
									<option value="30.396343,-88.890495">Waffle House</option>
									<option value="30.389458,-89.008632">Great Southern Golf Club</option>
									<option value="30.364262,-89.090184">Ship Island Excursions</option>
									<option value="30.392549,-88.891434">Beau Rivage</option>
									<option value="30.394401,-88.901084">Biloxi Lighthouse and Visitors Center</option>
									</select>

									End:
									<select id="end">
									<option value="30.364262,-89.090184">Ship Island Excursions</option>
									<option value="30.388913,-89.003790">Legacy Towers</option>
									<option value="30.389458,-89.008632">Great Southern Golf Club</option>
									<option value="30.394891,-88.894874">Double Tree Hotel</option>
									<option value="30.392549,-88.891434">Beau Rivage</option>
									<option value="30.392299,-88.887497">Hard Rock Casino</option>
									<option value="30.394401,-88.901084">Biloxi Lighthouse and Visitors Center</option>
									<option value="29.962601,-90.064923">Bourbon Street</option>
									<option value="30.396343,-88.890495">Waffle House</option>
									</select>

 Your Gulfport family is excited to welcome you back to the Mississippi Gulf Coast for the 2016 Family Reunion!  We had a wonderful time last year in Kansas City!  Family members who attended voted to host a destination/traditional reunion where it all started: Mississippi.  Therefore, this reunion will offer a destination, all-inclusive condominium or traditional hotel.  In addition, activities are being planned for everyone to enjoy. This destination reunion will give families the option of using this trip as a vacation and extending their stay, if they wish.

We are in the process of planning an exciting weekend and look forward to your stay with us.   The DoubleTree by Hilton Hotel and Legacy Towers will be the host lodging facilities for the week. Please choose the property that will best meet your family's needs.  Details are as follows:

Legacy Towers is a short drive from the DoubleTree by Hilton and is also located near many popular restaurants and attractions such as the  Great Southern Golf Club, Gulfport Premium Outlets (shopping),   Island View Casino,  Ship Island Excursions, and  Lynn Meadows Discovery Center.

							Contact Carrie Smith

Legacy Towers MSA Reunion Pricing

							Condo Option
							3-Night Stay
							4-Night Stay

							2 BED, 2 BATH STANDARD
							$1,035.78
							$1,381.05

							2 BED, 2 BATH DELUXE
							$1,076.94
							$1,435.93

							3 BED, 2 BATH STANDARD
							$1,113.77
							$1,485.02

							3 BED, 2 BATH PENTHOUSE
							$1,223.16
							$1,630.88

							3 BED, 3 BATH STANDARD
							$1,231.83
							$1,642.44

							3 BED, 3 BATH DELUXE
							$1,272.98
							$1,697.31

							3 BED, 3 BATH PENTHOUSE
							$1,472.34
							$1,963.12

  For families who want to relax in utmost luxury, an all-inclusive condo at the Legacy Towers is your best option.   Each condo features comfortable beds, deluxe bathrooms, a living room including a sofa bed which sleeps two, dining area, full kitchen, and a balcony overlooking the beautiful Gulf Coast beaches.  Please make reservations as soon as possible by contacting Carrie Smith, Assistant Reservations Manager at (228) 276-2300 (press 1 for reservations). You must mention the McElhaney, Simpson, and Adams Reunion to take advantage of this discount.

 Time is of the essence since these condos are prime beachfront rentals.  Condos require a 35% deposit at the time of booking; the remaining balance will be automatically charged 30 days prior to your arrival.  Once you are within that 30 days there is no cancellation.  Travel insurance is offered in case of emergencies.  Visit Biloxi Beach Rentals for more information.

The hotel is situated near many attractions such as the newly constructed MGM Park (home of Biloxi's baseball team, the   Biloxi Shuckers), Beau Rivage, Hard Rock, & IP Casinos, Edgewater Mall, the famous Biloxi Lighthouse and Visitors Center, restaurants, and more!

							Contact DoubleTree Hotel

  The DoubleTree by Hilton Hotel (pictured to the left) is located on Highway 90 in Biloxi, directly across the street from the beach. The group rate is $129 per night (plus tax) for either one king or two queen beds.  Hotel room rates are subject to state and local taxes (currently 12%) at the time of check-in.

 The DoubleTree offers modern amenities and the style in each of its 195 spacious rooms.  Each room features comfortable beds, 42 inch TV, coffee/tea, free internet, on-site restaurant and bar, 24-hour gym, water delivered daily, microwave, refrigerator, and pools.  For reservations, call (228) 546-3111 or (228) 546-3101.  You must mention the MSA Reunion in order to receive the group rate.  If you have additional questions you may contact Ms. Fallon McClain, Sales Director, at the numbers above or send her an email at fallon.mcclain@fourpointsbiloxi.com.

Things To Do

 Seafood runs the Gulf Coast. Period.  From shrimping to frying catfish, you'll eat like a king when you come down.  There's plenty entertainment to be had on the coast during your week stay in July.  You'll find casino gaming, concerts, restaurants, and a bustling nightlife in the neighborly New Orleans.

  With warm weather, year round, the Gulf Coast attracts many golfing enthusiasts as well as nature lovers.  State parks nearby provide serene nature trails for bikers, hikers, and family horseback riding.

  Don't wait til the last second.  Hotels book fast and we want you to be here at our 2016 Family Reunion!  Check out the gallery to see some local attractions!  See you soon!

ABOUT

The Family

History

Vision

SOCIAL

Flickr

Facebook

BASIC INFO

Reunion Letter

Registration Form

Itinerary

Map

CONTACT

<a href="#footer" class="page-scroll"   data-toggle="popover"  title="Laretta Marks" data-placement="left" data-content="Email:  larettamarks@msafamilyreunion.com Phone:
  228-832-8970  " >Head Of Operations

<a href="#footer" class="page-scroll"   data-toggle="popover"  title="Deverick Simpson" data-placement="left" data-content="Email:
 deverick@me.com
 Phone:
  228-324-0972  " >Technical

Copyright © 2016 Deverick Apollo. All rights reserved.


text:
package strings;// strings/Resetting.java
// (c)2017 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose.
// Visit http://OnJava8.com for more book information.
import java.util.regex.*;

public class Resetting {
  public static void
  main(String[] args) throws Exception {
    Matcher m = Pattern.compile("[frb][aiu][gx]")
      .matcher("fix the rug with bags");
    while(m.find())
      System.out.print(m.group() + " ");
    System.out.println();
    m.reset("fix the rig with rags");
    while(m.find())
      System.out.print(m.group() + " ");
  }
}
/* Output:
fix rug bag
fix rig rag
*/


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Windows.Threading;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Globalization;
using System.Collections.ObjectModel;
using System.IO;
using System.Windows.Markup;

namespace TabControlDemo
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
			this.DataContext = this;
        }

		private void TabClose(object sender, ExecutedRoutedEventArgs e)
		{
			TabItem tab = (TabItem)e.OriginalSource;
			tabControl.Items.Remove(tab);
		}

		private void TabCloseAll(object sender, ExecutedRoutedEventArgs e)
		{
			tabControl.Items.Clear();
		}

		private void TabCloseAllOthers(object sender, ExecutedRoutedEventArgs e)
		{
			TabItem tab = (TabItem)e.OriginalSource;
			for (int i = tabControl.Items.Count - 1; i >= 0; i--)
			{
				if (tabControl.Items[i] != tab)
				{
					tabControl.Items.RemoveAt(i);
				}
			}
		}

		private void TabOpen(object sender, ExecutedRoutedEventArgs e)
		{
			Random r = new Random();
			if (r.Next() % 2 == 0)
			{
				TabOpenTab1(sender, null);
			}
			else
			{
				TabOpenTab2(sender, null);
			}
		}

		private void TabClone(TabItem original)
		{
			object clone;
			using (var stream = new MemoryStream())
			{
				XamlWriter.Save(original, stream);
				stream.Seek(0, SeekOrigin.Begin);
				clone = XamlReader.Load(stream);
			}

			tabControl.Items.Add(clone);
			tabControl.SelectedItem = clone;
		}

		private void TabOpenTab1(object sender, ExecutedRoutedEventArgs e)
		{
			TabClone(tab1);
		}

		private void TabOpenTab2(object sender, ExecutedRoutedEventArgs e)
		{
			TabClone(tab2);
		}

		private void TabNewButton_Click(object sender, RoutedEventArgs e)
		{
			Button btn = (Button)sender;
			btn.ContextMenu.PlacementTarget = btn;
			btn.ContextMenu.IsOpen = true;
		}

		bool _isDragging = false;
		Point _dragStartingPoint;
		TabItem _draggedTab;

		private void TabItem_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
		{
			_isDragging = false;
			_dragStartingPoint = e.GetPosition(null);
			_draggedTab = (TabItem)sender;
		}

		private void TabItem_PreviewMouseMove(object sender, MouseEventArgs e)
		{
			if (_isDragging || e.LeftButton != MouseButtonState.Pressed) return;

			Point position = e.GetPosition(null);
			if (Math.Abs(position.X - _dragStartingPoint.X) > SystemParameters.MinimumHorizontalDragDistance ||
				Math.Abs(position.Y - _dragStartingPoint.Y) > SystemParameters.MinimumVerticalDragDistance)
			{
				_isDragging = true;
				DragDrop.DoDragDrop(_draggedTab, _draggedTab, DragDropEffects.All);
			}
		}

		private void TabItem_Drop(object sender, DragEventArgs e)
		{
			TabItem targetTab = sender as TabItem;
			if (targetTab == null) return;
			if (!e.Data.GetDataPresent(typeof(TabItem))) return;
			TabItem sourceTab = (TabItem)e.Data.GetData(typeof(TabItem));

			if (targetTab == sourceTab) return;

			int targetIdx = tabControl.Items.IndexOf(targetTab);
			using (Dispatcher.DisableProcessing())
			{
				tabControl.Items.Remove(sourceTab);
				tabControl.Items.Insert(targetIdx, sourceTab);
				tabControl.SelectedItem = sourceTab;
			}

		}
	}

	public static class TabCommands
	{
		public static RoutedUICommand Close = new RoutedUICommand(
			"Close",
			"TabClose",
			typeof(TabItem));

		public static RoutedUICommand CloseAll = new RoutedUICommand(
			"Close All",
            "CloseAll",
			typeof(TabItem));

		public static RoutedUICommand CloseAllOthers = new RoutedUICommand(
			"Close All Others",
			"TabCloseAllOthers",
			typeof(TabItem));

		public static RoutedUICommand Open = new RoutedUICommand(
			"Open",
			"Tab Open",
			typeof(TabItem));

		public static RoutedUICommand Tab1 = new RoutedUICommand(
			"Tab 1",
			"Tab1",
			typeof(TabControl));

		public static RoutedUICommand Tab2 = new RoutedUICommand(
			"Tab 2",
			"Tab2",
			typeof(TabControl));
	}
}


text:
package breeze.stats.distributions

import org.scalatest._
import org.scalatest.funsuite._
import org.scalatestplus.scalacheck._
import org.scalacheck._
import breeze.numerics._
import breeze.linalg._
import breeze.stats._

class MultivariateGaussianTest extends AnyFunSuite with Checkers {
  implicit val basis: RandBasis = RandBasis.mt0

  val N = 5

  implicit def genVector: Arbitrary[DenseVector[Double]] = Arbitrary {
    RandomInstanceSupport.genDenseVector(N, Gen.choose(0.0, 1.0))
  }

  implicit def genMatrix: Arbitrary[DenseMatrix[Double]] = {
    Arbitrary {
      RandomInstanceSupport.genDenseMatrix(N, N, Gen.choose(0.0, 0.2)).map{ m =>
        m + m.t + DenseMatrix.eye[Double](N)
      }
    }
  }

  test("Probability of mean") {
    check(Prop.forAll { (m: DenseVector[Double], s: DenseMatrix[Double]) =>
      {
        val b = MultivariateGaussian(m, s)
        b.unnormalizedLogPdf(m) == 0.0
      }
    })
  }

  test("Probability of N(0,1)(1) propto exp(-.5))") {
    assert(
      MultivariateGaussian(DenseVector(0.0), DenseMatrix.ones(1, 1)).unnormalizedLogPdf(DenseVector(1.0)) === -0.5)
  }

  implicit def arbDistr: Arbitrary[MultivariateGaussian] = Arbitrary {
    for (mean <- genVector.arbitrary; std <- genMatrix.arbitrary) yield MultivariateGaussian(mean, std);
  }

  val numSamples = 5000

  test("mean") {
    check(Prop.forAll { (distr: MultivariateGaussian) =>
      val sample = DenseVector.horzcat(distr.sample(numSamples): _*)
      val m = mean(sample(*, ::))
      if (norm(m - distr.mean, Double.PositiveInfinity) > 1E-1) {
        println("MExpected " + distr.mean + " but got " + m)
        false
      } else {
        true
      }

    })
  }

  val VARIANCE_TOLERANCE = 0.1
  test("variance") {
    check(Prop.forAll { (distr: MultivariateGaussian) =>
      // try twice, and only fail if both fail.
      // just a little more robustness...
      Iterator.range(0, 2).exists { _ =>
        val sample = DenseVector.horzcat(distr.sample(numSamples): _*)
        val vari = cov(sample.t)

        if (max(abs(vari - distr.variance)) > VARIANCE_TOLERANCE) {
          println("Expected " + distr.variance + " but got " + vari)
          false
        } else true
      }
    })
  }
}


text:
import { Observable } from '../Observable';
import { VirtualTimeScheduler } from '../scheduler/VirtualTimeScheduler';
import { Subject } from '../Subject';
import { TestMessage } from './TestMessage';
import { SubscriptionLog } from './SubscriptionLog';
export declare type observableToBeFn = (marbles: string, values?: any, errorValue?: any) => void;
export declare type subscriptionLogsToBeFn = (marbles: string | string[]) => void;
export declare class TestScheduler extends VirtualTimeScheduler {
    assertDeepEqual: (actual: any, expected: any) => boolean | void;
    private hotObservables;
    private coldObservables;
    private flushTests;
    constructor(assertDeepEqual: (actual: any, expected: any) => boolean | void);
    createColdObservable<T>(marbles: string, values?: any, error?: any): Observable<T>;
    createHotObservable<T>(marbles: string, values?: any, error?: any): Subject<T>;
    private materializeInnerObservable(observable, outerFrame);
    expectObservable(observable: Observable<any>, unsubscriptionMarbles?: string): ({
        toBe: observableToBeFn;
    });
    expectSubscriptions(actualSubscriptionLogs: SubscriptionLog[]): ({
        toBe: subscriptionLogsToBeFn;
    });
    flush(): void;
    static parseMarblesAsSubscriptions(marbles: string): SubscriptionLog;
    static parseMarbles(marbles: string, values?: any, errorValue?: any, materializeInnerObservables?: boolean): TestMessage[];
}


text:
package de.sstoehr.harreader.model;

import nl.jqno.equalsverifier.EqualsVerifier;
import org.junit.Assert;
import org.junit.Test;

public class HarTimingTest extends AbstractMapperTest<HarTiming> {

    @Override
    public void testMapping() {
        HarTiming timing = map("{\"blocked\": 3804,\"dns\": 23,\"connect\": 5,\"send\": 9,\"wait\": 5209,"
        + "\"receive\": 79, \"ssl\": 123, \"comment\": \"my comment\",\"_unknown\":\"unknown\"}", HarTiming.class);

        Assert.assertNotNull(timing);
        Assert.assertEquals(3804, (int) timing.getBlocked());
        Assert.assertEquals(23, (int) timing.getDns());
        Assert.assertEquals(5, (int) timing.getConnect());
        Assert.assertEquals(9, (int) timing.getSend());
        Assert.assertEquals(5209, (int) timing.getWait());
        Assert.assertEquals(79, (int) timing.getReceive());
        Assert.assertEquals(123, (int) timing.getSsl());
        Assert.assertEquals("my comment", timing.getComment());

        Assert.assertNotNull(timing.getAdditional());
        Assert.assertEquals("unknown", timing.getAdditional().get("_unknown"));
    }

    @Test
    public void testBlocked() {
        HarTiming timing = new HarTiming();
        timing.setBlocked(null);
        Assert.assertEquals(-1, (int) timing.getBlocked());
    }

    @Test
    public void testDns() {
        HarTiming timing = new HarTiming();
        timing.setDns(null);
        Assert.assertEquals(-1, (int) timing.getDns());
    }

    @Test
    public void testConnect() {
        HarTiming timing = new HarTiming();
        timing.setConnect(null);
        Assert.assertEquals(-1, (int) timing.getConnect());
    }

    @Test
    public void testSsl() {
        HarTiming timing = new HarTiming();
        timing.setSsl(null);
        Assert.assertEquals(-1, (int) timing.getSsl());
    }

    @Test
    public void equalsContract() {
        EqualsVerifier.simple().forClass(HarTiming.class).verify();
    }
}


text:
BEGIN;

CREATE MATERIALIZED VIEW cg.comic_strip_count AS
SELECT
    s.comic_id,
    count(s.id) AS strip_count
FROM cg.strip s
GROUP BY s.comic_id;

COMMIT;


text:
package topology

import (
	"crypto/x509"
)

// We don't support version less then 1.10, but Evergreen needs to be able to compile the driver
// using version 1.8.
func x509CertSubject(cert *x509.Certificate) string {
	return ""
}


text:
package util;

import java.io.IOException;

import shared.Course;
import shared.Department;

/**
 *
 * @author goldy
 *
 */
public interface CourseFetcher {

	/**
	 * @param department the department of the course
	 * @param courseNumber the course number
	 * @return the course fetched by the implementation
	 */
	Course fetchCourse(Department department, int courseNumber) throws IOException;

}


text:
import * as path from 'path';
import * as fs from 'graceful-fs';
import {cleanup, extractSummary, makeTemplate, writeFiles} from '../Utils';
import runJest from '../runJest';

const DIR = path.resolve(__dirname, '../to-match-inline-snapshot');
const TESTS_DIR = path.resolve(DIR, '__tests__');

const readFile = (filename: string) =>
  fs.readFileSync(path.join(TESTS_DIR, filename), 'utf8');

beforeEach(() => cleanup(TESTS_DIR));
afterAll(() => cleanup(TESTS_DIR));

test('basic support', () => {
  const filename = 'basic-support.test.js';
  const template = makeTemplate(
    "test('inline snapshots', () => expect($1).toMatchInlineSnapshot());\n",
  );

  {
    writeFiles(TESTS_DIR, {
      [filename]: template(['{apple: "original value"}']),
    });
    const {stderr, exitCode} = runJest(DIR, ['-w=1', '--ci=false', filename]);
    const fileAfter = readFile(filename);
    expect(stderr).toMatch('1 snapshot written from 1 test suite.');
    expect(exitCode).toBe(0);
    expect(fileAfter).toMatchSnapshot('initial write');
  }

  {
    const {stderr, exitCode} = runJest(DIR, ['-w=1', '--ci=false', filename]);
    const fileAfter = readFile(filename);
    expect(stderr).toMatch('Snapshots:   1 passed, 1 total');
    expect(stderr).not.toMatch('1 snapshot written from 1 test suite.');
    expect(exitCode).toBe(0);
    expect(fileAfter).toMatchSnapshot('snapshot passed');
  }

  {
    writeFiles(TESTS_DIR, {
      [filename]: readFile(filename).replace('original value', 'updated value'),
    });
    const {stderr, exitCode} = runJest(DIR, ['-w=1', '--ci=false', filename]);
    const fileAfter = readFile(filename);
    expect(stderr).toMatch('Snapshot name: `inline snapshots 1`');
    expect(exitCode).toBe(1);
    expect(fileAfter).toMatchSnapshot('snapshot mismatch');
  }

  {
    const {stderr, exitCode} = runJest(DIR, [
      '-w=1',
      '--ci=false',
      filename,
      '-u',
    ]);
    const fileAfter = readFile(filename);
    expect(stderr).toMatch('1 snapshot updated from 1 test suite.');
    expect(exitCode).toBe(0);
    expect(fileAfter).toMatchSnapshot('snapshot updated');
  }
});

test('do not indent empty lines', () => {
  const filename = 'empty-line-indent.test.js';
  const template = makeTemplate(
    "test('inline snapshots', () => expect($1).toMatchInlineSnapshot());\n",
  );

  {
    writeFiles(TESTS_DIR, {
      [filename]: template(['`hello\n\nworld`']),
    });
    const {stderr, exitCode} = runJest(DIR, ['-w=1', '--ci=false', filename]);
    const fileAfter = readFile(filename);
    expect(stderr).toMatch('1 snapshot written from 1 test suite.');
    expect(exitCode).toBe(0);
    expect(fileAfter).toMatchSnapshot('initial write');
  }

  {
    const {stderr, exitCode} = runJest(DIR, ['-w=1', '--ci=false', filename]);
    const fileAfter = readFile(filename);
    expect(stderr).toMatch('Snapshots:   1 passed, 1 total');
    expect(stderr).not.toMatch('1 snapshot written from 1 test suite.');
    expect(exitCode).toBe(0);
    expect(fileAfter).toMatchSnapshot('snapshot passed');
  }
});

test('handles property matchers', () => {
  const filename = 'handle-property-matchers.test.js';
  const template = makeTemplate(`test('handles property matchers', () => {
      expect({createdAt: $1}).toMatchInlineSnapshot({createdAt: expect.any(Date)});
    });
    `);

  {
    writeFiles(TESTS_DIR, {[filename]: template(['new Date()'])});
    const {stderr, exitCode} = runJest(DIR, ['-w=1', '--ci=false', filename]);
    const fileAfter = readFile(filename);
    expect(stderr).toMatch('1 snapshot written from 1 test suite.');
    expect(exitCode).toBe(0);
    expect(fileAfter).toMatchSnapshot('initial write');
  }

  {
    const {stderr, exitCode} = runJest(DIR, ['-w=1', '--ci=false', filename]);
    const fileAfter = readFile(filename);
    expect(stderr).toMatch('Snapshots:   1 passed, 1 total');
    expect(exitCode).toBe(0);
    expect(fileAfter).toMatchSnapshot('snapshot passed');
  }

  {
    writeFiles(TESTS_DIR, {
      [filename]: readFile(filename).replace('new Date()', '"string"'),
    });
    const {stderr, exitCode} = runJest(DIR, ['-w=1', '--ci=false', filename]);
    const fileAfter = readFile(filename);
    expect(stderr).toMatch('Snapshot name: `handles property matchers 1`');
    expect(stderr).toMatch('Snapshots:   1 failed, 1 total');
    expect(exitCode).toBe(1);
    expect(fileAfter).toMatchSnapshot('snapshot failed');
  }

  {
    writeFiles(TESTS_DIR, {
      [filename]: readFile(filename).replace('any(Date)', 'any(String)'),
    });
    const {stderr, exitCode} = runJest(DIR, [
      '-w=1',
      '--ci=false',
      filename,
      '-u',
    ]);
    const fileAfter = readFile(filename);
    expect(stderr).toMatch('1 snapshot updated from 1 test suite.');
    expect(exitCode).toBe(0);
    expect(fileAfter).toMatchSnapshot('snapshot updated');
  }
});

test('removes obsolete external snapshots', () => {
  const filename = 'removes-obsolete-external-snapshots.test.js';
  const snapshotPath = path.join(
    TESTS_DIR,
    '__snapshots__',
    `${filename}.snap`,
  );
  const template = makeTemplate(`
    test('removes obsolete external snapshots', () => {
      expect('1').$1();
    });
  `);

  {
    writeFiles(TESTS_DIR, {[filename]: template(['toMatchSnapshot'])});
    const {stderr, exitCode} = runJest(DIR, ['-w=1', '--ci=false', filename]);
    const fileAfter = readFile(filename);
    expect(stderr).toMatch('1 snapshot written from 1 test suite.');
    expect(exitCode).toBe(0);
    expect(fileAfter).toMatchSnapshot('initial write');
    expect(fs.existsSync(snapshotPath)).toBe(true);
  }

  {
    writeFiles(TESTS_DIR, {[filename]: template(['toMatchInlineSnapshot'])});
    const {stderr, exitCode} = runJest(DIR, ['-w=1', '--ci=false', filename]);
    const fileAfter = readFile(filename);
    expect(stderr).toMatch('Snapshots:   1 obsolete, 1 written, 1 total');
    expect(exitCode).toBe(1);
    expect(fileAfter).toMatchSnapshot('inline snapshot written');
    expect(fs.existsSync(snapshotPath)).toBe(true);
  }

  {
    const {stderr, exitCode} = runJest(DIR, [
      '-w=1',
      '--ci=false',
      filename,
      '-u',
    ]);
    const fileAfter = readFile(filename);
    expect(stderr).toMatch('Snapshots:   1 file removed, 1 passed, 1 total');
    expect(exitCode).toBe(0);
    expect(fileAfter).toMatchSnapshot('external snapshot cleaned');
    expect(fs.existsSync(snapshotPath)).toBe(false);
  }
});

test('supports async matchers', () => {
  const filename = 'async-matchers.test.js';
  const test = `
    test('inline snapshots', async () => {
      expect(Promise.resolve('success')).resolves.toMatchInlineSnapshot();
      expect(Promise.reject('fail')).rejects.toMatchInlineSnapshot();
    });
  `;

  writeFiles(TESTS_DIR, {[filename]: test});
  const {stderr, exitCode} = runJest(DIR, ['-w=1', '--ci=false', filename]);
  const fileAfter = readFile(filename);
  expect(stderr).toMatch('2 snapshots written from 1 test suite.');
  expect(exitCode).toBe(0);
  expect(fileAfter).toMatchSnapshot();
});

test('supports async tests', () => {
  const filename = 'async.test.js';
  const test = `
    test('inline snapshots', async () => {
      await 'next tick';
      expect(42).toMatchInlineSnapshot();
    });
  `;

  writeFiles(TESTS_DIR, {[filename]: test});
  const {stderr, exitCode} = runJest(DIR, ['-w=1', '--ci=false', filename]);
  const fileAfter = readFile(filename);
  expect(stderr).toMatch('1 snapshot written from 1 test suite.');
  expect(exitCode).toBe(0);
  expect(fileAfter).toMatchSnapshot();
});

test('writes snapshots with non-literals in expect(...)', () => {
  const filename = 'async.test.js';
  const test = `
    it('works with inline snapshots', () => {
      expect({a: 1}).toMatchInlineSnapshot();
    });
  `;

  writeFiles(TESTS_DIR, {[filename]: test});
  const {stderr, exitCode} = runJest(DIR, ['-w=1', '--ci=false', filename]);

  const fileAfter = readFile(filename);
  expect(stderr).toMatch('1 snapshot written from 1 test suite.');
  expect(exitCode).toBe(0);
  expect(fileAfter).toMatchSnapshot();
});

// issue: https://github.com/facebook/jest/issues/6702
test('handles mocking native modules prettier relies on', () => {
  const filename = 'mockFail.test.js';
  const test = `
    jest.mock('path', () => ({}));
    jest.mock('fs', () => ({}));
    jest.mock('graceful-fs', () => ({}));
    test('inline snapshots', () => {
      expect({}).toMatchInlineSnapshot();
    });
  `;

  writeFiles(TESTS_DIR, {[filename]: test});
  const {stderr, exitCode} = runJest(DIR, ['-w=1', '--ci=false', filename]);
  expect(stderr).toMatch('1 snapshot written from 1 test suite.');
  expect(exitCode).toBe(0);
});

test('supports custom matchers', () => {
  const filename = 'custom-matchers.test.js';
  const test = `
    const { toMatchInlineSnapshot } = require('jest-snapshot');
    expect.extend({
      toMatchCustomInlineSnapshot(received, ...args) {
        return toMatchInlineSnapshot.call(this, received, ...args);
      }
    });
    test('inline snapshots', () => {
      expect({apple: "original value"}).toMatchCustomInlineSnapshot();
    });
  `;

  writeFiles(TESTS_DIR, {[filename]: test});
  const {stderr, exitCode} = runJest(DIR, ['-w=1', '--ci=false', filename]);
  const fileAfter = readFile(filename);
  expect(stderr).toMatch('1 snapshot written from 1 test suite.');
  expect(exitCode).toBe(0);
  expect(fileAfter).toMatchSnapshot('custom matchers');
});

test('supports custom matchers with property matcher', () => {
  const filename = 'custom-matchers-with-property-matcher.test.js';
  const test = `
    const { toMatchInlineSnapshot } = require('jest-snapshot');
    expect.extend({
      toMatchCustomInlineSnapshot(received, ...args) {
        return toMatchInlineSnapshot.call(this, received, ...args);
      },
      toMatchUserInlineSnapshot(received, ...args) {
        return toMatchInlineSnapshot.call(
          this,
          received,
          {
            createdAt: expect.any(Date),
            id: expect.any(Number),
          },
          ...args
        );
      },
    });
    test('inline snapshots', () => {
      const user = {
        createdAt: new Date(),
        id: Math.floor(Math.random() * 20),
        name: 'LeBron James',
      };
      expect(user).toMatchCustomInlineSnapshot({
        createdAt: expect.any(Date),
        id: expect.any(Number),
      });
      expect(user).toMatchUserInlineSnapshot();
    });
  `;

  writeFiles(TESTS_DIR, {[filename]: test});
  const {stderr, exitCode} = runJest(DIR, ['-w=1', '--ci=false', filename]);
  const fileAfter = readFile(filename);
  expect(stderr).toMatch('2 snapshots written from 1 test suite.');
  expect(exitCode).toBe(0);
  expect(fileAfter).toMatchSnapshot('custom matchers with property matcher');
});

test('multiple custom matchers and native matchers', () => {
  const filename = 'multiple-matchers.test.js';
  const test = `
    const { toMatchInlineSnapshot } = require('jest-snapshot');
    expect.extend({
      toMatchCustomInlineSnapshot(received, ...args) {
        return toMatchInlineSnapshot.call(this, received, ...args);
      },
      toMatchCustomInlineSnapshot2(received, ...args) {
        return toMatchInlineSnapshot.call(this, received, ...args);
      },
    });
    test('inline snapshots', () => {
      expect({apple: "value 1"}).toMatchCustomInlineSnapshot();
      expect({apple: "value 2"}).toMatchInlineSnapshot();
      expect({apple: "value 3"}).toMatchCustomInlineSnapshot2();
      expect({apple: "value 4"}).toMatchInlineSnapshot();
    });
  `;

  writeFiles(TESTS_DIR, {[filename]: test});
  const {stderr, exitCode} = runJest(DIR, ['-w=1', '--ci=false', filename]);
  const fileAfter = readFile(filename);
  expect(stderr).toMatch('4 snapshots written from 1 test suite.');
  expect(exitCode).toBe(0);
  expect(fileAfter).toMatchSnapshot('multiple matchers');
});

test('indentation is correct in the presences of existing snapshots', () => {
  const filename = 'existing-snapshot.test.js';
  const test = `
    test('existing snapshot', () => {
      expect({ hello: 'world' }).toMatchInlineSnapshot(\`
        {
          "hello": "world",
        }
      \`);
      expect({ hello: 'world' }).toMatchInlineSnapshot();
    });
  `;

  writeFiles(TESTS_DIR, {[filename]: test});
  const {stderr, exitCode} = runJest(DIR, ['-w=1', '--ci=false', filename]);
  const fileAfter = readFile(filename);
  expect(stderr).toMatch('1 snapshot written from 1 test suite.');
  expect(exitCode).toBe(0);
  expect(fileAfter).toMatchSnapshot('existing snapshot');
});

test('indentation is correct in the presences of existing snapshots, when the file is correctly formatted by prettier', () => {
  const filename = 'existing-snapshot.test.js';
  const test = `
    it('is true', () => {
      expect(true).toMatchInlineSnapshot(\`true\`);
      expect([1, 2, 3]).toMatchInlineSnapshot();
    });\\n
  `;

  writeFiles(TESTS_DIR, {[filename]: test});
  const {stderr, exitCode} = runJest(DIR, ['-w=1', '--ci=false', filename]);
  const fileAfter = readFile(filename);
  expect(stderr).toMatch('1 snapshot written from 1 test suite.');
  expect(exitCode).toBe(0);
  expect(fileAfter).toMatchSnapshot('existing snapshot');
});

test('diff with prototype is correct', () => {
  const filename = 'with-prototype-diff.test.js';
  const test = `
    test('diff with prototype is correct', () => {
      expect({ hello: 'world' }).toMatchInlineSnapshot(\`
        Object {
          "hello": "world",
        }
      \`);
    });
  `;

  writeFiles(TESTS_DIR, {[filename]: test});
  const {stderr, exitCode} = runJest(DIR, ['--run-in-band', filename]);
  expect(extractSummary(stderr).rest).toMatchSnapshot();
  expect(exitCode).toBe(1);
});


text:
#include "clar_libgit2.h"
#include "buffer.h"

static void expect_decode_pass(const char *expected, const char *encoded)
{
	git_buf in = GIT_BUF_INIT, out = GIT_BUF_INIT;

	/*
	 * ensure that we only read the given length of the input buffer
	 * by putting garbage at the end.  this will ensure that we do
	 * not, eg, rely on nul-termination or walk off the end of the buf.
	 */
	cl_git_pass(git_buf_puts(&in, encoded));
	cl_git_pass(git_buf_PUTS(&in, "TRAILER"));

	cl_git_pass(git_buf_decode_percent(&out, in.ptr, strlen(encoded)));

	cl_assert_equal_s(expected, git_buf_cstr(&out));
	cl_assert_equal_i(strlen(expected), git_buf_len(&out));

	git_buf_dispose(&in);
	git_buf_dispose(&out);
}

void test_buf_percent__decode_succeeds(void)
{
	expect_decode_pass("", "");
	expect_decode_pass(" ", "%20");
	expect_decode_pass("a", "a");
	expect_decode_pass(" a", "%20a");
	expect_decode_pass("a ", "a%20");
	expect_decode_pass("github.com", "github.com");
	expect_decode_pass("github.com", "githu%62.com");
	expect_decode_pass("github.com", "github%2ecom");
	expect_decode_pass("foo bar baz", "foo%20bar%20baz");
	expect_decode_pass("foo bar baz", "foo%20bar%20baz");
	expect_decode_pass("foo bar ", "foo%20bar%20");
}

void test_buf_percent__ignores_invalid(void)
{
	expect_decode_pass("githu%%.com", "githu%%.com");
	expect_decode_pass("github.co%2", "github.co%2");
	expect_decode_pass("github%2.com", "github%2.com");
	expect_decode_pass("githu%2z.com", "githu%2z.com");
	expect_decode_pass("github.co%9z", "github.co%9z");
	expect_decode_pass("github.co%2", "github.co%2");
	expect_decode_pass("github.co%", "github.co%");
}


text:
from .stop_words import STOP_WORDS
from .tokenizer_exceptions import TOKENIZER_EXCEPTIONS
from .lex_attrs import LEX_ATTRS
from ..tokenizer_exceptions import BASE_EXCEPTIONS

from ...language import Language, BaseDefaults
from ...attrs import LANG
from ...util import update_exc

class BulgarianDefaults(BaseDefaults):
    lex_attr_getters = dict(Language.Defaults.lex_attr_getters)
    lex_attr_getters[LANG] = lambda text: "bg"

    lex_attr_getters.update(LEX_ATTRS)

    stop_words = STOP_WORDS
    tokenizer_exceptions = update_exc(BASE_EXCEPTIONS, TOKENIZER_EXCEPTIONS)

class Bulgarian(Language):
    lang = "bg"
    Defaults = BulgarianDefaults

__all__ = ["Bulgarian"]


text:
import copy
import unittest
import os
import sys

import PyOpenColorIO as OCIO
from UnitTestUtils import SIMPLE_CONFIG, TEST_NAMES

class ViewingRulesTest(unittest.TestCase):
    def setUp(self):
        self.rules = OCIO.ViewingRules()

    def tearDown(self):
        self.rule = None

    def test_copy(self):
        """
        Test the deepcopy() method.
        """

        self.rules.insertRule(0, "rule1")
        self.rules.insertRule(1, "rule2")
        self.rules.insertRule(2, "rule3")

        self.rules.addColorSpace(0, "cs1")
        self.rules.addEncoding(1, "enc1")
        self.rules.setCustomKey(2, "key1", "value1")

        other = copy.deepcopy(self.rules)
        self.assertFalse(other is self.rules)

        self.assertEqual(other.getNumEntries(), self.rules.getNumEntries())
        for idx in range(self.rules.getNumEntries()):
            self.assertEqual(other.getName(idx), self.rules.getName(idx))
        self.assertEqual(list(other.getColorSpaces(0)), list(self.rules.getColorSpaces(0)))
        self.assertEqual(list(other.getEncodings(1)), list(self.rules.getEncodings(1)))
        self.assertEqual(list(other.getCustomKeyName(2, 0)), list(self.rules.getCustomKeyName(2, 0)))
        self.assertEqual(list(other.getCustomKeyValue(2, 0)), list(self.rules.getCustomKeyValue(2, 0)))

    def test_insert_remove(self):
        """
        Test the insertRule(), removeRule(), getNumEntrie(), getIndexForRule(), getName() methods.
        """

        # Empty object.
        self.assertEqual(0, self.rules.getNumEntries())

        # Add some rules.
        rule1 = "rule1"
        rule2 = "rule2"
        self.rules.insertRule(0, rule1)
        self.rules.insertRule(1, rule2)

        self.assertEqual(2, self.rules.getNumEntries())
        self.assertEqual(rule1, self.rules.getName(0))
        self.assertEqual(rule2, self.rules.getName(1))

        self.assertEqual(0, self.rules.getIndexForRule(rule1))
        self.assertEqual(1, self.rules.getIndexForRule(rule2))

        # Remove a rule.
        self.rules.removeRule(0)
        self.assertEqual(1, self.rules.getNumEntries())
        self.assertEqual(rule2, self.rules.getName(0))
        self.rules.insertRule(0, rule1)
        self.assertEqual(2, self.rules.getNumEntries())
        self.assertEqual(rule1, self.rules.getName(0))
        self.assertEqual(rule2, self.rules.getName(1))

        # Index has to be valid.
        rule3 = "rule3"
        with self.assertRaises(OCIO.Exception):
            self.rules.insertRule(4, rule3)

        # Rule has to be present.
        with self.assertRaises(OCIO.Exception):
            self.rules.getIndexForRule(rule3)

        # Index has to be valid.
        with self.assertRaises(OCIO.Exception):
            self.rules.getName(3)

        # Index has to be valid.
        with self.assertRaises(OCIO.Exception):
            self.rules.removeRule(3)

        # Rule name must be unique.
        with self.assertRaises(OCIO.Exception):
            self.rules.insertRule(0, rule2)

    def test_color_spaces(self):
        """
        Test the getColorSpaces(), addColorSpace() and removeColorSpace() methods.
        """

        # Add new rule.
        ruleCS = "rule_cs"
        self.rules.insertRule(0, ruleCS)

        # Test empty color space list.
        self.assertEqual(0, len(self.rules.getColorSpaces(0)))
        with self.assertRaises(IndexError):
            self.rules.getColorSpaces(0)[0]

        # Test with defined TEST_NAMES.
        for i, y in enumerate(TEST_NAMES):
            self.rules.addColorSpace(0, y)
            self.assertEqual(i + 1, len(self.rules.getColorSpaces(0)))

        iterator = self.rules.getColorSpaces(0)
        for a in TEST_NAMES:
            self.assertEqual(a, next(iterator))

        # Test the length of color spaces is zero after removing all color spaces.
        for i in range(len(TEST_NAMES)):
            self.rules.removeColorSpace(0, 0)
        self.assertEqual(0, len(self.rules.getColorSpaces(0)))

        # Testing individually adding and removing a color space.
        self.rules.addColorSpace(0, TEST_NAMES[0])
        self.assertEqual(1, len(self.rules.getColorSpaces(0)))
        self.rules.addColorSpace(0, TEST_NAMES[1])
        self.assertEqual(2, len(self.rules.getColorSpaces(0)))
        self.rules.removeColorSpace(0, 1)
        self.assertEqual(1, len(self.rules.getColorSpaces(0)))

        # Index has to be valid.
        with self.assertRaises(OCIO.Exception):
            self.rules.removeColorSpace(0, 1)

        # Can't add encoding if there are color spaces.
        with self.assertRaises(OCIO.Exception):
            self.rules.addEncoding(0, "NoMix")

    def test_encodings(self):
        """
        Test the getEncodings(), addEncoding() and removeEncoding() methods.
        """

        # Add new rule.
        ruleEnc = "rule_enc"
        self.rules.insertRule(0, ruleEnc)

        # Test empty encodings list.
        self.assertEqual(0, len(self.rules.getEncodings(0)))
        with self.assertRaises(IndexError):
            self.rules.getEncodings(0)[0]

        # Test with defined TEST_NAMES.
        for i, y in enumerate(TEST_NAMES):
            self.rules.addEncoding(0, y)
            self.assertEqual(i + 1, len(self.rules.getEncodings(0)))

        iterator = self.rules.getEncodings(0)
        for a in TEST_NAMES:
            self.assertEqual(a, next(iterator))

        # Test the length of encodings is zero after removing all encodings.
        for i in range(len(TEST_NAMES)):
            self.rules.removeEncoding(0, 0)
        self.assertEqual(0, len(self.rules.getEncodings(0)))

        # Testing individually adding and removing an encoding.
        self.rules.addEncoding(0, TEST_NAMES[0])
        self.assertEqual(1, len(self.rules.getEncodings(0)))
        self.rules.addEncoding(0, TEST_NAMES[1])
        self.assertEqual(2, len(self.rules.getEncodings(0)))
        self.rules.removeEncoding(0, 1)
        self.assertEqual(1, len(self.rules.getEncodings(0)))

        # Index has to be valid.
        with self.assertRaises(OCIO.Exception):
            self.rules.removeEncoding(0, 1)

        # Can't add color space if there are encodings.
        with self.assertRaises(OCIO.Exception):
            self.rules.addColorSpace(0, "NoMix")

    def test_custom_keys(self):
        """
        Test the getNumCustomKeys(), getCustomKeyName(), getCustomKeyValue() and setCustomKey() methods.
        """
        # Add new rule.
        rule = "rule"
        self.rules.insertRule(0, rule)

        # Set keys and values and verify they are set.
        self.assertEqual(0, self.rules.getNumCustomKeys(0))
        self.rules.setCustomKey(0, "key1", "value1")
        self.rules.setCustomKey(0, "key2", "value2")
        self.assertEqual(2, self.rules.getNumCustomKeys(0))
        self.assertEqual("key1", self.rules.getCustomKeyName(0, 0))
        self.assertEqual("value1", self.rules.getCustomKeyValue(0, 0))
        self.assertEqual("key2", self.rules.getCustomKeyName(0, 1))
        self.assertEqual("value2", self.rules.getCustomKeyValue(0, 1))
        # Replace a value.
        self.rules.setCustomKey(0, "key2", "value3")
        self.assertEqual(2, self.rules.getNumCustomKeys(0))
        self.assertEqual("value3", self.rules.getCustomKeyValue(0, 1))
        # Remove a key.
        self.rules.setCustomKey(0, "key1", "")
        self.assertEqual(1, self.rules.getNumCustomKeys(0))
        self.assertEqual("key2", self.rules.getCustomKeyName(0, 0))

        # Index has to be valid.
        with self.assertRaises(OCIO.Exception):
            self.rules.setCustomKey(42, "wrong", "")
        # Key name has to be non-empty.
        with self.assertRaises(OCIO.Exception):
            self.rules.setCustomKey(0, "", "")
        # Index has to be valid.
        with self.assertRaises(OCIO.Exception):
            self.rules.getCustomKeyName(0, 42)

    def test_config(self):
        """
        Test the viewing rules object from an OCIO config.
        """

        # Get simple config file from UnitTestUtils.py
        cfg = OCIO.Config().CreateFromStream(SIMPLE_CONFIG)

        # Test ViewingRules class object getters from config
        rules = cfg.getViewingRules()
        self.assertEqual(4, rules.getNumEntries())

        iterator = rules.getColorSpaces(0)
        self.assertEqual(1, len(iterator))
        self.assertEqual("c1", next(iterator))
        self.assertEqual(2, rules.getNumCustomKeys(0))
        self.assertEqual("key0", rules.getCustomKeyName(0, 0))
        self.assertEqual("value0", rules.getCustomKeyValue(0, 0))
        self.assertEqual("key1", rules.getCustomKeyName(0, 1))
        self.assertEqual("value1", rules.getCustomKeyValue(0, 1))
        iterator = rules.getColorSpaces(1)
        self.assertEqual(2, len(iterator))
        self.assertEqual("c2", next(iterator))
        self.assertEqual("c3", next(iterator))
        self.assertEqual(0, rules.getNumCustomKeys(1))
        iterator = rules.getEncodings(2)
        self.assertEqual(1, len(iterator))
        self.assertEqual("log", next(iterator))
        self.assertEqual(0, rules.getNumCustomKeys(2))
        iterator = rules.getEncodings(3)
        self.assertEqual(2, len(iterator))
        self.assertEqual("log", next(iterator))
        self.assertEqual("scene-linear", next(iterator))
        self.assertEqual(2, rules.getNumCustomKeys(3))
        self.assertEqual("key1", rules.getCustomKeyName(3, 0))
        self.assertEqual("value2", rules.getCustomKeyValue(3, 0))
        self.assertEqual("key2", rules.getCustomKeyName(3, 1))
        self.assertEqual("value0", rules.getCustomKeyValue(3, 1))

        # Add a new rule.
        rules.insertRule(0, 'newRule')
        rules.addEncoding(0, 'log')
        rules.addEncoding(0, 'scene-linear')

        # Set the modified rules, get them back and verify there are now 5 rules.
        cfg.setViewingRules(rules)
        rules = cfg.getViewingRules()
        self.assertEqual(5, rules.getNumEntries())


text:
install:
	ansible-playbook --ask-become-pass local.yml

update-dotfiles:
	ansible-playbook --tags dotfiles local.yml


text:
<?php
// classes/Email.class.php

/**
 * Email class conceptualizes an email.
 * It contains the information that the Courier
 * needs to send an email message to a recipient
 */
class Email {
    public $to,
            $from,
            $subject,
            $message,
            $headers;

}

?>


text:
Imports System.Data
Imports System.Data.OleDb

Partial Class filedelete
    Inherits System.Web.UI.Page

    Private intContent As Integer

    Public SecInst As clsSecurity

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        'find out who this person is
        If HttpContext.Current.Session("Security") Is Nothing Then Response.Redirect(ConfigurationManager.AppSettings("gsSiteURL"))

        SecInst = HttpContext.Current.Session("Security")

        lngID.Value = CInt(Val(Request.QueryString("dbid") & ""))
        intContent = CInt(Val(Request.QueryString("contentid") & ""))

        'response.Write(lngID)
        If lngID.Value = 0 Then

            '%>
            Response.Write("That was an invalid ID Number.")
            Response.End()
            '<%

        Else

            If IsPostBack = False Then
                Try
                    Dim mvarconnSQL As New System.Data.OleDb.OleDbConnection(ConfigurationManager.AppSettings("SQLConnectionString").ToString)
                    mvarconnSQL.Open()

                    If mvarconnSQL.State = ConnectionState.Open Then

                        Dim cmd As New OleDb.OleDbCommand("SELECT * From [Songs] Where [ID] = " & lngID.Value & "", mvarconnSQL)
                        Dim data As OleDb.OleDbDataReader

                        cmd.CommandType = CommandType.Text
                        data = cmd.ExecuteReader()

                        If data.Read = False Then

                            Response.Write("Song Not Found.")
                            Response.End()

                        Else

                            lngID.Value = lngID.Value
                            intFileType.Value = intContent
                            If intContent = 0 Then
                                lblFileName.Text = data.Item("Mp3Link") & ""
                            Else
                                lblFileName.Text = data.Item("pptLink") & ""
                            End If

                            If lblFileName.Text = "" Then
                                Label1.Text = ""
                                lblTitle.Text = "NO FILE FOUND"
                                cmdConfirm.Visible = False
                                cmdCancel.Text = "Close"

                            End If

                        End If

                        data.Close()
                        data = Nothing

                        cmd.Dispose()
                        cmd = Nothing

                        mvarconnSQL.Close()
                        mvarconnSQL = Nothing

                    End If

                Catch ex As Exception

                End Try
            End If

        End If

        'cmdConfirm.Attributes.Add("onclick", "javascript: window.close(); return false;")
        cmdCancel.Attributes.Add("onclick", "javascript: window.close(); return false;")

    End Sub

    Protected Sub cmdConfirm_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles cmdConfirm.Click
        Dim intRes As Integer = 0
        Dim blnSecurityCheck As Boolean = False
        Dim cmd As OleDb.OleDbCommand

        Try

            If HttpContext.Current.Session("Security") Is Nothing Then Response.Redirect(ConfigurationManager.AppSettings("gsSiteURL"))

            SecInst = HttpContext.Current.Session("Security")

            'Check Permissions
            If SecInst.CheckPermission(clsSecurity.Permission_ActionCodes.act_PPT_Delete) And intFileType.Value = 1 Then
                blnSecurityCheck = True
            End If

            If SecInst.CheckPermission(clsSecurity.Permission_ActionCodes.act_Mp3Delete) And intFileType.Value = 0 Then
                blnSecurityCheck = True
            End If

            Dim mvarconnSQL As New System.Data.OleDb.OleDbConnection(ConfigurationManager.AppSettings("SQLConnectionString").ToString)
            mvarconnSQL.Open()

            If mvarconnSQL.State = ConnectionState.Open Then

                If intFileType.Value = 0 Then
                    cmd = New OleDb.OleDbCommand("UPDATE [Songs] SET Mp3Link='' Where [ID] = " & lngID.Value & "", mvarconnSQL)
                Else
                    cmd = New OleDb.OleDbCommand("UPDATE [Songs] SET pptLink='' Where [ID] = " & lngID.Value & "", mvarconnSQL)
                End If

                cmd.CommandType = CommandType.Text
                intRes = cmd.ExecuteNonQuery()

                If intRes > 0 Then
                    'Datebase Updated!

                    If clsSharedFns.DeleteFileFromRepos(lngID.Value, intFileType.Value) = True Then
                        lblFileName.Text = "File Deleted"
                    Else
                        lblFileName.Text = "Actual file could not be deleted."
                    End If

                    cmdCancel.Text = "Close"
                    cmdConfirm.Visible = False

                End If

                cmd.Dispose()
                cmd = Nothing

                mvarconnSQL.Close()
                mvarconnSQL = Nothing

            End If

        Catch ex As Exception
            lblFileName.Text = ex.ToString
        End Try

        'lblFileName.Text = "File Deleted"
        cmdCancel.Text = "Close"
        cmdConfirm.Visible = False

    End Sub

End Class