text:
#include <cppdevtk/util/get_user_name.hpp>
#if (!CPPDEVTK_PLATFORM_WINDOWS)
#	error "This file is Windows specific!!!"
#endif
#include <cppdevtk/base/system_exception.hpp>
#include <cppdevtk/base/logger.hpp>
#include <cppdevtk/base/cassert.hpp>
#include <cppdevtk/base/tstring_conv.hpp>

#include <windows.h>
#include <lmcons.h>

namespace cppdevtk {
namespace util {

CPPDEVTK_UTIL_API QString GetUserName() {
	QString userName;

	TCHAR buf[UNLEN + 1];
	DWORD bufSize = sizeof(buf) / sizeof(buf[0]);
	if (!::GetUserName(buf, &bufSize)) {
		const base::ErrorCode kErrorCode = base::GetLastSystemErrorCode();
		CPPDEVTK_ASSERT(kErrorCode.GetValue() != ERROR_INSUFFICIENT_BUFFER);
		CPPDEVTK_LOG_ERROR("GetUserName() failed; error code: " << kErrorCode.ToString());

		return userName;
	}

	userName = CPPDEVTK_T2Q(buf);

	return userName;
}

}	// namespace util
}	// namespace cppdevtk

redpajama_set_name: RedPajamaGithub


text:
ACCEPTED

#### According to
International Plant Names Index

#### Published in
null

#### Original name
Macromeles formosana Koidz.

### Remarks
null


text:
import pytest
from rancher import ApiError
from .common import *  # NOQA

namespace = {"p_client": None,
             "ns": None,
             "cluster": None,
             "project": None,
             "pv": None,
             "pvc": None}

# this is the path to the mounted dir in the pod(workload)
MOUNT_PATH = "/var/nfs"
# if True then delete the NFS after finishing tests, otherwise False
DELETE_NFS = eval(os.environ.get('RANCHER_DELETE_NFS', "True"))

rbac_role_list = [
    (CLUSTER_OWNER),
    (PROJECT_OWNER),
    (PROJECT_MEMBER),
    (PROJECT_READ_ONLY),
    (CLUSTER_MEMBER),
]

@if_test_rbac
@pytest.mark.parametrize("role", rbac_role_list)
def test_rbac_pv_create(role, remove_resource):
    nfs_ip = namespace["nfs_ip"]
    cluster = namespace["cluster"]
    url = CATTLE_TEST_URL + "/v3/clusters/" + cluster.id + "/persistentvolume"
    if (role == CLUSTER_OWNER):
        user_token = rbac_get_user_token_by_role(role)
        # Persistent volume can be created only using cluster client
        owner_clusterclient = get_cluster_client_for_token(cluster, user_token)
        pv = create_pv(owner_clusterclient, nfs_ip)
        remove_resource(pv)
    else:
        # Users other than cluster owner cannot create persistent volume
        # Other user clients do not have attribute to create persistent volume
        # Hence a post request is made as below
        user_token = rbac_get_user_token_by_role(role)
        headers = {"Content-Type": "application/json",
                   "Accept": "application/json",
                   "Authorization": "Bearer " + user_token}
        pv_config = {"type": "persistentVolume",
                     "accessModes": ["ReadWriteOnce"],
                     "name": "testpv",
                     "nfs": {"readOnly": "false",
                             "type": "nfsvolumesource",
                             "path": NFS_SERVER_MOUNT_PATH,
                             "server": nfs_ip
                             },
                     "capacity": {"storage": "10Gi"}
                     }

        response = requests.post(url, json=pv_config, verify=False,
                                 headers=headers)
        assert response.status_code == 403
        jsonresponse = json.loads(response.content)
        assert jsonresponse['code'] == "Forbidden"

@if_test_rbac
@pytest.mark.parametrize("role", rbac_role_list)
def test_rbac_pv_list(role, remove_resource):
    # All users can list the persistent volume which is at the cluster level
    # A get request is performed as user clients do not have attrribute to list
    # persistent volumes
    nfs_ip = namespace["nfs_ip"]
    cluster = namespace["cluster"]

    user_token = rbac_get_user_token_by_role(role)
    owner_token = rbac_get_user_token_by_role(CLUSTER_OWNER)
    owner_clusterclient = get_cluster_client_for_token(cluster, owner_token)
    pv = create_pv(owner_clusterclient, nfs_ip)
    pvname = pv['name']
    url = CATTLE_TEST_URL + "/v3/cluster/" + cluster.id +\
        "/persistentvolumes/" + pvname

    headers = {
        "Content-Type": "application/json",
        "Accept": "application/json",
        "Authorization": "Bearer " + user_token
    }
    response = requests.get(url, verify=False,
                            headers=headers)
    jsonresponse = json.loads(response.content)
    assert response.status_code == 200
    assert jsonresponse['type'] == "persistentVolume"
    assert jsonresponse['name'] == pvname
    remove_resource(pv)

@if_test_rbac
@pytest.mark.parametrize("role", rbac_role_list)
def test_rbac_pv_edit(role):
    nfs_ip = namespace["nfs_ip"]
    cluster = namespace["cluster"]
    clusterowner_token = rbac_get_user_token_by_role(CLUSTER_OWNER)
    owner_clusterclient = get_cluster_client_for_token(cluster,
                                                       clusterowner_token)
    if(role == CLUSTER_OWNER):
        # Verify editing of PV as a Cluster Owner succeeds
        edit_pv(owner_clusterclient, nfs_ip, owner_clusterclient)

    else:
        user_token = rbac_get_user_token_by_role(role)
        user_clusterclient = get_cluster_client_for_token(cluster,
                                                          user_token)
        # Verify editing of PV is forbidden for other roles
        with pytest.raises(ApiError) as e:
            edit_pv(user_clusterclient, nfs_ip, owner_clusterclient)
        print(e.value.error.code)
        assert e.value.error.status == 403
        assert e.value.error.code == 'Forbidden'

@if_test_rbac
@pytest.mark.parametrize("role", rbac_role_list)
def test_rbac_pv_delete(role, remove_resource):
    nfs_ip = namespace["nfs_ip"]
    cluster = namespace["cluster"]
    clusterowner_token = rbac_get_user_token_by_role(CLUSTER_OWNER)
    owner_clusterclient = get_cluster_client_for_token(cluster,
                                                       clusterowner_token)
    if(role == CLUSTER_OWNER):
        pv = create_pv(owner_clusterclient, nfs_ip)
        delete_pv(owner_clusterclient, pv)
    else:
        user_token = rbac_get_user_token_by_role(role)
        user_clusterclient = get_cluster_client_for_token(cluster,
                                                          user_token)
        # As a Cluster Owner create PV object using cluster client
        pv = create_pv(owner_clusterclient, nfs_ip)
        # Verify other roles cannot delete the PV object
        with pytest.raises(ApiError) as e:
            delete_pv(user_clusterclient, pv)
        assert e.value.error.status == 403
        assert e.value.error.code == 'Forbidden'
        remove_resource(pv)

@if_test_rbac
@pytest.mark.parametrize("role", rbac_role_list)
def test_rbac_pvc_create(role, remove_resource):
    user_project = None
    nfs_ip = namespace["nfs_ip"]
    cluster_client = namespace["cluster_client"]
    if(role == CLUSTER_MEMBER):
        user_token = rbac_get_user_token_by_role(CLUSTER_MEMBER)
        user_project, ns = create_project_and_ns(user_token,
                                                 namespace["cluster"],
                                                 random_test_name(
                                                     "cluster-mem"))
        p_client = get_project_client_for_token(user_project, user_token)
    else:
        user_token = rbac_get_user_token_by_role(role)
        project = rbac_get_project()
        ns = rbac_get_namespace()
        p_client = get_project_client_for_token(project, user_token)

    if (role != PROJECT_READ_ONLY):
        pv, pvc = create_pv_pvc(p_client, ns, nfs_ip, cluster_client)
        remove_resource(pv)
        remove_resource(pvc)
    else:
        project = rbac_get_project()
        ns = rbac_get_namespace()
        user_token = rbac_get_user_token_by_role(PROJECT_READ_ONLY)
        readonly_user_client = get_project_client_for_token(project,
                                                            user_token)
        # Verify Read Only member cannot create PVC objects
        with pytest.raises(ApiError) as e:
            create_pv_pvc(readonly_user_client, ns, nfs_ip, cluster_client)
        assert e.value.error.status == 403
        assert e.value.error.code == 'Forbidden'
    if(user_project is not None):
        remove_resource(user_project)

@if_test_rbac
@pytest.mark.parametrize("role", rbac_role_list)
def test_rbac_pvc_create_negative(role, remove_resource):
    nfs_ip = namespace["nfs_ip"]
    cluster_client = namespace["cluster_client"]
    if (role == CLUSTER_OWNER):
        unshared_project = rbac_get_unshared_project()
        ns = rbac_get_unshared_ns()
        user_token = rbac_get_user_token_by_role(role)
        p_client = get_project_client_for_token(unshared_project, user_token)
        pv, pvc = create_pv_pvc(p_client, ns, nfs_ip, cluster_client)
        remove_resource(pv)
        remove_resource(pvc)
    else:
        unshared_project = rbac_get_unshared_project()
        user_token = rbac_get_user_token_by_role(role)
        ns = rbac_get_unshared_ns()
        p_client = get_project_client_for_token(unshared_project, user_token)
        # Verify other members cannot create PVC objects
        with pytest.raises(ApiError) as e:
            create_pv_pvc(p_client, ns, nfs_ip, cluster_client)
        assert e.value.error.status == 403
        assert e.value.error.code == 'Forbidden'

@if_test_rbac
@pytest.mark.parametrize("role", rbac_role_list)
def test_rbac_pvc_edit_negative(role, remove_resource):
        # Editing of volume claims is not allowed for any role,
        # We are verifying that editing is forbidden in shared
        # and unshared projects

        nfs_ip = namespace["nfs_ip"]
        cluster_client = namespace["cluster_client"]
        cluster_owner_token = rbac_get_user_token_by_role(CLUSTER_OWNER)
        user_token = rbac_get_user_token_by_role(role)
        project = rbac_get_project()
        ns = rbac_get_namespace()
        p_client = get_project_client_for_token(project, user_token)
        # Cluster owner client created in the shared project
        owner_client = \
            get_project_client_for_token(project, cluster_owner_token)
        edit_pvc(p_client, ns, nfs_ip, cluster_client, owner_client)

        unshared_project = rbac_get_unshared_project()
        user_token = rbac_get_user_token_by_role(role)
        unshared_ns = rbac_get_unshared_ns()
        user_client = get_project_client_for_token(unshared_project,
                                                   user_token)

        # Cluster owner client created in the unshared project
        owner_client = \
            get_project_client_for_token(unshared_project, cluster_owner_token)

        nfs_ip = namespace["nfs_ip"]
        cluster_client = namespace["cluster_client"]
        edit_pvc(user_client, unshared_ns, nfs_ip, cluster_client,
                 owner_client)

