text:
#include <toolchain.h>
#include <irq.h>
#include <arch/cpu.h>

#include <tracing/tracing.h>

static ALWAYS_INLINE void riscv_idle(unsigned int key)
{
	sys_trace_idle();
	/* unlock interrupts */
	irq_unlock(key);

	/* Wait for interrupt */
	__asm__ volatile("wfi");
}

/**
 *
 * @brief Power save idle routine
 *
 * This function will be called by the kernel idle loop or possibly within
 * an implementation of _pm_save_idle in the kernel when the
 * '_pm_save_flag' variable is non-zero.
 *
 * @return N/A
 */
void arch_cpu_idle(void)
{
	riscv_idle(MSTATUS_IEN);
}

/**
 *
 * @brief Atomically re-enable interrupts and enter low power mode
 *
 * INTERNAL
 * The requirements for arch_cpu_atomic_idle() are as follows:
 * 1) The enablement of interrupts and entering a low-power mode needs to be
 *    atomic, i.e. there should be no period of time where interrupts are
 *    enabled before the processor enters a low-power mode.  See the comments
 *    in k_lifo_get(), for example, of the race condition that
 *    occurs if this requirement is not met.
 *
 * 2) After waking up from the low-power mode, the interrupt lockout state
 *    must be restored as indicated in the 'imask' input parameter.
 *
 * @return N/A
 */
void arch_cpu_atomic_idle(unsigned int key)
{
	riscv_idle(key);
}


text:
<?xml version="1.0" encoding="UTF-8"?>

<rootTag>
  <Award>
    <AwardTitle>STARS: Sycamore Technology Academics & Recruitment Scholarships</AwardTitle>
    <AwardEffectiveDate>06/01/2010</AwardEffectiveDate>
    <AwardExpirationDate>05/31/2016</AwardExpirationDate>
    <AwardAmount>487269</AwardAmount>
    <AwardInstrument>
      <Value>Continuing grant</Value>
    </AwardInstrument>
    <Organization>
      11040000
      <Directorate>
        <LongName>Direct For Education and Human Resources</LongName>
      </Directorate>
      <Division>
        <LongName>Division Of Undergraduate Education</LongName>
      </Division>
    </Organization>
    <ProgramOfficer>
      <SignBlockName>Connie K. Della-Piana</SignBlockName>
    </ProgramOfficer>
    <AbstractNarration>This project is providing 20 scholarships to academically talented and financially needy students at in two baccalaureate degree engineering technology programs (Computer Engineering Technology and Mechanical Engineering Technology) at Indiana State University (ISU). The project develops new support mechanisms including multi-disciplinary seminars, industry forum, and online academic/social networking to compliment mature student support services, such as learning community and co-ops/interns. Interactions among students and industry professionals help increase the focus and interest of students, enhance the educational experience of students, and build a relationship of feedback and exchange for students' ongoing success. Women and underrepresented minorities are also being recruited as participants of the project. An independent evaluator is involved in project evaluation.</AbstractNarration>
    <MinAmdLetterDate>05/27/2010</MinAmdLetterDate>
    <MaxAmdLetterDate>06/02/2011</MaxAmdLetterDate>
    <ARRAAmount/>
    <AwardID>0966219</AwardID>
    <Investigator>
      <FirstName>Jeffrey</FirstName>
      <LastName>McNabb</LastName>
      <EmailAddress>Jeffrey.McNabb@indstate.edu</EmailAddress>
      <StartDate>05/27/2010</StartDate>
      <EndDate/>
      <RoleCode>Co-Principal Investigator</RoleCode>
    </Investigator>
    <Investigator>
      <FirstName>Yuetong</FirstName>
      <LastName>Lin</LastName>
      <EmailAddress>yuetong.lin@indstate.edu</EmailAddress>
      <StartDate>05/27/2010</StartDate>
      <EndDate/>
      <RoleCode>Co-Principal Investigator</RoleCode>
    </Investigator>
    <Investigator>
      <FirstName>Xiaolong</FirstName>
      <LastName>Li</LastName>
      <EmailAddress>xiaolong.li@indstate.edu</EmailAddress>
      <StartDate>05/27/2010</StartDate>
      <EndDate/>
      <RoleCode>Co-Principal Investigator</RoleCode>
    </Investigator>
    <Investigator>
      <FirstName>M. Affan</FirstName>
      <LastName>Badar</LastName>
      <EmailAddress>M.Affan.Badar@indstate.edu</EmailAddress>
      <StartDate>05/27/2010</StartDate>
      <EndDate/>
      <RoleCode>Principal Investigator</RoleCode>
    </Investigator>
    <Investigator>
      <FirstName>A. Mehran</FirstName>
      <LastName>Shahhosseini</LastName>
      <EmailAddress>ali.shahhosseini@indstate.edu</EmailAddress>
      <StartDate>05/27/2010</StartDate>
      <EndDate/>
      <RoleCode>Co-Principal Investigator</RoleCode>
    </Investigator>
    <Institution>
      <Name>Indiana State University</Name>
      <CityName>TERRE HAUTE</CityName>
      <ZipCode>478091902</ZipCode>
      <PhoneNumber>8122373088</PhoneNumber>
      <StreetAddress>200 N 7TH STREET</StreetAddress>
      <CountryName>United States</CountryName>
      <StateName>Indiana</StateName>
      <StateCode>IN</StateCode>
    </Institution>
    <ProgramElement>
      1536
      <Text>S-STEM:SCHLR SCI TECH ENG&MATH</Text>
    </ProgramElement>
    <ProgramReference>
      9178
      <Text>UNDERGRADUATE EDUCATION</Text>
    </ProgramReference>
    <ProgramReference>
      SMET
      <Text>SCIENCE, MATH, ENG & TECH EDUCATION</Text>
    </ProgramReference>
  </Award>
</rootTag>

redpajama_set_name: RedPajamaGithub


text:
{% if displayHelper.getClaimStatusClosed(Claim['Status'], Claim['IsAdvanceClaim'], Claim['DateOfJourney']) %}

      Amount
      {% if errors['top-up-amount'][0] %}
        {{ errors['top-up-amount'][0] }}
      {% endif %}
      <input type='number' step="0.01" name='top-up-amount' id='top-up-amount' class='form-control' value="{{ topUpAmount }}">

      Reason
      {% if errors['top-up-reason'][0] %}
        {{ errors['top-up-reason'][0] }}
      {% endif %}
      <textarea name='top-up-reason' id='top-up-reason' maxlength='250'>{{ topUpReason }}</textarea>

    <input type="submit" class="button" name="add-top-up" id="add-top-up" value="Add Top Up">

{% endif %}


text:
package api

import (
	"bytes"
	"fmt"
	"os"
	"reflect"
	"testing"

	"sigs.k8s.io/yaml"
)

func newMergedConfig(certFile, certContent, keyFile, keyContent, caFile, caContent string, t *testing.T) Config {
	if err := os.WriteFile(certFile, []byte(certContent), 0644); err != nil {
		t.Errorf("unexpected error: %v", err)
	}
	if err := os.WriteFile(keyFile, []byte(keyContent), 0600); err != nil {
		t.Errorf("unexpected error: %v", err)
	}
	if err := os.WriteFile(caFile, []byte(caContent), 0644); err != nil {
		t.Errorf("unexpected error: %v", err)
	}

	return Config{
		AuthInfos: map[string]*AuthInfo{
			"red-user":  {Token: "red-token", ClientCertificateData: []byte(certContent), ClientKeyData: []byte(keyContent)},
			"blue-user": {Token: "blue-token", ClientCertificate: certFile, ClientKey: keyFile}},
		Clusters: map[string]*Cluster{
			"cow-cluster":     {Server: "http://cow.org:8080", CertificateAuthorityData: []byte(caContent)},
			"chicken-cluster": {Server: "http://chicken.org:8080", CertificateAuthority: caFile}},
		Contexts: map[string]*Context{
			"federal-context": {AuthInfo: "red-user", Cluster: "cow-cluster"},
			"shaker-context":  {AuthInfo: "blue-user", Cluster: "chicken-cluster"}},
		CurrentContext: "federal-context",
	}
}

func TestMinifySuccess(t *testing.T) {
	certFile, _ := os.CreateTemp("", "")
	defer os.Remove(certFile.Name())
	keyFile, _ := os.CreateTemp("", "")
	defer os.Remove(keyFile.Name())
	caFile, _ := os.CreateTemp("", "")
	defer os.Remove(caFile.Name())

	mutatingConfig := newMergedConfig(certFile.Name(), "cert", keyFile.Name(), "key", caFile.Name(), "ca", t)

	if err := MinifyConfig(&mutatingConfig); err != nil {
		t.Errorf("unexpected error: %v", err)
	}

	if len(mutatingConfig.Contexts) > 1 {
		t.Errorf("unexpected contexts: %v", mutatingConfig.Contexts)
	}
	if _, exists := mutatingConfig.Contexts["federal-context"]; !exists {
		t.Errorf("missing context")
	}

	if len(mutatingConfig.Clusters) > 1 {
		t.Errorf("unexpected clusters: %v", mutatingConfig.Clusters)
	}
	if _, exists := mutatingConfig.Clusters["cow-cluster"]; !exists {
		t.Errorf("missing cluster")
	}

	if len(mutatingConfig.AuthInfos) > 1 {
		t.Errorf("unexpected users: %v", mutatingConfig.AuthInfos)
	}
	if _, exists := mutatingConfig.AuthInfos["red-user"]; !exists {
		t.Errorf("missing user")
	}
}

func TestMinifyMissingContext(t *testing.T) {
	certFile, _ := os.CreateTemp("", "")
	defer os.Remove(certFile.Name())
	keyFile, _ := os.CreateTemp("", "")
	defer os.Remove(keyFile.Name())
	caFile, _ := os.CreateTemp("", "")
	defer os.Remove(caFile.Name())

	mutatingConfig := newMergedConfig(certFile.Name(), "cert", keyFile.Name(), "key", caFile.Name(), "ca", t)
	mutatingConfig.CurrentContext = "missing"

	errMsg := "cannot locate context missing"

	if err := MinifyConfig(&mutatingConfig); err == nil || err.Error() != errMsg {
		t.Errorf("expected %v, got %v", errMsg, err)
	}
}

func TestMinifyMissingCluster(t *testing.T) {
	certFile, _ := os.CreateTemp("", "")
	defer os.Remove(certFile.Name())
	keyFile, _ := os.CreateTemp("", "")
	defer os.Remove(keyFile.Name())
	caFile, _ := os.CreateTemp("", "")
	defer os.Remove(caFile.Name())

	mutatingConfig := newMergedConfig(certFile.Name(), "cert", keyFile.Name(), "key", caFile.Name(), "ca", t)
	delete(mutatingConfig.Clusters, mutatingConfig.Contexts[mutatingConfig.CurrentContext].Cluster)

	errMsg := "cannot locate cluster cow-cluster"

	if err := MinifyConfig(&mutatingConfig); err == nil || err.Error() != errMsg {
		t.Errorf("expected %v, got %v", errMsg, err)
	}
}

func TestMinifyMissingAuthInfo(t *testing.T) {
	certFile, _ := os.CreateTemp("", "")
	defer os.Remove(certFile.Name())
	keyFile, _ := os.CreateTemp("", "")
	defer os.Remove(keyFile.Name())
	caFile, _ := os.CreateTemp("", "")
	defer os.Remove(caFile.Name())

	mutatingConfig := newMergedConfig(certFile.Name(), "cert", keyFile.Name(), "key", caFile.Name(), "ca", t)
	delete(mutatingConfig.AuthInfos, mutatingConfig.Contexts[mutatingConfig.CurrentContext].AuthInfo)

	errMsg := "cannot locate user red-user"

	if err := MinifyConfig(&mutatingConfig); err == nil || err.Error() != errMsg {
		t.Errorf("expected %v, got %v", errMsg, err)
	}
}

