text:
import importlib
import re
import six

from fixtures_mongoengine.exceptions import FixturesMongoengineException

_fixture_registry = {}

def get_fixture_class(name):
    doc = _fixture_registry.get(name, None)
    if not doc:
        # Possible old style name
        single_end = name.split('.')[-1]
        compound_end = '.%s' % single_end
        possible_match = [k for k in _fixture_registry.keys()
                          if k.endswith(compound_end) or k == single_end]
        if len(possible_match) == 1:
            doc = _fixture_registry.get(possible_match.pop(), None)
    if not doc:
        raise FixturesMongoengineException('"{}" has not been registered in the fixture registry.'.format(name))
    return doc

def getattr_recursive(o, path):
    """
    :type o:
    :type path: list
    :rtype:
    """
    name = path.pop(0)
    if len(path) == 0:
        return getattr(o, name)
    else:
        return getattr_recursive(getattr(o, name), path)

class MetaFixture(type):
    def __new__(mcs, name, bases, attrs):
        new_class = super(MetaFixture, mcs).__new__(mcs, name, bases, attrs)

        _fixture_registry[new_class.__name__] = new_class
        return new_class

class BaseFixture(object):

    depends = {}

    data_file = None

    data = None

    attr_name = 'fixture_data'

    validate = True

    pk_field_name = None

    def __init__(self):
        super(BaseFixture, self).__init__()

        self._loaded = False
        self._data = {}
        self._depend_fixtures = {}
        self.depend_re = re.compile('\{([^\}]+)\}')

    def __getitem__(self, item):
        if isinstance(item, six.string_types) and item in self._data:
            return self._data[item]
        raise KeyError('There is no key "{}" in fixture {}'.format(item, self.__class__.__name__))

    def __contains__(self, item):
        return item in self._data

    @property
    def loaded(self):
        return self._loaded

    def init_depended_fixtures(self, fixtures):
        """
        :param fixtures: dict, {fixture_class: fixture}
        """
        for name, fixture_class in six.iteritems(self.depends):
            if fixture_class not in fixtures:
                raise FixturesMongoengineException('Depended fixture "{}: {}" not found in fixtures dict.'
                                                   .format(name, fixture_class.__name__))
            self._depend_fixtures[name] = fixtures[fixture_class]

    def before_load(self):
        pass

    def load(self):
        pass

    def after_load(self):
        pass

    def before_unload(self):
        pass

    def unload(self):
        pass

    def after_unload(self):
        pass

    def _validate_depend_fixtures(self):
        if not self.depends:
            return

        for name, fixture_class in six.iteritems(self.depends):
            if name not in self._depend_fixtures:
                raise FixturesMongoengineException('Depended fixture "{}" wasn\'t created.'.format(name))

            fixture = self._depend_fixtures[name]
            if not fixture.loaded:
                raise FixturesMongoengineException('Depended fixture "{}" wasn\'t loaded.'.format(name))

    def _get_raw_data(self):
        """
        :rtype: dict
        """
        if self.data is not None:
            return self.data
        else:
            data_module = importlib.import_module(self.data_file)
            return getattr(data_module, self.attr_name)

    def _resolve_depends(self, value):
        if isinstance(value, six.string_types):
            return self._get_resolved_value(value)
        elif isinstance(value, dict):
            return self._get_resolved_dict(value)
        elif isinstance(value, list):
            return self._get_resolved_list(value)

        return value

    def _get_resolved_dict(self, value):
        copy = dict(value)
        for key, value in six.iteritems(copy):
            copy[key] = self._resolve_depends(value)

        return copy

    def _get_resolved_list(self, value):
        copy = []
        for item in value:
            copy.append(self._resolve_depends(item))

        return copy

    def _get_resolved_value(self, value):
        match = self.depend_re.match(value)
        if not match:
            return value

        ref = match.group(1)
        parts = ref.split('.')
        if len(parts) < 2:
            msg = 'Wrong depend reference "{}" in fixture "{}"'.format(ref, self.__class__.__name__)
            raise FixturesMongoengineException(msg)

        ref_fixture = parts.pop(0)
        if ref_fixture not in self._depend_fixtures:
            msg = 'Fixture "{}" not fount in depended fixtures.'.format(ref_fixture)
            raise FixturesMongoengineException(msg)

        fixture = self._depend_fixtures[ref_fixture]
        ref_model = parts.pop(0)
        if ref_model not in fixture:
            msg = 'Model "{}" not fount in depended fixture "{}".'.format(ref_model, ref_fixture)
            raise FixturesMongoengineException(msg)

        if len(parts) == 0:
            return getattr(fixture[ref_model], fixture.pk_field_name)
        else:
            return getattr_recursive(fixture[ref_model], parts)

class Fixture(six.with_metaclass(MetaFixture, BaseFixture)):

    document_class = None

    pk_field_name = 'pk'

    def __init__(self):
        super(Fixture, self).__init__()

        if self.document_class is None:
            raise FixturesMongoengineException('"document_class" must be set.')

    def load(self):
        self._validate_depend_fixtures()

        raw_data = self._get_raw_data()
        for key, row in six.iteritems(raw_data):
            if self.depends:
                row = self._resolve_depends(row)
            model = self.document_class(**row)
            model.save(self.validate)
            self._data[key] = model

        self._loaded = True

    def unload(self):
        self._data = {}
        self.document_class.objects().delete()


text:
<?php

namespace djchen\OAuth2\Client\Test\Provider;

use GuzzleHttp\Client;
use League\OAuth2\Client\Token\AccessToken;
use Psr\Http\Message\ResponseInterface;
use djchen\OAuth2\Client\Provider\Fitbit;
use djchen\OAuth2\Client\Provider\FitbitOptionsProvider;
use PHPUnit_Framework_TestCase as TestCase;

class FitbitTest extends TestCase
{
    /**
     * @var Fitbit
     */
    protected $provider;

    protected function setUp()
    {
        $this->provider = new Fitbit([
            'clientId' => 'mock_client_id',
            'clientSecret' => 'mock_secret',
            'redirectUri' => 'none',
        ]);
    }

    public function tearDown()
    {
        parent::tearDown();
    }

    public function testAuthorizationUrl()
    {
        $url = $this->provider->getAuthorizationUrl();
        $uri = parse_url($url);
        parse_str($uri['query'], $query);

        $this->assertArrayHasKey('client_id', $query);
        $this->assertArrayHasKey('redirect_uri', $query);
        $this->assertArrayHasKey('state', $query);
        $this->assertArrayHasKey('scope', $query);
        $this->assertArrayHasKey('response_type', $query);
        $this->assertArrayNotHasKey('approval_prompt', $query);
        $this->assertNotNull($this->provider->getState());
    }

    public function testScopes()
    {
        $options = ['scope' => [uniqid()]];
        $url = $this->provider->getAuthorizationUrl($options);
        $this->assertContains(urlencode(implode(' ', $options['scope'])), $url);
    }

    public function testGetAuthorizationUrl()
    {
        $url = $this->provider->getAuthorizationUrl();
        $uri = parse_url($url);
        $this->assertEquals('/oauth2/authorize', $uri['path']);
    }

    public function testGetBaseAccessTokenUrl()
    {
        $params = [];
        $url = $this->provider->getBaseAccessTokenUrl($params);
        $uri = parse_url($url);
        $this->assertEquals('/oauth2/token', $uri['path']);
    }