@if_test_rbac
@pytest.mark.parametrize("role", rbac_role_list)
def test_rbac_pvc_delete(role, remove_resource):
    nfs_ip = namespace["nfs_ip"]
    cluster_client = namespace["cluster_client"]
    user_project = None
    if(role == CLUSTER_MEMBER):
        user_token = rbac_get_user_token_by_role(CLUSTER_MEMBER)
        user_project, ns = create_project_and_ns(user_token,
                                                 namespace["cluster"],
                                                 random_test_name(
                                                     "cluster-mem"))
        p_client = get_project_client_for_token(user_project, user_token)
    else:
        user_token = rbac_get_user_token_by_role(role)
        project = rbac_get_project()
        ns = rbac_get_namespace()
        p_client = get_project_client_for_token(project, user_token)

    if (role != PROJECT_READ_ONLY):
        pv, pvc = create_pv_pvc(p_client, ns, nfs_ip, cluster_client)
        delete_pvc(p_client, pvc, ns)
        remove_resource(pv)
    if user_project is not None:
        remove_resource(user_project)

    if (role == PROJECT_READ_ONLY):
        project = rbac_get_project()
        ns = rbac_get_namespace()
        cluster_owner_token = rbac_get_user_token_by_role(CLUSTER_OWNER)
        cluster_owner_p_client = \
            get_project_client_for_token(project, cluster_owner_token)
        user_token = rbac_get_user_token_by_role(PROJECT_READ_ONLY)
        readonly_client = get_project_client_for_token(project, user_token)

        # As a Cluster owner create a PVC object
        pv, pvc = create_pv_pvc(cluster_owner_p_client, ns, nfs_ip,
                                cluster_client)
        # Verify that the Read Only member cannot delete the PVC objects
        # created by Cluster Owner
        with pytest.raises(ApiError) as e:
            delete_pvc(readonly_client, pvc, ns)
        assert e.value.error.status == 403
        assert e.value.error.code == 'Forbidden'
        remove_resource(pv)
        remove_resource(pvc)

@if_test_rbac
@pytest.mark.parametrize("role", rbac_role_list)
def test_rbac_pvc_delete_negative(role, remove_resource):
    nfs_ip = namespace["nfs_ip"]
    cluster_client = namespace["cluster_client"]
    if (role == CLUSTER_OWNER):
        unshared_project = rbac_get_unshared_project()
        ns = rbac_get_unshared_ns()
        user_token = rbac_get_user_token_by_role(role)
        p_client = get_project_client_for_token(unshared_project, user_token)
        pv, pvc = create_pv_pvc(p_client, ns, nfs_ip,
                                cluster_client)
        delete_pvc(p_client, pvc, ns)
        remove_resource(pv)
    else:
        unshared_project = rbac_get_unshared_project()
        ns = rbac_get_unshared_ns()
        cluster_owner_token = rbac_get_user_token_by_role(CLUSTER_OWNER)
        owner_client = get_project_client_for_token(unshared_project,
                                                    cluster_owner_token)
        user_token = rbac_get_user_token_by_role(role)
        # As a Cluster Owner create pv, pvc
        pv, pvc = create_pv_pvc(owner_client, ns, nfs_ip,
                                cluster_client)
        user_client = get_project_client_for_token(unshared_project,
                                                   user_token)
        with pytest.raises(ApiError) as e:
            delete_pvc(user_client, pvc, ns)
        assert e.value.error.status == 403
        assert e.value.error.code == 'Forbidden'
        remove_resource(pv)
        remove_resource(pvc)

@if_test_rbac
@pytest.mark.parametrize("role", rbac_role_list)
def test_rbac_pvc_list(remove_resource, role):
    user_project = None
    nfs_ip = namespace["nfs_ip"]
    cluster_client = namespace["cluster_client"]
    if(role == CLUSTER_MEMBER):
        cluster_member_token = rbac_get_user_token_by_role(CLUSTER_MEMBER)
        user_project, ns = \
            create_project_and_ns(cluster_member_token,
                                  namespace["cluster"],
                                  random_test_name("cluster-mem"))

        user_client = get_project_client_for_token(user_project,
                                                   cluster_member_token)
        # As a cluster member create a PVC and he should be able to list it
        pv, pvc = create_pv_pvc(user_client, ns, nfs_ip, cluster_client)
    else:
        cluster_owner_token = rbac_get_user_token_by_role(CLUSTER_OWNER)
        project = rbac_get_project()
        cluster_owner_p_client = \
            get_project_client_for_token(project, cluster_owner_token)
        user_token = rbac_get_user_token_by_role(role)
        project = rbac_get_project()
        ns = rbac_get_namespace()
        user_client = get_project_client_for_token(project, user_token)
        # As a Cluster Owner create pv, pvc
        pv, pvc = create_pv_pvc(cluster_owner_p_client, ns, nfs_ip,
                                cluster_client)

    pvcname = pvc["name"]
    pvcdict = user_client.list_persistentVolumeClaim(name=pvcname)
    print(pvcdict)
    pvcdata = pvcdict['data']
    assert len(pvcdata) == 1
    assert pvcdata[0].type == "persistentVolumeClaim"
    assert pvcdata[0].name == pvcname
    remove_resource(pvc)
    remove_resource(pv)
    if user_client is not None:
        remove_resource(user_project)

@if_test_rbac
@pytest.mark.parametrize("role", rbac_role_list)
def test_rbac_pvc_list_negative(remove_resource, role):
    nfs_ip = namespace["nfs_ip"]
    cluster_client = namespace["cluster_client"]
    if (role == CLUSTER_OWNER):
        unshared_project = rbac_get_unshared_project()
        ns = rbac_get_unshared_ns()
        user_token = rbac_get_user_token_by_role(role)
        p_client = get_project_client_for_token(unshared_project, user_token)
        pv, pvc = create_pv_pvc(p_client, ns, nfs_ip, cluster_client)
        pvcname = pvc['name']
        pvcdict = p_client.list_persistentVolumeClaim(name=pvcname)
        pvcdata = pvcdict.get('data')
        assert len(pvcdata) == 1
        assert pvcdata[0].type == "persistentVolumeClaim"
        assert pvcdata[0].name == pvcname
        remove_resource(pv)
        remove_resource(pvc)
    else:
        cluster_owner_token = rbac_get_user_token_by_role(CLUSTER_OWNER)
        unshared_project = rbac_get_unshared_project()
        ns = rbac_get_unshared_ns()
        cluster_owner_client = \
            get_project_client_for_token(unshared_project, cluster_owner_token)
        user_token = rbac_get_user_token_by_role(role)
        user_client = get_project_client_for_token(unshared_project,
                                                   user_token)
        # As a Cluster Owner create pv, pvc
        pv, pvc = create_pv_pvc(cluster_owner_client, ns, nfs_ip,
                                cluster_client)
        pvcname = pvc['name']
        # Verify length of PVC list is zero for users with other roles
        pvcdict = user_client.list_horizontalPodAutoscaler(name=pvcname)
        pvcdata = pvcdict.get('data')
        assert len(pvcdata) == 0
        remove_resource(pv)
        remove_resource(pvcname)

def edit_pvc(user_client, ns, nfs_ip, cluster_client,
             cluster_owner_client):
    # Create pv and pvc as cluster owner which will be used during edit_pvc
    # negative test cases since roles other than cluster owner cannot
    # create pvc in unshared projects

    pv, pvc = create_pv_pvc(cluster_owner_client, ns, nfs_ip, cluster_client)

    updated_pvc_config = {
        "accessModes": ["ReadWriteOnce"],
        "name": pvc['name'],
        "volumeId": pv.id,
        "namespaceId": ns.id,
        "storageClassId": "",
        "resources": {"requests": {"storage": "15Gi"}}
    }
    with pytest.raises(ApiError) as e:
        user_client.update(pvc, updated_pvc_config)
    assert e.value.error.status == 403
    assert e.value.error.code == 'Forbidden'

    cluster_owner_client.delete(pvc)
    cluster_client.delete(pv)

def delete_pvc(client, pvc, ns):
    pvcname = pvc['name']
    print(pvcname)
    client.delete(pvc)
    # Sleep to allow PVC to be deleted
    time.sleep(5)
    timeout = 30
    pvcdict = client.list_persistentVolumeClaim(name=pvcname)
    start = time.time()
    if len(pvcdict.get('data')) > 0:
        testdata = pvcdict.get('data')
        print(testdata)
        while pvcname in testdata[0]:
            if time.time() - start > timeout:
                raise AssertionError("Timed out waiting for deletion")
            time.sleep(.5)
            pvcdict = client.list_persistentVolumeClaim(name=pvcname)
            testdata = pvcdict.get('data')
        assert True
    assert len(pvcdict.get('data')) == 0, "Failed to delete the PVC"

    # Verify pvc is deleted by "kubectl get pvc" command
    command = "get pvc {} --namespace {}".format(pvc['name'], ns.name)
    print("Command to obtain the pvc")
    print(command)
    result = execute_kubectl_cmd(command, json_out=False, stderr=True)
    print(result)

    print("Verify that the pvc does not exist "
          "and the error code returned is non zero ")
    assert result != 0, "Result should be a non zero value"

def delete_pv(cluster_client, pv):
    pvname = pv['name']
    print(pvname)
    cluster_client.delete(pv)
    # Sleep to allow PVC to be deleted
    time.sleep(5)
    timeout = 30
    pvdict = cluster_client.list_persistent_volume(name=pvname)
    print(pvdict)
    start = time.time()
    if len(pvdict.get('data')) > 0:
        testdata = pvdict.get('data')
        print(testdata)
        while pvname in testdata[0]:
            if time.time() - start > timeout:
                raise AssertionError("Timed out waiting for deletion")
            time.sleep(.5)
            pvcdict = cluster_client.list_persistent_volume(name=pvname)
            testdata = pvcdict.get('data')
        assert True
    assert len(pvdict.get('data')) == 0, "Failed to delete the PV"

    # Verify pv is deleted by "kubectl get pv" command
    command = "get pv {} ".format(pv['name'])
    print("Command to obtain the pvc")
    print(command)
    result = execute_kubectl_cmd(command, json_out=False, stderr=True)
    print(result)
    print("Verify that the pv does not exist "
          "and the error code returned is non zero ")
    assert result != 0, "Result should be a non zero value"

def edit_pv(client, nfs_ip, cluster_owner_client):
    pv = create_pv(cluster_owner_client, nfs_ip)

    updated_pv_config = {
        "type": "persistentVolume",
        "accessModes": ["ReadWriteOnce"],
        "name": pv['name'],
        "nfs": {"readOnly": "false",
                "type": "nfsvolumesource",
                "path": NFS_SERVER_MOUNT_PATH,
                "server": nfs_ip
                },
        "capacity": {"storage": "20Gi"}
    }
    updated_pv = client.update(pv, updated_pv_config)
    capacitydict = updated_pv['capacity']
    assert capacitydict['storage'] == '20Gi'
    assert pv['type'] == 'persistentVolume'
    cluster_owner_client.delete(updated_pv)