func TestFlattenSuccess(t *testing.T) {
	certFile, _ := os.CreateTemp("", "")
	defer os.Remove(certFile.Name())
	keyFile, _ := os.CreateTemp("", "")
	defer os.Remove(keyFile.Name())
	caFile, _ := os.CreateTemp("", "")
	defer os.Remove(caFile.Name())

	certData := "cert"
	keyData := "key"
	caData := "ca"

	unchangingCluster := "cow-cluster"
	unchangingAuthInfo := "red-user"
	changingCluster := "chicken-cluster"
	changingAuthInfo := "blue-user"

	startingConfig := newMergedConfig(certFile.Name(), certData, keyFile.Name(), keyData, caFile.Name(), caData, t)
	mutatingConfig := startingConfig

	if err := FlattenConfig(&mutatingConfig); err != nil {
		t.Errorf("unexpected error: %v", err)
	}

	if len(mutatingConfig.Contexts) != 2 {
		t.Errorf("unexpected contexts: %v", mutatingConfig.Contexts)
	}
	if !reflect.DeepEqual(startingConfig.Contexts, mutatingConfig.Contexts) {
		t.Errorf("expected %v, got %v", startingConfig.Contexts, mutatingConfig.Contexts)
	}

	if len(mutatingConfig.Clusters) != 2 {
		t.Errorf("unexpected clusters: %v", mutatingConfig.Clusters)
	}
	if !reflect.DeepEqual(startingConfig.Clusters[unchangingCluster], mutatingConfig.Clusters[unchangingCluster]) {
		t.Errorf("expected %v, got %v", startingConfig.Clusters[unchangingCluster], mutatingConfig.Clusters[unchangingCluster])
	}
	if len(mutatingConfig.Clusters[changingCluster].CertificateAuthority) != 0 {
		t.Errorf("unexpected caFile")
	}
	if string(mutatingConfig.Clusters[changingCluster].CertificateAuthorityData) != caData {
		t.Errorf("expected %v, got %v", caData, string(mutatingConfig.Clusters[changingCluster].CertificateAuthorityData))
	}

	if len(mutatingConfig.AuthInfos) != 2 {
		t.Errorf("unexpected users: %v", mutatingConfig.AuthInfos)
	}
	if !reflect.DeepEqual(startingConfig.AuthInfos[unchangingAuthInfo], mutatingConfig.AuthInfos[unchangingAuthInfo]) {
		t.Errorf("expected %v, got %v", startingConfig.AuthInfos[unchangingAuthInfo], mutatingConfig.AuthInfos[unchangingAuthInfo])
	}
	if len(mutatingConfig.AuthInfos[changingAuthInfo].ClientCertificate) != 0 {
		t.Errorf("unexpected caFile")
	}
	if string(mutatingConfig.AuthInfos[changingAuthInfo].ClientCertificateData) != certData {
		t.Errorf("expected %v, got %v", certData, string(mutatingConfig.AuthInfos[changingAuthInfo].ClientCertificateData))
	}
	if len(mutatingConfig.AuthInfos[changingAuthInfo].ClientKey) != 0 {
		t.Errorf("unexpected caFile")
	}
	if string(mutatingConfig.AuthInfos[changingAuthInfo].ClientKeyData) != keyData {
		t.Errorf("expected %v, got %v", keyData, string(mutatingConfig.AuthInfos[changingAuthInfo].ClientKeyData))
	}

}

func Example_minifyAndShorten() {
	certFile, _ := os.CreateTemp("", "")
	defer os.Remove(certFile.Name())
	keyFile, _ := os.CreateTemp("", "")
	defer os.Remove(keyFile.Name())
	caFile, _ := os.CreateTemp("", "")
	defer os.Remove(caFile.Name())

	certData := "cert"
	keyData := "key"
	caData := "ca"

	config := newMergedConfig(certFile.Name(), certData, keyFile.Name(), keyData, caFile.Name(), caData, nil)

	MinifyConfig(&config)
	ShortenConfig(&config)

	output, _ := yaml.Marshal(config)
	fmt.Printf("%s", string(output))
	// Output:
	// clusters:
	//   cow-cluster:
	//     LocationOfOrigin: ""
	//     certificate-authority-data: DATA+OMITTED
	//     server: http://cow.org:8080
	// contexts:
	//   federal-context:
	//     LocationOfOrigin: ""
	//     cluster: cow-cluster
	//     user: red-user
	// current-context: federal-context
	// preferences: {}
	// users:
	//   red-user:
	//     LocationOfOrigin: ""
	//     client-certificate-data: DATA+OMITTED
	//     client-key-data: DATA+OMITTED
	//     token: REDACTED
}

func TestShortenSuccess(t *testing.T) {
	certFile, _ := os.CreateTemp("", "")
	defer os.Remove(certFile.Name())
	keyFile, _ := os.CreateTemp("", "")
	defer os.Remove(keyFile.Name())
	caFile, _ := os.CreateTemp("", "")
	defer os.Remove(caFile.Name())

	certData := "cert"
	keyData := "key"
	caData := "ca"

	unchangingCluster := "chicken-cluster"
	unchangingAuthInfo := "blue-user"
	changingCluster := "cow-cluster"
	changingAuthInfo := "red-user"

	startingConfig := newMergedConfig(certFile.Name(), certData, keyFile.Name(), keyData, caFile.Name(), caData, t)
	mutatingConfig := startingConfig

	ShortenConfig(&mutatingConfig)

	if len(mutatingConfig.Contexts) != 2 {
		t.Errorf("unexpected contexts: %v", mutatingConfig.Contexts)
	}
	if !reflect.DeepEqual(startingConfig.Contexts, mutatingConfig.Contexts) {
		t.Errorf("expected %v, got %v", startingConfig.Contexts, mutatingConfig.Contexts)
	}

	dataOmitted := string(dataOmittedBytes)
	if len(mutatingConfig.Clusters) != 2 {
		t.Errorf("unexpected clusters: %v", mutatingConfig.Clusters)
	}
	if !reflect.DeepEqual(startingConfig.Clusters[unchangingCluster], mutatingConfig.Clusters[unchangingCluster]) {
		t.Errorf("expected %v, got %v", startingConfig.Clusters[unchangingCluster], mutatingConfig.Clusters[unchangingCluster])
	}
	if string(mutatingConfig.Clusters[changingCluster].CertificateAuthorityData) != dataOmitted {
		t.Errorf("expected %v, got %v", dataOmitted, string(mutatingConfig.Clusters[changingCluster].CertificateAuthorityData))
	}

	if len(mutatingConfig.AuthInfos) != 2 {
		t.Errorf("unexpected users: %v", mutatingConfig.AuthInfos)
	}
	if !reflect.DeepEqual(startingConfig.AuthInfos[unchangingAuthInfo], mutatingConfig.AuthInfos[unchangingAuthInfo]) {
		t.Errorf("expected %v, got %v", startingConfig.AuthInfos[unchangingAuthInfo], mutatingConfig.AuthInfos[unchangingAuthInfo])
	}
	if string(mutatingConfig.AuthInfos[changingAuthInfo].ClientCertificateData) != dataOmitted {
		t.Errorf("expected %v, got %v", dataOmitted, string(mutatingConfig.AuthInfos[changingAuthInfo].ClientCertificateData))
	}
	if string(mutatingConfig.AuthInfos[changingAuthInfo].ClientKeyData) != dataOmitted {
		t.Errorf("expected %v, got %v", dataOmitted, string(mutatingConfig.AuthInfos[changingAuthInfo].ClientKeyData))
	}
	if mutatingConfig.AuthInfos[changingAuthInfo].Token != "REDACTED" {
		t.Errorf("expected REDACTED, got %q", mutatingConfig.AuthInfos[changingAuthInfo].Token)
	}
}

func TestRedactSecrets(t *testing.T) {
	certFile, _ := os.CreateTemp("", "")
	defer os.Remove(certFile.Name())
	keyFile, _ := os.CreateTemp("", "")
	defer os.Remove(keyFile.Name())
	caFile, _ := os.CreateTemp("", "")
	defer os.Remove(caFile.Name())

	certData := "cert"
	keyData := "key"
	caData := "ca"

	unchangingCluster := "chicken-cluster"
	unchangingAuthInfo := "blue-user"
	changingAuthInfo := "red-user"

	startingConfig := newMergedConfig(certFile.Name(), certData, keyFile.Name(), keyData, caFile.Name(), caData, t)
	mutatingConfig := startingConfig

	err := RedactSecrets(&mutatingConfig)
	if err != nil {
		t.Errorf("unexpected error redacting secrets:\n%v", err)
	}

	if len(mutatingConfig.Contexts) != 2 {
		t.Errorf("unexpected contexts: %v", mutatingConfig.Contexts)
	}
	if !reflect.DeepEqual(startingConfig.Contexts, mutatingConfig.Contexts) {
		t.Errorf("expected %v, got %v", startingConfig.Contexts, mutatingConfig.Contexts)
	}

	if len(mutatingConfig.Clusters) != 2 {
		t.Errorf("unexpected clusters: %v", mutatingConfig.Clusters)
	}
	if !reflect.DeepEqual(startingConfig.Clusters[unchangingCluster], mutatingConfig.Clusters[unchangingCluster]) {
		t.Errorf("expected %v, got %v", startingConfig.Clusters[unchangingCluster], mutatingConfig.Clusters[unchangingCluster])
	}

	if len(mutatingConfig.AuthInfos) != 2 {
		t.Errorf("unexpected users: %v", mutatingConfig.AuthInfos)
	}
	if !reflect.DeepEqual(startingConfig.AuthInfos[unchangingAuthInfo], mutatingConfig.AuthInfos[unchangingAuthInfo]) {
		t.Errorf("expected %v, got %v", startingConfig.AuthInfos[unchangingAuthInfo], mutatingConfig.AuthInfos[unchangingAuthInfo])
	}
	if mutatingConfig.AuthInfos[changingAuthInfo].Token != "REDACTED" {
		t.Errorf("expected REDACTED, got %v", mutatingConfig.AuthInfos[changingAuthInfo].Token)
	}
	if !bytes.Equal(mutatingConfig.AuthInfos[changingAuthInfo].ClientKeyData, []byte("REDACTED")) {
		t.Errorf("expected REDACTED, got %s", mutatingConfig.AuthInfos[changingAuthInfo].ClientKeyData)
	}
}


text:
@implementation STPPhoneNumberValidator

+ (NSString *)countryCodeOrCurrentLocaleCountryFromString:(nullable NSString *)nillableCode {
    NSString *countryCode = nillableCode;
    if (!countryCode) {
        countryCode = [[NSLocale autoupdatingCurrentLocale] objectForKey:NSLocaleCountryCode];
    }
    return countryCode;
}

+ (BOOL)stringIsValidPartialPhoneNumber:(NSString *)string {
    return [self stringIsValidPartialPhoneNumber:string forCountryCode:nil];
}

+ (BOOL)stringIsValidPhoneNumber:(NSString *)string {
    if (!string) {
        return NO;
    }
    return [self stringIsValidPhoneNumber:string forCountryCode:nil];
}

+ (BOOL)stringIsValidPartialPhoneNumber:(NSString *)string
                         forCountryCode:(nullable NSString *)nillableCode {
    NSString *countryCode = [self countryCodeOrCurrentLocaleCountryFromString:nillableCode];

    if ([countryCode isEqualToString:@"US"]) {
        return [STPCardValidator sanitizedNumericStringForString:string].length <= 10;
    }
    else {
        return YES;
    }
}

+ (BOOL)stringIsValidPhoneNumber:(NSString *)string
                  forCountryCode:(nullable NSString *)nillableCode {
    NSString *countryCode = [self countryCodeOrCurrentLocaleCountryFromString:nillableCode];

    if ([countryCode isEqualToString:@"US"]) {
        return [STPCardValidator sanitizedNumericStringForString:string].length == 10;
    }
    else {
        return YES;
    }
}

+ (NSString *)formattedSanitizedPhoneNumberForString:(NSString *)string {
    return [self formattedSanitizedPhoneNumberForString:string
                                         forCountryCode:nil];
}

+ (NSString *)formattedSanitizedPhoneNumberForString:(NSString *)string
                                      forCountryCode:(nullable NSString *)nillableCode {
    NSString *countryCode = [self countryCodeOrCurrentLocaleCountryFromString:nillableCode];
    NSString *sanitized = [STPCardValidator sanitizedNumericStringForString:string];
    return [self formattedPhoneNumberForString:sanitized
                                forCountryCode:countryCode];
}

+ (NSString *)formattedRedactedPhoneNumberForString:(NSString *)string {
    return [self formattedRedactedPhoneNumberForString:string
                                        forCountryCode:nil];
}

+ (NSString *)formattedRedactedPhoneNumberForString:(NSString *)string
                                     forCountryCode:(nullable NSString *)nillableCode {
    NSString *countryCode = [self countryCodeOrCurrentLocaleCountryFromString:nillableCode];
    NSScanner *scanner = [NSScanner scannerWithString:string];
    NSMutableString *prefix = [NSMutableString stringWithCapacity:string.length];
    [scanner scanUpToString:@"*" intoString:&prefix];
    NSString *number = [string stringByReplacingOccurrencesOfString:prefix withString:@""];
    number = [number stringByReplacingOccurrencesOfString:@"*" withString:@"•"];
    number = [self formattedPhoneNumberForString:number
                                  forCountryCode:countryCode];
    return [NSString stringWithFormat:@"%@ %@", prefix, number];
}