    public function testOptionsProvider()
    {
        $optionsProvider = $this->provider->getOptionProvider();
        $this->assertInstanceOf(FitbitOptionsProvider::class, $optionsProvider);
    }

    /**
     * Test revoke works for regression purposes
     * Doesn't actually make a request, just to test no exceptions are thrown.
     */
    public function testRevoke()
    {
        $httpMock = \Mockery::mock(Client::class);
        $responseMock = \Mockery::mock(ResponseInterface::class);
        $httpMock->shouldReceive('send')->andReturn($responseMock);
        $this->provider = new Fitbit([
            'clientId' => 'mock_client_id',
            'clientSecret' => 'mock_secret',
            'redirectUri' => 'none',
        ], [
            'httpClient' => $httpMock,
        ]);
        $token = new AccessToken(['access_token' => 'atoken']);
        $result = $this->provider->revoke($token);
    }
}

redpajama_set_name: RedPajamaGithub


text:
package com.xth.intelligentassistant.util;

import android.content.Context;
import android.content.SharedPreferences;

import java.io.Serializable;

/**
 * Created by XTH on 2017/5/22.
 */

public class MySharePreferences implements Serializable {

    //    private Context context;
    private String voiceSelect;//0:普通女生,1:普通男生,2:特别男生,3:情感男生<度逍遥>,4:情感儿童声<度丫丫>
    private Boolean textVoiceFlag;//false:Text显示语音图标,true:voice显示文字图标
    private Boolean voiceSexChoice;
    private SharedPreferences pref;
    private SharedPreferences.Editor editor;

    public Boolean getVoiceSexChoice() {
        return voiceSexChoice;
    }

    public void setVoiceSexChoice(Boolean voiceSexChoice) {
        voiceSexChoice = !voiceSexChoice;
        this.voiceSexChoice = voiceSexChoice;
        editor.putBoolean(Constant.VOICE_SEX_CHOICE, voiceSexChoice);
        editor.apply();//保存提交
    }

    public void setVoiceSelect(String voiceSelect) {
        this.voiceSelect = voiceSelect;
        editor.putString(Constant.VOICE_SELECT, voiceSelect);
        editor.apply();
    }

    public void setTextVoiceFlag(Boolean textVoiceFlag) {
        textVoiceFlag = !textVoiceFlag;
        this.textVoiceFlag = textVoiceFlag;
        editor.putBoolean(Constant.TEXT_VOICE_FLAG, textVoiceFlag);
        editor.apply();//保存提交
    }

    public Boolean getTextVoiceFlag() {
        return textVoiceFlag;
    }

    public String getVoiceSelect() {
        return voiceSelect;
    }

    public MySharePreferences(Context context) {
//        this.context = context;
        pref = context.getSharedPreferences(Constant.PREF_FILE, context.MODE_PRIVATE);
        editor = pref.edit();
        voiceSelect = pref.getString(Constant.VOICE_SELECT, Constant.GENERALGIRL_VALUE);
        textVoiceFlag = pref.getBoolean(Constant.TEXT_VOICE_FLAG, false);
        voiceSexChoice = pref.getBoolean(Constant.VOICE_SEX_CHOICE, false);
    }
}


text:
IF EXISTS ( SELECT  *
            FROM    sys.objects
            WHERE   object_id = OBJECT_ID(N'pa.GenPla_Finalizacion')
                    AND type IN ( N'P', N'PC' ) )

/****** Object:  StoredProcedure [pa].[GenPla_Finalizacion]    Script Date: 16-01-2017 1:43:08 PM ******/
DROP PROCEDURE [pa].[GenPla_Finalizacion]
GO
IF NOT EXISTS ( SELECT  *
            FROM    INFORMATION_SCHEMA.COLUMNS
            WHERE   COLUMN_NAME in ('hpa_codcco', 'hpa_nombre_centro_costo', 'hpa_cco_nomenclatura_contable') )
alter table sal.hpa_hist_periodos_planilla add hpa_codcco int null, hpa_nombre_centro_costo varchar(100) null, hpa_cco_nomenclatura_contable varchar(20) null;