@pytest.fixture(scope="module", autouse="True")
def volumes_setup(request):
    client, cluster = get_user_client_and_cluster()
    create_kubeconfig(cluster)
    project, ns = create_project_and_ns(USER_TOKEN, cluster, "project-volumes")
    p_client = get_project_client_for_token(project, USER_TOKEN)
    nfs_node = provision_nfs_server()
    nfs_ip = nfs_node.get_public_ip()
    print("IP of the NFS Server: ", nfs_ip)

    # add  persistent volume to the cluster
    cluster_client = get_cluster_client_for_token(cluster, USER_TOKEN)

    namespace["p_client"] = p_client
    namespace["ns"] = ns
    namespace["cluster"] = cluster
    namespace["project"] = project
    namespace["nfs_ip"] = nfs_ip
    namespace["cluster_client"] = cluster_client

    def fin():
        cluster_client = get_cluster_client_for_token(namespace["cluster"],
                                                      USER_TOKEN)
        cluster_client.delete(namespace["project"])
        cluster_client.delete(namespace["pv"])
        if DELETE_NFS is True:
            AmazonWebServices().delete_node(nfs_node)
    request.addfinalizer(fin)


text:
package oglematchers_test

import (
	. "github.com/smartystreets/goconvey/convey/assertions/oglematchers"
	. "github.com/smartystreets/goconvey/convey/assertions/ogletest"
)

////////////////////////////////////////////////////////////////////////
// Helpers
////////////////////////////////////////////////////////////////////////

type AnyTest struct {
}

func init() { RegisterTestSuite(&AnyTest{}) }

////////////////////////////////////////////////////////////////////////
// Tests
////////////////////////////////////////////////////////////////////////

func (t *AnyTest) Description() {
	m := Any()
	ExpectEq("is anything", m.Description())
}

func (t *AnyTest) Matches() {
	var err error
	m := Any()

	err = m.Matches(nil)
	ExpectEq(nil, err)

	err = m.Matches(17)
	ExpectEq(nil, err)

	err = m.Matches("taco")
	ExpectEq(nil, err)
}


text:
__version__ = '0.11.0'

from .exceptions import *
from .net import Net
from .ipwhois import IPWhois


text:
using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using Orchard.ContentManagement;

namespace Orchard.AuditTrail.Services.Models {
    public class Filters : Dictionary<string, string> {

        public Filters(IUpdateModel updateModel) {
            UpdateModel = updateModel;
        }

        public IUpdateModel UpdateModel { get; set; }

        public static Filters From(NameValueCollection nameValues, IUpdateModel updateModel) {
            var filters = new Filters(updateModel);

            foreach (string nameValue in nameValues) {
                if (!String.IsNullOrEmpty(nameValue)) {
                    filters.Add(nameValue, nameValues[nameValue]);
                }
            }

            return filters;
        }

        public Filters AddFilter(string key, string value) {
            Add(key, value);
            return this;
        }
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="DesignSurface">
    <option name="filePathToZoomLevelMap">
      <map>
        <entry key="app/src/main/res/drawable/ic_menu_camera.xml" value="0.2845" />
        <entry key="app/src/main/res/drawable/ic_menu_gallery.xml" value="0.2845" />
        <entry key="app/src/main/res/drawable/ic_menu_slideshow.xml" value="0.2845" />
        <entry key="app/src/main/res/layout/activity_main.xml" value="0.333786231884058" />
        <entry key="app/src/main/res/layout/app_bar_main.xml" value="0.333786231884058" />
        <entry key="app/src/main/res/layout/content_main.xml" value="0.333786231884058" />
        <entry key="app/src/main/res/layout/fragment_about.xml" value="0.18177083333333333" />
        <entry key="app/src/main/res/layout/fragment_add_task.xml" value="0.18177083333333333" />
        <entry key="app/src/main/res/layout/fragment_gallery.xml" value="0.333786231884058" />
        <entry key="app/src/main/res/layout/fragment_home.xml" value="0.22" />
        <entry key="app/src/main/res/layout/fragment_slideshow.xml" value="0.333786231884058" />
        <entry key="app/src/main/res/layout/nav_header_main.xml" value="0.333786231884058" />
        <entry key="app/src/main/res/layout/recyclerview_row.xml" value="0.18177083333333333" />
        <entry key="app/src/main/res/layout/recyclerview_row2.xml" value="0.18177083333333333" />
        <entry key="app/src/main/res/menu/activity_main_drawer.xml" value="0.35625" />
        <entry key="app/src/main/res/menu/main.xml" value="0.35625" />
      </map>
    </option>
  </component>
  <component name="ProjectRootManager" version="2" languageLevel="JDK_11" default="true" project-jdk-name="Android Studio default JDK" project-jdk-type="JavaSDK">
    <output url="file://$PROJECT_DIR$/build/classes" />
  </component>
  <component name="ProjectType">
    <option name="id" value="Android" />
  </component>
</project>


text:
namespace LipidDeNovo
{
    partial class Form1
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.label1 = new System.Windows.Forms.Label();
            this.label2 = new System.Windows.Forms.Label();
            this.textBox1 = new System.Windows.Forms.TextBox();
            this.textBox2 = new System.Windows.Forms.TextBox();
            this.groupBox1 = new System.Windows.Forms.GroupBox();
            this.radioButton2 = new System.Windows.Forms.RadioButton();
            this.radioButton1 = new System.Windows.Forms.RadioButton();
            this.groupBox2 = new System.Windows.Forms.GroupBox();
            this.groupBox3 = new System.Windows.Forms.GroupBox();
            this.label12 = new System.Windows.Forms.Label();
            this.label4 = new System.Windows.Forms.Label();
            this.label3 = new System.Windows.Forms.Label();
            this.textBox12 = new System.Windows.Forms.TextBox();
            this.textBox4 = new System.Windows.Forms.TextBox();
            this.textBox3 = new System.Windows.Forms.TextBox();
            this.groupBox4 = new System.Windows.Forms.GroupBox();
            this.label8 = new System.Windows.Forms.Label();
            this.label5 = new System.Windows.Forms.Label();
            this.label7 = new System.Windows.Forms.Label();
            this.label6 = new System.Windows.Forms.Label();
            this.textBox8 = new System.Windows.Forms.TextBox();
            this.textBox7 = new System.Windows.Forms.TextBox();
            this.textBox5 = new System.Windows.Forms.TextBox();
            this.textBox6 = new System.Windows.Forms.TextBox();
            this.button1 = new System.Windows.Forms.Button();
            this.label13 = new System.Windows.Forms.Label();
            this.textBox13 = new System.Windows.Forms.TextBox();
            this.groupBox1.SuspendLayout();
            this.groupBox2.SuspendLayout();
            this.groupBox3.SuspendLayout();
            this.groupBox4.SuspendLayout();
            this.SuspendLayout();
            //
            // label1
            //
            this.label1.AutoSize = true;
            this.label1.Location = new System.Drawing.Point(6, 47);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(101, 13);
            this.label1.TabIndex = 1;
            this.label1.Text = "A2 ion (Intact Mass)";
            this.label1.Click += new System.EventHandler(this.label1_Click);
            //
            // label2
            //
            this.label2.AutoSize = true;
            this.label2.Location = new System.Drawing.Point(7, 24);
            this.label2.Name = "label2";
            this.label2.Size = new System.Drawing.Size(102, 13);
            this.label2.TabIndex = 0;
            this.label2.Text = "Y1 Ion (Intact Mass)";
            //
            // textBox1
            //
            this.textBox1.Location = new System.Drawing.Point(191, 47);
            this.textBox1.Name = "textBox1";
            this.textBox1.Size = new System.Drawing.Size(100, 20);
            this.textBox1.TabIndex = 3;
            this.textBox1.TextChanged += new System.EventHandler(this.textBox1_TextChanged);
            //
            // textBox2
            //
            this.textBox2.Location = new System.Drawing.Point(191, 24);
            this.textBox2.Name = "textBox2";
            this.textBox2.Size = new System.Drawing.Size(100, 20);
            this.textBox2.TabIndex = 2;
            //
            // groupBox1
            //
            this.groupBox1.Controls.Add(this.radioButton2);
            this.groupBox1.Controls.Add(this.radioButton1);
            this.groupBox1.Location = new System.Drawing.Point(12, 12);
            this.groupBox1.Name = "groupBox1";
            this.groupBox1.Size = new System.Drawing.Size(200, 100);
            this.groupBox1.TabIndex = 0;
            this.groupBox1.TabStop = false;
            this.groupBox1.Text = "Choose a Method";
            //
            // radioButton2
            //
            this.radioButton2.AutoSize = true;
            this.radioButton2.Location = new System.Drawing.Point(6, 43);
            this.radioButton2.Name = "radioButton2";
            this.radioButton2.Size = new System.Drawing.Size(70, 17);
            this.radioButton2.TabIndex = 1;
            this.radioButton2.Text = "Method 2";
            this.radioButton2.UseVisualStyleBackColor = true;
            this.radioButton2.CheckedChanged += new System.EventHandler(this.radioButton2_CheckedChanged);
            //
            // radioButton1
            //
            this.radioButton1.AutoSize = true;
            this.radioButton1.Checked = true;
            this.radioButton1.Location = new System.Drawing.Point(7, 20);
            this.radioButton1.Name = "radioButton1";
            this.radioButton1.Size = new System.Drawing.Size(70, 17);
            this.radioButton1.TabIndex = 0;
            this.radioButton1.TabStop = true;
            this.radioButton1.Text = "Method 1";
            this.radioButton1.UseVisualStyleBackColor = true;
            this.radioButton1.CheckedChanged += new System.EventHandler(this.radioButton1_CheckedChanged);
            //
            // groupBox2
            //
            this.groupBox2.Controls.Add(this.label1);
            this.groupBox2.Controls.Add(this.label2);
            this.groupBox2.Controls.Add(this.textBox1);
            this.groupBox2.Controls.Add(this.textBox2);
            this.groupBox2.Location = new System.Drawing.Point(256, 12);
            this.groupBox2.Name = "groupBox2";
            this.groupBox2.Size = new System.Drawing.Size(340, 81);
            this.groupBox2.TabIndex = 1;
            this.groupBox2.TabStop = false;
            this.groupBox2.Text = "Give Intact Masses";
            //
            // groupBox3
            //
            this.groupBox3.Controls.Add(this.label12);
            this.groupBox3.Controls.Add(this.label4);
            this.groupBox3.Controls.Add(this.label3);
            this.groupBox3.Controls.Add(this.textBox12);
            this.groupBox3.Controls.Add(this.textBox4);
            this.groupBox3.Controls.Add(this.textBox3);
            this.groupBox3.Enabled = false;
            this.groupBox3.Location = new System.Drawing.Point(256, 118);
            this.groupBox3.Name = "groupBox3";
            this.groupBox3.Size = new System.Drawing.Size(340, 129);
            this.groupBox3.TabIndex = 2;
            this.groupBox3.TabStop = false;
            this.groupBox3.Text = "Method 2 Specific";
            //
            // label12
            //
            this.label12.AutoSize = true;
            this.label12.Location = new System.Drawing.Point(7, 72);
            this.label12.Name = "label12";
            this.label12.Size = new System.Drawing.Size(61, 13);
            this.label12.TabIndex = 4;
            this.label12.Text = "Precursor 2";
            //
            // label4
            //
            this.label4.AutoSize = true;
            this.label4.Location = new System.Drawing.Point(6, 49);
            this.label4.Name = "label4";
            this.label4.Size = new System.Drawing.Size(38, 13);
            this.label4.TabIndex = 2;
            this.label4.Text = "X1+52";
            //
            // label3
            //
            this.label3.AutoSize = true;
            this.label3.Location = new System.Drawing.Point(6, 26);
            this.label3.Name = "label3";
            this.label3.Size = new System.Drawing.Size(38, 13);
            this.label3.TabIndex = 0;
            this.label3.Text = "X1 Ion";
            //
            // textBox12
            //
            this.textBox12.Location = new System.Drawing.Point(191, 69);
            this.textBox12.Name = "textBox12";
            this.textBox12.Size = new System.Drawing.Size(100, 20);
            this.textBox12.TabIndex = 2;
            this.textBox12.TextChanged += new System.EventHandler(this.textBox1_TextChanged);
            //
            // textBox4
            //
            this.textBox4.Location = new System.Drawing.Point(190, 46);
            this.textBox4.Name = "textBox4";
            this.textBox4.Size = new System.Drawing.Size(100, 20);
            this.textBox4.TabIndex = 1;
            this.textBox4.TextChanged += new System.EventHandler(this.textBox1_TextChanged);
            //
            // textBox3
            //
            this.textBox3.Location = new System.Drawing.Point(190, 19);
            this.textBox3.Name = "textBox3";
            this.textBox3.Size = new System.Drawing.Size(100, 20);
            this.textBox3.TabIndex = 0;
            this.textBox3.TextChanged += new System.EventHandler(this.textBox1_TextChanged);
            //
            // groupBox4
            //
            this.groupBox4.Controls.Add(this.label8);
            this.groupBox4.Controls.Add(this.label5);
            this.groupBox4.Controls.Add(this.label7);
            this.groupBox4.Controls.Add(this.label6);
            this.groupBox4.Controls.Add(this.textBox8);
            this.groupBox4.Controls.Add(this.textBox7);
            this.groupBox4.Controls.Add(this.textBox5);
            this.groupBox4.Controls.Add(this.textBox6);
            this.groupBox4.Location = new System.Drawing.Point(12, 238);
            this.groupBox4.Name = "groupBox4";
            this.groupBox4.Size = new System.Drawing.Size(669, 84);
            this.groupBox4.TabIndex = 5;
            this.groupBox4.TabStop = false;
            this.groupBox4.Text = "MS/MS Information";
            this.groupBox4.Enter += new System.EventHandler(this.groupBox4_Enter);
            //
            // label8
            //
            this.label8.AutoSize = true;
            this.label8.Location = new System.Drawing.Point(306, 45);
            this.label8.Name = "label8";
            this.label8.Size = new System.Drawing.Size(150, 13);
            this.label8.TabIndex = 1;
            this.label8.Text = "MS/MS a2 Intensity (CSV List)";
            this.label8.Click += new System.EventHandler(this.label5_Click);
            //
            // label5
            //
            this.label5.AutoSize = true;
            this.label5.Location = new System.Drawing.Point(6, 49);
            this.label5.Name = "label5";
            this.label5.Size = new System.Drawing.Size(131, 13);
            this.label5.TabIndex = 7;
            this.label5.Text = "MS/MS a2 Ions (CSV List)";
            this.label5.Click += new System.EventHandler(this.label5_Click);
            //
            // label7
            //
            this.label7.AutoSize = true;
            this.label7.Location = new System.Drawing.Point(306, 22);
            this.label7.Name = "label7";
            this.label7.Size = new System.Drawing.Size(151, 13);
            this.label7.TabIndex = 5;
            this.label7.Text = "MS/MS Y1 Intensity (CSV List)";
            this.label7.Click += new System.EventHandler(this.label6_Click);
            //
            // label6
            //
            this.label6.AutoSize = true;
            this.label6.Location = new System.Drawing.Point(6, 26);
            this.label6.Name = "label6";
            this.label6.Size = new System.Drawing.Size(132, 13);
            this.label6.TabIndex = 0;
            this.label6.Text = "MS/MS Y1 Ions (CSV List)";
            this.label6.Click += new System.EventHandler(this.label6_Click);
            //
            // textBox8
            //
            this.textBox8.Location = new System.Drawing.Point(462, 46);
            this.textBox8.Name = "textBox8";
            this.textBox8.Size = new System.Drawing.Size(147, 20);
            this.textBox8.TabIndex = 6;
            this.textBox8.TextChanged += new System.EventHandler(this.textBox1_TextChanged);
            //
            // textBox7
            //
            this.textBox7.Location = new System.Drawing.Point(463, 15);
            this.textBox7.Name = "textBox7";
            this.textBox7.Size = new System.Drawing.Size(146, 20);
            this.textBox7.TabIndex = 4;
            this.textBox7.TextChanged += new System.EventHandler(this.textBox1_TextChanged);
            //
            // textBox5
            //
            this.textBox5.Location = new System.Drawing.Point(143, 46);
            this.textBox5.Name = "textBox5";
            this.textBox5.Size = new System.Drawing.Size(147, 20);
            this.textBox5.TabIndex = 5;
            this.textBox5.TextChanged += new System.EventHandler(this.textBox1_TextChanged);
            //
            // textBox6
            //
            this.textBox6.Location = new System.Drawing.Point(144, 19);
            this.textBox6.Name = "textBox6";
            this.textBox6.Size = new System.Drawing.Size(146, 20);
            this.textBox6.TabIndex = 3;
            this.textBox6.TextChanged += new System.EventHandler(this.textBox1_TextChanged);
            //
            // button1
            //
            this.button1.Location = new System.Drawing.Point(240, 328);
            this.button1.Name = "button1";
            this.button1.Size = new System.Drawing.Size(191, 23);
            this.button1.TabIndex = 6;
            this.button1.Text = "Make Structure";
            this.button1.UseVisualStyleBackColor = true;
            this.button1.Click += new System.EventHandler(this.button1_Click);
            //
            // label13
            //
            this.label13.AutoSize = true;
            this.label13.Location = new System.Drawing.Point(18, 137);
            this.label13.Name = "label13";
            this.label13.Size = new System.Drawing.Size(81, 13);
            this.label13.TabIndex = 1;
            this.label13.Text = "2- Charge State";
            //
            // textBox13
            //
            this.textBox13.Location = new System.Drawing.Point(125, 134);
            this.textBox13.Name = "textBox13";
            this.textBox13.Size = new System.Drawing.Size(100, 20);
            this.textBox13.TabIndex = 2;
            this.textBox13.TextChanged += new System.EventHandler(this.textBox1_TextChanged);
            //
            // Form1
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(693, 359);
            this.Controls.Add(this.button1);
            this.Controls.Add(this.label13);
            this.Controls.Add(this.groupBox2);
            this.Controls.Add(this.textBox13);
            this.Controls.Add(this.groupBox4);
            this.Controls.Add(this.groupBox3);
            this.Controls.Add(this.groupBox1);
            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
            this.Name = "Form1";
            this.Text = "UVliPiD Neutral Loss Calculator";
            this.Load += new System.EventHandler(this.Form1_Load);
            this.groupBox1.ResumeLayout(false);
            this.groupBox1.PerformLayout();
            this.groupBox2.ResumeLayout(false);
            this.groupBox2.PerformLayout();
            this.groupBox3.ResumeLayout(false);
            this.groupBox3.PerformLayout();
            this.groupBox4.ResumeLayout(false);
            this.groupBox4.PerformLayout();
            this.ResumeLayout(false);
            this.PerformLayout();

        }