+ (NSString *)formattedPhoneNumberForString:(NSString *)string
                             forCountryCode:(NSString *)countryCode {

    if (![countryCode isEqualToString:@"US"]) {
        return string;
    }
    if (string.length >= 6) {
        return [NSString stringWithFormat:@"(%@) %@-%@",
                [string stp_safeSubstringToIndex:3],
                [[string stp_safeSubstringToIndex:6] stp_safeSubstringFromIndex:3],
                [[string stp_safeSubstringToIndex:10] stp_safeSubstringFromIndex:6]
                ];
    } else if (string.length >= 3) {
        return [NSString stringWithFormat:@"(%@) %@",
                [string stp_safeSubstringToIndex:3],
                [string stp_safeSubstringFromIndex:3]
                ];
    }
    return string;
}

@end


text:
namespace android.content
{
	[global::MonoJavaBridge.JavaClass()]
	public partial class MutableContextWrapper : android.content.ContextWrapper
	{
		internal new static global::MonoJavaBridge.JniGlobalHandle staticClass;
		static MutableContextWrapper()
		{
			InitJNI();
		}
		protected MutableContextWrapper(global::MonoJavaBridge.JNIEnv @__env) : base(@__env)
		{
		}
		internal static global::MonoJavaBridge.MethodId _setBaseContext1728;
		public virtual void setBaseContext(android.content.Context arg0)
		{
			global::MonoJavaBridge.JNIEnv @__env = global::MonoJavaBridge.JNIEnv.ThreadEnv;
			if (!IsClrObject)
				@__env.CallVoidMethod(this.JvmHandle, global::android.content.MutableContextWrapper._setBaseContext1728, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0));
			else
				@__env.CallNonVirtualVoidMethod(this.JvmHandle, global::android.content.MutableContextWrapper.staticClass, global::android.content.MutableContextWrapper._setBaseContext1728, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0));
		}
		internal static global::MonoJavaBridge.MethodId _MutableContextWrapper1729;
		public MutableContextWrapper(android.content.Context arg0)  : base(global::MonoJavaBridge.JNIEnv.ThreadEnv)
		{
			global::MonoJavaBridge.JNIEnv @__env = global::MonoJavaBridge.JNIEnv.ThreadEnv;
			global::MonoJavaBridge.JniLocalHandle handle = @__env.NewObject(android.content.MutableContextWrapper.staticClass, global::android.content.MutableContextWrapper._MutableContextWrapper1729, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0));
			Init(@__env, handle);
		}
		private static void InitJNI()
		{
			global::MonoJavaBridge.JNIEnv @__env = global::MonoJavaBridge.JNIEnv.ThreadEnv;
			global::android.content.MutableContextWrapper.staticClass = @__env.NewGlobalRef(@__env.FindClass("android/content/MutableContextWrapper"));
			global::android.content.MutableContextWrapper._setBaseContext1728 = @__env.GetMethodIDNoThrow(global::android.content.MutableContextWrapper.staticClass, "setBaseContext", "(Landroid/content/Context;)V");
			global::android.content.MutableContextWrapper._MutableContextWrapper1729 = @__env.GetMethodIDNoThrow(global::android.content.MutableContextWrapper.staticClass, "<init>", "(Landroid/content/Context;)V");
		}
	}
}


text:
SUBDIR=	font-adobe-100dpi font-adobe-symbol-100dpi font-adobe-utopia-100dpi \
	font-bh-100dpi font-bh-lucidatypewriter-100dpi font-bitstream-100dpi

FONTSUBDIR=	100dpi

.include "../Makefile.fontdir"

.include <bsd.subdir.mk>


text:
+++
title = "Patricia Magrin Leonardelli"
Twitter = ""
linkedin = ""
image = "patricia-magrin.png"
type = "speaker"
linktitle = "patricia-magrin"
+++

• Profissional com mais de 15 anos de experiência no mercado em empresas de grande porte nos segmentos de serviços e financeiro;
• Experiência em gestão de equipes: planejamento de atividades, planejamento e acompanhamento de metas, organização e apresentação de entregas;
• Forte conhecimento em avaliação de riscos de segurança da informação;
• Larga vivência em desenvolvimento de políticas, normas e procedimentos de segurança da informação;
• Amplo conhecimento e vivência com diretrizes/requisitos das normas de segurança da informação ISO 27001, ISO 27002;
• Sólida atuação junto às áreas de desenvolvimento de novos produtos em atividades relacionadas à segurança da informação;
• Amplo conhecimento no desenvolvimento e na manutenção dos planos de continuidade de negócios.


text:
<?php

// autoload_namespaces.php @generated by Composer

$vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir);

return array(
    'SecurityLib' => array($vendorDir . '/ircmaxell/security-lib/lib'),
    'RandomLib' => array($vendorDir . '/ircmaxell/random-lib/lib'),
    'Psr\\Log\\' => array($vendorDir . '/psr/log'),
    'Pimple' => array($vendorDir . '/pimple/pimple/src'),
    'PayPal' => array($vendorDir . '/paypal/rest-api-sdk-php/lib'),
);


text:
<?php

/**
 * SfGuardUser
 *
 * This class has been auto-generated by the Doctrine ORM Framework
 *
 * @package    PuntoSeguro
 * @subpackage model
 * @author     Gustavo Lacoste <gustavo@lacosox.org>
 * @version    SVN: $Id: Builder.php 7490 2010-03-29 19:53:27Z jwage $
 */
class SfGuardUser extends BaseSfGuardUser
{
}


text:
layout: post
title: CV Top30 by Microsoft Research Asia
subtitle: Reviews
---
#### Keywords: High-Resolution representation, Spatial Attention Mechanism --> Relation networks, Tracking by duel networks (with semantic), Depth prediction, Knowledge distillation.
--------------
1. Deep High-Resolution Representation Learning for Human Pose Estimation
<img src="/img/20200119_1.png" alt="Drawing" style="width: 80%;"/>

   1.1 Two  benefits of the architecture

    1. Connects high-to-low resolution sub-networks in parallel rather than in series as done in most existing solutions.
    2. Repeated multi-scale  fusions  to  boost  the  high-resolution representations with the help of  the  low-resolution  representations  of  the same depth and similar level,  and vice versa.

8. Relation Networks for Object Detection
   Define relations between objects by adopting attention mechanism. In their work, it largely used for remove duplicate detection.

9. Learning Region Features for Object Detection
    Local features without RoI pooling.

10. Local Relation Networks for Image Recognition
    another relation networks on ImageNet.

14. Deformable ConvNets v2: More Deformable, Better Results

16. A Twofold Siamese Network for Real-Time Object Tracking
    Tracking with help pf semantic.

27. Learning Pyramid Context Encoder Network for High-Quality Image Inpainting
    Attention of pyramid.

29. Structured Knowledge Distillation forDense Prediction


text:
topic: "Feedback lab02"
desc: "Feedback on lab02"
---

# Feedback on lab02

Here's what to look for when giving feedback on lab02 (a pair lab.)

## Did they submit to Gradescope?

This is the first thing to check.  If they did, and if they got a perfect score, add a congratulations in their feedback
repo.  Everything else is an additional sanity check after that.

If they did NOT submit on Gradescope, or if they did not get a perfect score, then something is definitely amiss, and we'll
want to look into it further.

To check: Log into Gradescope.  If you haven't logged in yet, it is gradescope.com, and you use your ucsd email address
as your login.  If you haven't logged in before, you may need to ask for a password reset.

You should have access to the SPIS 2016 course in Gradescope.

## Did they submit as a team in Gradescope?

It is possible that only one pair partner submitted for the team.  There is a way for them to create teams of two in Gradescope, but it may not have been clear to them how to do this.  If they didn't submit as a team, check why.

## Does the repo they created have the correct name?

The should have created a repo with the name listed in this spreadsheet (private to mentors only):

Use the tabs at the bottom of the sheets to select "lab02 repos"

<https://docs.google.com/spreadsheets/d/1YPx3YtYVFCgCFAZU7wqZBAS7n2UUHhbc2J8odHyoQZk/edit?usp=sharing>

If the name is not correct, you won't be able to find it by clicking on the link.

Instead, go to the organization page: <https://github.com/ucsd-cse-spis-2016>, type "lab02" in the search box,
and look through to see if you can find the repo.

## Does the repo contain the right files?

The files should be:

* `.gitignore`
* `README.md`
* `tempFuncs.py`
* `test_tempFuncs.py`

If they dont have the right files, or the file names are wrong, provide some feedback on that.

##  tempFuncs.py: two function definitions

Check that tempFuncs.py has function definitions for both `ftoc` and `ctof`

These are pretty straightforward, so there probably isn't much you can say, unless you see something that jumps out at you.

## test_tempFuncs.py

They were supposed to add four tests for ctof that were NOT in the starter code so that there are nine tests in all.

Check whether they did.

One common error is to have the same name repeated.  You may want to try cloning the repo and running the tests yourself.

It is not necessary to fire up IDLE to do so.   The easiest way is just to type this at the unix shell prompt:

```
python test_tempFuncs.py
```

Ideally, you should see that it ran nine tests and they all passed:

```
$ python test_tempFuncs.py
.........
----------------------------------------------------------------------
Ran 9 tests in 0.000s

OK
$
```


text:
USING_NS_CC;
using namespace ui;

namespace cocostudio
{
    static const char* P_TouchScaleEnable = "touchScaleEnable";
    static const char* P_Text = "text";
    static const char* P_FontSize = "fontSize";
    static const char* P_FontName = "fontName";
    static const char* P_AreaWidth = "areaWidth";
    static const char* P_AreaHeight = "areaHeight";
    static const char* P_HAlignment = "hAlignment";
    static const char* P_VAlignment = "vAlignment";

    static TextReader* instanceTextReader = nullptr;

    IMPLEMENT_CLASS_WIDGET_READER_INFO(TextReader)

    TextReader::TextReader()
    {

    }

    TextReader::~TextReader()
    {

    }

    TextReader* TextReader::getInstance()
    {
        if (!instanceTextReader)
        {
            instanceTextReader = new (std::nothrow) TextReader();
        }
        return instanceTextReader;
    }

    void TextReader::setPropsFromBinary(cocos2d::ui::Widget *widget, CocoLoader *cocoLoader, stExpCocoNode *cocoNode)
    {
        this->beginSetBasicProperties(widget);

        stExpCocoNode *stChildArray = cocoNode->GetChildArray(cocoLoader);

        Text* label = static_cast<Text*>(widget);

        std::string binaryFilePath = GUIReader::getInstance()->getFilePath();

        for (int i = 0; i < cocoNode->GetChildNum(); ++i) {
            std::string key = stChildArray[i].GetName(cocoLoader);
            std::string value = stChildArray[i].GetValue(cocoLoader);
            //read all basic properties of widget
            CC_BASIC_PROPERTY_BINARY_READER
            //read all color related properties of widget
            CC_COLOR_PROPERTY_BINARY_READER

            else if (key == P_TouchScaleEnable) {
                label->setTouchScaleChangeEnabled(valueToBool(value));
            }

            else if(key == P_Text){
                label->setString(value);
            }else if(key == P_FontSize){
                label->setFontSize(valueToInt(value));
            }else if(key == P_FontName){
                std::string fontFilePath;
                fontFilePath = binaryFilePath.append(value);
                if (FileUtils::getInstance()->isFileExist(fontFilePath)) {
                    label->setFontName(fontFilePath);
                }else{
                    label->setFontName(value);
                }
            }else if(key == P_AreaWidth){
                label->setTextAreaSize(Size(valueToFloat(value), label->getTextAreaSize().height));
            }else if(key == P_AreaHeight){
                label->setTextAreaSize(Size(label->getTextAreaSize().width, valueToFloat(value)));
            }else if(key == P_HAlignment){
                label->setTextHorizontalAlignment((TextHAlignment)valueToInt(value));
            }else if(key == P_VAlignment){
                label->setTextVerticalAlignment((TextVAlignment)valueToInt(value));
            }

        } //end of for loop
        this->endSetBasicProperties(widget);
    }