GO
/****** Object:  StoredProcedure [pa].[GenPla_Finalizacion]    Script Date: 16-01-2017 1:43:08 PM ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE PROCEDURE [pa].[GenPla_Finalizacion]
	@sessionId UNIQUEIDENTIFIER = NULL,
	@codppl INT,
	@userName VARCHAR(100) = NULL
AS
BEGIN

set nocount on

declare @codcia int, @anio int, @mes int, @codtpl int, @fecha_fin datetime

select @codcia = tpl_codcia, @anio = ppl_anio, @mes = ppl_mes, @codtpl = ppl_codtpl, @fecha_fin = ppl_fecha_fin
from sal.ppl_periodos_planilla
join sal.tpl_tipo_planilla on tpl_codigo = ppl_codtpl
where ppl_codigo = @codppl

declare @now datetime, @maxId bigint
set @now = getdate()

--* Verifica los parámetros
set @userName = isnull(@userName, system_user)

begin transaction

-- Inserta los ingresos generados en la formulacion
insert into sal.inn_ingresos
		(inn_codppl, inn_codemp, inn_codtig, inn_codmon, inn_unidad_tiempo, inn_usuario_grabacion, inn_fecha_grabacion,
		inn_valor, inn_tiempo)
select inn_codppl, inn_codemp, inn_codtig, inn_codmon, inn_unidad_tiempo, @userName, @now,
		sum(round(isnull(inn_valor, 0), 2)), sum(round(isnull(inn_tiempo, 0), 2))
from tmp.inn_ingresos
where inn_codppl = @codppl
and sal.empleado_en_gen_planilla(@sessionId, inn_codemp) = 1
and exists (select 1 from sal.tig_tipos_ingreso where tig_codigo = inn_codtig)
group by inn_codppl, inn_codemp, inn_codtig, inn_codmon, inn_unidad_tiempo

-- Inserta los descuentos generados en la formulacion
insert into sal.dss_descuentos
		(dss_codppl, dss_codemp, dss_codtdc, dss_codmon, dss_unidad_tiempo, dss_usuario_grabacion, dss_fecha_grabacion,
		dss_valor, dss_valor_patronal, dss_ingreso_afecto, dss_tiempo)
select dss_codppl, dss_codemp, dss_codtdc, dss_codmon, dss_unidad_tiempo, @userName, @now,
	    sum(round(isnull(dss_valor, 0), 2)), sum(round(isnull(dss_valor_patronal, 0), 2)),
		sum(round(isnull(dss_ingreso_afecto, 0), 2)), sum(round(isnull(dss_tiempo, 0), 2))
from tmp.dss_descuentos
where dss_codppl = @codppl
and sal.empleado_en_gen_planilla(@sessionId, dss_codemp) = 1
and exists (select 1 from sal.tdc_tipos_descuento where tdc_codigo = dss_codtdc)
-- No consolida los descuentos que corresponden a descuentos ciclicos
and not exists (
	select 1
	from sal.cdc_cuotas_descuento_ciclico
	join sal.dcc_descuentos_ciclicos
	on dcc_codigo = cdc_coddcc
	where cdc_codppl = dss_codppl
	and dcc_codtdc = dss_codtdc
	and dcc_codemp = dss_codemp
	and cdc_valor_cobrado = dss_valor
	and dcc_activo = 1
)
group by dss_codppl, dss_codemp, dss_codtdc, dss_codmon, dss_unidad_tiempo

-- Inserta los descuentos generados en la formulacion
insert into sal.dss_descuentos
		(dss_codppl, dss_codemp, dss_codtdc, dss_codmon, dss_unidad_tiempo, dss_usuario_grabacion, dss_fecha_grabacion,
		dss_valor, dss_valor_patronal, dss_ingreso_afecto, dss_tiempo)
select dss_codppl, dss_codemp, dss_codtdc, dss_codmon, dss_unidad_tiempo, @userName, @now,
	    round(isnull(dss_valor, 0), 2), round(isnull(dss_valor_patronal, 0), 2),
		round(isnull(dss_ingreso_afecto, 0), 2), round(isnull(dss_tiempo, 0), 2)
from tmp.dss_descuentos
where dss_codppl = @codppl
and sal.empleado_en_gen_planilla(@sessionId, dss_codemp) = 1
and exists (select 1 from sal.tdc_tipos_descuento where tdc_codigo = dss_codtdc)
-- No consolida los descuentos que corresponden a descuentos ciclicos
and exists (
	select 1
	from sal.cdc_cuotas_descuento_ciclico
	join sal.dcc_descuentos_ciclicos
	on dcc_codigo = cdc_coddcc
	where cdc_codppl = dss_codppl
	and dcc_codtdc = dss_codtdc
	and dcc_codemp = dss_codemp
	and cdc_valor_cobrado = dss_valor
	and dcc_activo = 1
)

-- Borra los datos de ingresos las tablas temporales
delete from tmp.inn_ingresos
where inn_codppl = @codppl
--and sal.empleado_en_gen_planilla(@sessionId, inn_codemp) = 1

-- Borra los datos de descuentos las tablas temporales
delete from tmp.dss_descuentos
where dss_codppl = @codppl
--and sal.empleado_en_gen_planilla(@sessionId, dss_codemp) = 1

-- Borra los descuentos mayores a cero para los que no existan ingresos en la misma planilla
delete from sal.dss_descuentos
where dss_codppl = @codppl
--and sal.empleado_en_gen_planilla(@sessionId, dss_codemp) = 1
and dss_valor > 0
and not exists (select 1 from sal.inn_ingresos
				where inn_codppl = dss_codppl
				and inn_codemp = dss_codemp	)

-- Borra los registros de calculo de acumuladores de renta para empleados que no tuvieron ingresos en la planilla
delete from sal.rap_renta_anual_panama
where rap_codppl = @codppl
--and sal.empleado_en_gen_planilla(@sessionId, rap_codemp) = 1
and not exists (select 1 from sal.inn_ingresos
				where inn_codppl = rap_codppl
				and inn_codemp = rap_codemp)

-- Elimina las cuotas de descuentos ciclicos que no fueron aplicados en planilla
DELETE FROM sal.cdc_cuotas_descuento_ciclico
WHERE cdc_codppl = @codppl
AND cdc_aplicado_planilla = 0
--and (SELECT sal.empleado_en_gen_planilla(@sessionId, dcc_codemp)
--     FROM sal.dcc_descuentos_ciclicos
--     WHERE dcc_codigo = cdc_coddcc
--) = 1

-- Elimina las cuotas de descuentos ciclicos del personal que no participa en planilla
delete
from sal.cdc_cuotas_descuento_ciclico
where cdc_codppl = @codppl
and not exists (
	--select 1
	--from sal.dcc_descuentos_ciclicos
	--where dcc_codigo = cdc_coddcc
	--and dcc_codemp in (
	--	select distinct emp_codigo
	--	from exp.emp_empleos
	--	join sal.inn_ingresos
	--	on inn_codemp = emp_codigo
	--	where inn_codppl = 1014
	--)
	select 1
	from sal.inn_ingresos
	join sal.dcc_descuentos_ciclicos
	on dcc_codemp = inn_codemp
	where inn_codppl = cdc_codppl
	and dcc_codigo = cdc_coddcc
	and inn_codppl = @codppl
)

-- Guarda el saldo anterior y saldo nuevo por aplicar la cuota en planilla
update sal.cdc_cuotas_descuento_ciclico
set cdc_property_bag_data = gen.set_pb_field_data(cdc_property_bag_data,
													'CuotasDescuentoCiclico',
													'cdc_saldo_anterior',
													(case dcc_usa_porcentaje
														when 1 then gen.get_pb_field_data_float(dcc_property_bag_data, 'dcc_saldo_impar')
														else dcc_saldo
														end))
from sal.dcc_descuentos_ciclicos
where dcc_codigo = cdc_coddcc
and cdc_codppl = @codppl
and ( dcc_monto_indefinido = 0 or
		(dcc_usa_porcentaje = 1 and
		isnull(gen.get_pb_field_data_float(dcc_property_bag_data, 'dcc_saldo_impar'), 0) > 0)
	)

update sal.cdc_cuotas_descuento_ciclico
set cdc_property_bag_data = gen.set_pb_field_data(cdc_property_bag_data,
													'CuotasDescuentoCiclico',
													'cdc_saldo_nuevo',
													gen.get_pb_field_data_float(cdc_property_bag_data, 'cdc_saldo_anterior') - cdc_valor_cobrado
													)
from sal.dcc_descuentos_ciclicos
where dcc_codigo = cdc_coddcc
and cdc_codppl = @codppl
and ( dcc_monto_indefinido = 0 or
		(dcc_usa_porcentaje = 1 and
		isnull(gen.get_pb_field_data_float(dcc_property_bag_data, 'dcc_saldo_impar'), 0) > 0)
	)

-- Establece como no aplicados los ingresos eventuales de los empleados que no participan en planilla
update sal.oin_otros_ingresos
set oin_aplicado_planilla = 0
where oin_codppl = @codppl
and not exists (
	select 1
	from sal.inn_ingresos
	where inn_codppl = oin_codppl
	and inn_codemp = oin_codemp
)

-- Establece como no aplicados los descuentos eventuales de los empleados que no participan en planilla
update sal.ods_otros_descuentos
set ods_aplicado_planilla = 0
where ods_codppl = @codppl
and not exists (
	select 1
	from sal.dss_descuentos
	where dss_codppl = ods_codppl
	and dss_codemp = ods_codemp
)

update sal.ext_horas_extras
set ext_aplicado_planilla = 0
where ext_codppl = @codppl
and not exists (
	select 1
	from sal.inn_ingresos
	where inn_codppl = ext_codppl
	and inn_codemp = ext_codemp
)

update sal.tnn_tiempos_no_trabajados
set tnn_aplicado_planilla = 0
where tnn_codppl = @codppl
and not exists (
	select 1
	from sal.inn_ingresos
	where inn_codppl = tnn_codppl
	and inn_codemp = tnn_codemp
)
-- Genera la tabla de historicos
-- HISTORICO DE PLANILLAS CALCULADAS
insert into sal.hpa_hist_periodos_planilla
	(hpa_codppl, hpa_codemp, hpa_nombres_apellidos, hpa_apellidos_nombres, hpa_fecha_ingreso,
	hpa_codafp, hpa_nombre_afp, hpa_codmon, hpa_tasa_cambio, hpa_salario, hpa_salario_hora,
	hpa_codtco, hpa_codplz, hpa_nombre_plaza, hpa_coduni, hpa_nombre_unidad, hpa_codarf, hpa_nombre_areafun,
	hpa_codcdt, hpa_nombre_centro_trabajo, hpa_codpue, hpa_nombre_puesto, hpa_nombre_tipo_planilla, hpa_nombre_periodo_planilla,
	hpa_session_id, hpa_usuario_grabacion, hpa_fecha_grabacion,
	hpa_codcco, hpa_nombre_centro_costo, hpa_cco_nomenclatura_contable
	/*hpa_codjor,hpa_jornada,hpa_horas_x_semana,hpa_rata*/
	)