        #endregion

        private System.Windows.Forms.Label label1;
        private System.Windows.Forms.Label label2;
        private System.Windows.Forms.TextBox textBox1;
        private System.Windows.Forms.TextBox textBox2;
        private System.Windows.Forms.GroupBox groupBox1;
        private System.Windows.Forms.RadioButton radioButton2;
        private System.Windows.Forms.RadioButton radioButton1;
        private System.Windows.Forms.GroupBox groupBox2;
        private System.Windows.Forms.GroupBox groupBox3;
        private System.Windows.Forms.Label label4;
        private System.Windows.Forms.Label label3;
        private System.Windows.Forms.TextBox textBox4;
        private System.Windows.Forms.TextBox textBox3;
        private System.Windows.Forms.GroupBox groupBox4;
        private System.Windows.Forms.Label label5;
        private System.Windows.Forms.Label label6;
        private System.Windows.Forms.TextBox textBox5;
        private System.Windows.Forms.TextBox textBox6;
        private System.Windows.Forms.Label label8;
        private System.Windows.Forms.Label label7;
        private System.Windows.Forms.TextBox textBox8;
        private System.Windows.Forms.TextBox textBox7;
        private System.Windows.Forms.Button button1;
        private System.Windows.Forms.Label label12;
        private System.Windows.Forms.TextBox textBox12;
        private System.Windows.Forms.Label label13;
        private System.Windows.Forms.TextBox textBox13;
    }
}


text:
namespace FurnitureFactory.Models
{
    using System;

    public class Order
    {
        public int Id { get; set; }

        public int ClientId { get; set; }

        public virtual Client Client { get; set; }

        public int ProductId { get; set; }

        public virtual Product Product { get; set; }

        public int Quantity { get; set; }

        public decimal Price { get; set; }

        public DateTime DeliveryDate { get; set; }

        public bool PaymentStatus { get; set; }
    }
}


text:
namespace UnrealBuildTool.Rules
{
	public class CodeView : ModuleRules
	{
		public CodeView(TargetInfo Target)
		{
			PublicDependencyModuleNames.AddRange(
				new string[]
				{
					"Slate",
                    "InputCore",
					"Core",
					"CoreUObject",
					"Engine",
					"UnrealEd",
					"EditorStyle",
					"PropertyEditor",
					"DesktopPlatform",
				}
			);

			PrivateDependencyModuleNames.AddRange(
				new string[]
				{
					"DetailCustomizations",
					"SlateCore",
				}
			);
		}
	}
}


text:
'use strict';

import ArtistConstants from '../constants/ArtistConstants';

const artist = (state = {}, action) => {
	switch (action.type) {
		case ArtistConstants.GET_ARTIST:
			return Object.assign({}, state, action.data);
		case ArtistConstants.CREATE_ARTIST:
			return Object.assign({}, state, action.data);
		case ArtistConstants.UPDATE_ARTIST:
			return Object.assign({}, state, action.data);
		default:
			return state;
	}
};

const artists = (state = [], action) => {
	switch (action.type) {
		case ArtistConstants.GET_ARTISTS:
			return [...action.data];
		case ArtistConstants.CREATE_ARTIST:
			return [
				...state,
				artist(undefined, action)
			];
		case ArtistConstants.REMOVE_ARTIST:
			let artistArray = [...state];
			let index = state.findIndex((artist) => artist.id === action.data);
			if (index !== -1) {
				artistArray.splice(index, 1);
			}
			return artistArray;
		case ArtistConstants.FILTER_ARTISTS:
			return [...action.data];
		default:
			return state;
	}
}

export {
	artist,
	artists
};


text:
<?php

namespace Sonata\DoctrinePHPCRAdminBundle\Filter;

use Sonata\AdminBundle\Filter\Filter as BaseFilter;
use Sonata\DoctrinePHPCRAdminBundle\Datagrid\ProxyQuery;

abstract class Filter extends BaseFilter
{
    /**
     * @var bool
     */
    protected $active = false;

    /**
     * @param ProxyQuery $queryBuilder
     * @param mixed      $value
     */
    public function apply($queryBuilder, $value)
    {
        $this->value = $value;
        $this->filter($queryBuilder, $queryBuilder->getAlias(), $this->getFieldName(), $value);
    }