    void TextReader::setPropsFromJsonDictionary(Widget *widget, const rapidjson::Value &options)
    {
        WidgetReader::setPropsFromJsonDictionary(widget, options);

        std::string jsonPath = GUIReader::getInstance()->getFilePath();

        Text* label = static_cast<Text*>(widget);
        bool touchScaleChangeAble = DICTOOL->getBooleanValue_json(options, P_TouchScaleEnable);
        label->setTouchScaleChangeEnabled(touchScaleChangeAble);
        const char* text = DICTOOL->getStringValue_json(options, P_Text,"Text Label");
        label->setString(text);

        label->setFontSize(DICTOOL->getIntValue_json(options, P_FontSize,20));

        std::string fontName = DICTOOL->getStringValue_json(options, P_FontName, "微软雅黑");

        std::string fontFilePath = jsonPath.append(fontName);
		if (FileUtils::getInstance()->isFileExist(fontFilePath))
		{
			label->setFontName(fontFilePath);
		}
		else{
			label->setFontName(fontName);
		}

        bool aw = DICTOOL->checkObjectExist_json(options, P_AreaWidth);
        bool ah = DICTOOL->checkObjectExist_json(options, P_AreaHeight);
        if (aw && ah)
        {
            Size size = Size(DICTOOL->getFloatValue_json(options, P_AreaWidth),DICTOOL->getFloatValue_json(options,P_AreaHeight));
            label->setTextAreaSize(size);
        }
        bool ha = DICTOOL->checkObjectExist_json(options, P_HAlignment);
        if (ha)
        {
            label->setTextHorizontalAlignment((TextHAlignment)DICTOOL->getIntValue_json(options, P_HAlignment));
        }
        bool va = DICTOOL->checkObjectExist_json(options, P_VAlignment);
        if (va)
        {
            label->setTextVerticalAlignment((TextVAlignment)DICTOOL->getIntValue_json(options, P_VAlignment));
        }

        WidgetReader::setColorPropsFromJsonDictionary(widget, options);
    }

    void TextReader::setPropsFromProtocolBuffers(ui::Widget *widget, const protocolbuffers::NodeTree &nodeTree)
    {
		Text* label = static_cast<Text*>(widget);
        const protocolbuffers::TextOptions& options = nodeTree.textoptions();

		bool IsCustomSize = options.iscustomsize();
		label->ignoreContentAdaptWithSize(!IsCustomSize);

        WidgetReader::setPropsFromProtocolBuffers(widget, nodeTree);

        label->setUnifySizeEnabled(false);

        std::string protocolBuffersPath = GUIReader::getInstance()->getFilePath();

        bool touchScaleChangeAble = options.touchscaleenable();
        label->setTouchScaleChangeEnabled(touchScaleChangeAble);
        const char* text = options.has_text() ? options.text().c_str() : "Text Label";
        label->setString(text);

        int fontSize = options.has_fontsize() ? options.fontsize() : 20;
        label->setFontSize(fontSize);

        std::string fontName = options.has_fontname() ? options.fontname() : "微软雅黑";

        std::string fontFilePath = protocolBuffersPath.append(fontName);
		if (FileUtils::getInstance()->isFileExist(fontFilePath))
		{
			label->setFontName(fontFilePath);
		}
		else{
			label->setFontName(fontName);
		}

        bool aw = options.has_areawidth();
        bool ah = options.has_areaheight();
        if (aw && ah)
        {
            Size size = Size(options.areawidth(), options.areaheight());
            label->setTextAreaSize(size);
        }
        bool ha = options.has_halignment();
        if (ha)
        {
            label->setTextHorizontalAlignment((TextHAlignment)options.halignment());
        }
        bool va = options.has_valignment();
        if (va)
        {
            label->setTextVerticalAlignment((TextVAlignment)options.valignment());
        }

		if (options.has_fontresource())
		{
			const protocolbuffers::ResourceData& resourceData = options.fontresource();
		    label->setFontName(protocolBuffersPath + resourceData.path());
		}

        // other commonly protperties
        WidgetReader::setColorPropsFromProtocolBuffers(widget, nodeTree);
    }

    void TextReader::setPropsFromXML(cocos2d::ui::Widget *widget, const tinyxml2::XMLElement *objectData)
    {
        WidgetReader::setPropsFromXML(widget, objectData);

        Text* label = static_cast<Text*>(widget);

        std::string xmlPath = GUIReader::getInstance()->getFilePath();

        float areaWidth = 0.0f, areaHeight = 0.0f;
        int halignment = 0, valignment = 0;

        int opacity = 255;

        label->setUnifySizeEnabled(false);

        label->setFontName("微软雅黑");

        // attributes
        const tinyxml2::XMLAttribute* attribute = objectData->FirstAttribute();
        while (attribute)
        {
            std::string name = attribute->Name();
            std::string value = attribute->Value();

            if (name == "TouchScaleChangeAble")
            {
                label->setTouchScaleChangeEnabled((value == "True") ? true : false);
            }
            else if (name == "LabelText")
            {
                label->setString(value);
            }
            else if (name == "FontSize")
            {
                label->setFontSize(atoi(value.c_str()));
            }
            else if (name == "FontName")
            {
                label->setFontName(value);
            }
            else if (name == "AreaWidth")
            {
                areaWidth = atoi(value.c_str());
            }
            else if (name == "AreaHeight")
            {
                areaHeight = atoi(value.c_str());
            }
            else if (name == "HorizontalAlignmentType")
            {
                if (value == "HT_Left")
                {
                    halignment = 0;
                }
                else if (value == "HT_Center")
                {
                    halignment = 1;
                }
                else if (value == "HT_Right")
                {
                    halignment = 2;
                }
            }
            else if (name == "VerticalAlignmentType")
            {
                if (value == "VT_Top")
                {
                    valignment = 0;
                }
                else if (value == "VT_Center")
                {
                    valignment = 1;
                }
                else if (value == "VT_Bottom")
                {
                    valignment = 2;
                }
            }
            else if (name == "Alpha")
            {
                opacity = atoi(value.c_str());
            }

            attribute = attribute->Next();
        }

        // child elements
        const tinyxml2::XMLElement* child = objectData->FirstChildElement();
        while (child)
        {
            std::string name = child->Name();

            if (name == "Size")
            {
                attribute = child->FirstAttribute();
                float width = 0.0f, height = 0.0f;

                while (attribute)
                {
                    name = attribute->Name();
                    std::string value = attribute->Value();

                    if (name == "X")
                    {
                        width = atof(value.c_str());
                    }
                    else if (name == "Y")
                    {
                        height = atof(value.c_str());
                    }

                    attribute = attribute->Next();
                }

                label->ignoreContentAdaptWithSize(false);
                label->setContentSize(Size(width, height));
            }
            else if (name == "FontResource")
            {
                attribute = child->FirstAttribute();
                int resourceType = 0;
                std::string path = "", plistFile = "";

                while (attribute)
                {
                    name = attribute->Name();
                    std::string value = attribute->Value();

                    if (name == "Path")
                    {
                        path = value;
                    }
                    else if (name == "Type")
                    {
                        resourceType = (value == "Normal" || value == "Default" || value == "MarkedSubImage") ? 0 : 1;
                    }
                    else if (name == "Plist")
                    {
                        plistFile = value;
                    }

                    attribute = attribute->Next();
                }

                switch (resourceType)
                {
                    case 0:
                    {
                        label->setFontName(xmlPath + path);
                        break;
                    }

                    default:
                        break;
                }
            }

            child = child->NextSiblingElement();
        }

        if (areaWidth != 0 || areaHeight != 0)
        {
            label->setTextAreaSize(Size(areaWidth, areaHeight));
        }

        label->setTextHorizontalAlignment((TextHAlignment)halignment);
        label->setTextVerticalAlignment((TextVAlignment)valignment);

        label->setOpacity(opacity);
    }

}


text:
package com.evolveum.midpoint.model.intest.password;

import org.springframework.test.annotation.DirtiesContext;
import org.springframework.test.annotation.DirtiesContext.ClassMode;
import org.springframework.test.context.ContextConfiguration;
import org.testng.annotations.Listeners;
import org.testng.annotations.Test;

import com.evolveum.midpoint.prism.PrismObject;
import com.evolveum.midpoint.schema.constants.SchemaConstants;
import com.evolveum.midpoint.schema.result.OperationResult;
import com.evolveum.midpoint.task.api.Task;
import com.evolveum.midpoint.test.util.TestUtil;
import com.evolveum.midpoint.util.exception.PolicyViolationException;
import com.evolveum.midpoint.xml.ns._public.common.common_3.CredentialsStorageTypeType;
import com.evolveum.midpoint.xml.ns._public.common.common_3.ShadowType;
import com.evolveum.midpoint.xml.ns._public.common.common_3.UserType;

/**
 * Password test with HASHING storage for all credential types.
 *
 * @author semancik
 *
 */
@ContextConfiguration(locations = {"classpath:ctx-model-intest-test-main.xml"})
@DirtiesContext(classMode = ClassMode.AFTER_CLASS)
@Listeners({ com.evolveum.midpoint.tools.testng.AlphabeticalMethodInterceptor.class })
public class TestPasswordDefaultHashing extends AbstractPasswordTest {

	@Override
	public void initSystem(Task initTask, OperationResult initResult) throws Exception {
		super.initSystem(initTask, initResult);
	}

	@Override
	protected String getSecurityPolicyOid() {
		return SECURITY_POLICY_DEFAULT_STORAGE_HASHING_OID;
	}

	@Override
	protected CredentialsStorageTypeType getPasswordStorageType() {
		return CredentialsStorageTypeType.HASHING;
	}

	@Override
	protected void assertShadowLifecycle(PrismObject<ShadowType> shadow, boolean focusCreated) {
		if (focusCreated) {
			assertShadowLifecycle(shadow, null);
		} else {
			assertShadowLifecycle(shadow, SchemaConstants.LIFECYCLE_PROPOSED);
		}
	}

	/**
	 * There is a RED account with a strong password
	 * mapping. The reconcile and the strong mapping would normally try to set the short
	 * password to RED account which would fail on RED account password policy. But not today.
	 * As we do not have password cleartext in the user then no password change should happen.
	 * And everything should go smoothly.
	 */
	@Test
    public void test202ReconcileUserJack() throws Exception {
		final String TEST_NAME = "test202ReconcileUserJack";
        TestUtil.displayTestTitle(this, TEST_NAME);

        // GIVEN
        Task task = taskManager.createTaskInstance(AbstractPasswordTest.class.getName() + "." + TEST_NAME);
        OperationResult result = task.getResult();

        PrismObject<UserType> userBefore = getUser(USER_JACK_OID);
		display("User before", userBefore);
		assertLinks(userBefore, 4);

		// WHEN
        reconcileUser(USER_JACK_OID, task, result);

		// THEN
		result.computeStatus();
		TestUtil.assertSuccess(result);

		PrismObject<UserType> userAfter = getUser(USER_JACK_OID);
		display("User after", userAfter);
		assertLinks(userAfter, 4);
        accountJackYellowOid = getLinkRefOid(userAfter, RESOURCE_DUMMY_YELLOW_OID);

        // Check account in dummy resource (yellow): password is too short for this, original password should remain there
        assertDummyAccount(RESOURCE_DUMMY_YELLOW_NAME, ACCOUNT_JACK_DUMMY_USERNAME, ACCOUNT_JACK_DUMMY_FULLNAME, true);
        assertDummyPasswordConditional(RESOURCE_DUMMY_YELLOW_NAME, ACCOUNT_JACK_DUMMY_USERNAME, USER_PASSWORD_1_CLEAR);

        // Check account in dummy resource (red)
        assertDummyAccount(RESOURCE_DUMMY_RED_NAME, ACCOUNT_JACK_DUMMY_USERNAME, ACCOUNT_JACK_DUMMY_FULLNAME, true);
        assertDummyPassword(RESOURCE_DUMMY_RED_NAME, ACCOUNT_JACK_DUMMY_USERNAME, USER_PASSWORD_AA_CLEAR);

        // User and default dummy account should have unchanged passwords
        assertUserPassword(userAfter, USER_PASSWORD_AA_CLEAR);
     	assertDummyPassword(ACCOUNT_JACK_DUMMY_USERNAME, USER_PASSWORD_AA_CLEAR);

		// this one is not changed
		assertDummyPassword(RESOURCE_DUMMY_UGLY_NAME, ACCOUNT_JACK_DUMMY_USERNAME, USER_JACK_EMPLOYEE_NUMBER_NEW_GOOD);

		assertPasswordHistoryEntries(userAfter);
	}