select @codppl, emp_codigo, exp_nombres_apellidos, exp_apellidos_nombres, emp_fecha_ingreso,
		null afp_codigo, null afp_nombre, inn_codmon, gen.get_tasa_cambio(inn_codmon, ppl_fecha_fin), isnull(valor, 0), isnull(valor_hora, 0),
		tco_codigo, plz_codigo, plz_nombre, uni_codigo, uni_descripcion, arf_codigo, arf_nombre,
		cdt_codigo, cdt_descripcion, pue_codigo, pue_nombre, tpl_descripcion, left(convert(varchar, ppl_fecha_ini, 100), 11) + ' - ' + left(convert(varchar, ppl_fecha_fin, 100), 11),
		@sessionId, @userName, @now
		, codcco, cco_descripcion, cco_nomenclatura_contable
		/* jor_Codigo, jor_descripcion, jor_total_horas,  case when isnull(jor_total_horas,0) > 0
															then (isnull(esa_valor, 0) / (52/12.000000)) / jor_total_horas
															else 0
														end */
	from exp.emp_empleos
	join (select inn_codemp, max(inn_codmon) inn_codmon
			from sal.inn_ingresos
			where inn_codppl = @codppl
			--and sal.empleado_en_gen_planilla(@sessionId, inn_codemp) = 1
			group by inn_codemp) inn on inn_codemp = emp_codigo
	join sal.ppl_periodos_planilla on ppl_codigo = @codppl
	join sal.tpl_tipo_planilla on tpl_codigo = ppl_codtpl
	--left join exp.esa_est_sal_actual_empleos_v on esa_codemp = emp_codigo and esa_es_salario_base = 1
	left join exp.fn_get_datos_rubro_salarial(null, 'S', @fecha_fin, 'pa')
	on codemp = emp_codigo
	join exp.tco_tipos_de_contrato on tco_codigo = emp_codtco
	join eor.plz_plazas on plz_codigo = emp_codplz
	join eor.uni_unidades on uni_codigo = plz_coduni
	join eor.arf_areas_funcionales on arf_codigo = uni_codarf
	join eor.cdt_centros_de_trabajo on cdt_codigo = plz_codcdt
	join eor.pue_puestos on pue_codigo = plz_codpue
	join exp.exp_expedientes on exp_codigo = emp_codexp
	left join sal.jor_jornadas on jor_codigo = emp_codjor
	left join (
		select codplz, codcco, cco_descripcion, cco_nomenclatura_contable
		from (
			select cpp_codplz codplz, max(cpp_codcco) codcco
			from eor.cpp_centros_costo_plaza
			group by cpp_codplz
		) v
		join eor.cco_centros_de_costo
		on cco_codigo = codcco
	) w
	on w.codplz = plz_codigo
	--left join exp.afp_afp on afp_codigo = gen.get_pb_field_data_int(emp_property_bag_data, 'codAFP')

/*****EVALUAR SI VA
-- Borra los ingresos generados con montos cero
delete from sal.inn_ingresos
where inn_codppl = @codppl
--and sal.empleado_en_gen_planilla(@sessionId, inn_codemp) = 1
and inn_valor = 0

-- Borra los descuentos generados con montos cero
delete from sal.dss_descuentos
where dss_codppl = @codppl
--and sal.empleado_en_gen_planilla(@sessionId, dss_codemp) = 1
and dss_valor = 0
*/

--*GENERA HISTORICO DE CENTROS DE COSTO
delete from  sal.hco_hist_cco_periodos_planilla
where exists(select null from sal.hpa_hist_periodos_planilla
				where hpa_Codppl = @codppl and hpa_codigo = hco_codhpa)

INSERT INTO sal.hco_hist_cco_periodos_planilla
(hco_codhpa, hco_codcco, hco_nombre_centro_costo, hco_porcentaje/*, hco_nomenclatura_contable*/)
SELECT hpa_codigo hco_codhpa, cco_codigo hco_codcco, cco_descripcion hco_nombre_centro_costo,
	cpp_porcentaje hco_porcentaje --, cco_nomenclatura_contable hco_nomenclatura_contable
FROM sal.hpa_hist_periodos_planilla
JOIN eor.plz_plazas ON plz_codigo = hpa_codplz
JOIN eor.cpp_Centros_costo_plaza ON cpp_Codplz = plz_codigo
JOIN eor.cco_Centros_De_costo ON cco_Codigo = cpp_codcco
WHERE hpa_codppl = @codppl

--*GENERACIÓN DE RESERVAS (PROVISIONES)
--execute pa.GenPla_Genera_Reservas @sessionId, @codppl, @userName

--*GENERACIÓN DE DATOS PREELABORADA
--Ejecución de proceso de llenado de tabla de seguro social
--execute pa.GenPla_llena_SIPE @codcia,@anio,@mes

--*GENERACIÓN DE PARTIDA CONTABLE
--execute pa.genpla_poliza_contable @sessionId,@codppl,@userName

--*CAMBIA A ESTADO GENERADO EL PERIODO DE PLANILLA
UPDATE sal.ppl_periodos_planilla
SET ppl_Estado = 'Generado'
WHERE ppl_Codigo  =@codppl

-- Marca Incapacidades como aplicadas en planilla
--UPDATE acc.pie_periodos_incapacidad
--   set pie_aplicado_planilla = 1
--WHERE pie_aplicado_planilla = 0
--AND pie_planilla_autorizada = 0
--AND (pie_valor_a_pagar > 0 or PIE_VALOR_A_DESCONTAR > 0)
--AND pie_codppl = @codppl
--AND exists (select null
--              from acc.ixe_incapacidades
--              JOIN acc.txi_tipos_incapacidad ON txi_codigo = ixe_codtxi
--              JOIN acc.rin_riesgos_incapacidades on rin_codigo= ixe_codrin
--			where ixe_codigo = pie_codixe
--              AND rin_utiliza_fondo = 1
--			)

UPDATE sal.tnn_tiempos_no_trabajados
SET tnn_aplicado_planilla = 1
WHERE EXISTS (
	SELECT 1
	FROM sal.ods_otros_descuentos
	WHERE ods_lote_masivo = tnn_codigo
	AND ods_aplicado_planilla = 1
	AND ods_codppl = 1018
)

DELETE FROM sal.ods_otros_descuentos
WHERE EXISTS (
	SELECT 1
	FROM sal.tnn_tiempos_no_trabajados
	WHERE tnn_codigo = ods_lote_masivo
	AND tnn_codppl = 1018
)