    /**
     * {@inheritdoc}
     */
    public function isActive()
    {
        return $this->active;
    }

    /**
     * Add the where statement for this filter to the query.
     *
     * @param ProxyQuery $proxy
     */
    protected function getWhere(ProxyQuery $proxy)
    {
        $queryBuilder = $proxy->getQueryBuilder();
        if ($this->getCondition() == self::CONDITION_OR) {
            return $queryBuilder->orWhere();
        }

        return $queryBuilder->andWhere();
    }
}


text:
package org.shredzone.acme4j.connector;

import java.net.URL;
import java.security.KeyPair;
import java.security.cert.X509Certificate;
import java.time.ZonedDateTime;
import java.util.Collection;
import java.util.List;
import java.util.Optional;

import org.shredzone.acme4j.Login;
import org.shredzone.acme4j.Session;
import org.shredzone.acme4j.exception.AcmeException;
import org.shredzone.acme4j.toolbox.JSON;
import org.shredzone.acme4j.toolbox.JSONBuilder;

/**
 * Dummy implementation of {@link Connection} that always fails. Single methods are
 * supposed to be overridden for testing.
 */
public class DummyConnection implements Connection {

    @Override
    public void resetNonce(Session session) throws AcmeException {
        throw new UnsupportedOperationException();
    }

    @Override
    public int sendRequest(URL url, Session session, ZonedDateTime ifModifiedSince) {
        throw new UnsupportedOperationException();
    }

    @Override
    public int sendCertificateRequest(URL url, Login login) throws AcmeException {
        throw new UnsupportedOperationException();
    }

    @Override
    public int sendSignedPostAsGetRequest(URL url, Login login) throws AcmeException {
        throw new UnsupportedOperationException();
    }

    @Override
    public int sendSignedRequest(URL url, JSONBuilder claims, Login login)
                throws AcmeException {
        throw new UnsupportedOperationException();
    }

    @Override
    public int sendSignedRequest(URL url, JSONBuilder claims, Session session, KeyPair keypair)
                throws AcmeException {
        throw new UnsupportedOperationException();
    }

    @Override
    public JSON readJsonResponse() {
        throw new UnsupportedOperationException();
    }

    @Override
    public List<X509Certificate> readCertificates() throws AcmeException {
        throw new UnsupportedOperationException();
    }

    @Override
    public void handleRetryAfter(String message) throws AcmeException {
        throw new UnsupportedOperationException();
    }

    @Override
    public String getNonce() {
        throw new UnsupportedOperationException();
    }

    @Override
    public URL getLocation() {
        throw new UnsupportedOperationException();
    }

    @Override
    public Optional<ZonedDateTime> getLastModified() {
        throw new UnsupportedOperationException();
    }

    @Override
    public Optional<ZonedDateTime> getExpiration() {
        throw new UnsupportedOperationException();
    }

    @Override
    public Collection<URL> getLinks(String relation) {
        throw new UnsupportedOperationException();
    }

    @Override
    public void close() {
        // closing is always safe
    }

}


text:
package org.gradle.internal.nativeintegration.filesystem.services;

import io.rubygrapefruit.platform.PosixFiles;
import org.gradle.internal.nativeintegration.filesystem.Symlink;

import java.io.File;
import java.io.IOException;

class NativePlatformBackedSymlink implements Symlink {
    private final PosixFiles posixFiles;

    public NativePlatformBackedSymlink(PosixFiles posixFiles) {
        this.posixFiles = posixFiles;
    }

    public boolean isSymlinkSupported() {
        return true;
    }

    public void symlink(File link, File target) throws IOException {
        link.getParentFile().mkdirs();
        posixFiles.symlink(link, target.getPath());
    }
}


text:
from django.conf.urls import *
from cache.views import QueueView
from statistics.views import FrontPageView, PersonDetailView

urlpatterns = patterns('',
    (r'^$', FrontPageView.as_view()),
    (r'^(\d+)', PersonDetailView.as_view()),
    (r'^queue', QueueView.as_view()),
)