	@Override
	protected void assert31xBluePasswordAfterAssignment(PrismObject<UserType> userAfter) throws Exception {
		assertDummyPassword(RESOURCE_DUMMY_BLUE_NAME, ACCOUNT_JACK_DUMMY_USERNAME, null);
		PrismObject<ShadowType> shadow = getBlueShadow(userAfter);
		assertNoShadowPassword(shadow);
	}

	@Override
	protected void assert31xBluePasswordAfterPasswordChange(PrismObject<UserType> userAfter) throws Exception {
		// Password is set during the assign operation. As password mapping is weak it is never changed.
		assertDummyPassword(RESOURCE_DUMMY_BLUE_NAME, ACCOUNT_JACK_DUMMY_USERNAME, USER_PASSWORD_VALID_2);
		PrismObject<ShadowType> shadow = getBlueShadow(userAfter);
		assertIncompleteShadowPassword(shadow);
	}

	@Override
	protected void assertAccountActivationNotification(String dummyResourceName, String username) {
		checkDummyTransportMessages(NOTIFIER_ACCOUNT_ACTIVATION_NAME, 1);
		String body = getDummyTransportMessageBody(NOTIFIER_ACCOUNT_ACTIVATION_NAME, 0);
		//String expectedPrefix = getExpectedAccountPasswordNotificationBodyPrefix(dummyResourceName, username);
		if (!body.contains("activat")) {
			fail("Activation not mentioned in "+dummyResourceName+" dummy account activation notification message : "+body);
		}
		if (!body.contains("activate/accounts")) {
			fail("Link seems to be missing in "+dummyResourceName+" dummy account activation notification message : "+body);
		}
	}

	/**
	 * Monkey has password that does not comply with current password policy.
	 * Attempt to create account on blue account should pass in this case.
	 * User password is hashed, therefore account password is not set from user.
	 * No need to panic.
	 * MID-4791
	 */
	@Test
	@Override
    public void test345AssignMonkeyAccountBlue() throws Exception {
		final String TEST_NAME = "test345AssignMonkeyAccountBlue";
        displayTestTitle(TEST_NAME);

        // GIVEN
        Task task = createTask(TEST_NAME);
        OperationResult result = task.getResult();
        prepareTest();

		// WHEN
        displayWhen(TEST_NAME);

        assignAccountToUser(USER_THREE_HEADED_MONKEY_OID, RESOURCE_DUMMY_BLUE_OID, null, task, result);

		// THEN
        displayThen(TEST_NAME);
		assertSuccess(result);

        PrismObject<UserType> userAfter = getUser(USER_THREE_HEADED_MONKEY_OID);
		display("User after", userAfter);
		assertAssignments(userAfter, 2);
		assertUserPassword(userAfter, USER_PASSWORD_A_CLEAR);

		assertDummyAccount(null, USER_THREE_HEADED_MONKEY_NAME);
		assertDummyAccount(RESOURCE_DUMMY_BLUE_NAME, USER_THREE_HEADED_MONKEY_NAME);

		// CLEANUP
		displayCleanup(TEST_NAME);

		unassignAccountFromUser(USER_THREE_HEADED_MONKEY_OID, RESOURCE_DUMMY_BLUE_OID, null, task, result);

		PrismObject<UserType> userCleanup = getUser(USER_THREE_HEADED_MONKEY_OID);
		display("User cleanup", userCleanup);
		assertAssignments(userCleanup, 1);
		assertUserPassword(userCleanup, USER_PASSWORD_A_CLEAR);

		assertDummyAccount(null, USER_THREE_HEADED_MONKEY_NAME);
		assertNoDummyAccount(RESOURCE_DUMMY_BLUE_NAME, USER_THREE_HEADED_MONKEY_NAME);
	}

	/**
	 * Monkey has password that does not comply with current password policy.
	 * Let's assign yellow account. Attempt to create account on blue account
	 * should pass in this case. User password is hashed, therefore account
	 * password is not set from user. No need to panic.
	 * MID-4791
	 */
	@Test
	@Override
    public void test347AssignMonkeyAccountYellow() throws Exception {
		final String TEST_NAME = "test347AssignMonkeyYellow";
        displayTestTitle(TEST_NAME);

        // GIVEN
        Task task = createTask(TEST_NAME);
        OperationResult result = task.getResult();
        prepareTest();

		// WHEN
        displayWhen(TEST_NAME);

        assignAccountToUser(USER_THREE_HEADED_MONKEY_OID, RESOURCE_DUMMY_YELLOW_OID, null, task, result);

		// THEN
        displayThen(TEST_NAME);
		assertSuccess(result);

        PrismObject<UserType> userAfter = getUser(USER_THREE_HEADED_MONKEY_OID);
		display("User after", userAfter);
		assertAssignments(userAfter, 2);
		assertUserPassword(userAfter, USER_PASSWORD_A_CLEAR);

		assertDummyAccount(null, USER_THREE_HEADED_MONKEY_NAME);
		assertDummyAccount(RESOURCE_DUMMY_YELLOW_NAME, USER_THREE_HEADED_MONKEY_NAME);
		assertNoDummyAccount(RESOURCE_DUMMY_BLUE_NAME, USER_THREE_HEADED_MONKEY_NAME);

		// CLEANUP
		displayCleanup(TEST_NAME);

		unassignAccountFromUser(USER_THREE_HEADED_MONKEY_OID, RESOURCE_DUMMY_YELLOW_OID, null, task, result);

		PrismObject<UserType> userCleanup = getUser(USER_THREE_HEADED_MONKEY_OID);
		display("User cleanup", userCleanup);
		assertAssignments(userCleanup, 1);
		assertUserPassword(userCleanup, USER_PASSWORD_A_CLEAR);

		assertDummyAccount(null, USER_THREE_HEADED_MONKEY_NAME);
		assertNoDummyAccount(RESOURCE_DUMMY_YELLOW_NAME, USER_THREE_HEADED_MONKEY_NAME);
		assertNoDummyAccount(RESOURCE_DUMMY_BLUE_NAME, USER_THREE_HEADED_MONKEY_NAME);
	}

	/**
	 * Monkey has password that does not comply with current password policy.
	 * Let's assign yellow account. Yellow resource has a minimum password length
	 * (resource-enforced). User password is hashed, therefore account
	 * password is not set from user. No need to panic.
	 * MID-4793
	 */
	@Test
	@Override
    public void test966AssignMonkeyAccountYellow() throws Exception {
		final String TEST_NAME = "test966AssignMonkeyAccountYellow";
        displayTestTitle(TEST_NAME);

        // GIVEN
        Task task = createTask(TEST_NAME);
        OperationResult result = task.getResult();
        prepareTest();

		// WHEN
        displayWhen(TEST_NAME);

        assignAccountToUser(USER_THREE_HEADED_MONKEY_OID, RESOURCE_DUMMY_YELLOW_OID, null, task, result);

		// THEN
        displayThen(TEST_NAME);
		assertSuccess(result);

        PrismObject<UserType> userAfter = getUser(USER_THREE_HEADED_MONKEY_OID);
		display("User after", userAfter);
		assertAssignments(userAfter, 4);
		assertUserPassword(userAfter, USER_PASSWORD_A_CLEAR);

		assertDummyAccount(null, USER_THREE_HEADED_MONKEY_NAME);
		assertDummyAccount(RESOURCE_DUMMY_YELLOW_NAME, USER_THREE_HEADED_MONKEY_NAME);
		assertDummyAccount(RESOURCE_DUMMY_BLUE_NAME, USER_THREE_HEADED_MONKEY_NAME);
	}

}


text:
/**
 * Provides Connect middleware that
 * provides `res.streamFiles`.
 *
 * @method onyxProvider
 * @param {Onyx} onyx An instance of Onyx.
 */
module.exports = function onyxProvider (onyx) {

    /**
     * Connect middleware that provides `res.streamFiles`.
     */
    return function streamFilesFilter (req, res, next) {

        /**
         * Respond to this request by sending files.
         *
         * If a file isn't found or is a directory, don't handle the request
         * and pass through to the next middleware. (This usually yields a 404.)
         *
         * @param {Array|String} files The fully-qualified path to the file.
         * @param {Object} config Configuration to pass through to Onyx.
         */
        res.streamFiles = function streamFilesResponder (files, config) {
            if (!config) {
                config = {};
            }

            config.req = req;
            config.res = res;
            config.files = files;

            onyx.streamFiles(config, function (err) {
                if (err) {
                    if (err.code === "ENOENT" || err.code === "EISDIR") {
                        next();
                    } else {
                        next(err);
                    }
                    return;
                }
                res.end();
            });
        };

        next();
    };

};


text:
package src;

import java.io.File;
import java.io.IOException;
import java.sql.SQLException;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.Scanner;
import java.util.logging.Level;
import java.util.logging.Logger;

import org.apache.http.client.ClientProtocolException;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;

import web.CommunityInfoReader;
import api.GTranslator;
import api.TweetSearch;
import api.TweetUpdater;

public class Crawler {
	private static final Logger logger = Logger.getLogger(Crawler.class .getName());
	private static CommunityInfoReader commInfoReader = null;
	private static DBManager db = null;
	private static TweetSearch ts = null;
	private static TweetUpdater tu = null;
	private static ArrayList<String> directory = null;
	private static Scanner user_input = null;
	private final static String IDEASCALE_BASE_URL = "https://ideascale.com/index/";
	private static final String EXECUTIONFILE = "running.lck";
	private static final String ERRORFILE = "error.lck";
	private static GTranslator translator = null;

	public static void init() {
		commInfoReader = new CommunityInfoReader();
		db = new DBManager();
		ts = new TweetSearch();
		tu = new TweetUpdater();
		directory = new ArrayList<String>(Arrays.asList("a","b","c",
				  	"d","e","f","g","h","i","j","k","l","m","n","o",
				  	"p","q","r","s","t","u","v","w","x","y","z"));
		user_input = new Scanner(System.in);
		translator = new GTranslator();
		//logger.setLevel(Level.SEVERE);
		try {
			CrawlLogger.setup();
		} catch (IOException e) {
			e.printStackTrace();
			throw new RuntimeException("Problems creating the log files");
		}
	}