EXEC pa.GenPla_Genera_Reservas @codppl = @codppl
EXEC pa.GenPla_genera_partida_contable @codppl = @codppl

COMMIT TRANSACTION

END

GO


text:
import { Injectable } from '@angular/core';

import { HandyOauthUrls as Urls } from './../../../shared/class/handy-oauth-urls.class';
import { GoogleAuthModel } from './../../google/model/google-auth.model';

@Injectable()
export class FacebookAuthModel extends GoogleAuthModel {
    protected scope: string = 'public_profile,email';

    constructor(protected urls: Urls) {
        super(urls);
    }

    protected prepareUrl() {
        this.url = this.urls.FACEBOOK_AUTH_URL;
        this.uri = this.urls.FACEBOOK_AUTH_URI;
    }
}


text:
For the organization/user `npm` and the repo `npm-registry-client`
```
$ ./client.scm npm/npm-registry-client
```

Add this to your .bash_rc:

```bash
export AI_GITHUB_USERNAME=robertkowalski
```

Then to list all your potential abandoned issues:

```
$ ai $USERNAME/$REPO
```


text:
description: How to setup RemixVR
---

# Installation

## Before you start

There are couple of things you need to understand about how RemixVR is setup before you start.

There are 3 main parts to RemixVR.

1. [Frontend](installation.md#frontend)
2. [Backend](installation.md#backend)
3. [Templates](installation.md#templates)

In the next section, you can see how to setup each part of RemixVR on your computer.

## Steps to setup RemixVR on your computer

### Prerequisites

To make sure the projects runs on your machine, you need to have the following items installed on your machine.

#### Downloading RemixVR

First, we need to clone this Github repo and open the folder.

```bash
git clone https://github.com/teliportme/remixVR.git
cd remixVR
```

Once you're inside this folder, you can see 3 main folders which you should be aware of.

1. Frontend
2. Backend
3. Templates

#### Frontend

* Node.js
* Yarn

[Install node.js](https://nodejs.org/en/download/package-manager/) on your machine. We'll be using node.js for running our development server and building our project using [webpack](https://webpack.js.org/).

We'll use [yarn](https://yarnpkg.com/en/) as our [dependency manager](https://yarnpkg.com/lang/en/docs/managing-dependencies/). If you don't have `yarn` on your machine, make sure to [install yarn](https://yarnpkg.com/en/docs/install).

Once these are installed, go into the frontend folder.

```bash
cd frontend
```

Here we have to install the dependencies.

```bash
yarn install
```

This will download the project dependencies to `node_modules` folder. Once it is complete, you can use the following command to start the frontend.

```bash
yarn start
```

The frontend part of RemixVR will now be available at [http://localhost:3000/](http://localhost:3000/).

#### Backend

* Python 3
* Virtualenv

For RemixVR backend, we're using [Flask](http://flask.pocoo.org/) framework. To install flask and all the dependencies, make sure you have Python 3 installed on your computer. If you're not sure you have Python installed, you can run the following command in your terminal.

```bash
python --version
```

If you have Python 3 installed, you'll get something like `3.x.x` as the result. If you get an error saying Python is not installed or if the Python version is `2.x.x`, then [install Python 3](https://realpython.com/installing-python/).

Once you're ready with Python on your computer, you can go to the _backend_ folder inside RemixVR directory.

```bash
cd backend
```

Once here, we'll first setup [`virtualenv`](https://virtualenv.pypa.io/en/latest/) for our project. To install `virtualenv`, run the following command.

```bash
pip install virtualenv
```

Once you've installed `virtualenv`, create a new environment inside the `backend` directory.

```text
virtualenv env
```

This will create a new folder called _env_ which will save all the python dependencies there. Once the setup is complete, you'll need to run the following command to start using the correct dependencies in _env_ folder.

```bash
source env/bin/activate
```

Now you're ready to install the rest of Python dependencies. Since we're using `virtualenv`, Python will use the version of dependency specified in _env_ folder for our project.

When we finish working with backend, we can stop using the dependency versions in _env_ folder by running the following command.

```bash
deactivate
```

If we didn't use `virtualenv`, then all the dependencies will be shared with rest of the python projects, which makes it difficult to use correct version of dependency for your project.

Inside _requirements_ folder, you can see there are two files, called _dev.txt_  for development environment and _prod.txt_ for __production __environment.

For our local machine, we'll download the dependencies in _dev.txt._ This includes additional packages used  for development, compared to production environment.

```bash
pip install -r requirements/dev.txt
```

Once the installation is complete, all the backend dependencies for your project are installed.

There are couple more steps needed before we start our application.

First, set your app's secret key as an environment variable. For example, add the following to `.bashrc` or `.bash_profile`.

```bash
export remixvr_SECRET='something-really-secret'
```

Before running shell commands, set the `FLASK_APP` and `FLASK_DEBUG` environment variables

```bash
export FLASK_APP=/path/to/autoapp.py
export FLASK_DEBUG=1
```

{% hint style="warning" %}
In the above command, make sure FLASK\_APP points to _autoapp.py_ in your backend folder. For example, `/projects/remixVR/backend/autoapp.py`
{% endhint %}

Run the following commands to create your app's database tables and perform the initial migration

```text
flask db init
flask db migrate
flask db upgrade
```

To run the web application use:

```text
flask run --with-threads
```

This will start the backend at [http://localhost:5000/](http://localhost:5000/)

#### Templates

Templates in RemixVR is what makes VR possible inside RemixVR. All the VR based code lives inside templates.

To develop on templates shipped with RemixVR, you need to go inside _templates_ folder inside _remixvr_ directory.

```bash
cd templates
```

The templates in this directory share the dependencies in a common `node_modules` folder by using [yarn workspaces](https://yarnpkg.com/lang/en/docs/workspaces/).

This reduces the amount of space used by dependencies when common dependencies are involved.

Once inside _templates_ folder, run the following command to install the dependencies.

```bash
yarn install
```

All the templates are placed inside _packages_ folder inside the _templates_ folder.

```bash
cd packages
```

Inside _packages_ folder, you can see the a folder for each of the template. You can go to any of the folder \(_for example, 360vr_\) and run the following command to open the template in development mode.

```bash
cd 360vr
yarn start
```

This will open the VR template in development mode inside your browser.

You can run the following command to build the template and get it ready for production.

```bash
yarn build
```

To learn more about templates and about how to create VR templates, you can learn them at [Template section](templates.md).


text:
/**
 *
 */
package com.contalcob.bsp.partner.logic;

import com.contalcob.bsp.business.entity.Business;
import com.contalcob.bsp.partner.dao.PartnerDao;
import com.contalcob.bsp.partner.entity.Partner;
import com.contalcob.set.location.logic.LocationLogic;

/**
 * company : yonax73@gmail.com

 * user : YQ

 * update date : Jun 2, 2015

 * update by : Yonatan Alexis Quintero Rodriguez

 *
 * @created : Jun 2, 2015

 * @version : 0.1

 * @author Yonatan Alexis Quintero Rodriguez
 *
 */
public class PartnerLogic {

	/**
	 * @param business
	 * @return
	 */
	public static boolean search(Business business) {
		return business.exists() && PartnerDao.search(business);
	}

	/**
	 * @param partner
	 * @return
	 */
	public static boolean load(Partner partner) {
		boolean loaded = false;
		if (partner.exists() && PartnerDao.load(partner)) {
			if (partner.getLocation() != null) {
				loaded = LocationLogic.load(partner.getLocation());
			}
		}
		return loaded;
	}

	/**
	 * @param business
	 * @return
	 */
	public static boolean save(Business business) {
		boolean saved = false;
		Partner partner = business.getPartner();
		if (partner.exists()) {
			saved = PartnerDao.update(partner);
		} else if (business.exists()) {
			saved = PartnerDao.create(business);
		}
		return saved;
	}

}


text:
import { Component, OnInit, Output, ViewChild, EventEmitter } from '@angular/core';
import { NgForm } from '@angular/forms'
import { Track } from '../track.model'
import { TrackService } from '../track.service'

@Component({
  selector: 'track-form',
  templateUrl: './track-form.html'
})
export class TrackFormComponent implements OnInit {

  track: Track

  @Output() trackAdded: EventEmitter<Track> = new EventEmitter()
  @ViewChild('trackForm') trackForm: NgForm

  constructor(private trackService: TrackService) {}

  ngOnInit() {
    this.track = new Track()
  }

  success(track: Track) {
    this.trackAdded.emit(track)
    this.track = new Track()
  }
  onSubmit() {
    if(this.trackForm.valid) {
      this.trackService.create(this.track).subscribe(
        track => this.success(track),
        error => console.log('an error occured', error)
      )
    }
  }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fitsSystemWindows="true">

    <android.support.design.widget.AppBarLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:theme="@style/AppTheme.AppBarOverlay"
        app:elevation="0dp">

        <android.support.v7.widget.Toolbar
            android:id="@+id/toolbar"
            android:layout_width="match_parent"
            android:layout_height="?attr/actionBarSize"
            android:background="?attr/colorPrimary"
            app:popupTheme="@style/AppTheme.PopupOverlay"/>

    </android.support.design.widget.AppBarLayout>

    <LinearLayout
        android:id="@+id/fragment_book"
        xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:app="http://schemas.android.com/apk/res-auto"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical"
        app:layout_behavior="@string/appbar_scrolling_view_behavior">

        <android.support.design.widget.TabLayout
            android:id="@+id/sliding_tabs"
            style="@style/CustomTabLayout"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            app:layout_scrollFlags="scroll|enterAlways"
            app:tabGravity="fill"
            app:tabMode="fixed"/>

        <android.support.v4.view.ViewPager
            android:id="@+id/viewpager"
            android:layout_width="match_parent"
            android:layout_height="match_parent"/>

    </LinearLayout>
</android.support.design.widget.CoordinatorLayout>


text:
namespace Scammer_Bingo_Reborn
{
    partial class Settings
    {
        /// <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.groupBox1 = new System.Windows.Forms.GroupBox();
            this.button1 = new System.Windows.Forms.Button();
            this.checkBox1 = new System.Windows.Forms.CheckBox();
            this.groupBox2 = new System.Windows.Forms.GroupBox();
            this.checkBox2 = new System.Windows.Forms.CheckBox();
            this.button2 = new System.Windows.Forms.Button();
            this.button3 = new System.Windows.Forms.Button();
            this.button4 = new System.Windows.Forms.Button();
            this.groupBox3 = new System.Windows.Forms.GroupBox();
            this.label3 = new System.Windows.Forms.Label();
            this.comboBox2 = new System.Windows.Forms.ComboBox();
            this.label2 = new System.Windows.Forms.Label();
            this.comboBox1 = new System.Windows.Forms.ComboBox();
            this.label1 = new System.Windows.Forms.Label();
            this.groupBox4 = new System.Windows.Forms.GroupBox();
            this.comboBoxDifficulty = new System.Windows.Forms.ComboBox();
            this.label5 = new System.Windows.Forms.Label();
            this.button_Edit = new System.Windows.Forms.Button();
            this.button_Remove = new System.Windows.Forms.Button();
            this.button_Add = new System.Windows.Forms.Button();
            this.listBoxStrings = new System.Windows.Forms.ListBox();
            this.label4 = new System.Windows.Forms.Label();
            this.groupBox5 = new System.Windows.Forms.GroupBox();
            this.checkBox3 = new System.Windows.Forms.CheckBox();
            this.button_Default = new System.Windows.Forms.Button();
            this.groupBox1.SuspendLayout();
            this.groupBox2.SuspendLayout();
            this.groupBox3.SuspendLayout();
            this.groupBox4.SuspendLayout();
            this.groupBox5.SuspendLayout();
            this.SuspendLayout();
            //
            // groupBox1
            //
            this.groupBox1.Controls.Add(this.button1);
            this.groupBox1.Controls.Add(this.checkBox1);
            this.groupBox1.ForeColor = System.Drawing.SystemColors.ControlLightLight;
            this.groupBox1.Location = new System.Drawing.Point(13, 13);
            this.groupBox1.Name = "groupBox1";
            this.groupBox1.Size = new System.Drawing.Size(477, 59);
            this.groupBox1.TabIndex = 0;
            this.groupBox1.TabStop = false;
            this.groupBox1.Text = "Messages";
            //
            // button1
            //
            this.button1.BackColor = System.Drawing.SystemColors.ControlDarkDark;
            this.button1.ForeColor = System.Drawing.SystemColors.ControlLightLight;
            this.button1.Location = new System.Drawing.Point(339, 19);
            this.button1.Name = "button1";
            this.button1.Size = new System.Drawing.Size(114, 23);
            this.button1.TabIndex = 1;
            this.button1.Text = "Edit Messages";
            this.button1.UseVisualStyleBackColor = false;
            this.button1.Click += new System.EventHandler(this.button1_Click);
            //
            // checkBox1
            //
            this.checkBox1.AutoSize = true;
            this.checkBox1.ForeColor = System.Drawing.SystemColors.Control;
            this.checkBox1.Location = new System.Drawing.Point(6, 25);
            this.checkBox1.Name = "checkBox1";
            this.checkBox1.Size = new System.Drawing.Size(200, 17);
            this.checkBox1.TabIndex = 0;
            this.checkBox1.Text = "Enable messages (10/20 and 20/20)";
            this.checkBox1.UseVisualStyleBackColor = true;
            this.checkBox1.CheckedChanged += new System.EventHandler(this.checkBox1_CheckedChanged);
            //
            // groupBox2
            //
            this.groupBox2.Controls.Add(this.checkBox2);
            this.groupBox2.ForeColor = System.Drawing.SystemColors.ControlLightLight;
            this.groupBox2.Location = new System.Drawing.Point(13, 79);
            this.groupBox2.Name = "groupBox2";
            this.groupBox2.Size = new System.Drawing.Size(477, 49);
            this.groupBox2.TabIndex = 1;
            this.groupBox2.TabStop = false;
            this.groupBox2.Text = "Auto Reset";
            //
            // checkBox2
            //
            this.checkBox2.AutoSize = true;
            this.checkBox2.ForeColor = System.Drawing.SystemColors.Control;
            this.checkBox2.Location = new System.Drawing.Point(6, 20);
            this.checkBox2.Name = "checkBox2";
            this.checkBox2.Size = new System.Drawing.Size(285, 17);
            this.checkBox2.TabIndex = 0;
            this.checkBox2.Text = "Enable Auto Reset (Will reset when the score is 20/20)";
            this.checkBox2.UseVisualStyleBackColor = true;
            this.checkBox2.CheckedChanged += new System.EventHandler(this.checkBox2_CheckedChanged);
            //
            // button2
            //
            this.button2.BackColor = System.Drawing.SystemColors.ControlDarkDark;
            this.button2.ForeColor = System.Drawing.SystemColors.ControlLightLight;
            this.button2.Location = new System.Drawing.Point(415, 623);
            this.button2.Name = "button2";
            this.button2.Size = new System.Drawing.Size(75, 23);
            this.button2.TabIndex = 2;
            this.button2.Text = "Apply";
            this.button2.UseVisualStyleBackColor = false;
            this.button2.Click += new System.EventHandler(this.button2_Click);
            //
            // button3
            //
            this.button3.BackColor = System.Drawing.SystemColors.ControlDarkDark;
            this.button3.DialogResult = System.Windows.Forms.DialogResult.Cancel;
            this.button3.ForeColor = System.Drawing.SystemColors.ControlLightLight;
            this.button3.Location = new System.Drawing.Point(334, 623);
            this.button3.Name = "button3";
            this.button3.Size = new System.Drawing.Size(75, 23);
            this.button3.TabIndex = 3;
            this.button3.Text = "Cancel";
            this.button3.UseVisualStyleBackColor = false;
            this.button3.Click += new System.EventHandler(this.button3_Click);
            //
            // button4
            //
            this.button4.BackColor = System.Drawing.SystemColors.ControlDarkDark;
            this.button4.ForeColor = System.Drawing.SystemColors.ControlLightLight;
            this.button4.Location = new System.Drawing.Point(253, 623);
            this.button4.Name = "button4";
            this.button4.Size = new System.Drawing.Size(75, 23);
            this.button4.TabIndex = 4;
            this.button4.Text = "OK";
            this.button4.UseVisualStyleBackColor = false;
            this.button4.Click += new System.EventHandler(this.button4_Click);
            //
            // groupBox3
            //
            this.groupBox3.Controls.Add(this.label3);
            this.groupBox3.Controls.Add(this.comboBox2);
            this.groupBox3.Controls.Add(this.label2);
            this.groupBox3.Controls.Add(this.comboBox1);
            this.groupBox3.Controls.Add(this.label1);
            this.groupBox3.ForeColor = System.Drawing.SystemColors.ControlLightLight;
            this.groupBox3.Location = new System.Drawing.Point(13, 135);
            this.groupBox3.Name = "groupBox3";
            this.groupBox3.Size = new System.Drawing.Size(477, 99);
            this.groupBox3.TabIndex = 5;
            this.groupBox3.TabStop = false;
            this.groupBox3.Text = "Theme Settings";
            //
            // label3
            //
            this.label3.AutoSize = true;
            this.label3.Location = new System.Drawing.Point(6, 80);
            this.label3.Name = "label3";
            this.label3.Size = new System.Drawing.Size(295, 13);
            this.label3.TabIndex = 4;
            this.label3.Text = "Theme settings will be applied when clicking \"Apply\" or \"OK\"";
            //
            // comboBox2
            //
            this.comboBox2.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            this.comboBox2.FormattingEnabled = true;
            this.comboBox2.Items.AddRange(new object[] {
            "Dark Green",
            "Green",
            "Lime",
            "Dark Blue",
            "Blue",
            "Light Blue",
            "Magenta",
            "Red",
            "Orange",
            "White",
            "Gray",
            "Black"});
            this.comboBox2.Location = new System.Drawing.Point(104, 44);
            this.comboBox2.Name = "comboBox2";
            this.comboBox2.Size = new System.Drawing.Size(163, 21);
            this.comboBox2.TabIndex = 3;
            this.comboBox2.SelectedIndexChanged += new System.EventHandler(this.comboBox2_SelectedIndexChanged);
            //
            // label2
            //
            this.label2.AutoSize = true;
            this.label2.Location = new System.Drawing.Point(7, 47);
            this.label2.Name = "label2";
            this.label2.Size = new System.Drawing.Size(88, 13);
            this.label2.TabIndex = 2;
            this.label2.Text = "Foreground Color";
            //
            // comboBox1
            //
            this.comboBox1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            this.comboBox1.FormattingEnabled = true;
            this.comboBox1.Items.AddRange(new object[] {
            "Dark Green",
            "Green",
            "Lime",
            "Dark Blue",
            "Blue",
            "Light Blue",
            "Magenta",
            "Red",
            "Orange",
            "White",
            "Gray",
            "Black"});
            this.comboBox1.Location = new System.Drawing.Point(104, 17);
            this.comboBox1.Name = "comboBox1";
            this.comboBox1.Size = new System.Drawing.Size(163, 21);
            this.comboBox1.TabIndex = 1;
            this.comboBox1.SelectedIndexChanged += new System.EventHandler(this.comboBox1_SelectedIndexChanged);
            //
            // label1
            //
            this.label1.AutoSize = true;
            this.label1.Location = new System.Drawing.Point(7, 20);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(91, 13);
            this.label1.TabIndex = 0;
            this.label1.Text = "Background color";
            //
            // groupBox4
            //
            this.groupBox4.Controls.Add(this.comboBoxDifficulty);
            this.groupBox4.Controls.Add(this.label5);
            this.groupBox4.Controls.Add(this.button_Edit);
            this.groupBox4.Controls.Add(this.button_Remove);
            this.groupBox4.Controls.Add(this.button_Add);
            this.groupBox4.Controls.Add(this.listBoxStrings);
            this.groupBox4.Controls.Add(this.label4);
            this.groupBox4.ForeColor = System.Drawing.SystemColors.ControlLightLight;
            this.groupBox4.Location = new System.Drawing.Point(13, 241);
            this.groupBox4.Name = "groupBox4";
            this.groupBox4.Size = new System.Drawing.Size(477, 322);
            this.groupBox4.TabIndex = 6;
            this.groupBox4.TabStop = false;
            this.groupBox4.Text = "Buttons";
            //
            // comboBoxDifficulty
            //
            this.comboBoxDifficulty.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            this.comboBoxDifficulty.FormattingEnabled = true;
            this.comboBoxDifficulty.Items.AddRange(new object[] {
            "Easy (4x3)",
            "Medium (5x4)",
            "Hard (6x5)",
            "Custom"});
            this.comboBoxDifficulty.Location = new System.Drawing.Point(94, 20);
            this.comboBoxDifficulty.Name = "comboBoxDifficulty";
            this.comboBoxDifficulty.Size = new System.Drawing.Size(121, 21);
            this.comboBoxDifficulty.TabIndex = 11;
            this.comboBoxDifficulty.SelectedIndexChanged += new System.EventHandler(this.comboBoxDifficulty_SelectedIndexChanged);
            //
            // label5
            //
            this.label5.AutoSize = true;
            this.label5.Location = new System.Drawing.Point(15, 23);
            this.label5.Name = "label5";
            this.label5.Size = new System.Drawing.Size(47, 13);
            this.label5.TabIndex = 10;
            this.label5.Text = "Difficulty";
            //
            // button_Edit
            //
            this.button_Edit.BackColor = System.Drawing.SystemColors.ControlDarkDark;
            this.button_Edit.Enabled = false;
            this.button_Edit.ForeColor = System.Drawing.SystemColors.ControlLightLight;
            this.button_Edit.Location = new System.Drawing.Point(339, 287);
            this.button_Edit.Name = "button_Edit";
            this.button_Edit.Size = new System.Drawing.Size(123, 23);
            this.button_Edit.TabIndex = 9;
            this.button_Edit.Text = "Edit";
            this.button_Edit.UseVisualStyleBackColor = false;
            this.button_Edit.Click += new System.EventHandler(this.button_Edit_Click);
            //
            // button_Remove
            //
            this.button_Remove.BackColor = System.Drawing.SystemColors.ControlDarkDark;
            this.button_Remove.Enabled = false;
            this.button_Remove.ForeColor = System.Drawing.SystemColors.ControlLightLight;
            this.button_Remove.Location = new System.Drawing.Point(94, 287);
            this.button_Remove.Name = "button_Remove";
            this.button_Remove.Size = new System.Drawing.Size(75, 23);
            this.button_Remove.TabIndex = 8;
            this.button_Remove.Text = "Remove (TBD)";
            this.button_Remove.UseVisualStyleBackColor = false;
            this.button_Remove.Click += new System.EventHandler(this.button_Remove_Click);
            //
            // button_Add
            //
            this.button_Add.BackColor = System.Drawing.SystemColors.ControlDarkDark;
            this.button_Add.ForeColor = System.Drawing.SystemColors.ControlLightLight;
            this.button_Add.Location = new System.Drawing.Point(10, 287);
            this.button_Add.Name = "button_Add";
            this.button_Add.Size = new System.Drawing.Size(75, 23);
            this.button_Add.TabIndex = 7;
            this.button_Add.Text = "Add";
            this.button_Add.UseVisualStyleBackColor = false;
            this.button_Add.Click += new System.EventHandler(this.button_Add_Click);
            //
            // listBoxStrings
            //
            this.listBoxStrings.FormattingEnabled = true;
            this.listBoxStrings.Location = new System.Drawing.Point(10, 69);
            this.listBoxStrings.Name = "listBoxStrings";
            this.listBoxStrings.Size = new System.Drawing.Size(452, 212);
            this.listBoxStrings.TabIndex = 1;
            this.listBoxStrings.SelectedIndexChanged += new System.EventHandler(this.listBoxStrings_SelectedIndexChanged);
            //
            // label4
            //
            this.label4.AutoSize = true;
            this.label4.Location = new System.Drawing.Point(7, 53);
            this.label4.Name = "label4";
            this.label4.Size = new System.Drawing.Size(194, 13);
            this.label4.TabIndex = 0;
            this.label4.Text = "Click on a string to change what it says.";
            //
            // groupBox5
            //
            this.groupBox5.Controls.Add(this.checkBox3);
            this.groupBox5.Location = new System.Drawing.Point(13, 569);
            this.groupBox5.Name = "groupBox5";
            this.groupBox5.Size = new System.Drawing.Size(477, 48);
            this.groupBox5.TabIndex = 7;
            this.groupBox5.TabStop = false;
            this.groupBox5.Text = "Updates";
            //
            // checkBox3
            //
            this.checkBox3.AutoSize = true;
            this.checkBox3.Location = new System.Drawing.Point(9, 19);
            this.checkBox3.Name = "checkBox3";
            this.checkBox3.Size = new System.Drawing.Size(163, 17);
            this.checkBox3.TabIndex = 0;
            this.checkBox3.Text = "Check for updates on launch";
            this.checkBox3.UseVisualStyleBackColor = true;
            this.checkBox3.CheckedChanged += new System.EventHandler(this.checkBox3_CheckedChanged);
            //
            // button_Default
            //
            this.button_Default.BackColor = System.Drawing.SystemColors.ControlDarkDark;
            this.button_Default.ForeColor = System.Drawing.SystemColors.ControlLightLight;
            this.button_Default.Location = new System.Drawing.Point(12, 623);
            this.button_Default.Name = "button_Default";
            this.button_Default.Size = new System.Drawing.Size(75, 23);
            this.button_Default.TabIndex = 8;
            this.button_Default.Text = "Default";
            this.button_Default.UseVisualStyleBackColor = false;
            this.button_Default.Click += new System.EventHandler(this.button_Default_Click);
            //
            // Settings
            //
            this.AcceptButton = this.button4;
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.BackColor = System.Drawing.SystemColors.ControlDarkDark;
            this.CancelButton = this.button3;
            this.ClientSize = new System.Drawing.Size(505, 658);
            this.Controls.Add(this.button_Default);
            this.Controls.Add(this.groupBox5);
            this.Controls.Add(this.groupBox4);
            this.Controls.Add(this.groupBox3);
            this.Controls.Add(this.button4);
            this.Controls.Add(this.button3);
            this.Controls.Add(this.button2);
            this.Controls.Add(this.groupBox2);
            this.Controls.Add(this.groupBox1);
            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
            this.MaximizeBox = false;
            this.MinimizeBox = false;
            this.Name = "Settings";
            this.ShowIcon = false;
            this.Text = "Settings";
            this.Load += new System.EventHandler(this.Settings_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.groupBox5.ResumeLayout(false);
            this.groupBox5.PerformLayout();
            this.ResumeLayout(false);

        }

        #endregion

        private System.Windows.Forms.GroupBox groupBox1;
        private System.Windows.Forms.Button button1;
        private System.Windows.Forms.CheckBox checkBox1;
        private System.Windows.Forms.GroupBox groupBox2;
        private System.Windows.Forms.CheckBox checkBox2;
        private System.Windows.Forms.Button button2;
        private System.Windows.Forms.Button button3;
        private System.Windows.Forms.Button button4;
        private System.Windows.Forms.GroupBox groupBox3;
        private System.Windows.Forms.ComboBox comboBox2;
        private System.Windows.Forms.Label label2;
        private System.Windows.Forms.ComboBox comboBox1;
        private System.Windows.Forms.Label label1;
        private System.Windows.Forms.Label label3;
        private System.Windows.Forms.GroupBox groupBox4;
        private System.Windows.Forms.Label label4;
        private System.Windows.Forms.ListBox listBoxStrings;
        private System.Windows.Forms.Button button_Edit;
        private System.Windows.Forms.Button button_Remove;
        private System.Windows.Forms.Button button_Add;
        private System.Windows.Forms.ComboBox comboBoxDifficulty;
        private System.Windows.Forms.Label label5;
        private System.Windows.Forms.GroupBox groupBox5;
        private System.Windows.Forms.CheckBox checkBox3;
        private System.Windows.Forms.Button button_Default;
    }
}


text:
/*
 * KeepAliveTimer.cpp
 *
 *  Created on: Feb 9, 2014
 *      Author: root
 */

#include <KeepAliveTimer.h>

KeepAliveTimer::KeepAliveTimer()
{
	seconds = milliseconds =  0;
}
KeepAliveTimer::KeepAliveTimer(int seconds, int milliseconds)
{
		Timer(seconds, milliseconds, false);
		timer_counter = 0;
}

KeepAliveTimer::~KeepAliveTimer()
{
	// TODO Auto-generated destructor stub
}

void KeepAliveTimer::TimerTask()
{
	timer_counter++;
}