text:
ActiveRecord::Schema.define(version: 2022_04_03_080334) do

  create_table "accounts", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci", force: :cascade do |t|
    t.string "code", default: "", null: false
    t.string "name", default: "", null: false
    t.integer "dc_type", null: false
    t.integer "account_type", null: false
    t.integer "sub_account_type", default: 1, null: false
    t.integer "tax_type", null: false
    t.string "description"
    t.string "short_description"
    t.integer "display_order"
    t.string "path", default: "", null: false
    t.integer "trade_type", default: 1, null: false
    t.boolean "is_settlement_report_account", default: true, null: false
    t.integer "depreciation_method", limit: 1
    t.boolean "is_trade_account_payable", default: false, null: false
    t.boolean "journalizable", default: true, null: false
    t.boolean "deleted", default: false, null: false
    t.datetime "created_at"
    t.datetime "updated_at"
    t.boolean "depreciable", default: false, null: false
    t.boolean "personal_only", default: false, null: false
    t.boolean "company_only", default: false, null: false
    t.integer "is_tax_account", limit: 1, default: 0, null: false
    t.integer "parent_id"
    t.boolean "system_required", default: false, null: false
    t.boolean "sub_account_editable", default: false, null: false
    t.boolean "is_suspense_receipt_account", default: false, null: false
    t.index ["code"], name: "index_accounts_on_code", unique: true
    t.index ["name"], name: "index_accounts_on_name", unique: true
  end

  create_table "active_storage_attachments", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8", force: :cascade do |t|
    t.string "name", null: false
    t.string "record_type", null: false
    t.bigint "record_id", null: false
    t.bigint "blob_id", null: false
    t.datetime "created_at", null: false
    t.index ["blob_id"], name: "index_active_storage_attachments_on_blob_id"
    t.index ["record_type", "record_id", "name", "blob_id"], name: "index_active_storage_attachments_uniqueness", unique: true
  end

  create_table "active_storage_blobs", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8", force: :cascade do |t|
    t.string "key", null: false
    t.string "filename", null: false
    t.string "content_type"
    t.text "metadata"
    t.bigint "byte_size", null: false
    t.string "checksum", null: false
    t.datetime "created_at", null: false
    t.index ["key"], name: "index_active_storage_blobs_on_key", unique: true
  end

  create_table "assets", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci", force: :cascade do |t|
    t.string "code", limit: 8, default: "", null: false
    t.string "name", default: "", null: false
    t.integer "status", limit: 1, null: false
    t.integer "account_id", null: false
    t.integer "branch_id", null: false
    t.integer "sub_account_id"
    t.integer "durable_years", limit: 2
    t.bigint "ym", null: false
    t.integer "day", limit: 2, null: false
    t.integer "start_fiscal_year"
    t.integer "end_fiscal_year"
    t.integer "amount", null: false
    t.integer "depreciation_method", limit: 1
    t.integer "depreciation_limit"
    t.string "remarks"
    t.decimal "business_use_ratio", precision: 5, scale: 2
    t.integer "journal_detail_id", null: false
    t.boolean "deleted", default: false, null: false
    t.datetime "created_at"
    t.datetime "updated_at"
    t.integer "lock_version", default: 0, null: false
    t.index ["code"], name: "index_assets_on_code", unique: true
  end

  create_table "attendances", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8", force: :cascade do |t|
    t.integer "company_id", null: false
    t.integer "employee_id", null: false
    t.integer "yyyymm"
    t.integer "day"
    t.time "from"
    t.time "to"
    t.string "holiday_type"
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
  end

  create_table "bank_accounts", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci", force: :cascade do |t|
    t.string "code", limit: 10, default: "", null: false
    t.string "name", default: "", null: false
    t.string "holder_name", null: false
    t.boolean "deleted", default: false, null: false
    t.datetime "created_at"
    t.datetime "updated_at"
    t.integer "bank_id", null: false
    t.integer "bank_office_id"
    t.integer "financial_account_type", default: 0, null: false
    t.boolean "for_payroll", default: false, null: false
    t.integer "company_id", null: false
    t.index ["name"], name: "index_bank_accounts_on_name", unique: true
  end

  create_table "bank_offices", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci", force: :cascade do |t|
    t.integer "bank_id", null: false
    t.string "name", null: false
    t.string "code", limit: 3, null: false
    t.boolean "deleted", default: false, null: false
    t.datetime "created_at"
    t.datetime "updated_at"
    t.boolean "disabled", default: false, null: false
    t.string "address"
  end

  create_table "banks", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci", force: :cascade do |t|
    t.string "name", null: false
    t.string "code", limit: 4, null: false
    t.boolean "deleted", default: false, null: false
    t.datetime "created_at"
    t.datetime "updated_at"
    t.boolean "disabled", default: false, null: false
    t.integer "company_id", null: false
    t.integer "lt_30k_same_office"
    t.integer "ge_30k_same_office"
    t.integer "lt_30k_other_office"
    t.integer "ge_30k_other_office"
    t.integer "lt_30k_other_bank"
    t.integer "ge_30k_other_bank"
  end

  create_table "branch_employees", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8", force: :cascade do |t|
    t.integer "branch_id", null: false
    t.integer "employee_id", null: false
    t.boolean "default_branch", default: false, null: false
    t.datetime "created_at"
    t.datetime "updated_at"
    t.boolean "deleted", default: false, null: false
  end

  create_table "branches", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci", force: :cascade do |t|
    t.string "code", default: "", null: false
    t.string "name", null: false
    t.integer "company_id", null: false
    t.integer "sub_account_id"
    t.integer "parent_id"
    t.string "path", default: "/", null: false
    t.integer "cost_ratio", default: 100, null: false
    t.boolean "deleted", default: false, null: false
    t.datetime "created_at"
    t.datetime "updated_at"
    t.integer "business_office_id"
    t.string "formal_name", null: false
  end

  create_table "business_offices", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci", force: :cascade do |t|
    t.integer "company_id", null: false
    t.string "name", null: false
    t.string "prefecture_name", limit: 16, null: false
    t.string "address1"
    t.string "address2"
    t.datetime "created_at"
    t.datetime "updated_at"
    t.integer "lock_version", default: 0, null: false
    t.string "tel", limit: 13
    t.string "prefecture_code", limit: 2, null: false
    t.string "zip_code", limit: 8
    t.boolean "deleted", default: false, null: false
    t.integer "responsible_person_id"
    t.string "business_outline"
  end

  create_table "business_types", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci", force: :cascade do |t|
    t.string "name", limit: 32, null: false
    t.string "description"
    t.decimal "deemed_tax_ratio", precision: 3, scale: 2, null: false
    t.boolean "deleted", default: false, null: false
    t.datetime "created_at"
    t.datetime "updated_at"
    t.index ["name"], name: "index_bisiness_types_on_name", unique: true
  end

  create_table "careers", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci", force: :cascade do |t|
    t.integer "employee_id", null: false
    t.date "start_from", null: false
    t.date "end_to", null: false
    t.integer "customer_id", null: false
    t.string "customer_name", null: false
    t.string "project_name", null: false
    t.string "description"
    t.string "project_size"
    t.string "role"
    t.string "process"
    t.datetime "created_at"
    t.datetime "updated_at"
    t.string "hardware_skill"
    t.string "os_skill"
    t.string "db_skill"
    t.string "language_skill"
    t.string "other_skill"
  end

  create_table "companies", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci", force: :cascade do |t|
    t.string "name", default: "", null: false
    t.integer "fiscal_year"
    t.integer "start_month_of_fiscal_year", null: false
    t.string "logo", default: ""
    t.date "founded_date", null: false
    t.integer "type_of", default: 0, null: false
    t.string "admin_email"
    t.boolean "deleted", default: false, null: false
    t.datetime "created_at"
    t.datetime "updated_at"
    t.integer "business_type_id"
    t.integer "lock_version", default: 0, null: false
    t.string "payday", default: "0,25", null: false
    t.string "enterprise_number", limit: 13
    t.integer "employment_insurance_type"
    t.string "labor_insurance_number", limit: 14
  end

  create_table "customers", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci", force: :cascade do |t|
    t.string "code", default: "", null: false
    t.boolean "is_order_entry", default: false, null: false
    t.boolean "is_order_placement", default: false, null: false
    t.string "address", default: ""
    t.boolean "deleted", default: false, null: false
    t.datetime "created_at"
    t.datetime "updated_at"
    t.boolean "disabled", default: false, null: false
    t.boolean "is_investment", default: false, null: false
    t.string "formal_name"
    t.string "name"
    t.index ["code"], name: "index_customers_on_code", unique: true
  end

  create_table "dependent_family_members", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8", force: :cascade do |t|
    t.integer "exemption_id", null: false
    t.integer "exemption_type", null: false
    t.string "name", null: false
    t.string "kana", null: false
    t.string "my_number"
    t.boolean "live_in", default: true, null: false
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
  end

  create_table "depreciations", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci", force: :cascade do |t|
    t.integer "asset_id", null: false
    t.integer "fiscal_year", null: false
    t.integer "amount_at_start", null: false
    t.integer "amount_at_end", null: false
    t.boolean "depreciated", default: false, null: false
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  create_table "employee_bank_accounts", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8", force: :cascade do |t|
    t.integer "employee_id", null: false
    t.string "code", null: false
    t.integer "bank_id", null: false
    t.integer "bank_office_id", null: false
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
  end

  create_table "employees", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci", force: :cascade do |t|
    t.integer "company_id", null: false
    t.string "first_name", null: false
    t.string "last_name", null: false
    t.date "employment_date", null: false
    t.string "zip_code", limit: 8
    t.string "address"
    t.string "sex", limit: 1, null: false
    t.boolean "deleted", default: false, null: false
    t.datetime "created_at"
    t.datetime "updated_at"
    t.date "birth", null: false
    t.integer "user_id"
    t.string "my_number", limit: 12
    t.boolean "executive", default: false, null: false
    t.integer "num_of_dependent", default: 0, null: false
    t.string "position"
    t.date "retirement_date"
    t.string "first_name_kana"
    t.string "last_name_kana"
  end

  create_table "exemptions", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8", force: :cascade do |t|
    t.string "employee_id", null: false
    t.integer "yyyy", null: false
    t.datetime "created_at"
    t.datetime "updated_at"
    t.integer "company_id", null: false
    t.integer "num_of_house_loan"
    t.integer "max_mortgage_deduction"
    t.date "date_of_start_living_1"
    t.string "mortgage_deduction_code_1"
    t.integer "year_end_balance_1"
    t.date "date_of_start_living_2"
    t.string "mortgage_deduction_code_2"
    t.integer "year_end_balance_2"
    t.integer "small_scale_mutual_aid"
    t.integer "life_insurance_premium_new"
    t.integer "life_insurance_premium_old"
    t.integer "earthquake_insurance_premium"
    t.integer "special_tax_for_spouse"
    t.integer "dependents"
    t.integer "spouse"
    t.integer "disabled_persons"
    t.integer "basic"
    t.integer "previous_salary"
    t.integer "previous_withholding_tax"
    t.integer "previous_social_insurance"
    t.text "remarks"
    t.integer "care_insurance_premium"
    t.integer "private_pension_insurance_new"
    t.integer "private_pension_insurance_old"
  end

  create_table "financial_statement_headers", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8", force: :cascade do |t|
    t.integer "company_id", null: false
    t.integer "branch_id", null: false
    t.integer "report_type", null: false
    t.integer "fiscal_year", null: false
    t.integer "max_node_level", null: false
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
    t.integer "report_style"
  end

  create_table "financial_statements", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8", force: :cascade do |t|
    t.integer "ym", null: false
    t.integer "account_id", null: false
    t.string "account_name", null: false
    t.integer "amount", null: false
    t.datetime "created_at"
    t.datetime "updated_at"
    t.integer "financial_statement_header_id"
  end

  create_table "fiscal_years", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci", force: :cascade do |t|
    t.integer "company_id", null: false
    t.integer "fiscal_year", null: false
    t.integer "closing_status", default: 0, null: false
    t.integer "tax_management_type", default: 1, null: false
    t.boolean "deleted", default: false, null: false
    t.datetime "created_at"
    t.datetime "updated_at"
    t.integer "lock_version", default: 0, null: false
    t.integer "consumption_entry_type", limit: 1
    t.integer "accepted_amount_of_excess_depreciation", default: 0, null: false
    t.integer "approved_loss_amount_of_business_tax", default: 0, null: false
    t.index ["company_id", "fiscal_year"], name: "index_fiscal_yeras_on_company_id_and_fiscal_year", unique: true
  end

  create_table "inhabitant_taxes", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci", force: :cascade do |t|
    t.datetime "created_at"
    t.datetime "updated_at"
    t.integer "employee_id", null: false
    t.integer "ym", null: false
    t.integer "amount"
  end

  create_table "input_frequencies", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci", force: :cascade do |t|
    t.integer "user_id", null: false
    t.integer "input_type", limit: 1, null: false
    t.string "input_value", limit: 30, default: ""
    t.integer "frequency", null: false
    t.datetime "created_at"
    t.datetime "updated_at"
    t.string "input_value2", limit: 30, default: ""
    t.index ["user_id", "input_type", "input_value", "input_value2"], name: "index_input_frequencies_for_unique_key", unique: true
  end

  create_table "investments", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8", force: :cascade do |t|
    t.integer "shares", default: 0, null: false
    t.integer "trading_value", default: 0, null: false
    t.datetime "created_at"
    t.datetime "updated_at"
    t.integer "customer_id", null: false
    t.integer "ym", null: false
    t.integer "day", null: false
    t.integer "bank_account_id", null: false
    t.integer "journal_detail_id"
    t.integer "for_what", null: false
    t.integer "charges", default: 0, null: false
    t.integer "gains", default: 0, null: false
  end

  create_table "journal_details", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci", force: :cascade do |t|
    t.integer "journal_id", null: false
    t.integer "detail_no", null: false
    t.integer "detail_type", default: 1, null: false
    t.integer "dc_type", null: false
    t.integer "account_id", null: false
    t.string "account_name", default: "", null: false
    t.integer "amount", null: false
    t.integer "branch_id", null: false
    t.string "branch_name", null: false
    t.integer "sub_account_id"
    t.string "sub_account_name"
    t.integer "social_expense_number_of_people"
    t.string "note"
    t.integer "tax_type", default: 1, null: false
    t.integer "main_detail_id"
    t.datetime "created_at"
    t.datetime "updated_at"
    t.integer "settlement_type", limit: 1
    t.decimal "tax_rate", precision: 4, scale: 3, default: "0.0", null: false
    t.integer "allocation_type"
    t.index ["journal_id", "detail_no"], name: "journal_details_journal_header_id_and_detail_no_index", unique: true
    t.index ["main_detail_id"], name: "index_journal_details_main_detail_id"
  end

  create_table "journals", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci", force: :cascade do |t|
    t.integer "ym", null: false
    t.integer "day", null: false
    t.integer "slip_type", null: false
    t.string "remarks", null: false
    t.integer "amount", null: false
    t.string "finder_key", limit: 1023
    t.integer "transfer_from_id"
    t.integer "depreciation_id"
    t.integer "transfer_from_detail_id"
    t.integer "create_user_id", null: false
    t.integer "update_user_id", null: false
    t.datetime "created_at"
    t.datetime "updated_at"
    t.integer "lock_version", default: 0, null: false
    t.integer "company_id", null: false
    t.boolean "deleted", default: false, null: false
    t.boolean "auto", default: false, null: false
    t.integer "payroll_id"
    t.string "type"
    t.index ["company_id", "ym", "day"], name: "index_journal_headers_on_company_id_and_date"
    t.index ["transfer_from_detail_id"], name: "index_journal_headers_transfer_from_detail_id"
    t.index ["transfer_from_id"], name: "index_journals_on_transfer_from_id"
    t.index ["ym"], name: "index_journals_on_ym"
  end

  create_table "nostalgic_attrs", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8", force: :cascade do |t|
    t.string "model_type", null: false
    t.integer "model_id", null: false
    t.string "name", null: false
    t.string "value"
    t.date "effective_at", null: false
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  create_table "payrolls", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci", force: :cascade do |t|
    t.integer "ym", null: false
    t.integer "days_of_work", default: 0
    t.integer "hours_of_work", default: 0
    t.integer "hours_of_day_off_work", default: 0
    t.integer "hours_of_early_work", default: 0
    t.integer "hours_of_late_night_work", default: 0
    t.datetime "created_at"
    t.datetime "updated_at"
    t.integer "employee_id", null: false
    t.boolean "is_bonus", default: false, null: false
    t.integer "commuting_allowance", default: 0, null: false
    t.integer "base_salary", default: 0, null: false
    t.integer "annual_adjustment", default: 0, null: false
    t.integer "accrued_liability", default: 0, null: false
    t.integer "health_insurance", default: 0, null: false
    t.integer "welfare_pension", default: 0, null: false
    t.integer "employment_insurance", default: 0, null: false
    t.integer "income_tax", default: 0, null: false
    t.integer "inhabitant_tax", default: 0, null: false
    t.integer "create_user_id", null: false
    t.integer "update_user_id", null: false
    t.date "pay_day", null: false
    t.integer "monthly_standard", default: 0, null: false
    t.integer "housing_allowance", default: 0, null: false
    t.integer "extra_pay", default: 0, null: false
    t.integer "temporary_salary", default: 0, null: false
    t.integer "transfer_fee", default: 0, null: false
    t.integer "qualification_allowance", default: 0, null: false
    t.index ["ym", "employee_id", "is_bonus"], name: "index_payrolls_ym_and_employee_id_and_is_bonus", unique: true
  end

  create_table "qualifications", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8", force: :cascade do |t|
    t.integer "company_id", null: false
    t.string "name", null: false
    t.integer "allowance", default: 0, null: false
    t.boolean "deleted", default: false, null: false
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
  end

  create_table "receipts", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8", force: :cascade do |t|
    t.integer "journal_id", null: false
    t.string "file"
    t.string "original_filename"
    t.boolean "deleted", default: false, null: false
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  create_table "rents", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci", force: :cascade do |t|
    t.string "name"
    t.integer "status", null: false
    t.integer "customer_id", null: false
    t.integer "rent_type", null: false
    t.integer "usage_type", null: false
    t.string "address"
    t.datetime "created_at"
    t.datetime "updated_at"
    t.string "zip_code", limit: 7
    t.date "start_from", null: false
    t.date "end_to"
  end

  create_table "sequences", id: false, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci", force: :cascade do |t|
    t.string "name", limit: 32, null: false
    t.string "section", limit: 32
    t.integer "value", default: 0, null: false
    t.datetime "created_at"
    t.datetime "updated_at"
    t.index ["name", "section"], name: "index_sequences_on_name_and_section", unique: true
  end

  create_table "sessions", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci", force: :cascade do |t|
    t.string "session_id", default: "", null: false
    t.text "data"
    t.datetime "created_at"
    t.datetime "updated_at"
    t.index ["session_id"], name: "index_sessions_on_session_id"
    t.index ["updated_at"], name: "index_sessions_on_updated_at"
  end

  create_table "simple_slip_settings", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci", force: :cascade do |t|
    t.integer "user_id", null: false
    t.integer "account_id", null: false
    t.string "shortcut_key", limit: 10, null: false
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  create_table "simple_slip_templates", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci", force: :cascade do |t|
    t.string "remarks", default: "", null: false
    t.integer "owner_type", null: false
    t.integer "owner_id", null: false
    t.string "description"
    t.string "keywords"
    t.integer "account_id"
    t.integer "branch_id"
    t.integer "sub_account_id"
    t.integer "dc_type", limit: 1
    t.integer "amount"
    t.integer "tax_type", limit: 1
    t.integer "tax_amount"
    t.string "focus_on_complete"
    t.boolean "deleted", default: false, null: false
    t.datetime "created_at"
    t.datetime "updated_at"
    t.decimal "tax_rate", precision: 4, scale: 3
    t.index ["remarks"], name: "index_simple_slip_templates_on_remarks"
  end

  create_table "skills", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8", force: :cascade do |t|
    t.integer "employee_id", null: false
    t.integer "qualification_id", null: false
    t.date "qualified_on", null: false
    t.boolean "deleted", default: false, null: false
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
  end

  create_table "sub_accounts", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci", force: :cascade do |t|
    t.string "code", default: "", null: false
    t.string "name", default: "", null: false
    t.integer "account_id", null: false
    t.boolean "deleted", default: false, null: false
    t.datetime "created_at"
    t.datetime "updated_at"
    t.integer "sub_account_type", limit: 2, default: 1, null: false
    t.boolean "social_expense_number_of_people_required", default: false, null: false
  end

  create_table "tax_admin_infos", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci", force: :cascade do |t|
    t.integer "journal_id", null: false
    t.boolean "should_include_tax", default: false, null: false
    t.boolean "checked", default: false, null: false
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  create_table "users", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci", force: :cascade do |t|
    t.string "login_id", default: "", null: false
    t.string "email", default: ""
    t.integer "slips_per_page", default: 20
    t.string "salt", default: "", null: false
    t.boolean "deleted", default: false, null: false
    t.string "google_account"
    t.integer "account_count_of_frequencies", default: 10, null: false
    t.string "yahoo_api_app_id"
    t.boolean "show_details", default: true, null: false
    t.string "encrypted_password", default: "", null: false
    t.string "reset_password_token"
    t.datetime "reset_password_sent_at"
    t.datetime "remember_created_at"
    t.integer "sign_in_count", default: 0, null: false
    t.datetime "current_sign_in_at"
    t.datetime "last_sign_in_at"
    t.string "current_sign_in_ip"
    t.string "last_sign_in_ip"
    t.datetime "created_at"
    t.datetime "updated_at"
    t.string "otp_secret_key"
    t.integer "second_factor_attempts_count", default: 0
    t.boolean "use_two_factor_authentication", default: false, null: false
    t.boolean "admin", default: false, null: false
    t.string "direct_otp"
    t.datetime "direct_otp_sent_at"
    t.datetime "totp_timestamp"
    t.index ["email"], name: "index_users_on_email", unique: true
    t.index ["login_id"], name: "index_users_on_login_id", unique: true
    t.index ["otp_secret_key"], name: "index_users_on_otp_secret_key", unique: true
    t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true
  end