	public static void exit() {
		db.close();
	}

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		init();
		if (args.length > 0) {
			String type = args[0];
			if (type.equalsIgnoreCase("fg")) {
				Util.printMessage("Crawler started in foreground mode.","info",logger);
				startFg();
			}
			else if (type.equalsIgnoreCase("bg")) {
				Util.printMessage("Crawler started in background mode.","info",logger);
				startBg(args);
			}
			else {
				Util.printMessage("Unkown argument " + type,"severe",logger);
				exit();
				System.exit(1);
			}
		}
		else {
			System.out.println("Usage TYPE [OPTION] [LETTERS] [SYNCMODE]");
			System.out.println("TYPE: 'fg' or 'bg'");
			System.out.println("If 'bg':");
			System.out.println("- OPTION: 1, 2, 3, 4, 5, or 6");
			System.out.println("- 1: For synchronizing the entire IdeaScale community directory");
			System.out.println("- 2: For synchronizing only a sub-set of communities");
			System.out.println("- 3: For synchronizing ideas, votes, comments and social sharing counters of active communities");
			System.out.println("- 4: For updating recorded tweet's metrics");
			System.out.println("- 5: For synchronizing ideas, votes, comments and social sharing counters of active communities, and updating recorded tweet's metrics");
            System.out.println("- 6: For synchronizing ideas, votes, comments and social sharing counters of all civic-participation communities even if they are inactive or close");
			System.out.println("If 'OPTION' = 2:");
			System.out.println("- LETTERS: ");
			System.out.println("- 'a,b,c' specify a group of communities directory letters by using comma-separeted values");
			System.out.println("- 'a-d' specify a range of community directory letters by using dash");
			System.out.println("- 'a' specify a single community directory letter");
			System.out.println("If 'OPTION' = 3:");
			System.out.println("- SYNCMODE: ");
			System.out.println("- 1: Synchronization of the entire group of active communities");
			System.out.println("- 2: Continue with a previous stopped syncronization process");
		}
	}

	public static void startFg() {
		System.out.println("Please choose one of the following numbers:");
		System.out.println("1 - for synchronizing the entire IdeaScale community directory");
		System.out.println("2 - for synchronizing only a sub-set of communities");
		System.out.println("3 - for synchronizing active communities");
		System.out.println("4 - for updating recorded tweet's metrics");
		System.out.println("5 - for synchronizing the ideas, votes, comments and social sharing counters of all active communities, and updating recorded tweet's metrics");
        System.out.println("6 - for synchronizing ideas, votes, comments and social sharing counters of all civic-participation communities even if they are inactive or close");

		String option = user_input.next();

		if (option.equals("1")) {
			syncCommunityCat(directory);
			exit();
		}
		else if (option.equals("2")) {
			System.out.println("Introduce the directory letters you want to " +
							   "synchronize, you can do it by specifying individual " +
							   "letters separated by commas or by entering a " +
							   "range of letters");
			String letters = user_input.next();
			ArrayList<String> lettersSync = getSetLettersSync(letters);
			syncCommunityCat(lettersSync);
			exit();
		}
		else if (option.equals("3")) {
			System.out.println("Please select one of the synchronization modes:");
			System.out.println("1 - for synchronizing the entire group of active communities");
			System.out.println("2 - for continuing with a previous stopped synchronization process");
			String opSync = user_input.next();
			if (opSync.equals("1") || opSync.equals("2")) {
				syncActiveCommunitiesInfo(Integer.parseInt(option),opSync);
				exit();
			}
			else {
				Util.printMessage("Unknown option " + option + ".","severe",logger);
				exit();
				System.exit(1);
			}
		}
		else if(option.equals("4")) {
			updateTweetsMetrics();
			exit();
		}
		else if(option.equals("5")) {
			syncActiveCommunitiesInfo(Integer.parseInt(option),"1");
			updateTweetsMetrics();
			exit();
		}
        else if(option.equals("6")) {
        	String opSync = user_input.next();
        	downloadInfoCPCommunities(opSync);
			exit();
		}
		else {
			Util.printMessage("Unknown option " + option + ".","severe",logger);
			exit();
			System.exit(1);
		}
	}

	private static void startBg(String[]  args) {
		if (args.length > 1) {
			Integer op = Integer.parseInt(args[1]);
			if (op == 1) {
				createExecutionFile();
				syncCommunityCat(directory);
				removeFile(EXECUTIONFILE);
				exit();
			}
			else if (op == 3) {
				if (args.length == 3) {
					createExecutionFile();
					syncActiveCommunitiesInfo(op, args[2]);
					removeFile(EXECUTIONFILE);
					exit();
				}
				else {
					Util.printMessage("Invalid synchronization mode","severe",logger);
					exit();
					System.exit(1);
				}
			}
			else if (op == 2) {
				if (args.length == 3) {
					String letters = args[2];
					ArrayList<String> lettersSync = getSetLettersSync(letters);
					createExecutionFile();
					syncCommunityCat(lettersSync);
					removeFile(EXECUTIONFILE);
					exit();
				}
				else {
					Util.printMessage("Invalid community directory letters","severe",logger);
					exit();
					System.exit(1);
				}
			}
			else if (op == 4) {
				createExecutionFile();
				updateTweetsMetrics();
				removeFile(EXECUTIONFILE);
				exit();
			}
			else if(op == 5) {
				createExecutionFile();
				syncActiveCommunitiesInfo(op, "1");
				updateTweetsMetrics();
				removeFile(EXECUTIONFILE);
				exit();
			}
            else if(op == 6) {
            	downloadInfoCPCommunities(args[2]);
				exit();
			}
            else if(op==7) {
            	createExecutionFile();
            	updateUnknwonLanguageCommunities();
            	exit();
			}
			else {
				Util.printMessage("Unknown background option: " + op,"severe",logger);
				exit();
				System.exit(1);
			}
		}
		else {
			Util.printMessage("Invalid number of arguments for background mode","severe",logger);
			exit();
			System.exit(1);
		}
	}

	private static void createExecutionFile() {
        //Remove the execution file
        removeFile(EXECUTIONFILE);

		File file = new File(EXECUTIONFILE);

		try {
			if (!file.createNewFile()) {
				Util.printMessage("Cannot create the execution file","severe",logger);
				System.exit(1);
			}
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

	private static void removeFile(String fileName) {
		File file = new File(fileName);

		if(file.exists()) {
			if (!file.delete()) {
				Util.printMessage("Cannot delete the file " + fileName,"severe",logger);
			}
		}
	}

	private static void createErrorFile() {
        //Remove previous existing error files
        removeFile(ERRORFILE);

		File file = new File(ERRORFILE);

		try {
			if (!file.createNewFile()) {
				Util.printMessage("Cannot create the error file","severe",logger);
				System.exit(1);
			}
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

	private static ArrayList<String> getSetLettersSync(String letters) {
		ArrayList<String> lettersSync = new ArrayList<String>();

		letters = letters.replaceAll("\\s","");
		if (letters.length() > 1) {
			if (letters.contains(",")) {
				for (String letter : letters.split(",")) {
					letter = letter.trim();
					if (directory.contains(letter)) {
						lettersSync.add(letter);
					}
					else {
						Util.printMessage("Unknown letter: " + letter + ".","severe",logger);
						System.exit(1);
					}
				}
			}
			else if (letters.contains("-")) {
				int startR, endR;
				String[] auxLetters = letters.split("-");
				startR = directory.indexOf(auxLetters[0]);
				if (startR == -1) {
					Util.printMessage("Unknown letter: " + auxLetters[0] + ".","severe",logger);
					System.exit(1);
				}
				endR = directory.indexOf(auxLetters[1]);
				if (endR == -1) {
					Util.printMessage("Unknown letter: " + auxLetters[1] + ".","severe",logger);
					System.exit(0);
				}
				for (int i = startR; i <= endR; i++) {
					lettersSync.add(directory.get(i));
				}
			}
			else {
				Util.printMessage("Unknown symbol.","severe",logger);
				System.exit(1);
			}
		}
		else if (letters.length() == 1) {
			if (directory.contains(letters)) {
				lettersSync.add(letters.trim());
			}
			else {
				Util.printMessage("Unknown letter: " + letters + ".","severe",logger);
				System.exit(1);
			}
		}
		else {
			Util.printMessage("Wrong input.","severe",logger);
			System.exit(1);
		}

		return lettersSync;
	}

	private static ArrayList<String> syncCommunityCat(ArrayList<String> letters)
	{
		String urlDir = IDEASCALE_BASE_URL;
		ArrayList<String> newCommunities = new ArrayList<String>();
		long startingTime = System.currentTimeMillis();
		HashMap<String,String> duration = null;
		DateFormat timeFormat = new SimpleDateFormat("HH:mm:ss");

		for (String letter : letters) {
			System.out.println("");
			String content;
			String idCommunity;
			try {
				Util.printMessage("Resetting update flags of communities whose " +
						   	 "names start with " + letter.toUpperCase() + "...",
						   	 "info",logger);
				db.resetUpdateFlag(letter);
				content = commInfoReader.getUrlContent(Util.toURI(urlDir+letter+".html"));
				Document doc = Jsoup.parse(content);
		        Elements liElements = doc.getElementsByTag("li");
		        Util.printMessage("Starting syncronization of communities whose " +
					   	 	 "names start with: " + letter.toUpperCase() + "...",
					   	 	 "info",logger);
		        for (Element li : liElements) {
		        	if (li.children().size() > 0) {
		        		String link = li.child(0).attr("href");
		        		String name = li.text();
		        		if (link.contains("http://") &&
		        			!commInfoReader.inBlackList(link))
		        		{
		        			if (commInfoReader.checkHTTPSecureProtocol(link)) {
		        				int colon = link.indexOf(":");
		        				//Convert http to https
		        				link = link.substring(0, colon) + "s" +
		        					   link.substring(colon);
		        			}

		        			//link = "http://www.wtfcolumbia.com";
		        			//name = "WTF Columbia";

		    				HashMap<String,Object> communityInfo = new HashMap<String,Object>();
		    				HashMap<String,Object> communityStats = commInfoReader.readCommunityStats(link, name);
		    				if (communityStats.get("ideas") != null) {   //Checking if it isn't a wrong page
			    				HashMap<String,Object> communityDates = commInfoReader.getCommunityLifeSpan(link,
			    														(ArrayList<HashMap<String,String>>) communityStats.get("tabs"));
			    				communityInfo.put("name", name);
			    				communityInfo.put("url", link);
			    				communityInfo.put("ideas", communityStats.get("ideas"));
			    				communityInfo.put("ideas_in_review", communityStats.get("ideas_in_review"));
			    				communityInfo.put("ideas_in_progress", communityStats.get("ideas_in_progress"));
			    				communityInfo.put("ideas_completed", communityStats.get("ideas_completed"));
			    				communityInfo.put("members", communityStats.get("members"));
			    				communityInfo.put("votes", communityStats.get("votes"));
			    				communityInfo.put("comments", communityStats.get("comments"));
			    				communityInfo.put("facebook", communityStats.get("facebook"));
			    				communityInfo.put("twitter", communityStats.get("twitter"));
			    				communityInfo.put("logo", communityStats.get("logo"));
			    				communityInfo.put("explanation_text", communityStats.get("explanation_text"));
			    				communityInfo.put("dateLastIdea", communityDates.get("dateLastIdea"));
			    				communityInfo.put("dateFirstIdea", communityDates.get("dateFirstIdea"));
			    				communityInfo.put("lifespan", communityDates.get("lifespan"));
			    				communityInfo.put("status", communityDates.get("status"));
			    				Util.printMessage(communityInfo.toString(),"info",logger);
			    				//Check whether the community already exists in the DB
			    				idCommunity = db.alreadyOnDB(link);
			        			//Update its information
			        			if (idCommunity != null) {
			        				db.updateCommunityInfo(idCommunity,communityInfo);
			        			}
			        			//Save it to DB
			        			else  {
			        				newCommunities.add(name);
			        				db.insertCommunityFromHash(communityInfo);
			        			}
		    				}

		    				//Wait for a moment to avoid being banned
		        			double rand = Math.random() * 5;
		        			Thread.sleep((long) (rand * 1000));

		        			System.out.println("");
		        		}
		        	}
		        }
		        duration = calcOpDuration(startingTime);

		        //Remove unexisting communities
		        int removedCommunities = db.removeUnexistingCommunities(letter);
		        Util.printMessage("Removed " + letter +"'s communities: " + removedCommunities,"info",logger);

				//Register operation in Audit table
				Calendar cal = Calendar.getInstance();
				Date opDuration = timeFormat.parse(duration.get("hours") + ":" +
												   duration.get("minutes")  + ":" +
												   duration.get("seconds"));
				db.registerOperation(cal.getTime(), "Syncronization of communities: " + letter, opDuration,-1);

				Util.printMessage("Syncronization of communities "+ letter +
							 	  " has finished with a duration of: " +
							 	  duration.get("hours") + ":" +
							 	  duration.get("minutes")  + ":" +
				  		   	  	  duration.get("seconds"),"info",logger);

				Util.printMessage("Found " + newCommunities.size() + " new communities.","info",logger);
				for (int i = 0; i < newCommunities.size(); i++)
					Util.printMessage("- " + newCommunities.get(i),"info",logger);
			}
			catch(Exception e) {
				e.printStackTrace();
				logger.log(Level.SEVERE,e.getMessage(),e);
				createErrorFile();
			}
		}

        return newCommunities;
	}

	/*
	 * Synchronize the twitter counters and ideas of active communities
	 * */
	private static void syncActiveCommunitiesInfo(Integer op, String opSync) {
		long startingTime = 0;
		ArrayList<HashMap<String, String>> activeCommunities;
		Calendar cal = Calendar.getInstance();
		Date today = cal.getTime();
		Integer observation;

		try {
			if (opSync.equals("1")) {
				db.resetSyncFlag();
				db.cleanSyncProgressTable();
				observation = db.getLastObservationId() + 1;
			}
			else {
				observation = db.getLastObservationId();
				//Before starting check whether exists unfinished processes and finishing them
				HashMap<String,Object> unfinishedProcess = db.getUnfinishedSyncProcess();
				if (!unfinishedProcess.isEmpty()) {
					startingTime = System.currentTimeMillis();
					//1: Resume the unfinished process
					resumeUnfinishedProcess(unfinishedProcess, today);
					HashMap<String,String> unfinishedCommunity = new HashMap<String,String>();
					unfinishedCommunity.put("id", unfinishedProcess.get("community_id").toString());
					unfinishedCommunity.put("url", unfinishedProcess.get("community_url").toString());
					unfinishedCommunity.put("tab", unfinishedProcess.get("current_tab").toString());
					//2: Save Tweets of unfinished community
					saveCommunityTweets(unfinishedCommunity);
					//3: Save Tweets of unfinished community ideas
					saveCommunityIdeasTweets(unfinishedCommunity,observation);
					//4: Finishing synchronization of the unfinished process
					finishCommunitySync(startingTime, unfinishedCommunity.get("url"),
									    unfinishedCommunity.get("id"), today,
									    observation);
					//5: Pause for a moment to avoid being banned
					pause();
				}
			}
			activeCommunities = db.getActiveCommunities();
			if (activeCommunities.size() == 0) {
				Util.printMessage("All communities are already synchronized.","info",logger);
				return;
			}
			System.out.println("");
			Util.printMessage("Starting the synchronization of active communities...","info",logger);
			for (HashMap<String,String> activeCommunity : activeCommunities) {
				System.out.println("");
				Util.printMessage("Synchronizing community: " + activeCommunity.get("name"),"info",logger);
				startingTime = System.currentTimeMillis();
				String url = activeCommunity.get("url");
				if (commInfoReader.checkHTTPSecureProtocol(url)) {
    				int colon = url.indexOf(":");
    				//Convert http to https
    				url = url.substring(0, colon) + "s" +
    					  url.substring(colon);
    			}
				//1: Sync Community Ideas and Social Network Statistics
				boolean processed = syncCommunitySnStatsAndIdeas(activeCommunity,observation);
				if (processed) {
					//2: Save Community Tweets
					saveCommunityTweets(activeCommunity);
					//3: Save Community Ideas Tweets
					saveCommunityIdeasTweets(activeCommunity,observation);
                }
				//4: Finishing synchronization
				finishCommunitySync(startingTime,activeCommunity.get("name"),
								    activeCommunity.get("id"), today, observation);
				//5: Pause for a moment to avoid being banned
				pause();
			}
		} catch (SQLException e) {
			e.printStackTrace();
			logger.log(Level.SEVERE,e.getMessage(),e);
			createErrorFile();
		} catch (Exception e) {
			e.printStackTrace();
			logger.log(Level.SEVERE,e.getMessage(),e);
			createErrorFile();
		}
	}

    private static void downloadInfoCPCommunities(String opSync) {
		long startingTime = 0;
		ArrayList<HashMap<String, String>> cpCommunities;
		Calendar cal = Calendar.getInstance();
		Date today = cal.getTime();

		try {
			if (opSync.equals("1")) {
				db.resetCPSyncFlag();
				db.cleanSyncProgressTable();
			}
			else {
				//Before starting check whether exists unfinished processes and finishing them
				HashMap<String,Object> unfinishedProcess = db.getUnfinishedSyncProcess();
				if (!unfinishedProcess.isEmpty()) {
					startingTime = System.currentTimeMillis();
					//1: Resume the unfinished process
					resumeUnfinishedProcess(unfinishedProcess, today);
					HashMap<String,String> unfinishedCommunity = new HashMap<String,String>();
					unfinishedCommunity.put("id", unfinishedProcess.get("community_id").toString());
					unfinishedCommunity.put("url", unfinishedProcess.get("community_url").toString());
					unfinishedCommunity.put("tab", unfinishedProcess.get("current_tab").toString());
					//2: Save Tweets of unfinished community
					saveCommunityTweets(unfinishedCommunity);
					//3: Save Tweets of unfinished community ideas
					saveCommunityIdeasTweets(unfinishedCommunity,-1);
					//4: Finishing synchronization of the unfinished process
					finishCommunitySync(startingTime, unfinishedCommunity.get("url"),
									    unfinishedCommunity.get("id"), today,
									    -1);
					//5: Pause for a moment to avoid being banned
					pause();
				}
			}
			cpCommunities = db.getCivicParticipationCommunities();
			System.out.println("");
			Util.printMessage("Starting the synchronization of civic-participation communities...","info",logger);
			for (HashMap<String,String> cpCommunity : cpCommunities) {
				System.out.println("");
				Util.printMessage("Synchronizing community: " + cpCommunity.get("name"),"info",logger);
                String url = cpCommunity.get("url");
                if (commInfoReader.existsCommunity(url)) {
                    startingTime = System.currentTimeMillis();
                    if (commInfoReader.checkHTTPSecureProtocol(url)) {
                        int colon = url.indexOf(":");
                        //Convert http to https
                        url = url.substring(0, colon) + "s" +
                              url.substring(colon);
                    }
                    //1: Sync Community Ideas and Social Network Statistics
                    boolean processed = syncCommunitySnStatsAndIdeas(cpCommunity,-1);
                    if (processed) {
	                    //2: Save Community Tweets
	                    saveCommunityTweets(cpCommunity);
	                    //3: Save Community Ideas Tweets
	                    saveCommunityIdeasTweets(cpCommunity,-1);
                    }
	                //4: Finishing synchronization
	                finishCommunitySync(startingTime,cpCommunity.get("name"),
	                                    cpCommunity.get("id"), today, -1);
	                //5: Pause for a moment to avoid being banned
	                pause();
                }
                else {
                    Util.printMessage("The community doesn't exist","info",logger);
                }
			}
		} catch (SQLException e) {
			e.printStackTrace();
			logger.log(Level.SEVERE,e.getMessage(),e);
			createErrorFile();
		} catch (Exception e) {
			e.printStackTrace();
			logger.log(Level.SEVERE,e.getMessage(),e);
			createErrorFile();
		}
	}

	private static void finishCommunitySync(long startingTime, String communityName,
											String communityId, Date today,
											Integer observation)
	throws ParseException, SQLException {
		DateFormat timeFormat = new SimpleDateFormat("HH:mm:ss");
		HashMap<String,String> duration = calcOpDuration(startingTime);

		Util.printMessage("The syncronization of communities'ideas has " +
						  "finished with a duration of: " +
						  duration.get("hours") + ":" +
				 	 	  duration.get("minutes")  + ":" +
				 	 	  duration.get("seconds"),"info",logger);

		//Register operation in Audit table
		Date opDuration = timeFormat.parse(duration.get("hours") + ":" +
										   duration.get("minutes")  + ":" +
										   duration.get("seconds"));
		String opMsg = "Synchronization of the ideas of the community: " +
						communityName;

		db.updateSyncFlag(communityId);
		db.registerOperation(today, opMsg, opDuration, observation);
	}

	private static void resumeUnfinishedProcess(HashMap<String,Object> unfinishedProcess,
												Date today)
	throws Exception {
		commInfoReader.resumeSyncProcess(unfinishedProcess, db);
	}

	private static boolean syncCommunitySnStatsAndIdeas(HashMap<String,String> community,
										  			    Integer observation)
	throws Exception
	{
		HashMap<String,Object> communityStats = null;

		String url = community.get("url");
		String communityId = community.get("id");
		String lang = community.get("language");

		communityStats = commInfoReader.syncCommunityStats(communityId, url, db);
		if (communityStats.get("status").equals("active")) {
			checkIncrementSNCounters(observation,community,communityStats);

			ArrayList<HashMap<String,String>> tabs = (ArrayList<HashMap<String,String>>) communityStats.get("tabs");
			commInfoReader.syncIdeas(url, Integer.parseInt(communityId), tabs, 0, db, observation, lang);

			return true;
		}
		else {
			return false;
		}
	}

	private static void checkIncrementSNCounters(Integer observation,
												 HashMap<String,String> old,
												 HashMap<String,Object> current)
	throws SQLException {

		if (current.get("facebook") != null && current.get("twitter") != null &&
			old.get("facebook") != null && old.get("twitter") != null)
		{
			Integer currentFBCounter = Integer.parseInt((String) current.get("facebook"));
			Integer currentTWCounter = Integer.parseInt((String) current.get("twitter"));
			Integer oldFBCounter = Integer.parseInt((String) old.get("facebook"));
			Integer oldTWCounter = Integer.parseInt((String) old.get("twitter"));
			if (currentFBCounter > oldFBCounter || currentTWCounter > oldTWCounter) {
				if (current.get("votes") != null && old.get("votes") != null) {
					if (Integer.parseInt((String)current.get("votes")) <
						Integer.parseInt(old.get("votes")))
						Util.printMessage("There are less votes than before. " +
										  "Community: " + old.get("url") + ". " +
										  "Before: " + old.get("votes") +
										  " - Now: " + current.get("votes"),
										  "severe", logger);
				}
				if (current.get("comments") != null && old.get("comments") != null) {
					if (Integer.parseInt((String)current.get("comments")) <
						Integer.parseInt(old.get("comments")))
						Util.printMessage("There are less comments than before. " +
										  "Community: " + old.get("url") + ". " +
										  "Before: " + old.get("comments") +
										  " - Now: " + current.get("comments"),
										  "severe", logger);
				}
				if (current.get("ideas") != null && old.get("ideas") != null) {
					if (Integer.parseInt((String)current.get("ideas")) <
						Integer.parseInt(old.get("ideas")))
						Util.printMessage("There are less ideas than before. " +
										  "Community: " + old.get("url") + ". " +
										  "Before: " + old.get("ideas") +
										  " - Now: " + current.get("ideas"),
										  "severe", logger);
				}
				db.saveLogCommunity(observation, old, current);
			}
		}
		else {
			Util.printMessage("Some of the SN counters of the community " +
						   	  old.get("name") + " are null", "info", logger);
		}

	}

	private static void saveCommunityTweets(HashMap<String,String> community)
	throws Exception {
		String url = community.get("url");
		String idCommunity = community.get("id");

		ArrayList<HashMap<String,Object>> tweets = ts.GetTweets(url);
		if (tweets.size() > 0) {
			for (HashMap<String,Object> tweet : tweets) {
				String idTweet = (String) tweet.get("id");
				if (!db.tweetAlreadyInserted(idTweet))
					//Saves only if the tweet wasn't saved previously
					db.insertCommunityTweets(tweet, idCommunity);
			}
		}
	}

	private static void saveCommunityIdeasTweets(HashMap<String,String> community,
												 Integer observation)
 	throws Exception
 	{
		String idCommunity = community.get("id");
		ArrayList<HashMap<String,String>> ideas = db.getCommunityIdeas(idCommunity);
		ArrayList<HashMap<String,String>> remainingIdeas = new ArrayList<HashMap<String,String>>();

		if (community.containsKey("tab")) {   //Finishing an unfinished process
			String idUnSavedIdea = community.get("tab");
			boolean found = false;
			for (HashMap<String,String> idea : ideas) {
				if (idea.get("id").equals(idUnSavedIdea) || found) {
					found = true;
					remainingIdeas.add(idea);
				}
			}
		}
		else {
			remainingIdeas = ideas;
		}
		db.cleanSyncProgressTable();
		for (HashMap<String,String> idea : remainingIdeas) {
			String url = idea.get("url");
			String idIdea = idea.get("id");
			db.insertSyncProcess(url, idIdea, -1,
								Integer.parseInt(idCommunity),
								observation);
			ArrayList<HashMap<String,Object>> tweets = ts.GetTweets(url);
			if (tweets.size() > 0) {
				for (HashMap<String,Object> tweet : tweets) {
					String idTweet = (String) tweet.get("id");
					if (!db.tweetAlreadyInserted(idTweet))
						//Saves only if the tweet wasn't saved previously
						db.insertTweetsIdea(tweet, idIdea);
				}
			}
			db.cleanSyncProgressTable();
		}
	}

	private static HashMap<String,String> calcOpDuration(long startingTime) {
		long etH = 0, etM = 0, etS = 0;
		String sETH = "", sETM = "", sETS = "";
		HashMap<String,String> duration = new HashMap<String,String>();

		long finishingTime = System.currentTimeMillis();
	    etH = (finishingTime - startingTime) / (60 * 60 * 1000) % 24;
	    if (etH < 10) sETH = "0"+etH; else sETH = Long.toString(etH);
	    etM = (finishingTime - startingTime) / (60 * 1000) % 60;
	    if (etM < 10) sETM = "0"+etM; else sETM = Long.toString(etM);
	    etS = (finishingTime - startingTime) / 1000 % 60;
	    if (etS < 10) sETS = "0"+etS; else sETS = Long.toString(etS);

	    duration.put("hours", sETH);
	    duration.put("minutes", sETM);
	    duration.put("seconds", sETS);

	    return duration;
	}

	public static void updateTweetsMetrics() {
		Calendar cal = Calendar.getInstance();
		Date today = cal.getTime();
		DateFormat timeFormat = new SimpleDateFormat("HH:mm:ss");
		long startingTime = System.currentTimeMillis();

		try {
			//Update metrics of tweets related to communities
			ArrayList<HashMap<String,String>> tweets = db.getCommunitiesTweets();
			for (HashMap<String,String> tweet : tweets) {
				HashMap<String,Long> newMetrics = tu.updateTweetMetrics(tweet.get("id_tweet"));
                if (newMetrics.size() > 0)
				    db.updateCommunityTweetMetric(tweet.get("id"), newMetrics);
			}
			//Update metrics of tweets related to ideas
			tweets = db.getIdeasTweets();
			for (HashMap<String,String> tweet : tweets) {
				HashMap<String,Long> newMetrics = tu.updateTweetMetrics(tweet.get("id_tweet"));
                if (newMetrics.size() > 0)
				    db.updateIdeaTweetMetric(tweet.get("id"), newMetrics);
			}
			Util.printMessage("Tweets Metrics Update finished.", "info", logger);

			HashMap<String,String> duration = calcOpDuration(startingTime);
			Date opDuration = timeFormat.parse(duration.get("hours") + ":" +
					   						   duration.get("minutes")  + ":" +
					   						   duration.get("seconds"));
			db.registerOperation(today, "Updating tweet metrics", opDuration,-1);
		} catch (SQLException e) {
			e.printStackTrace();
			logger.log(Level.SEVERE,e.getMessage(),e);
			createErrorFile();
		} catch (Exception e) {
			e.printStackTrace();
			logger.log(Level.SEVERE,e.getMessage(),e);
			createErrorFile();
		}
	}

	public static void pause() throws InterruptedException {
		//Wait for a moment to avoid being banned
		double rand = Math.random() * 5;
		Thread.sleep((long) (rand * 1000));
	}

	public static void updateUnknwonLanguageCommunities() {
		try {
			ArrayList<Integer> communityIds = db.getUnknownLaguageCommunities();
			for (Integer communityId : communityIds) {
				String ideaDesc = db.getUnknownLanguageIdea(communityId);
				String lang = translator.detectSourceLanguage(ideaDesc);
				db.updateCommunityLanguage(communityId,lang);
			}
		} catch (SQLException e) {
			e.printStackTrace();
		} catch (ClientProtocolException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		} catch (org.json.simple.parser.ParseException e) {
			e.printStackTrace();
		}
	}

	/*public static void checkCommunitiesExistence(CommunityInfoReader commInfoReader,
			 									  DBManager db) {
		ArrayList<HashMap<String,String>> communities = getCommunitiesURLs(db,null);
		System.out.println("Checking communities existence, please wait...");
		for (HashMap<String,String> community : communities) {
			try {
				commInfoReader.existsCommunity(community.get("url"));
			} catch (Exception e) {
				System.out.println("Community " + community.get("name") + " does not exist!");
			}
		}
	}

	public static void recordCommunitiesLifespan(CommunityInfoReader commInfoReader,
					  DBManager db)
	{
		System.out.println("Saving Communities LifeSpan, please wait...");
		ArrayList<HashMap<String,String>> communities = getCommunitiesURLs(db,getFilters());
		HashMap<String,Object> communityDates = new HashMap<String,Object>();
		communityDates.put("dateLastIdea", null);
		communityDates.put("dateFirstIdea", null);
		communityDates.put("lifespan", null);
		communityDates.put("status", "unexisting");
		for (HashMap<String,String> community : communities) {
			try {
				System.out.println("Processing community: " + community.get("name") + " ...");
				communityDates = commInfoReader.getCommunityLifeSpan(community.get("url"),null);
			} catch(Exception e) {
				System.out.println("Problem:  getting dates from community with id " + community.get("id") + " message: ");
				e.printStackTrace();
			} finally {
				try {
					db.saveCommunityDates(community.get("id"),communityDates);
				} catch(SQLException e) {
					System.out.println("Problem saving data into de database");
					e.printStackTrace();
				}
			}
		}
		System.out.println("End");
	}

	public static void recordInactiveCommunitiesLifespan(CommunityInfoReader commInfoReader,
				  		  								 DBManager db)
	{
		ArrayList<ArrayList<String>> filters = new ArrayList<ArrayList<String>>();
		ArrayList<String> filter = new ArrayList<String>();
		filter.add("status");
		filter.add("=");
		filter.add("'inactive'");
		filters.add(filter);
		ArrayList<String> filter2 = new ArrayList<String>();
		filter2.add("outlier");
		filter2.add("=");
		filter2.add("0");
		filters.add(filter2);
		ArrayList<String> filter3 = new ArrayList<String>();
		filter3.add("lastidea_ts");
		filter3.add(">");
		filter3.add("'2013-01-01'");
		filters.add(filter3);
		ArrayList<HashMap<String,String>> communities = getCommunitiesURLs(db,filters);
		for (HashMap<String,String> community : communities) {
			try {
				System.out.println("Processing community: " + community.get("name") + " ...");
				HashMap<String,Object> communityDates = commInfoReader.getCommunityLifeSpan(community.get("url"),null);
				db.saveCommunityDates(community.get("id"),communityDates);
			} catch(Exception e) {
				System.out.println("Problem: " + e.getMessage() + " getting dates from community with id " + community.get("id"));
			}
		}
	}

	private static ArrayList<HashMap<String,String>> getCommunitiesURLs(DBManager db,
																		ArrayList<ArrayList<String>> filter)
	{
		ArrayList<HashMap<String,String>> communitiesURLs = db.getCommunitiesURL(filter);
		return communitiesURLs;
	}

	private static ArrayList<ArrayList<String>> getFilters() {
		ArrayList<ArrayList<String>> filters = null;
		ArrayList<ArrayList<String>> filters = new ArrayList<ArrayList<String>>();
		ArrayList<String> filter = new ArrayList<String>();
		filter.add("outlier");
		filter.add("=");
		filter.add("1");
		filters.add(filter);
		ArrayList<String> filter2 = new ArrayList<String>();
		filter2.add("lifespan");
		filter2.add("is");
		filter2.add("NULL");
		filters.add(filter2);

		return filters;
	}

	public static void crawlIdeaScaleDir(CommunityInfoReader commInfoReader) {
		Reporter reporter = new Reporter();
		System.out.println("Collecting information about Ideascale communities, please wait...");
		List<HashMap<String,Object>> communities = commInfoReader.getCommunitiesInfo();
		System.out.println("Writing the report, please wait...");
		//reporter.createReport(communities);
		System.out.println("Done!, take a look at the report at " + reporter.getPathReport());
	}

	public static void syncCommunityDir(CommunityInfoReader commInfoReader,
										 DBManager db, Logger logger)
	{

		ArrayList<String> letterDir = new ArrayList<String>(Arrays.asList("a","b","c",
			  "d","e","f","g","h","i","j","k","l","m","n","o",
			  "p","q","r","s","t","u","v","w","x","y","z"));

		ArrayList<String> totalNewCommunities = new ArrayList<String>();

		System.out.println("Synchronizing local DB with Ideascale community directory, please wait...");

		ArrayList<String> newCommunitiesCat = syncCommunityCat(commInfoReader,db,letterDir,logger);
		for (int i = 0; i < newCommunitiesCat.size(); i++)
		totalNewCommunities.add(newCommunitiesCat.get(i));

		System.out.println("Finished!, next the results of the syncronization...");
		System.out.println("New Communities: " + totalNewCommunities.size());
		for (int i = 0; i < totalNewCommunities.size(); i++)
		System.out.println("- " + totalNewCommunities.get(i));
	}*/
}


text:
layout: page
permalink: /tags/
title: "Tags"
author_profile: true
---

{% comment %}

{% endcomment %}

{% capture tags %}{% for tag in site.tags %}{{tag[0]}}{{','}}{% endfor %}{% endcapture %}
{% assign sortedtags = tags | downcase | split:"," | sort %}

{% assign tags_counted = '' %}
{% for tag in sortedtags %}
{% assign count = 0 %}
{% unless tag == previous %}

  {% for post in site.posts %}
	{% for t in post.tags %}
	   {% capture tdown %}{{ t | downcase }}{% endcapture %}
	   {% if tdown == tag %}
		  {% assign count = count | plus: 1 %}
	   {% endif %}
	{% endfor %}
  {% endfor %}

  {% capture tags_counted %}
	{{ tags_counted }}{{ count | plus: -100000 }}###{{ tag | replace: ' ', '##' }}###{{ count }}
  {% endcapture %}

{% endunless %}
{% assign previous = tag %}
{% endfor %}

{% assign tags_counted = tags_counted | split: ' ' | sort %}
{% assign tags = '' %}
{% for tag_count in tags_counted %}

    {% assign items = tag_count | split: '###' %}
    {% assign tag = items[1] | replace: '##', ' ' %}
    {% assign count = items[2] | plus: 0 %}
	{% assign tags = tags | append: tag | append: '#' %}

        {{ tag }}{{ count }}

{% endfor %}

	{% assign tags = tags | split: '#' %}
	{% for tag in tags %}
    {% unless tag == previous %}

{{ tag }}

          {% for post in site.posts %}
            {% for t in post.tags %}
               {% capture tdown %}{{ t | downcase }}{% endcapture %}
               {% if tdown == tag %}

                    {{ post.title }} •
                     {{ post.date | date: '%d %b %Y' }}

               {% endif %}
            {% endfor %}
          {% endfor %}

    {% endunless %}
    {% assign previous = tag %}
	{% endfor %}


text:
@()
@main("Filtered Fanfiction") {
    <ui-breadcrumbs displayname-property="data.displayName"></ui-breadcrumbs>
    <ui-view></ui-view>
}


text:
SUITE(RectangularWindow)
{
    TEST(SampleValue)
    {
        const std::size_t SIZE = 4;
        Aquila::RectangularWindow w(SIZE);
        Aquila::SampleType expected[SIZE] = {1.0, 1.0, 1.0, 1.0};
        CHECK_ARRAY_CLOSE(expected, w.toArray(), SIZE, 0.000001);
    }

    TEST(Multiplication)
    {
        const std::size_t SIZE = 1024;
        Aquila::SquareGenerator generator(44100);
        generator.setFrequency(1000).setAmplitude(500).generate(SIZE);
        Aquila::RectangularWindow w(SIZE);
        auto result = generator * w;
        CHECK_ARRAY_CLOSE(generator.toArray(), result.toArray(), SIZE, 0.00001);
    }
}


text:
package io.reactivex.exceptions;

public final class OnCompleteFailedException extends RuntimeException {
    /** */
    private static final long serialVersionUID = -6179993283427447098L;

    public OnCompleteFailedException(Throwable cause) {
        super(cause);
    }

}


text:
action :create_or_update do
  dns_provider = new_resource.dns_provider || node[:generic_dns][:default_dns_provider]

  case dns_provider.to_sym
  when :amazon
    amazon_dns_zone new_resource.domain do
      aws_access_key_id     new_resource.aws_access_key_id if new_resource.aws_access_key_id
      aws_secret_access_key new_resource.aws_secret_access_key if new_resource.aws_secret_access_key

      action :create
    end

    amazon_dns_record new_resource.name do
      domain                new_resource.domain if new_resource.domain
      zone_id               new_resource.zone_id if new_resource.zone_id
      value                 new_resource.value if new_resource.value
      alias_target          new_resource.alias_target if new_resource.alias_target
      type                  new_resource.type
      ttl                   new_resource.ttl
      weight                new_resource.weight if new_resource.weight
      aws_access_key_id     new_resource.aws_access_key_id if new_resource.aws_access_key_id
      aws_secret_access_key new_resource.aws_secret_access_key if new_resource.aws_secret_access_key

      action :create_or_update
    end

  when :dnsimple
    dnsimple_record new_resource.name do
      type     new_resource.type
      ttl      new_resource.ttl
      domain   new_resource.domain
      content  new_resource.value
      username new_resource.dnsimple_username ? new_resource.dnsimple_username : node[:dnsimple][:username]
      password new_resource.dnsimple_password ? new_resource.dnsimple_password : node[:dnsimple][:password]

      action :create
    end

  else
    Chef::Log.fatal "No DNS provider set for #{ new_resource.name }, I don't know what to do"
  end

end

action :destroy do
  dns_provider = new_resource.dns_provider ? new_resource.dns_provider : node[:generic_dns][:default_dns_provider]

  case dns_provider.to_sym
  when :amazon
    amazon_dns_record new_resource.name do
      action :destroy
    end
  when :dnsimple
    dnsimple_record new_resource.name do
      action :destroy
    end
  else
    Chef::Log.fatal "No DNS provider set for #{ new_resource.name }, I don't know what to do"
  end
end