text:
package com.amazonaws.services.ec2.model;

import java.io.Serializable;
import com.amazonaws.AmazonWebServiceRequest;
import com.amazonaws.Request;
import com.amazonaws.services.ec2.model.transform.ModifyVpcEndpointRequestMarshaller;

/**
 *

 * Contains the parameters for ModifyVpcEndpoint.
 *

 */
public class ModifyVpcEndpointRequest extends AmazonWebServiceRequest implements
        Serializable, Cloneable,
        DryRunSupportedRequest<ModifyVpcEndpointRequest> {

    /**
     *

     * The ID of the endpoint.
     *

     */
    private String vpcEndpointId;
    /**
     *

     * Specify true to reset the policy document to the default
     * policy. The default policy allows access to the service.
     *

     */
    private Boolean resetPolicy;
    /**
     *

     * A policy document to attach to the endpoint. The policy must be in valid
     * JSON format.
     *

     */
    private String policyDocument;
    /**
     *

     * One or more route tables IDs to associate with the endpoint.
     *

     */
    private com.amazonaws.internal.SdkInternalList<String> addRouteTableIds;
    /**
     *

     * One or more route table IDs to disassociate from the endpoint.
     *

     */
    private com.amazonaws.internal.SdkInternalList<String> removeRouteTableIds;

    /**
     *

     * The ID of the endpoint.
     *

     *
     * @param vpcEndpointId
     *        The ID of the endpoint.
     */

    public void setVpcEndpointId(String vpcEndpointId) {
        this.vpcEndpointId = vpcEndpointId;
    }

    /**
     *

     * The ID of the endpoint.
     *

     *
     * @return The ID of the endpoint.
     */

    public String getVpcEndpointId() {
        return this.vpcEndpointId;
    }

    /**
     *

     * The ID of the endpoint.
     *

     *
     * @param vpcEndpointId
     *        The ID of the endpoint.
     * @return Returns a reference to this object so that method calls can be
     *         chained together.
     */

    public ModifyVpcEndpointRequest withVpcEndpointId(String vpcEndpointId) {
        setVpcEndpointId(vpcEndpointId);
        return this;
    }

    /**
     *

     * Specify true to reset the policy document to the default
     * policy. The default policy allows access to the service.
     *

     *
     * @param resetPolicy
     *        Specify true to reset the policy document to the
     *        default policy. The default policy allows access to the service.
     */

    public void setResetPolicy(Boolean resetPolicy) {
        this.resetPolicy = resetPolicy;
    }

    /**
     *

     * Specify true to reset the policy document to the default
     * policy. The default policy allows access to the service.
     *

     *
     * @return Specify true to reset the policy document to the
     *         default policy. The default policy allows access to the service.
     */

    public Boolean getResetPolicy() {
        return this.resetPolicy;
    }

    /**
     *

     * Specify true to reset the policy document to the default
     * policy. The default policy allows access to the service.
     *

     *
     * @param resetPolicy
     *        Specify true to reset the policy document to the
     *        default policy. The default policy allows access to the service.
     * @return Returns a reference to this object so that method calls can be
     *         chained together.
     */

    public ModifyVpcEndpointRequest withResetPolicy(Boolean resetPolicy) {
        setResetPolicy(resetPolicy);
        return this;
    }

    /**
     *

     * Specify true to reset the policy document to the default
     * policy. The default policy allows access to the service.
     *

     *
     * @return Specify true to reset the policy document to the
     *         default policy. The default policy allows access to the service.
     */

    public Boolean isResetPolicy() {
        return this.resetPolicy;
    }

    /**
     *

     * A policy document to attach to the endpoint. The policy must be in valid
     * JSON format.
     *

     *
     * @param policyDocument
     *        A policy document to attach to the endpoint. The policy must be in
     *        valid JSON format.
     */

    public void setPolicyDocument(String policyDocument) {
        this.policyDocument = policyDocument;
    }

    /**
     *

     * A policy document to attach to the endpoint. The policy must be in valid
     * JSON format.
     *

     *
     * @return A policy document to attach to the endpoint. The policy must be
     *         in valid JSON format.
     */

    public String getPolicyDocument() {
        return this.policyDocument;
    }

    /**
     *

     * A policy document to attach to the endpoint. The policy must be in valid
     * JSON format.
     *

     *
     * @param policyDocument
     *        A policy document to attach to the endpoint. The policy must be in
     *        valid JSON format.
     * @return Returns a reference to this object so that method calls can be
     *         chained together.
     */

    public ModifyVpcEndpointRequest withPolicyDocument(String policyDocument) {
        setPolicyDocument(policyDocument);
        return this;
    }

    /**
     *

     * One or more route tables IDs to associate with the endpoint.
     *

     *
     * @return One or more route tables IDs to associate with the endpoint.
     */

    public java.util.List<String> getAddRouteTableIds() {
        if (addRouteTableIds == null) {
            addRouteTableIds = new com.amazonaws.internal.SdkInternalList<String>();
        }
        return addRouteTableIds;
    }

    /**
     *

     * One or more route tables IDs to associate with the endpoint.
     *

     *
     * @param addRouteTableIds
     *        One or more route tables IDs to associate with the endpoint.
     */

    public void setAddRouteTableIds(
            java.util.Collection<String> addRouteTableIds) {
        if (addRouteTableIds == null) {
            this.addRouteTableIds = null;
            return;
        }

        this.addRouteTableIds = new com.amazonaws.internal.SdkInternalList<String>(
                addRouteTableIds);
    }

    /**
     *

     * One or more route tables IDs to associate with the endpoint.
     *

     *

     * NOTE: This method appends the values to the existing list (if
     * any). Use {@link #setAddRouteTableIds(java.util.Collection)} or
     * {@link #withAddRouteTableIds(java.util.Collection)} if you want to
     * override the existing values.
     *

     *
     * @param addRouteTableIds
     *        One or more route tables IDs to associate with the endpoint.
     * @return Returns a reference to this object so that method calls can be
     *         chained together.
     */

    public ModifyVpcEndpointRequest withAddRouteTableIds(
            String... addRouteTableIds) {
        if (this.addRouteTableIds == null) {
            setAddRouteTableIds(new com.amazonaws.internal.SdkInternalList<String>(
                    addRouteTableIds.length));
        }
        for (String ele : addRouteTableIds) {
            this.addRouteTableIds.add(ele);
        }
        return this;
    }

    /**
     *

     * One or more route tables IDs to associate with the endpoint.
     *

     *
     * @param addRouteTableIds
     *        One or more route tables IDs to associate with the endpoint.
     * @return Returns a reference to this object so that method calls can be
     *         chained together.
     */

    public ModifyVpcEndpointRequest withAddRouteTableIds(
            java.util.Collection<String> addRouteTableIds) {
        setAddRouteTableIds(addRouteTableIds);
        return this;
    }

    /**
     *

     * One or more route table IDs to disassociate from the endpoint.
     *

     *
     * @return One or more route table IDs to disassociate from the endpoint.
     */

    public java.util.List<String> getRemoveRouteTableIds() {
        if (removeRouteTableIds == null) {
            removeRouteTableIds = new com.amazonaws.internal.SdkInternalList<String>();
        }
        return removeRouteTableIds;
    }

    /**
     *

     * One or more route table IDs to disassociate from the endpoint.
     *

     *
     * @param removeRouteTableIds
     *        One or more route table IDs to disassociate from the endpoint.
     */

    public void setRemoveRouteTableIds(
            java.util.Collection<String> removeRouteTableIds) {
        if (removeRouteTableIds == null) {
            this.removeRouteTableIds = null;
            return;
        }

        this.removeRouteTableIds = new com.amazonaws.internal.SdkInternalList<String>(
                removeRouteTableIds);
    }

    /**
     *

     * One or more route table IDs to disassociate from the endpoint.
     *

     *

     * NOTE: This method appends the values to the existing list (if
     * any). Use {@link #setRemoveRouteTableIds(java.util.Collection)} or
     * {@link #withRemoveRouteTableIds(java.util.Collection)} if you want to
     * override the existing values.
     *

     *
     * @param removeRouteTableIds
     *        One or more route table IDs to disassociate from the endpoint.
     * @return Returns a reference to this object so that method calls can be
     *         chained together.
     */

    public ModifyVpcEndpointRequest withRemoveRouteTableIds(
            String... removeRouteTableIds) {
        if (this.removeRouteTableIds == null) {
            setRemoveRouteTableIds(new com.amazonaws.internal.SdkInternalList<String>(
                    removeRouteTableIds.length));
        }
        for (String ele : removeRouteTableIds) {
            this.removeRouteTableIds.add(ele);
        }
        return this;
    }

    /**
     *

     * One or more route table IDs to disassociate from the endpoint.
     *

     *
     * @param removeRouteTableIds
     *        One or more route table IDs to disassociate from the endpoint.
     * @return Returns a reference to this object so that method calls can be
     *         chained together.
     */

    public ModifyVpcEndpointRequest withRemoveRouteTableIds(
            java.util.Collection<String> removeRouteTableIds) {
        setRemoveRouteTableIds(removeRouteTableIds);
        return this;
    }

    /**
     * This method is intended for internal use only. Returns the marshaled
     * request configured with additional parameters to enable operation
     * dry-run.
     */
    @Override
    public Request<ModifyVpcEndpointRequest> getDryRunRequest() {
        Request<ModifyVpcEndpointRequest> request = new ModifyVpcEndpointRequestMarshaller()
                .marshall(this);
        request.addParameter("DryRun", Boolean.toString(true));
        return request;
    }

    /**
     * Returns a string representation of this object; useful for testing and
     * debugging.
     *
     * @return A string representation of this object.
     *
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        if (getVpcEndpointId() != null)
            sb.append("VpcEndpointId: " + getVpcEndpointId() + ",");
        if (getResetPolicy() != null)
            sb.append("ResetPolicy: " + getResetPolicy() + ",");
        if (getPolicyDocument() != null)
            sb.append("PolicyDocument: " + getPolicyDocument() + ",");
        if (getAddRouteTableIds() != null)
            sb.append("AddRouteTableIds: " + getAddRouteTableIds() + ",");
        if (getRemoveRouteTableIds() != null)
            sb.append("RemoveRouteTableIds: " + getRemoveRouteTableIds());
        sb.append("}");
        return sb.toString();
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;

        if (obj instanceof ModifyVpcEndpointRequest == false)
            return false;
        ModifyVpcEndpointRequest other = (ModifyVpcEndpointRequest) obj;
        if (other.getVpcEndpointId() == null ^ this.getVpcEndpointId() == null)
            return false;
        if (other.getVpcEndpointId() != null
                && other.getVpcEndpointId().equals(this.getVpcEndpointId()) == false)
            return false;
        if (other.getResetPolicy() == null ^ this.getResetPolicy() == null)
            return false;
        if (other.getResetPolicy() != null
                && other.getResetPolicy().equals(this.getResetPolicy()) == false)
            return false;
        if (other.getPolicyDocument() == null
                ^ this.getPolicyDocument() == null)
            return false;
        if (other.getPolicyDocument() != null
                && other.getPolicyDocument().equals(this.getPolicyDocument()) == false)
            return false;
        if (other.getAddRouteTableIds() == null
                ^ this.getAddRouteTableIds() == null)
            return false;
        if (other.getAddRouteTableIds() != null
                && other.getAddRouteTableIds().equals(
                        this.getAddRouteTableIds()) == false)
            return false;
        if (other.getRemoveRouteTableIds() == null
                ^ this.getRemoveRouteTableIds() == null)
            return false;
        if (other.getRemoveRouteTableIds() != null
                && other.getRemoveRouteTableIds().equals(
                        this.getRemoveRouteTableIds()) == false)
            return false;
        return true;
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;

        hashCode = prime
                * hashCode
                + ((getVpcEndpointId() == null) ? 0 : getVpcEndpointId()
                        .hashCode());
        hashCode = prime
                * hashCode
                + ((getResetPolicy() == null) ? 0 : getResetPolicy().hashCode());
        hashCode = prime
                * hashCode
                + ((getPolicyDocument() == null) ? 0 : getPolicyDocument()
                        .hashCode());
        hashCode = prime
                * hashCode
                + ((getAddRouteTableIds() == null) ? 0 : getAddRouteTableIds()
                        .hashCode());
        hashCode = prime
                * hashCode
                + ((getRemoveRouteTableIds() == null) ? 0
                        : getRemoveRouteTableIds().hashCode());
        return hashCode;
    }

    @Override
    public ModifyVpcEndpointRequest clone() {
        return (ModifyVpcEndpointRequest) super.clone();
    }
}


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>Intérprete de BASIC: C:/Users/figura4/Dropbox/común/Curso/PruebaGui/src/operandos/OpBooleano.h Source File</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />

<link href="search/search.css" rel="stylesheet" type="text/css"/>

Intérprete de BASIC

Main Page

Namespaces

Classes

Files

          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)"
               onblur="searchBox.OnSearchFieldFocus(false)"
               onkeyup="searchBox.OnSearchFieldChange(event)"/>

File List

 All Classes Namespaces Files Functions Variables Friends

C:/Users/figura4/Dropbox/común/Curso/PruebaGui/src/operandos/OpBooleano.h

Go to the documentation of this file.

00001 #ifndef OPBOOLEANO_H
00002 #define OPBOOLEANO_H
00003
00004 #include "..\Operando.h"
00005
00007 class OpBooleano : public Operando
00008 {
00009     public:
00010         OpBooleano();
00013         OpBooleano(std::string nom);
00017         OpBooleano(std::string nom, std::string val);
00020         std::string getValue();
00023         bool getTypeValue();
00026         std::string getNombre();
00030         static std::string boolToStr(bool x);
00033         std::string getTipo();
00037         static bool isType(std::string val);
00041         void setValue(std::string val) throw (EInvalidConversion);
00042         virtual ~OpBooleano();
00043     private:
00045         std::string valor;
00047         static const std::string TIPO;
00049         std::string nombre;
00050 };
00051
00052 #endif // OPBOOLEANO_H

<address class="footer">
Generated on Mon Jun 4 2012 01:01:33 for Intérprete de BASIC by

 1.8.0
</address>

redpajama_set_name: RedPajamaGithub


text:
<?php
/**
 * WPSEO plugin file.
 *
 * @package WPSEO\admin\google_search_console
 */

/**
 * Class WPSEO_GSC.
 */
class WPSEO_GSC implements WPSEO_WordPress_Integration {

	/**
	 * The option where data will be stored.
	 *
	 * @var string
	 */
	const OPTION_WPSEO_GSC = 'wpseo-gsc';

	/**
	 * Outputs the HTML for the redirect page.
	 *
	 * @return void
	 */
	public function display() {
		require_once WPSEO_PATH . 'admin/google_search_console/views/gsc-display.php';
	}

	/**
	 * Registers the hooks.
	 *
	 * @deprecated 12.5
	 *
	 * @codeCoverageIgnore
	 *
	 * @return void
	 */
	public function register_hooks() {
		_deprecated_function( __METHOD__, 'WPSEO 12.5' );
	}

	/**
	 * Handles the dashboard notification.
	 *
	 * If the Google Search Console has no credentials, show a notification
	 * for the user to give them a heads up. This message is dismissable.
	 *
	 * @deprecated 12.5
	 *
	 * @codeCoverageIgnore
	 *
	 * @return void
	 */
	public function register_gsc_notification() {
		_deprecated_function( __METHOD__, 'WPSEO 12.5' );
	}

	/**
	 * Makes sure the settings will be registered, so data can be stored.
	 *
	 * @deprecated 12.5
	 *
	 * @codeCoverageIgnore
	 *
	 * @return void
	 */
	public function register_settings() {
		_deprecated_function( __METHOD__, 'WPSEO 12.5' );
	}

	/**
	 * Displays the table.
	 *
	 * @deprecated 12.5
	 *
	 * @codeCoverageIgnore
	 *
	 * @return void
	 */
	public function display_table() {
		_deprecated_function( __METHOD__, 'WPSEO 12.5' );
	}

	/**
	 * Loads the admin redirects scripts.
	 *
	 * @deprecated 12.5
	 *
	 * @codeCoverageIgnore
	 *
	 * @return void
	 */
	public function page_scripts() {
		_deprecated_function( __METHOD__, 'WPSEO 12.5' );
	}

	/**
	 * Sets the screen options.
	 *
	 * @deprecated 12.5
	 *
	 * @codeCoverageIgnore
	 *
	 * @param string $status Status string.
	 * @param string $option Option key.
	 * @param string $value  Value to return.
	 *
	 * @return mixed The screen option value. False when not errors_per_page.
	 */
	public function set_screen_option( $status, $option, $value ) {
		_deprecated_function( __METHOD__, 'WPSEO 12.5' );

		return false;
	}

	/**
	 * Sets the tab help on top of the screen.
	 *
	 * @deprecated 12.5
	 *
	 * @codeCoverageIgnore
	 *
	 * @return void
	 */
	public function set_help() {
		_deprecated_function( __METHOD__, 'WPSEO 12.5' );
	}

	/**
	 * Run init logic.
	 *
	 * @codeCoverageIgnore
	 *
	 * @deprecated 9.5
	 *
	 * @return void
	 */
	public function init() {
		_deprecated_function( __METHOD__, 'WPSEO 9.5' );
	}
}


text:
package org.hawkular.rx.cdi;

import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.ElementType.PARAMETER;
import static java.lang.annotation.ElementType.TYPE;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;

import javax.enterprise.util.Nonbinding;
import javax.inject.Qualifier;

/**
 * @author Jirka Kremser
 */
@Qualifier
@Target({TYPE, METHOD, PARAMETER, FIELD})
@Retention(RUNTIME)
@Documented
public @interface WithValues {

    @Nonbinding String[] values() default {};

}


text:
import {
	isCommentNode,
	isBaseElementNode,
	isDirectiveNode,
	isAttributeNode,
	isSimpleExpressionNode,
	isCompoundExpressionNode,
	isInterpolationNode,
	isTextNode
} from './guards'

describe('guards', () => {
	it('should return false when null', () => {
		expect(isTextNode()).toBeFalsy()
		expect(isCommentNode()).toBeFalsy()
		expect(isBaseElementNode()).toBeFalsy()
		expect(isDirectiveNode()).toBeFalsy()
		expect(isAttributeNode()).toBeFalsy()
		expect(isSimpleExpressionNode()).toBeFalsy()
		expect(isCompoundExpressionNode()).toBeFalsy()
		expect(isInterpolationNode()).toBeFalsy()
	})
})


text:
package com.google.caliper.model;

import static com.google.common.base.Preconditions.checkNotNull;

import com.google.common.base.Objects;
import java.io.Serializable;

/** A magnitude with units. */
public class Value implements Serializable {
  private static final long serialVersionUID = 1L;

  static final Value DEFAULT = new Value();

  public static Value create(double value, String unit) {
    return new Value(value, checkNotNull(unit));
  }

  private double magnitude;
  // TODO(gak): do something smarter than string for units
  // TODO(gak): give guidelines for how to specify units.  E.g. s or seconds
  private String unit;

  private Value() {
    this.magnitude = 0.0;
    this.unit = "";
  }

  private Value(double value, String unit) {
    this.magnitude = value;
    this.unit = unit;
  }

  public String unit() {
    return unit;
  }

  public double magnitude() {
    return magnitude;
  }

  @Override
  public boolean equals(Object obj) {
    if (obj == this) {
      return true;
    } else if (obj instanceof Value) {
      Value that = (Value) obj;
      return this.magnitude == that.magnitude && this.unit.equals(that.unit);
    } else {
      return false;
    }
  }

  @Override
  public int hashCode() {
    return Objects.hashCode(magnitude, unit);
  }

  @Override
  public String toString() {
    return new StringBuilder().append(magnitude).append(unit).toString();
  }
}


text:
document.getElementById("id_business_level_version").innerHTML = "Business level version: 2017.11.29.3";

document.addEventListener("touchstart", on_touch_start);

var recognition = new webkitSpeechRecognition();
recognition.lang = "en-US";
recognition.maxAlternatives = 1;
recognition.onresult = on_speech_result;
recognition.onsoundend = on_sound_end;
var is_listening = false;
//vor rula doar cand iti returneaza google cuvintele recunoscute
 var synt = window.speechSynthesis;

function on_touch_start(e)
{
	if(!is_listening) {
		recognition.start();
		is_listening = true;
	}
}

function on_speech_result(e)
{
	var alternatives = e.results[0];
	for (var i = 0; i < alternatives.length; i++) {
		document.getElementById("id_p").innerHTML += alternatives[i].transcript + "("+alternatives[i].confidence+")"+"<br>";
		switch(alternatives[i].transcript){
			case "go forward":
				speak("moving forward");
				break;
			case "go backward":
				speak("moving backward");
				break;
				//....
			default:
				speak("Idiot xiaomi!!");

		}
	}
}

function on_sound_end(e)
{
	recognition.stop();

}

function speak(_text)
{
	var enunt = new SpeechSynthesisUtterance();
	enunt.lang = "en-US"
	enunt.text = _text;

	enunt.onend = function(e){
		is_listening = false;
	}

	synt.speak(enunt);
}


text:
package org.pencethren.bathlarp.battleboard;

import org.junit.Test;

import static org.junit.Assert.*;

/**
 * To work on unit tests, switch the Test Artifact in the Build Variants view.
 */
public class ExampleUnitTest {
    @Test
    public void addition_isCorrect() throws Exception {
        assertEquals(4, 2 + 2);
    }
}


text:
@interface HCCommentsList()
-(void)addComment:(HCComment*)comment;
@end

@implementation HCCommentsList {

    HCStream* _stream;
    NSMutableArray* _comments;
    HyperCommentSorting _sortType;

}

-(id)initWithStream:(HCStream*)stream {

    if( self = [super init] ) {
        _stream = stream;
        _limit = 20;
        _comments = [NSMutableArray arrayWithCapacity:5];
    }

    return self;

}

-(void)retrieve {
    [self retrievePage:0 withBlock:nil];
}

-(void)retrievePage:(NSUInteger)page withBlock:(HyperCommentsCompleteHandler)handler {

    if( !_stream )
        return;

    NSMutableDictionary* params = [NSMutableDictionary dictionaryWithCapacity:4];
    params[@"link"] = _stream.link;

    if( _stream.xId && [_stream.xId length] > 0 ) {
        params[@"xid"] = _stream.xId;
    }

    switch( self.sortType ) {
        case SortAll:
            params[@"sort"] = @"all";
            break;
        case SortNew:
            params[@"sort"] = @"new";
            break;
        default:
            params[@"sort"] = @"popular";
    }

    params[@"limit"] = ( self.limit > 20 ) ? @20 : [NSNumber numberWithUnsignedInteger:self.limit];

    params[@"offset"] = [NSNumber numberWithUnsignedInteger:(page * self.limit)];

    [[HCNetwork instance] apiRequestPath:@"comments/list" withParams:params networkHandler:^(id responseObject, NSError *error) {

        if( !error ) {

            NSEnumerator* rawCommentsEnum = [((NSArray*)responseObject) objectEnumerator];
            NSDictionary* rawComment;
            HCComment* comment;

            while( rawComment = [rawCommentsEnum nextObject] ) {

                comment = [HCComment commentByRaw:rawComment inStream:_stream];

                [self addComment:comment];

            }

        }

        if(handler)
            handler(self, error);

    }];

}

//
-(HyperCommentSorting)sortType {
    return _sortType;
}

-(void)setSortType:(HyperCommentSorting)sortType {

    if( _sortType == sortType )
        return;

    [_comments removeAllObjects];

    _sortType = sortType;

}

#pragma mark - Private

-(void)addComment:(HCComment*)comment {

    // Prvent add same comment
    HCComment* hcComment;

    if( comment && comment.parentComment )
        return;

    for( unsigned i = 0; i < _comments.count; i++ ) {

        hcComment = _comments[i];

        if( [hcComment equals:comment] )
            return;

        if( [hcComment.creationDate compare:comment.creationDate] == NSOrderedAscending ) {
            [_comments insertObject:comment atIndex:i];
            return;
        }

    }

    [_comments addObject:comment];

}

@end


text:
<?xml version="1.0" encoding="utf-8"?>
<manifest
    package="app.season.mvpstructure"
    xmlns:android="http://schemas.android.com/apk/res/android">

    <!-- 用于访问网络,网络定位需要上网 -->
    <uses-permission android:name="android.permission.INTERNET"/>

    <application
        android:name=".BaseApplication"
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">
        <activity
            android:name=".ui.login.LoginActivity"
            android:label="@string/title_activity_login"
            android:theme="@style/AppTheme.NoActionBar">
            <intent-filter>
                <action android:name="android.intent.action.MAIN"/>

                <category android:name="android.intent.category.LAUNCHER"/>
            </intent-filter>
        </activity>
        <activity
            android:name=".ui.note.NoteActivity"
            android:label="@string/title_activity_note"
            android:theme="@style/AppTheme.NoActionBar">
        </activity>
        <activity
            android:name=".ui.main.MainActivity"
            android:label="@string/title_activity_main"
            android:theme="@style/AppTheme.NoActionBar">

        </activity>
        <activity
            android:name=".ui.moviedetail.MovieDetailActivity"
            android:label="@string/title_activity_movie_detail"
            android:theme="@style/AppTheme.NoActionBar">
        </activity>
    </application>

</manifest>


text:
<resources>
    <declare-styleable name="QuantityView">
        <attr name="qv_addButtonText" format="string" />
        <attr name="qv_addButtonBackground" format="color|reference" />
        <attr name="qv_addButtonTextColor" format="color" />

        <attr name="qv_removeButtonText" format="string" />
        <attr name="qv_removeButtonBackground" format="color|reference" />
        <attr name="qv_removeButtonTextColor" format="color" />

        <attr name="qv_quantity" format="integer" />
        <attr name="qv_quantityDialog" format="boolean" />
        <attr name="qv_quantityBackground" format="color|reference" />
        <attr name="qv_quantityTextColor" format="color" />
        <attr name="qv_quantityPadding" format="dimension" />

        <attr name="qv_maxQuantity" format="integer" />
        <attr name="qv_minQuantity" format="integer" />
    </declare-styleable>
</resources>


text:
MouseHelper::MouseHelper(QWidget* _w)
    : QObject(_w)
    , w(_w)
    , isHover(false)
    , isPressed(false)
    , clickDist(4)
    , dblClickDist(4)
{
    Q_ASSERT(w);
    w->installEventFilter(this);
}

MouseHelper::~MouseHelper()
{
}

bool MouseHelper::IsPressed() const
{
    return isPressed;
}

bool MouseHelper::eventFilter(QObject* obj, QEvent* e)
{
    if (obj == w)
    {
        switch (e->type())
        {
        case QEvent::Enter:
            enterEvent(e);
            break;
        case QEvent::Leave:
            leaveEvent(e);
            break;
        case QEvent::MouseMove:
            mouseMoveEvent(static_cast<QMouseEvent*>(e));
            break;
        case QEvent::MouseButtonPress:
            mousePressEvent(static_cast<QMouseEvent*>(e));
            break;
        case QEvent::MouseButtonRelease:
            mouseReleaseEvent(static_cast<QMouseEvent*>(e));
            break;

        default:
            break;
        }
    }

    return QObject::eventFilter(obj, e);
}

void MouseHelper::enterEvent(QEvent* event)
{
    isHover = true;
}

void MouseHelper::leaveEvent(QEvent* event)
{
    isHover = false;
}

void MouseHelper::mouseMoveEvent(QMouseEvent* event)
{
    pos = event->pos();
    emit mouseMove(pos);
}

void MouseHelper::mousePressEvent(QMouseEvent* event)
{
    if (event->button() != Qt::LeftButton)
        return;

    pos = event->pos();
    clickPos = pos;
    isPressed = true;
    emit mousePress(pos);
}

void MouseHelper::mouseReleaseEvent(QMouseEvent* event)
{
    if (event->button() != Qt::LeftButton)
        return;
    if (!isPressed)
        return;

    pos = event->pos();
    isPressed = false;
    emit mouseRelease(pos);

    const QPoint dist = pos - clickPos;
    const int sqrDist = dist.x() * dist.x() + dist.y() * dist.y();
    if (sqrDist <= clickDist * clickDist)
    {
        emit clicked();
    }
}


text:
This [meteorjs](https://www.meteor.com) package allows you to organize your settings inside your private assets directory. The configuration files will be autoloaded during startup based on the active environment.

Now you can easily switch between settings just by changing the NODE_ENV variable.

The package also allows to specify different configuration files for server and public settings.

Last but not least you can divide your configuration files into partials and get them merged and overloaded during startup. You can define defaults and redefine only a few afterwards based on the active environment (see samples below).

The config files may be written (also mixed) in YAML and JSON notation.

### Installation

You can add this package to your meteor app like any other package from atmosphere

````
$ meteor add 4commerce:env-settings
````

### Directory structure

All configuration files must be placed in

````
private/config
````

There is the option to create sub-directories for all environments to load a set of configuration files for server and public

*Defaults*

````
private/config/public/
private/config/server/
````

*Per environment*

````
private/config/development/public/
private/config/development/server/

private/config/production/public/
private/config/production/server/
````

> You may name your environments as you like but I advise you to stay with the standards like development, production and testing.

*Single file configurations*

If you do not want to create partials for your configuration files, you also may use (also mixable) the single file naming:

````
private/config/public.yaml
private/config/server.yaml

private/config/production/public.yaml
private/config/production/server.yaml
````

*File extensions*

The loader will only take care of following files, all others are skipped:

````
*.json
*.yaml
*.yml
````

*Loading order*

Below you see the complete pattern matching and also the loading order. Config files are loaded and merged from inner to outer sub-directories. Beware of this when deciding your overloads.

````
private/config/public.(json|yaml|yml)
private/config/public/*.(json|yaml|yml)
private/config/environment/public.(json|yaml|yml)
private/config/environment/public/*.(json|yaml|yml)

private/config/server.(json|yaml|yml)
private/config/server/*.(json|yaml|yml)
private/config/environment/server.(json|yaml|yml)
private/config/environment/server/*.(json|yaml|yml)
````

> Also the file extensions will touch the ordering and you will overload file.json with file.yaml with file.yml. But, I would advise you to use just one type for each file.

### Meteor.settings

The configuration files are loaded during `Meteor.startup()` which is included in the package.

If you place this package somewhere on top of your used packages, you be able to access your settings on a early stage.

After autoload of your configuration files you may access the settings through the standard `Meteor.settings` and `Meteor.settings.public` object. Your `Meteor.settings.public` values are also available on your client app.

Try `console.log(Meteor.settings);` on both client and server and get what has distributed.

[Read more at meteor documentation](http://docs.meteor.com/#/full/meteor_settings)

### Meteor.settings.(public).runtime

In addition we append a few useful properties about the runtime environment automatically during the loading process.

*Server only:*

````
console.log(Meteor.settings.runtime.env); => "development"
````

````
console.log(Meteor.settings.runtime.serverDir); => absolute file path to your meteor server bundle path
````

*Public both:*

````
console.log(Meteor.settings.public.runtime.env); => "development"
````

### Grammar

Your config files may notated in [JSON](https://en.wikipedia.org/wiki/JSON) and [YAML](https://en.wikipedia.org/wiki/YAML) grammar (see links to Wikipedia).

*Example public.yaml:*

````
application:
  name: "My super application"
  version: "1.0"

images:
  upload: "upload-folder"
  max_size: 10
  auto_shrink: true
````

*Example public.json:*

````
{
  "application": {
    "name": "My super application",
    "version": "1.0"
  },

  "images": {
    "upload": "upload-folder",
    "max_size": 10,
    "auto_shrink": true
  }
}
````

I prefer to use [YAML](https://en.wikipedia.org/wiki/YAML) in case of it's easy notation and leveling.

For parsing YAML and JSON we using [js-yaml](https://github.com/nodeca/js-yaml) and getting file content via it's `safeLoad` method. Please be aware that this is defined as loading untrusted data and therefor some features are not enabled. Currently I can't see any loss on that.

You may check your YAML code on their online editor at: http://nodeca.github.io/js-yaml/

### Loading, overloading and merge

After each config file is loaded, parsed and instatiated, we extend that object to the already existing configuration. For that process we are using `_.deepExtend` which do not replace sub-elements but merge or overload them.

For overloading you have to take care about the file loading order which is described at section _Directory Structure_.

Here is a small example.

*config/public.yaml*

````
caches:
  enabled: false
  tmp_path: /tmp
````

*config/production/public.yaml*

````
caches:
  enabled: true
````

*config/testing/public.yaml*

````
caches:
  tmp_path: /dev/null
````

This will result in always `Meteor.settings.public.caches.enabled == false` except when your environment is `production`.

The value of `Meteor.settings.public.caches.tmp_path` gets overwritten on the `testing` environment only

### Partials

If you want to structure your configuration in partials you can use folders to place them to right configuration context.

*config/public/caches.yaml*

````
caches:
  enabled: false
  tmp_path: /tmp
````

*config/public/mail.yaml*

````
smtp:
  server: mail.local
````

*config/production/public/caches.yaml*

````
caches:
  enabled: true
````

*config/testing/public/mail.yaml*

````
smtp:
  server: mail.trash
````

Be aware that the rules of overloading and file ordering is still the same.

_Attention_: It is not necessary for the loader, that the partials have the same filename at all environments – but, I advise you to name them equal for clearness.

### Meteor option --settings and METEOR_SETTINGS

In case that we merge and overload the content of your config files to the `Meteor.settings` object, you still can initialize it with the standard options.

### Set mission critical / security values

As said in previous paragraph, you still can load some values to your settings via the `METEOR_SETTINGS` env var. So within that you can place your login credentials like Amazon S3 keys etc. without committing them to your repos. All other app settings getting merged by this package.

### Template.helpers

From release 1.2.0 we dropped the dependencies to our helper packages. If you want to get easy access to your public settings while working on your templates, we advise you to install one or both of our template helpers for that.

##### meteor-namespace-template-helper

See package [4commerce:meteor-namespace-template-helper](https://atmospherejs.com/4commerce/meteor-namespace-template-helper). This package brings the Meteor namespace (Meteor.user, Meteor.settings.public etc.) directly to templates.

*Example:*

````
<template name="about">
  <span>{{Meteor.settings.public.application.version}}</span>
</template>
````

Read more at the package's homepage [on GitHub](https://github.com/4commerce-technologies-AG/meteor-package-meteor-namespace-template-helper).

##### pubsettings-template-helper

See package [4commerce:pubsettings-template-helper](https://atmospherejs.com/4commerce/pubsettings-template-helper). This package gain access to `Meteor.settings.public` within your templates by a _ShortCut function_.

*Example:*

````
<template name="about">
  <span>{{pubSettings.application.version}}</span>
</template>
````

Read more at the package's homepage [on GitHub](https://github.com/4commerce-technologies-AG/meteor-package-pubsettings-template-helper).

### Changes to Meteor.settings

The object properties of Meteor.settings are allways writeable. We highly advise you not to make changes to your settings inside your server or your client app. If you have to and can not realize your requests within the configuration files, you should make latest changes while inside main startup code. The setting values are not reactive and changes are not (re-)synced between client and server.

### A public element in your config files

The loading process will automatically merge the public settings at the `Meteor.settings.public` element. Therefor and to make sure, that you have not made a typing error, we denied the occurence of a `public` element at root level inside your public and server configurations (only at root level). This should avoid (miss-typed) structures like `Meteor.settings.public.public`. In such a case an error is thrown with the identification of the false file.

### Package dependencies

When you add this package, follwing dependencies will load:

1. [meteorblackbelt:underscore-deep](https://atmospherejs.com/meteorblackbelt/underscore-deep)
2. [udondan:yml](https://atmospherejs.com/udondan/yml)

### Related packages

When you add this package, follwing are usefull to add:

1. [4commerce:meteor-namespace-template-helper](https://atmospherejs.com/4commerce/meteor-namespace-template-helper)
2. [4commerce:pubsettings-template-helper](https://atmospherejs.com/4commerce/pubsettings-template-helper)

### Issues & help

In case of support or error please report your issue request. The issue tracker is available at: https://github.com/4commerce-technologies-AG/meteor-package-env-settings/issues

### Author & Credits

Author: [Tom Freudenberg, 4commerce technologies AG](http://about.me/tom.freudenberg)

Copyright (c) 2015 [Tom Freudenberg](http://www.4commerce.de/), [4commerce technologies AG](http://www.4commerce.de/), released under the MIT license


text:
package com.google.appengine.datanucleus.jdo;

import com.google.appengine.api.datastore.EntityNotFoundException;
import com.google.appengine.api.datastore.KeyFactory;
import com.google.appengine.datanucleus.Utils;
import com.google.appengine.datanucleus.test.jdo.UnownedUpgradeJDO.HasOneToManyWithKey;
import com.google.appengine.datanucleus.test.jdo.UnownedUpgradeJDO.HasOneToManyWithUnowned;
import com.google.appengine.datanucleus.test.jdo.UnownedUpgradeJDO.HasOneToOneWithKey;
import com.google.appengine.datanucleus.test.jdo.UnownedUpgradeJDO.HasOneToOneWithUnowned;
import com.google.appengine.datanucleus.test.jdo.UnownedUpgradeJDO.SideB;
import com.google.appengine.tools.development.testing.LocalDatastoreServiceTestConfig;

import java.util.Map;

/**
 * Tests for upgrading Key relations to real unowned relations.
 * In the original storage version you could save a Key in the other object.
 * In the latest storage version you have real unowned relations.
 * These tests simulate creating using the old storage version and old classes, and then reading back in
 * using the new storage version and new (equivalent) classes.
 */
public class JDOUnownedUpgradeTest extends JDOTestCase {

  @Override
  protected String getAppId() {
    return "s~DNTest";
  }

  @Override
  protected LocalDatastoreServiceTestConfig newLocalDatastoreServiceTestConfig() {
    LocalDatastoreServiceTestConfig config = super.newLocalDatastoreServiceTestConfig();
    return config.setDefaultHighRepJobPolicyUnappliedJobPercentage(1);
  }

  public void testOneToManyUpgrade() {
    // Persist using original storage version
    switchDatasource(PersistenceManagerFactoryName.originalStorageVersion);

    // Do the writes with the relationship managed via Key
    SideB sideB1 = new SideB();
    sideB1.setName("yar");
    beginTxn();
    pm.makePersistent(sideB1);
    commitTxn();

    SideB sideB2 = new SideB();
    sideB2.setName("bar");
    beginTxn();
    pm.makePersistent(sideB2);
    commitTxn();

    HasOneToManyWithKey withKey = new HasOneToManyWithKey();
    withKey.addOther(KeyFactory.createKey("UnownedUpgradeJDO$SideB", sideB1.getId()));
    withKey.addOther(KeyFactory.createKey("UnownedUpgradeJDO$SideB", sideB2.getId()));
    beginTxn();
    pm.makePersistent(withKey);
    commitTxn();

    beginTxn();
    assertEquals(2, pm.getObjectById(
        HasOneToManyWithKey.class, withKey.getId()).getOthers().size());
    commitTxn();

    // Read back in using latest storage version, as unowned
    Map<String, String> props = Utils.newHashMap();
    props.put("datanucleus.appengine.datastoreEnableXGTransactions", Boolean.TRUE.toString());
    switchDatasource(PersistenceManagerFactoryName.transactional, props);

    beginTxn();
    HasOneToManyWithUnowned withUnowned =
        pm.getObjectById(HasOneToManyWithUnowned.class, withKey.getId());
    assertEquals(2, withUnowned.getOthers().size());
    assertEquals(sideB1.getId(), withUnowned.getOthers().get(0).getId());
    assertEquals(sideB2.getId(), withUnowned.getOthers().get(1).getId());
    commitTxn();
  }

  public void testOneToOneUpgrade() throws EntityNotFoundException {
    // Persist using original storage version
    switchDatasource(PersistenceManagerFactoryName.originalStorageVersion);

    // Do the writes with the relationship managed via Key
    SideB sideB1 = new SideB();
    sideB1.setName("yar");
    beginTxn();
    pm.makePersistent(sideB1);
    commitTxn();

    HasOneToOneWithKey withKey = new HasOneToOneWithKey();
    withKey.setOther(KeyFactory.createKey("UnownedUpgradeJDO$SideB", sideB1.getId()));
    beginTxn();
    pm.makePersistent(withKey);
    commitTxn();

    beginTxn();
    assertNotNull(pm.getObjectById(HasOneToOneWithKey.class, withKey.getId()).getOther());
    commitTxn();

    // Read back in using latest storage version, as unowned
    Map<String, String> props = Utils.newHashMap();
    props.put("datanucleus.appengine.datastoreEnableXGTransactions", Boolean.TRUE.toString());
    switchDatasource(PersistenceManagerFactoryName.transactional, props);

    beginTxn();
    HasOneToOneWithUnowned withUnowned = pm.getObjectById(HasOneToOneWithUnowned.class, withKey.getId());
    assertNotNull(withUnowned.getOther());
    assertEquals(sideB1.getId(), withUnowned.getOther().getId());
    commitTxn();
  }
}


text:
declare var variable: string;

declare module "some-module"
{
	export = variable;
}


text:
<form id="info_form" action="{:u('ad/edit')}" method="post">

        {:L('ad_name')} :
        <input type="text" name="name" id="name" class="input-text" size="40" value="{$info.name}">

        {:L('ad_url')} :
        <input type="text" name="url" class="input-text" size="40" value="{$info.url}">

        {:L('adboard')} :

            {$board_info.name} ({$board_info.width}*{$board_info.height})

        {:L('ad_type')} :

            <select name="type" id="type">
            <volist name="ad_type_arr" id="val" >
                <option value="{$key}" <if condition="$info['type'] eq $key">selected="selected"</if>>{$val}</option>
            </volist>
            </select>

        {:L('ad_image')} :
        <input type="text" name="img" id="J_img" class="input-text fl mr10" size="30" value="{$info.content}">

{:L('upload')}

		<if condition="$info.type eq 'image'"><notempty name="info['content']"></notempty></if>

        {:L('ad_code')} :
        <textarea rows="3" cols="50" name="code" id="code">{$info.content}</textarea>

        {:L('ad_flash')} :

            <input type="text" name="flash" id="J_flash" class="input-text fl mr10" size="30" value="{$info.content}">

{:L('upload')}

        {:L('ad_text')} :
        <textarea rows="3" cols="50" name="text" id="text">{$info.content}</textarea>

      {:L('ad_ext_image')} :

          <input type="text" name="extimg" id="J_extimg" class="input-text fl mr10" size="30" value="{$info.extimg}">

{:L('upload')}

      {:L('ad_ext_val')} :

          <input type="text" name="extval" class="input-text fl mr10" value="{$info.extval}">

      {:L('ad_desc')} :
      <input type="text" name="desc" class="input-text fl mr10" size="30" value="{$info.desc}">

        {:L('ad_time')} :

            <input type="text" name="start_time" id="start_time" class="date" size="12" value="{$info.start_time|date='Y-m-d',###}">
            <input type="text" name="end_time" id="end_time" class="date" size="12" value="{$info.end_time|date='Y-m-d',###}">

        {:L('enabled')} :

            <input type="radio" <if condition="$info['status'] eq '1'">checked="checked"</if> value="1" name="status"> {:L('yes')}
            <input type="radio" <if condition="$info['status'] eq '0'">checked="checked"</if> value="0" name="status"> {:L('no')}

<input type="hidden" name="id" id="id" value="{$info.id}" />
</form>


text:
package org.gaixie.jibu.security.servlet;

import com.google.inject.Inject;
import com.google.inject.Injector;
import com.google.inject.Singleton;

import java.io.IOException;
import java.io.PrintWriter;
import java.util.HashMap;
import java.util.List;
import java.util.ResourceBundle;
import java.util.Map;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.gaixie.jibu.JibuException;
import org.gaixie.jibu.json.JSONArray;
import org.gaixie.jibu.json.JSONException;
import org.gaixie.jibu.json.JSONObject;
import org.gaixie.jibu.security.annotation.CIVerify;
import org.gaixie.jibu.security.model.Criteria;
import org.gaixie.jibu.security.model.User;
import org.gaixie.jibu.security.service.UserService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * 响应用户管理相关操作的请求。
 * <p>
 */
@Singleton public class UserServlet extends HttpServlet {
    final static Logger logger = LoggerFactory.getLogger(UserServlet.class);
    @Inject private Injector injector;

    public void doGet(HttpServletRequest req, HttpServletResponse resp)
        throws IOException {
        resp.setContentType("application/json;charset=UTF-8");

        String rst = null;
        if ("userAdd".equals(req.getParameter("ci"))) {
            rst = userAdd(req,injector);
        } else if ("userUpdate".equals(req.getParameter("ci"))) {
            rst = userUpdate(req,injector);
        } else if ("userDelete".equals(req.getParameter("ci"))) {
            rst = userDelete(req,injector);
        } else if ("userFind".equals(req.getParameter("ci"))) {
            rst = userFind(req,injector);
        }

        PrintWriter pw = resp.getWriter();
        pw.println(rst);
        pw.close();
    }

    public void doPost(HttpServletRequest req,  HttpServletResponse resp)
        throws IOException{
        doGet(req, resp);
    }

    @CIVerify
        protected String userAdd(HttpServletRequest req,
                                 Injector injector) {
        UserService userService = injector.getInstance(UserService.class);
        Map<String, Object> jsonMap = new HashMap<String, Object>();
        ResourceBundle rb =
            ResourceBundle.getBundle("i18n/CoreExtjsResources",
                                     ServletUtils.getLocale(req));
        try {
            User user = ServletUtils.httpToBean(User.class,req);
            userService.add(user);
            jsonMap.put("success", true);
            jsonMap.put("message", rb.getString("message.001"));
        } catch (JibuException e) {
            logger.error(e.getMessage());
            jsonMap.put("success", false);
            jsonMap.put("message", rb.getString("message.002"));
        } finally {
            return (new JSONObject(jsonMap)).toString();
        }
    }

    protected String userUpdate(HttpServletRequest req,
                                Injector injector) {
        UserService userService = injector.getInstance(UserService.class);
        Map<String, Object> jsonMap = new HashMap<String, Object>();
        ResourceBundle rb =
            ResourceBundle.getBundle("i18n/CoreExtjsResources",
                                     ServletUtils.getLocale(req));
        try {
            User user = ServletUtils.httpToBean(User.class,req);
            userService.update(user);
            jsonMap.put("success", true);
            jsonMap.put("message", rb.getString("message.001"));
        } catch (JibuException e) {
            logger.error(e.getMessage());
            jsonMap.put("success", false);
            jsonMap.put("message", rb.getString("message.002"));
        } finally {
            return (new JSONObject(jsonMap)).toString();
        }
    }

    @CIVerify
        protected String userDelete(HttpServletRequest req,
                                    Injector injector) {
        UserService userService = injector.getInstance(UserService.class);

        Map<String, Object> jsonMap = new HashMap<String, Object>();
        ResourceBundle rb =
            ResourceBundle.getBundle("i18n/CoreExtjsResources",
                                     ServletUtils.getLocale(req));
        String id = req.getParameter("id");
        try {
            User user = new User();
            user.setId(Integer.parseInt(id));
            userService.delete(user);
            jsonMap.put("success", true);
            jsonMap.put("message", rb.getString("message.001"));
        } catch (JibuException e) {
            logger.error(e.getMessage());
            jsonMap.put("success", false);
            jsonMap.put("message", rb.getString("message.002"));
        } finally {
            return (new JSONObject(jsonMap)).toString();
        }
    }

    @CIVerify
        protected String userFind(HttpServletRequest req,
                                  Injector injector) {
        UserService userService = injector.getInstance(UserService.class);
        Map<String, Object> jsonMap = new HashMap<String, Object>();
        ResourceBundle rb =
            ResourceBundle.getBundle("i18n/CoreExtjsResources",
                                     ServletUtils.getLocale(req));

        try {
            User user = ServletUtils.httpToBean(User.class,req);
            Criteria criteria = ServletUtils.httpToCriteria(req);
            List<User> users = userService.find(user,criteria);
            jsonMap.put("success", true);
            jsonMap.put("data", new JSONArray(users,false));
            if (null != criteria && criteria.getLimit()>0) {
                jsonMap.put("total", criteria.getTotal());
            }
        } catch (JibuException e) {
            logger.error(e.getMessage());
        } finally {
            return (new JSONObject(jsonMap)).toString();
        }
    }
}


text:
package edu.mum.lab3;

import java.util.Map;

/**
 * Created by dewei.xiang on 7/11/2017.
 */
public interface IObserver {
    void update(Map<String, Double> stocklist);
}


text:
package sun.java2d.x11;

import java.awt.image.*;

import sun.awt.*;
import sun.java2d.*;
import sun.java2d.loops.*;
import sun.java2d.pipe.*;

public abstract class XSurfaceData extends SurfaceData {
    static boolean isX11SurfaceDataInitialized = false;

    public static boolean isX11SurfaceDataInitialized() {
        return isX11SurfaceDataInitialized;
    }

    public static void setX11SurfaceDataInitialized() {
        isX11SurfaceDataInitialized = true;
    }

    public XSurfaceData(SurfaceType surfaceType, ColorModel cm) {
        super(surfaceType, cm);
    }

    protected native void initOps(X11ComponentPeer peer, X11GraphicsConfig gc, int depth);

    protected static native long XCreateGC(long pXSData);

    protected static native void XResetClip(long xgc);

    protected static native void XSetClip(long xgc, int lox, int loy, int hix, int hiy, Region complexclip);

    protected native void flushNativeSurface();

    protected native boolean isDrawableValid();

    protected native void setInvalid();

    protected static native void XSetGraphicsExposures(long xgc, boolean needExposures);
}


text:
import * as React from 'react';
import { SxProps } from '@material-ui/system';
import { OverrideProps, OverridableComponent } from '../OverridableComponent';
import { Theme } from '../styles/createMuiTheme';

export interface BoxTypeMap<P = {}, D extends React.ElementType = 'div'> {
  props: P & {
    children?: React.ReactNode | ((props: React.ComponentPropsWithRef<D>) => React.ReactNode);
    component?: React.ElementType;
    clone?: boolean;
    ref?: React.Ref<unknown>;
    sx?: SxProps<Theme>;
  };
  defaultComponent: D;
}

declare const Box: OverridableComponent<BoxTypeMap>;

export type BoxProps<
  D extends React.ElementType = BoxTypeMap['defaultComponent'],
  P = {}
> = OverrideProps<BoxTypeMap<P, D>, D>;

export default Box;


text:
    <form class="col s12" method="POST" action="<?php echo base_url() ?>usuarios/registrar">

          <input placeholder="Ingrese nombre de usuario" id="user_name" type="text" class="validate" name="username" required>
          Nombre Usuario

          <input id="Ingrese contraseña" placeholder="****" type="password" class="validate" name="password" required>
          Contraseña

          <input id="email" type="email" class="validate" required>
          Email

        <button class="btn waves-effect waves-light" type="submit" name="action">Submit
    send
  </button>
    </form>


text:
package org.apache.flink.table.runtime.operators.dynamicfiltering;

import org.apache.flink.api.connector.source.SourceEvent;
import org.apache.flink.runtime.operators.coordination.MockOperatorEventGateway;
import org.apache.flink.runtime.operators.coordination.OperatorEvent;
import org.apache.flink.runtime.source.event.SourceEventWrapper;
import org.apache.flink.streaming.util.OneInputStreamOperatorTestHarness;
import org.apache.flink.table.connector.source.DynamicFilteringData;
import org.apache.flink.table.connector.source.DynamicFilteringEvent;
import org.apache.flink.table.data.GenericRowData;
import org.apache.flink.table.data.RowData;
import org.apache.flink.table.data.binary.BinaryStringData;
import org.apache.flink.table.types.logical.BigIntType;
import org.apache.flink.table.types.logical.IntType;
import org.apache.flink.table.types.logical.RowType;
import org.apache.flink.table.types.logical.VarCharType;

import org.junit.jupiter.api.Test;

import java.util.Arrays;
import java.util.List;
import java.util.concurrent.ConcurrentLinkedQueue;

import static org.assertj.core.api.Assertions.assertThat;

/** Tests for {@link DynamicFilteringDataCollectorOperator}. */
class DynamicFilteringDataCollectorOperatorTest {

    @Test
    void testCollectDynamicFilteringData() throws Exception {
        RowType rowType = RowType.of(new IntType(), new BigIntType(), new VarCharType());
        List<Integer> indexes = Arrays.asList(0, 1, 3);
        MockOperatorEventGateway gateway = new MockOperatorEventGateway();

        DynamicFilteringDataCollectorOperator operator =
                new DynamicFilteringDataCollectorOperator(rowType, indexes, -1, gateway);
        ConcurrentLinkedQueue<Object> output;
        try (OneInputStreamOperatorTestHarness<RowData, Object> harness =
                new OneInputStreamOperatorTestHarness<>(operator)) {
            output = harness.getOutput();
            harness.setup();
            harness.open();

            for (long i = 0L; i < 3L; i++) {
                harness.processElement(rowData(1, 1L, 0, "a"), i);
            }
            harness.processElement(rowData(2, 1L, 0, null), 3L);

            // operator.finish is called when closing
        }

        assertThat(output).isEmpty();

        assertThat(gateway.getEventsSent()).hasSize(1);
        OperatorEvent event = gateway.getEventsSent().get(0);
        assertThat(event).isInstanceOf(SourceEventWrapper.class);
        SourceEvent dynamicFilteringEvent = ((SourceEventWrapper) event).getSourceEvent();
        assertThat(dynamicFilteringEvent).isInstanceOf(DynamicFilteringEvent.class);

        DynamicFilteringData data = ((DynamicFilteringEvent) dynamicFilteringEvent).getData();
        assertThat(data.isFiltering()).isTrue();
        assertThat(data.getData()).hasSize(2);
        assertThat(data.contains(rowData(1, 1L, "a"))).isTrue();
        assertThat(data.contains(rowData(2, 1L, null))).isTrue();
    }

    @Test
    void testExceedsThreshold() throws Exception {
        RowType rowType = RowType.of(new IntType(), new BigIntType(), new VarCharType());
        List<Integer> indexes = Arrays.asList(0, 1, 3);
        MockOperatorEventGateway gateway = new MockOperatorEventGateway();
        // Can hold at most 2 rows
        int thresholds = 100;

        DynamicFilteringDataCollectorOperator operator =
                new DynamicFilteringDataCollectorOperator(rowType, indexes, thresholds, gateway);
        try (OneInputStreamOperatorTestHarness<RowData, Object> harness =
                new OneInputStreamOperatorTestHarness<>(operator)) {
            harness.setup();
            harness.open();

            harness.processElement(rowData(1, 1L, 0, "a"), 1L);
            harness.processElement(rowData(2, 1L, 0, "b"), 2L);
            harness.processElement(rowData(3, 1L, 0, "c"), 3L);
        }

        assertThat(gateway.getEventsSent()).hasSize(1);
        OperatorEvent event = gateway.getEventsSent().get(0);
        assertThat(event).isInstanceOf(SourceEventWrapper.class);
        SourceEvent dynamicFilteringEvent = ((SourceEventWrapper) event).getSourceEvent();
        assertThat(dynamicFilteringEvent).isInstanceOf(DynamicFilteringEvent.class);
        DynamicFilteringData data = ((DynamicFilteringEvent) dynamicFilteringEvent).getData();
        assertThat(data.isFiltering()).isFalse();
    }

    private RowData rowData(Object... values) {
        GenericRowData rowData = new GenericRowData(values.length);
        for (int i = 0; i < values.length; ++i) {
            Object value = values[i];
            value = value instanceof String ? new BinaryStringData((String) value) : value;
            rowData.setField(i, value);
        }
        return rowData;
    }
}


text:
Simple Threshold Trigger
========================

.. _documentation: http://graphite.readthedocs.org/en/latest/functions.html

Let's say you measure how much free space is left on your HDD and store
this value as ``DevOps.my_server.hdd.freespace_mbytes`` in Graphite.
Maybe you want to get an email when you have less than 50 GB left (it's not
a big problem), and a Pushover notification when you have less than
1 GB left (you really need to delete something asap).

You can easily accomplish this by adding a trigger in Moira's Simple Mode:

.. image:: ../_static/simple.png
   :alt: simple trigger

Graphite Target
---------------

You can specify a single metric like we did here:
``DevOps.my_server.hdd.freespace_mbytes``.

You can also specify multiple metrics like ``DevOps.*.hdd.freespace_mbytes``.
All metrics will be monitored separately, and you will get separate
notifications for each metric.

You can even use Graphite functions like
``movingAverage(DevOps.my_server.hdd.freespace_mbytes, 10)``. Moira understands
everything that Graphite itself understands. See appropriate documentation_.

Thresholds
----------

In simple mode you need to at least one threshold values: WARNING and ERROR.
In our example we set both, lower values are bad, so we set warning threshold
greater than error threshold. In this case, Moira will consider any value less
than 50000 a warning and less than 1000 an error, which is what we want.
In other cases, you may need to consider large values a problem - then you
should make error threshold greater than warning and select
``Watch for value rising`` option.

.. seealso::

  You can set only one threshold. For example, you can set WARNING equal to 50000, omit ERROR and select ``Watch for value falling``.
  In this case you will receive only WARNING messages when free space goes under 50GB and never receive ERROR messages.
  You can also do vise versa: set ERROR and omit WARNING.

Tags
----

In Moira, you cannot subscribe to a single trigger. Instead, you should
categorize your triggers by tags and subscribe to a tag. It may look like
an overkill here, but when you have dozens of triggers, you are much better
off with tags, because you don't have to enter your contact information over
and over again. Tags also help to filter information on main screen:

.. image:: ../_static/main_screen.png
   :alt: main screen with filter

You can add as many tags as you want.

Subscriptions
-------------

Proceed to the :doc:`/user_guide/subscriptions` page to learn how to
set up a subscription to your trigger.


text:
package org.apache.airavata.workflow.tracking.samples.listener;

import java.io.StringReader;

import org.apache.airavata.commons.WorkFlowUtils;
import org.apache.airavata.workflow.tracking.client.LeadNotificationManager;
import org.apache.airavata.workflow.tracking.client.Subscription;
import org.apache.airavata.wsmg.client.WseMsgBrokerClient;
import org.apache.axiom.om.OMAbstractFactory;
import org.apache.axiom.om.OMElement;
import org.apache.axiom.om.OMFactory;
import org.apache.axis2.addressing.EndpointReference;

public class Listener {

    private static OMFactory factory = OMAbstractFactory.getOMFactory();
    public static final String finalNotification = "<end>This is the last Notification. end your subscription when you receive this</end>";

    /**
     * @param args
     */
    public static void main(String[] args) {

        String brokerLocation = args.length > 0 ? args[0] : "localhost:8080/axis2/services/EventingService";
        String topic = "pickTheTOpicThatWorkflowPublishTheEventsFrom";

        Subscription subscription = null;
        // Create a sbscription
        try {
            // create a callback
            CallbackHandler callback = new CallbackHandler();
            // create the subscription
            subscription = LeadNotificationManager.createSubscription(brokerLocation, topic, callback, 2222);
            // set the subscription in the callback so we could destroy the
            // subscription within the callback
            callback.setSubscription(subscription);
        } catch (Exception e) {
            // Falied to create subscription
            System.out.println("Failed to create Subscription");
            e.printStackTrace();
            // do what you want to do instead of rethrowing. e.g. like retrying
            throw new RuntimeException(e);
        }

        // Subscription is created and now we listen. Now the workflow should
        // publish notification with
        // that particular topic.
        // Inthis sample we emulate it by manually publishing notifications

        // created a publisher

        WseMsgBrokerClient publisher = new WseMsgBrokerClient();
        EndpointReference endpointRef = publisher.createEndpointReference(brokerLocation, topic);
        publisher.init(endpointRef.getAddress());

        try {

            OMElement finalNotificationEl = WorkFlowUtils.reader2OMElement(new StringReader(finalNotification));

            OMElement testNotification = factory.createOMElement("Test", null);

            testNotification.setText("test event for workflow tracking sample");

            publisher.publish(null, testNotification);
            publisher.publish(null, finalNotificationEl);
        } catch (Exception e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }

    }

}


text:
namespace _03.ComparePerformanceOfFunctions
{
    using System;

    public class SinusMethods
    {
        public static double CalculateFloatSinus(float number)
        {
            return Math.Sin(number);
        }

        public static double CalculateDoubleSinus(double number)
        {
            return Math.Sin(number);
        }

        public static double CalculateDecimalSinus(decimal number)
        {
            return Math.Sin((double)number);
        }
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<spring:beans xmlns="http://www.citrusframework.org/schema/testcase"
              xmlns:spring="http://www.springframework.org/schema/beans"
              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
              xmlns:selenium="http://www.citrusframework.org/schema/selenium/testcase"
              xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
                                  http://www.citrusframework.org/schema/testcase http://www.citrusframework.org/schema/testcase/citrus-testcase.xsd
                                  http://www.citrusframework.org/schema/selenium/testcase http://www.citrusframework.org/schema/selenium/testcase/citrus-selenium-testcase.xsd">

    <testcase name="SeleniumActionsParserTest">
        <actions>
            <selenium:start browser="mockBrowser"/>

            <selenium:alert accept="true"/>

            <selenium:alert accept="false">
                <selenium:alert-text>This is a warning message!</selenium:alert-text>
            </selenium:alert>

            <selenium:find>
                <selenium:element class-name="clickable" tag-name="button" text="Ok" displayed="true" enabled="false">
                    <selenium:attributes>
                        <selenium:attribute name="type" value="submit"/>
                    </selenium:attributes>
                    <selenium:styles>
                        <selenium:style name="color" value="#000000"/>
                    </selenium:styles>
                </selenium:element>
            </selenium:find>

            <selenium:page name="userForm" action="setUserName">
                <selenium:arguments>
                    <selenium:argument>${username}</selenium:argument>
                </selenium:arguments>
            </selenium:page>

            <selenium:page type="com.consol.citrus.selenium.pages.UserFormPage"
                           action="validate"
                           validator="pageValidator"/>

            <selenium:click>
                <selenium:element id="edit-link"/>
            </selenium:click>

            <selenium:hover>
                <selenium:element id="edit-link"/>
            </selenium:hover>

            <selenium:set-input value="new-value">
                <selenium:element tag-name="input"/>
            </selenium:set-input>

            <selenium:check-input checked="true">
                <selenium:element xpath="//input[@type='checkbox']"/>
            </selenium:check-input>

            <selenium:dropdown-select option="male">
                <selenium:element name="gender"/>
            </selenium:dropdown-select>

            <selenium:dropdown-select>
                <selenium:element id="title"/>
                <selenium:options>
                    <selenium:option>Mr.</selenium:option>
                    <selenium:option>Dr.</selenium:option>
                </selenium:options>
            </selenium:dropdown-select>

            <selenium:wait until="hidden">
                <selenium:element id="dialog"/>
            </selenium:wait>

            <selenium:javascript>
                <selenium:script>alert('This is awesome!')</selenium:script>
                <selenium:errors>
                    <selenium:error>Something went wrong</selenium:error>
                </selenium:errors>
            </selenium:javascript>

            <selenium:screenshot browser="mockBrowser" output-dir="/tmp/storage"/>

            <selenium:navigate page="back"/>

            <selenium:open-window name="newWindow"/>
            <selenium:switch-window name="switchWindow"/>
            <selenium:close-window name="closeWindow"/>

            <selenium:store-file file-path="classpath:download/file.txt"/>
            <selenium:get-stored-file file-name="file.txt"/>

            <selenium:clear-cache/>

            <selenium:stop browser="mockBrowser"/>
        </actions>
    </testcase>

    <spring:bean id="userForm" class="com.consol.citrus.selenium.pages.UserFormPage"/>

    <spring:bean id="pageValidator" class="org.mockito.Mockito" factory-method="mock">
        <spring:constructor-arg value="com.consol.citrus.selenium.model.PageValidator"/>
    </spring:bean>

    <spring:bean id="mockBrowser" class="org.mockito.Mockito" factory-method="mock">
        <spring:constructor-arg value="com.consol.citrus.selenium.endpoint.SeleniumBrowser"/>
    </spring:bean>

</spring:beans>


text:
layout: page
title: whoami
permalink: /about/
---

Hey there!

I am Karthikeyan. I am a self-taught developer and I have been programming professionally since 2014. I write Python for food and fun at day. Outside of work, I am a CPython core triager and write a little bit of Clojure. In terms of food, I love dosa, koala biryani (Thalapakati) and plain Vanilla (Not vanilla JavaScript though :). I Reddit a lot. I occassionally read books with stoicism, (auto)?biographies and short novels being my picks. This blog started about programming and then turned about to be a personal blog about my mistakes and opinions. I mostly write here in an open manner so that I can look back at my life about both progress and mistakes. So you might find some posts interesting and others depressing. I also write [poems with puns](/poems/) and [draw comics](/comics/)

Flavour of music for code :

* Linkin Park
* Eminem
* A.R. Rahman

You can reach out to me at below and I will get back to you for sure!

Email : tir.karthi@gmail.com

[PGP](https://keybase.io/xtreak)

*"You got to find what you love.. And like any great relationship it just gets better and better as the years roll on" - Steve Jobs, Stanford Commencement*

Oh yes! I do have a life!

Not a great designer by the way the whole blog is possible due to the work of Jekyll.

Disclaimer : The content on the blog are views on my own and doesn't represent the views of my employer current, past and future. It also doesn't represent views about any particular person unless otherwise specified.


text:
var socket = io('http://127.0.0.1:13374');
var elems = document.getElementsByClassName("status");

socket.on('status', function (data) {
  console.log(data);

  for (var i = 0; i < elems.length; i++) {
    var elem  = elems[i];
    var key   = elem.getAttribute("data-key");
    var unit  = elem.getAttribute("data-unit");

    var value = data[key];

    if (value != undefined) {
      elem.innerHTML = value + " " + unit;
    }
  }

  var body = document.body;
  var img = document.getElementById("lock_image");
  var data_fields = document.getElementById("data");

  if (data["state"] == "open") {
    body.style.background = "#00FF00";
    img.setAttribute("src", "assets/images/open.svg");
    data_fields.style.color = "#00FF00";
  } else {
    body.style.background = "#FF0000";
    img.setAttribute("src", "assets/images/closed.svg");
    data_fields.style.color = "#FF0000";
  }
});


text:
package org.fax4j.spi.vbs;

import org.fax4j.FaxException;
import org.fax4j.common.FaxActionType;
import org.fax4j.spi.FaxClientSpi;
import org.fax4j.test.TestUtil;
import org.fax4j.test.TestUtil.EmptyFaxClientSpi;
import org.fax4j.util.ProcessExecutorHelper.ProcessOutput;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;

/**
 * Test Class
 *
 * @author 	Sagie Gur-Ari
 */
public class VBSProcessOutputValidatorTest
{
	/**The validator to test*/
	private VBSProcessOutputValidator validator;
	/**Empty fax client SPI*/
	private FaxClientSpi faxClientSpi;

	/**
	 * Sets up the test objects.
	 *
	 * @throws 	Exception
	 * 			Any exception
	 */
	@Before
    public void setUp() throws Exception
	{
		this.validator=new VBSProcessOutputValidator();
		this.faxClientSpi=TestUtil.createFaxClientSpi(EmptyFaxClientSpi.class.getName(),null);
	}

	/**
	 * Test
	 *
	 * @throws 	Exception
	 * 			Any exception
	 */
	@Test
	public void validateProcessOutputValidTest() throws Exception
	{
		ProcessOutput processOutput=new ProcessOutput("fax.operation.done=true","err",0);
		this.validator.validateProcessOutput(this.faxClientSpi,processOutput,FaxActionType.SUBMIT_FAX_JOB);
	}

	/**
	 * Test
	 *
	 * @throws 	Exception
	 * 			Any exception
	 */
	@Test(expected=FaxException.class)
	public void validateProcessOutputNoFaxOutputTest() throws Exception
	{
		ProcessOutput processOutput=new ProcessOutput("abc","err",0);
		this.validator.validateProcessOutput(this.faxClientSpi,processOutput,FaxActionType.SUBMIT_FAX_JOB);
	}

	/**
	 * Test
	 *
	 * @throws 	Exception
	 * 			Any exception
	 */
	@Test(expected=FaxException.class)
	public void validateProcessOutputErrorOutputNullMessageTest() throws Exception
	{
		ProcessOutput processOutput=new ProcessOutput("fax.operation.done=false\nfax.error=","err",0);
		this.validator.validateProcessOutput(this.faxClientSpi,processOutput,FaxActionType.SUBMIT_FAX_JOB);
	}

	/**
	 * Test
	 *
	 * @throws 	Exception
	 * 			Any exception
	 */
	@Test(expected=FaxException.class)
	public void validateProcessOutputErrorOutputEmptyMessageTest() throws Exception
	{
		ProcessOutput processOutput=new ProcessOutput("fax.operation.done=false\n","err",0);
		this.validator.validateProcessOutput(this.faxClientSpi,processOutput,FaxActionType.SUBMIT_FAX_JOB);
	}

	/**
	 * Test
	 *
	 * @throws 	Exception
	 * 			Any exception
	 */
	@Test(expected=FaxException.class)
	public void validateProcessOutputErrorOutputWithMessageTest() throws Exception
	{
		ProcessOutput processOutput=new ProcessOutput("fax.operation.done=false\n",".vbs(13, ",0);
		this.validator.validateProcessOutput(this.faxClientSpi,processOutput,FaxActionType.SUBMIT_FAX_JOB);
	}

	/**
	 * Test
	 *
	 * @throws 	Exception
	 * 			Any exception
	 */
	@Test(expected=FaxException.class)
	public void validateProcessOutputNullOutputTest() throws Exception
	{
		ProcessOutput processOutput=new ProcessOutput(null,"err",0);
		this.validator.validateProcessOutput(this.faxClientSpi,processOutput,FaxActionType.SUBMIT_FAX_JOB);
	}

	/**
	 * Test
	 *
	 * @throws 	Exception
	 * 			Any exception
	 */
	@Test(expected=FaxException.class)
	public void validateProcessOutputEmptyOutputTest() throws Exception
	{
		ProcessOutput processOutput=new ProcessOutput("","err",0);
		this.validator.validateProcessOutput(this.faxClientSpi,processOutput,FaxActionType.SUBMIT_FAX_JOB);
	}

	/**
	 * Test
	 *
	 * @throws 	Exception
	 * 			Any exception
	 */
	@Test(expected=FaxException.class)
	public void validateProcessOutputInvalidExitCodeTest() throws Exception
	{
		ProcessOutput processOutput=new ProcessOutput("fax.operation.done=true","err",1);
		this.validator.validateProcessOutput(this.faxClientSpi,processOutput,FaxActionType.SUBMIT_FAX_JOB);
	}

	/**
	 * Test
	 *
	 * @throws 	Exception
	 * 			Any exception
	 */
	@Test(expected=FaxException.class)
	public void validateProcessOutputInvalidNullOutputTest() throws Exception
	{
		ProcessOutput processOutput=new ProcessOutput(null,"err",1);
		this.validator.validateProcessOutput(this.faxClientSpi,processOutput,FaxActionType.SUBMIT_FAX_JOB);
	}

	/**
	 * Test
	 *
	 * @throws 	Exception
	 * 			Any exception
	 */
	@Test(expected=FaxException.class)
	public void validateProcessOutputInvalidEmptyOutputTest() throws Exception
	{
		ProcessOutput processOutput=new ProcessOutput(null,"err",1);
		this.validator.validateProcessOutput(this.faxClientSpi,processOutput,FaxActionType.SUBMIT_FAX_JOB);
	}

	/**
	 * Test
	 *
	 * @throws 	Exception
	 * 			Any exception
	 */
	@Test(expected=FaxException.class)
	public void validateProcessOutputActiveXErrorTest() throws Exception
	{
		ProcessOutput processOutput=new ProcessOutput("fax.operation.done=false","ActiveX component can't create object",0);
		this.validator.validateProcessOutput(this.faxClientSpi,processOutput,FaxActionType.SUBMIT_FAX_JOB);
	}

	/**
	 * Test
	 *
	 * @throws 	Exception
	 * 			Any exception
	 */
	@Test
	public void getVBSFailedLineErrorMessageFoundTest() throws Exception
	{
		int lineNumber=15;
		String errorPut="TEST.vbs("+lineNumber+", ";
		Object output=this.validator.getVBSFailedLineErrorMessage(errorPut);
		Assert.assertNotNull(output);
		Assert.assertEquals(" error found at line "+lineNumber+", ",output);
	}

	/**
	 * Test
	 *
	 * @throws 	Exception
	 * 			Any exception
	 */
	@Test
	public void getVBSFailedLineErrorMessageNotFoundTest() throws Exception
	{
		String errorPut="TEST";
		Object output=this.validator.getVBSFailedLineErrorMessage(errorPut);
		Assert.assertNotNull(output);
		Assert.assertEquals("",output);
	}

	/**
	 * Test
	 *
	 * @throws 	Exception
	 * 			Any exception
	 */
	@Test
	public void getVBSFailedLineErrorMessageNullTest() throws Exception
	{
		Object output=this.validator.getVBSFailedLineErrorMessage(null);
		Assert.assertNotNull(output);
		Assert.assertEquals("",output);
	}
}


text:
package notizync.Android;

import android.app.Activity;
import android.content.SharedPreferences;
import android.view.View;
import android.widget.TextView;
import notizync.core.api.INote;
import notizync.core.api.IStorageProvider;

public class OpenNoteListener implements
        View.OnClickListener {
    private IStorageProvider storageProvider;

    private Activity activity;
    private SharedPreferences preferences;

    public OpenNoteListener(IStorageProvider storageProvider, Activity activity) {
        this.storageProvider = storageProvider;
        this.activity = activity;
        this.preferences = activity.getApplicationContext()
                .getSharedPreferences(NotiZyncActivity.PREFERENCES_NAME, activity.MODE_PRIVATE);

    }

    /**
     * Called when a view has been clicked.
     *
     * @param v The view that was clicked.
     */
    @Override
    public void onClick(View v) {
        if(v instanceof TextView) {
            TextView textView = (TextView) v;
            CharSequence title = textView.getText();
            storageProvider.getNoteSet();
            for(INote note : storageProvider.getNoteSet()) {
                String noteTitle = note.getTitle().toString();
                if(title.equals(noteTitle)) {
                    StringBuilder sb = new StringBuilder();
                    for(String line : note.getContent().getLines()) {
                        sb.append(line);
                        sb.append('\n');
                    }
                    NotiZyncActivity.noteContent.setText(sb);
                    this.activity.setContentView(NotiZyncActivity.noteContent);
                    break;
                }
            }
        }
    }
}