end


text:
package de.tudarmstadt.informatik.tk.assistance.sdk.db;

import org.greenrobot.greendao.annotation.*;

import de.tudarmstadt.informatik.tk.assistance.sdk.db.DaoSession;
import org.greenrobot.greendao.DaoException;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. Enable "keep" sections if you want to edit.

/**
 * Entity mapped to table "calendar_sensor".
 */
@Entity(active = true, nameInDb = "calendar_sensor")
public class DbCalendarSensor implements de.tudarmstadt.informatik.tk.assistance.sdk.interfaces.IDbUpdatableSensor {

    @Id(autoincrement = true)
    @Index
    private Long id;
    private Long eventId;
    private Long calendarId;
    private Boolean allDay;
    private Integer availability;
    private String description;
    private Long timestampStart;
    private Long timestampEnd;
    private String duration;
    private String location;
    private String timezoneStart;
    private String timezoneEnd;
    private String recurrenceExceptionDate;
    private String recurrenceExceptionRule;
    private Boolean hasAlarm;
    private Long lastDate;
    private Boolean originalAllDay;
    private String originalId;
    private Long originalInstanceTime;
    private String recurrenceDate;
    private String recurrenceRule;
    private Integer status;
    private String title;
    private Boolean isNew;
    private Boolean isUpdated;
    private Boolean isDeleted;

    @NotNull
    private String created;

    @Index
    private Long deviceId;

    /** Used to resolve relations */
    @Generated
    private transient DaoSession daoSession;

    /** Used for active entity operations. */
    @Generated
    private transient DbCalendarSensorDao myDao;

    @ToOne(joinProperty = "deviceId")
    private DbDevice dbDevice;

    @Generated
    private transient Long dbDevice__resolvedKey;

    @Generated
    public DbCalendarSensor() {
    }

    public DbCalendarSensor(Long id) {
        this.id = id;
    }

    @Generated
    public DbCalendarSensor(Long id, Long eventId, Long calendarId, Boolean allDay, Integer availability, String description, Long timestampStart, Long timestampEnd, String duration, String location, String timezoneStart, String timezoneEnd, String recurrenceExceptionDate, String recurrenceExceptionRule, Boolean hasAlarm, Long lastDate, Boolean originalAllDay, String originalId, Long originalInstanceTime, String recurrenceDate, String recurrenceRule, Integer status, String title, Boolean isNew, Boolean isUpdated, Boolean isDeleted, String created, Long deviceId) {
        this.id = id;
        this.eventId = eventId;
        this.calendarId = calendarId;
        this.allDay = allDay;
        this.availability = availability;
        this.description = description;
        this.timestampStart = timestampStart;
        this.timestampEnd = timestampEnd;
        this.duration = duration;
        this.location = location;
        this.timezoneStart = timezoneStart;
        this.timezoneEnd = timezoneEnd;
        this.recurrenceExceptionDate = recurrenceExceptionDate;
        this.recurrenceExceptionRule = recurrenceExceptionRule;
        this.hasAlarm = hasAlarm;
        this.lastDate = lastDate;
        this.originalAllDay = originalAllDay;
        this.originalId = originalId;
        this.originalInstanceTime = originalInstanceTime;
        this.recurrenceDate = recurrenceDate;
        this.recurrenceRule = recurrenceRule;
        this.status = status;
        this.title = title;
        this.isNew = isNew;
        this.isUpdated = isUpdated;
        this.isDeleted = isDeleted;
        this.created = created;
        this.deviceId = deviceId;
    }

    /** called by internal mechanisms, do not call yourself. */
    @Generated
    public void __setDaoSession(DaoSession daoSession) {
        this.daoSession = daoSession;
        myDao = daoSession != null ? daoSession.getDbCalendarSensorDao() : null;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getEventId() {
        return eventId;
    }

    public void setEventId(Long eventId) {
        this.eventId = eventId;
    }

    public Long getCalendarId() {
        return calendarId;
    }

    public void setCalendarId(Long calendarId) {
        this.calendarId = calendarId;
    }

    public Boolean getAllDay() {
        return allDay;
    }

    public void setAllDay(Boolean allDay) {
        this.allDay = allDay;
    }

    public Integer getAvailability() {
        return availability;
    }

    public void setAvailability(Integer availability) {
        this.availability = availability;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public Long getTimestampStart() {
        return timestampStart;
    }

    public void setTimestampStart(Long timestampStart) {
        this.timestampStart = timestampStart;
    }

    public Long getTimestampEnd() {
        return timestampEnd;
    }

    public void setTimestampEnd(Long timestampEnd) {
        this.timestampEnd = timestampEnd;
    }

    public String getDuration() {
        return duration;
    }

    public void setDuration(String duration) {
        this.duration = duration;
    }

    public String getLocation() {
        return location;
    }

    public void setLocation(String location) {
        this.location = location;
    }

    public String getTimezoneStart() {
        return timezoneStart;
    }

    public void setTimezoneStart(String timezoneStart) {
        this.timezoneStart = timezoneStart;
    }

    public String getTimezoneEnd() {
        return timezoneEnd;
    }

    public void setTimezoneEnd(String timezoneEnd) {
        this.timezoneEnd = timezoneEnd;
    }

    public String getRecurrenceExceptionDate() {
        return recurrenceExceptionDate;
    }

    public void setRecurrenceExceptionDate(String recurrenceExceptionDate) {
        this.recurrenceExceptionDate = recurrenceExceptionDate;
    }

    public String getRecurrenceExceptionRule() {
        return recurrenceExceptionRule;
    }

    public void setRecurrenceExceptionRule(String recurrenceExceptionRule) {
        this.recurrenceExceptionRule = recurrenceExceptionRule;
    }

    public Boolean getHasAlarm() {
        return hasAlarm;
    }

    public void setHasAlarm(Boolean hasAlarm) {
        this.hasAlarm = hasAlarm;
    }

    public Long getLastDate() {
        return lastDate;
    }

    public void setLastDate(Long lastDate) {
        this.lastDate = lastDate;
    }

    public Boolean getOriginalAllDay() {
        return originalAllDay;
    }

    public void setOriginalAllDay(Boolean originalAllDay) {
        this.originalAllDay = originalAllDay;
    }

    public String getOriginalId() {
        return originalId;
    }

    public void setOriginalId(String originalId) {
        this.originalId = originalId;
    }

    public Long getOriginalInstanceTime() {
        return originalInstanceTime;
    }

    public void setOriginalInstanceTime(Long originalInstanceTime) {
        this.originalInstanceTime = originalInstanceTime;
    }

    public String getRecurrenceDate() {
        return recurrenceDate;
    }

    public void setRecurrenceDate(String recurrenceDate) {
        this.recurrenceDate = recurrenceDate;
    }

    public String getRecurrenceRule() {
        return recurrenceRule;
    }

    public void setRecurrenceRule(String recurrenceRule) {
        this.recurrenceRule = recurrenceRule;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public Boolean getIsNew() {
        return isNew;
    }

    public void setIsNew(Boolean isNew) {
        this.isNew = isNew;
    }

    public Boolean getIsUpdated() {
        return isUpdated;
    }

    public void setIsUpdated(Boolean isUpdated) {
        this.isUpdated = isUpdated;
    }

    public Boolean getIsDeleted() {
        return isDeleted;
    }

    public void setIsDeleted(Boolean isDeleted) {
        this.isDeleted = isDeleted;
    }

    @NotNull
    public String getCreated() {
        return created;
    }

    /** Not-null value; ensure this value is available before it is saved to the database. */
    public void setCreated(@NotNull String created) {
        this.created = created;
    }

    public Long getDeviceId() {
        return deviceId;
    }

    public void setDeviceId(Long deviceId) {
        this.deviceId = deviceId;
    }

    /** To-one relationship, resolved on first access. */
    @Generated
    public DbDevice getDbDevice() {
        Long __key = this.deviceId;
        if (dbDevice__resolvedKey == null || !dbDevice__resolvedKey.equals(__key)) {
            __throwIfDetached();
            DbDeviceDao targetDao = daoSession.getDbDeviceDao();
            DbDevice dbDeviceNew = targetDao.load(__key);
            synchronized (this) {
                dbDevice = dbDeviceNew;
            	dbDevice__resolvedKey = __key;
            }
        }
        return dbDevice;
    }

    @Generated
    public void setDbDevice(DbDevice dbDevice) {
        synchronized (this) {
            this.dbDevice = dbDevice;
            deviceId = dbDevice == null ? null : dbDevice.getId();
            dbDevice__resolvedKey = deviceId;
        }
    }

    /**
    * Convenient call for {@link org.greenrobot.greendao.AbstractDao#delete(Object)}.
    * Entity must attached to an entity context.
    */
    @Generated
    public void delete() {
        __throwIfDetached();
        myDao.delete(this);
    }

    /**
    * Convenient call for {@link org.greenrobot.greendao.AbstractDao#update(Object)}.
    * Entity must attached to an entity context.
    */
    @Generated
    public void update() {
        __throwIfDetached();
        myDao.update(this);
    }

    /**
    * Convenient call for {@link org.greenrobot.greendao.AbstractDao#refresh(Object)}.
    * Entity must attached to an entity context.
    */
    @Generated
    public void refresh() {
        __throwIfDetached();
        myDao.refresh(this);
    }

    @Generated
    private void __throwIfDetached() {
        if (myDao == null) {
            throw new DaoException("Entity is detached from DAO context");
        }
    }

}


text:
package com.redshape.ui.data.bindings.views;

public interface IDefferedModel extends IComposedModel {

}


text:
import os
import sys

try:
    import apiai
except ImportError:
    sys.path.append(
        os.path.join(os.path.dirname(os.path.realpath(__file__)), os.pardir)
    )
    import apiai

import thread
import pyaudio
import time

CHUNK = 512
FORMAT = pyaudio.paInt16
CHANNELS = 1
RATE = 44100
RECORD_SECONDS = 2

CLIENT_ACCESS_TOKEN = 'YOUR_ACCESS_TOKEN'

def input_thread(L):
    raw_input()
    L.append(None)

def main():
    resampler = apiai.Resampler(source_samplerate=RATE)

    vad = apiai.VAD()

    ai = apiai.ApiAI(CLIENT_ACCESS_TOKEN)

    request = ai.voice_request()

    request.lang = 'en'  # optional, default value equal 'en'

    def callback(in_data, frame_count, time_info, status):
        frames, data = resampler.resample(in_data, frame_count)
        state = vad.processFrame(frames)
        request.send(data)

        if (state == 1):
            return in_data, pyaudio.paContinue
        else:
            return in_data, pyaudio.paComplete

    p = pyaudio.PyAudio()

    stream = p.open(format=FORMAT,
                    channels=CHANNELS,
                    rate=RATE,
                    input=True,
                    output=False,
                    frames_per_buffer=CHUNK,
                    stream_callback=callback)

    stream.start_stream()

    print ("Say! Press enter for stop audio recording.")

    try:
        L = []
        thread.start_new_thread(input_thread, (L,))

        while stream.is_active() and len(L) == 0:
            time.sleep(0.1)

    except Exception:
        raise
    except KeyboardInterrupt:
        pass

    stream.stop_stream()
    stream.close()
    p.terminate()

    print ("Wait for response...")
    response = request.getresponse()

    print (response.read())

if __name__ == '__main__':
    main()


text:
package com.dl7.downloaderlib.helper;

import com.dl7.downloaderlib.DownloadListener;
import com.dl7.downloaderlib.entity.FileInfo;
import com.dl7.downloaderlib.model.DownloadStatus;
import com.dl7.downloaderlib.service.DownloadThreadPool;

/**
 * Created by long on 2016/5/26.
 * 封装下载监听器
 */
public final class ListenerDecorator implements DownloadListener {

    private final DownloadListener mListener;
    private final boolean mIsUiThread;

    public ListenerDecorator(DownloadListener listener, boolean isUiThread) {
        this.mListener = listener;
        this.mIsUiThread = isUiThread;
    }

    @Override
    public void onStart(final FileInfo fileInfo) {
        fileInfo.setStatus(DownloadStatus.START);
        if (mIsUiThread) {
            MainHandler.getInstance().runInMainThread(new Runnable() {
                @Override
                public void run() {
                    mListener.onStart(fileInfo);
                }
            });
        } else {
            mListener.onStart(fileInfo);
        }
    }

    @Override
    public void onUpdate(final FileInfo fileInfo) {
        fileInfo.setStatus(DownloadStatus.DOWNLOADING);
        if (mIsUiThread) {
            MainHandler.getInstance().runInMainThread(new Runnable() {
                @Override
                public void run() {
                    mListener.onUpdate(fileInfo);
                }
            });
        } else {
            mListener.onUpdate(fileInfo);
        }
    }

    @Override
    public void onStop(final FileInfo fileInfo) {
        fileInfo.setStatus(DownloadStatus.STOP);
        if (mIsUiThread) {
            MainHandler.getInstance().runInMainThread(new Runnable() {
                @Override
                public void run() {
                    mListener.onStop(fileInfo);
                }
            });
        } else {
            mListener.onStop(fileInfo);
        }
    }

    @Override
    public void onComplete(final FileInfo fileInfo) {
        fileInfo.setStatus(DownloadStatus.COMPLETE);
        if (mIsUiThread) {
            MainHandler.getInstance().runInMainThread(new Runnable() {
                @Override
                public void run() {
                    mListener.onComplete(fileInfo);
                }
            });
        } else {
            mListener.onComplete(fileInfo);
        }
        DownloadThreadPool.getInstance().cancel(fileInfo.getUrl(), false);
    }

    @Override
    public void onCancel(final FileInfo fileInfo) {
        fileInfo.setStatus(DownloadStatus.CANCEL);
        if (mIsUiThread) {
            MainHandler.getInstance().runInMainThread(new Runnable() {
                @Override
                public void run() {
                    mListener.onCancel(fileInfo);
                }
            });
        } else {
            mListener.onCancel(fileInfo);
        }
        DownloadThreadPool.getInstance().cancel(fileInfo.getUrl(), true);
    }

    @Override
    public void onError(final FileInfo fileInfo, final String errorMsg) {
        fileInfo.setStatus(DownloadStatus.ERROR);
        if (mIsUiThread) {
            MainHandler.getInstance().runInMainThread(new Runnable() {
                @Override
                public void run() {
                    mListener.onError(fileInfo, errorMsg);
                }
            });
        } else {
            mListener.onError(fileInfo, errorMsg);
        }
        DownloadThreadPool.getInstance().cancel(fileInfo.getUrl(), false);
    }
}


text:
set -o errexit
set -o nounset
set -o pipefail

function exit_trap() {
    local return_code=$?
    echo "[DEBUG] Exit trap handler got return code ${return_code}"

    end_time=$(date +%s)

    if [[ "${return_code}" -eq "0" ]]; then
        verb="succeeded"
    else
        verb="failed"
    fi

    echo "$0 ${verb} after $((${end_time} - ${start_time})) seconds"
    exit "${return_code}"
}

trap exit_trap EXIT

start_time=$(date +%s)
CODE_ROOT=$(dirname "${BASH_SOURCE}")/..
source "${CODE_ROOT}/hack/common.sh"
source "${CODE_ROOT}/hack/util.sh"
cd "${CODE_ROOT}"
ii::log::install_errexit
ii::build::setup_env

# Internalize environment variables we consume and default if they're not set
dry_run="${DRY_RUN:-}"
test_timeout="${TIMEOUT:-120s}"
detect_races="${DETECT_RACES:-true}"
coverage_spec="${COVERAGE_SPEC:--cover -covermode atomic}"
gotest_flags="${GOTEST_FLAGS:-}"

# determine if user wanted verbosity
verbose=
if [[ "${gotest_flags}" =~ -v( |$) ]]; then
    verbose=true
fi

# Build arguments for 'go test'
if [[ -z "${verbose}" ]]; then
    gotest_flags+=" -v"
fi

if [[ "${detect_races}" == "true" ]]; then
    gotest_flags+=" -race"
fi

# check to see if user has not disabled coverage mode
if [[ -n "${coverage_spec}" ]]; then
    # if we have a coverage spec set, we add it. '-race' implies '-cover -covermode atomic'
    # but specifying both at the same time does not lead to an error so we can add both specs
    gotest_flags+=" ${coverage_spec}"
fi

# check to see if user has not disabled test timeouts
if [[ -n "${test_timeout}" ]]; then
    gotest_flags+=" -timeout ${test_timeout}"
fi

# list_test_packages_under lists all packages containing Golang test files that we want to run as unit tests
# under the given base dir in the OpenShift Origin tree
function list_test_packages_under() {
    local basedir=$@

    # we do not quote ${basedir} to allow for multiple arguments to be passed in as well as to allow for
    # arguments that use expansion, e.g. paths containing brace expansion or wildcards
    find ${basedir} -not \(                   \
        \(                                    \
              -path 'vendor'                  \
              -o -path '*_output'             \
              -o -path '*.git'                \
              -o -path '*vendor/*'            \
              -o -path '*test/*'              \
        \) -prune                             \
    \) -name '*_test.go' | xargs -n1 dirname | sort -u | xargs -n1 printf "${II_GO_PACKAGE}/%s\n"
}

# Break up the positional arguments into packages that need to be tested and arguments that need to be passed to `go test`
package_args=
for arg in "$@"; do
    if [[ "${arg}" =~ -.* ]]; then
        # we found an arg that begins with a dash, so we stop interpreting arguments
        # henceforth as packages and instead interpret them as flags to give to `go test`
        break
    fi
    # an arg found before the first flag is a package
    package_args+=" ${arg}"
    shift
done
gotest_flags+=" $*"

# Determine packages to test
vendor_package_prefix="vendor/"
test_packages=
if [[ -n "${package_args}" ]]; then
    for package in ${package_args}; do
        # If we're trying to recursively test a package under vendor, strip the vendor prefix so go test can find the packages correctly
        if [[ "${package}" == "${vendor_package_prefix}"*"/..." ]]; then
            test_packages="${test_packages} ${package:${#vendor_package_prefix}}"
        else
            test_packages="${test_packages} ${II_GO_PACKAGE}/${package}"
        fi
    done
else
    # If no packages are given to test, we need to generate a list of all packages with unit tests
    ii_test_packages="$(list_test_packages_under '*')"
    test_packages="${ii_test_packages}"
fi

go test ${gotest_flags} ${test_packages}