text:
static NSString * const CHRVariableTimerExecutionQueueNamePrefix = @"com.chronus.CHRVariableTimer";

#pragma mark CHRVariableTimer Class Extension

@interface CHRVariableTimer () {
    volatile int32_t    _running;
    volatile int32_t    _valid;
    volatile NSUInteger _nextInvocation;
    volatile NSUInteger _lastInvocation;
    volatile bool       _executionBlockDidSetTimer;
    volatile bool       _executing;
}

@property (readonly) dispatch_source_t timer;

@end

#pragma mark - CHRVariableTimer Implementation

@implementation CHRVariableTimer
@synthesize executionBlock = _executionBlock;
@synthesize executionQueue = _executionQueue;

- (void)dealloc
{
    [self cancel];
}

#pragma mark Creating a Variable Timer

- (instancetype)initWithIntervalProvider:(CHRVariableTimerIntervalProvider)intervalProvider
                          executionBlock:(CHRRepeatingTimerExecutionBlock)executionBlock
{
    NSString *executionQueueName = [NSString stringWithFormat:@"%@.%p", CHRVariableTimerExecutionQueueNamePrefix, self];
    dispatch_queue_t executionQueue = dispatch_queue_create([executionQueueName UTF8String], DISPATCH_QUEUE_SERIAL);
    return [self initWithIntervalProvider:intervalProvider
                           executionBlock:executionBlock
                           executionQueue:executionQueue];
}

- (instancetype)initWithIntervalProvider:(CHRVariableTimerIntervalProvider)intervalProvider
                          executionBlock:(CHRRepeatingTimerExecutionBlock)executionBlock
                          executionQueue:(dispatch_queue_t)executionQueue
{
    return [self initWithIntervalProvider:intervalProvider
                           executionBlock:executionBlock
                           executionQueue:executionQueue
                             failureBlock:nil];
}

- (instancetype)initWithIntervalProvider:(CHRVariableTimerIntervalProvider)intervalProvider
                          executionBlock:(CHRRepeatingTimerExecutionBlock)executionBlock
                          executionQueue:(dispatch_queue_t)executionQueue
                            failureBlock:(CHRTimerInitFailureBlock)failureBlock
{
    if (self = [super init]) {
        _executionQueue = executionQueue;
        _timer = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0, _executionQueue);
        if (!_timer) {
            if (failureBlock) {
                failureBlock();
            } else {
                NSLog(@"%@", @"Failed to create dispatch source for timer.");
            }
            return nil;
        }
        _valid = CHRTimerStateValid;
        _executionBlock = [executionBlock copy];
        _intervalProvider = [intervalProvider copy];
        __weak CHRVariableTimer *weak = self;
        dispatch_source_set_event_handler(_timer, ^{
            CHRVariableTimer *strong = weak;
            if (strong) {
                strong->_executing = true;
                strong->_nextInvocation = strong->_lastInvocation + 1;
                strong->_executionBlock(weak, strong->_lastInvocation++);
                strong->_executing = false;
                if (!strong->_executionBlockDidSetTimer) {
                    [strong schedule];
                }
                strong->_executionBlockDidSetTimer = false;
            }
        });
    }
    return self;
}

+ (CHRVariableTimer *)timerWithIntervalProvider:(CHRVariableTimerIntervalProvider)intervalProvider
                                 executionBlock:(CHRRepeatingTimerExecutionBlock)executionBlock
{
    return [[CHRVariableTimer alloc]initWithIntervalProvider:intervalProvider
                                              executionBlock:executionBlock];
}

+ (CHRVariableTimer *)timerWithIntervalProvider:(CHRVariableTimerIntervalProvider)intervalProvider
                                 executionBlock:(CHRRepeatingTimerExecutionBlock)executionBlock
                                 executionQueue:(dispatch_queue_t)executionQueue
{
    return [[CHRVariableTimer alloc]initWithIntervalProvider:intervalProvider
                                              executionBlock:executionBlock
                                              executionQueue:executionQueue];
}

+ (CHRVariableTimer *)timerWithIntervalProvider:(CHRVariableTimerIntervalProvider)intervalProvider
                                 executionBlock:(CHRRepeatingTimerExecutionBlock)executionBlock
                                 executionQueue:(dispatch_queue_t)executionQueue
                                   failureBlock:(CHRTimerInitFailureBlock)failureBlock
{
    return [[CHRVariableTimer alloc]initWithIntervalProvider:intervalProvider
                                              executionBlock:executionBlock
                                              executionQueue:executionQueue
                                                failureBlock:failureBlock];
}

#pragma mark Using a Timer

- (void)start:(BOOL)now
{
    [self validate];

    if (OSAtomicCompareAndSwap32Barrier(CHRTimerStateStopped, CHRTimerStateRunning, &_running)) {
        if (now) {
            dispatch_source_set_timer(_timer, DISPATCH_TIME_NOW, DISPATCH_TIME_FOREVER, chr_leeway(0.0));
        } else {
            [self schedule];
        }
        _executionBlockDidSetTimer = (_executing) ? true : false;
        dispatch_resume(self.timer);
    }
}

- (void)pause
{
    [self validate];

    if (OSAtomicCompareAndSwap32Barrier(CHRTimerStateRunning, CHRTimerStateStopped, &_running)) {
        dispatch_suspend(_timer);
    }
}

- (void)cancel
{
    if (OSAtomicCompareAndSwap32Barrier(CHRTimerStateValid, CHRTimerStateInvalid, &_valid)) {
        if (_running == CHRTimerStateStopped) {
            dispatch_resume(_timer);
        }
        _running = CHRTimerStateStopped;
        dispatch_source_cancel(_timer);
    }
}

- (void)schedule
{
    if (self.isValid) {
        __weak CHRVariableTimer *weak = self;
        NSTimeInterval interval = self.intervalProvider(weak, _nextInvocation);
        dispatch_source_set_timer(_timer, chr_startTime(interval, NO), interval * NSEC_PER_SEC, chr_leeway(interval));
    }
}

- (void)validate
{
    if (!self.isValid) {
        @throw [NSException exceptionWithName:NSInternalInconsistencyException
                                       reason:@"Attempting to use invalid CHRVariableTimer."
                                     userInfo:nil];
    }
}

#pragma mark Getters

- (BOOL)isRunning
{
    return _running == CHRTimerStateRunning;
}

- (BOOL)isValid
{
    return _valid == CHRTimerStateValid;
}

- (NSUInteger)invocations
{
    return _lastInvocation;
}

@end


text:
<!DOCTYPE html>

  <meta charset="utf-8">
  <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">

  <title>Ionic Toggles</title>

  <link href="http://code.ionicframework.com/nightly/css/ionic.min.css" rel="stylesheet">
  <link href="style.css" rel="stylesheet">

  <ion-header-bar class="bar-positive">

Toggles

  </ion-header-bar>

  <ion-content>

        Settings

      <ion-toggle ng-repeat="item in settingsList" ng-model="item.checked" ng-checked="item.checked">
        {{ item.text }}
      </ion-toggle>

        Notifications

      <ion-toggle ng-model="pushNotification.checked" ng-change="pushNotificationChange()">
        Push Notifications
      </ion-toggle>

      <ion-toggle ng-model="emailNotification" ng-true-value="Subscribed" ng-false-value="Unubscribed">
        Newsletter
      </ion-toggle>

  </ion-content>

redpajama_set_name: RedPajamaGithub


text:
<bill session="115" type="h" number="2958" updated="2017-09-11T02:39:23Z">
  <state datetime="2017-06-20">REFERRED</state>
  <status>
    <introduced datetime="2017-06-20"/>
  </status>
  <introduced datetime="2017-06-20"/>
  <titles>
    <title type="short" as="introduced">Climate Solutions Act of 2017</title>
    <title type="short" as="introduced">Climate Solutions Act of 2017</title>
    <title type="official" as="introduced">To reduce greenhouse gas emissions and protect the climate.</title>
    <title type="display">Climate Solutions Act of 2017</title>
  </titles>
  <sponsor bioguide_id="L000582"/>
  <cosponsors>
    <cosponsor bioguide_id="B001300" joined="2017-06-20"/>
    <cosponsor bioguide_id="B000574" joined="2017-06-22"/>
    <cosponsor bioguide_id="C001090" joined="2017-06-22"/>
    <cosponsor bioguide_id="D000216" joined="2017-06-20"/>
    <cosponsor bioguide_id="E000288" joined="2017-06-20"/>
    <cosponsor bioguide_id="G000574" joined="2017-06-20"/>
    <cosponsor bioguide_id="J000298" joined="2017-06-22"/>
    <cosponsor bioguide_id="L000551" joined="2017-06-20"/>
    <cosponsor bioguide_id="L000397" joined="2017-06-23"/>
    <cosponsor bioguide_id="M000312" joined="2017-06-22"/>
    <cosponsor bioguide_id="N000179" joined="2017-06-20"/>
    <cosponsor bioguide_id="N000147" joined="2017-07-28"/>
    <cosponsor bioguide_id="P000598" joined="2017-06-20"/>
    <cosponsor bioguide_id="Q000023" joined="2017-06-20"/>
    <cosponsor bioguide_id="T000472" joined="2017-06-20"/>
    <cosponsor bioguide_id="T000460" joined="2017-07-28"/>
  </cosponsors>
  <actions>
    <action datetime="2017-06-20">
      <text>Introduced in House</text>
    </action>
    <action datetime="2017-06-20" state="REFERRED">
      <text>Referred to the Committee on Energy and Commerce, and in addition to the Committee on Foreign Affairs, for a period to be subsequently determined by the Speaker, in each case for consideration of such provisions as fall within the jurisdiction of the committee concerned.</text>
    </action>
    <action datetime="2017-06-20">
      <text>Referred to the Committee on Energy and Commerce, and in addition to the Committee on Foreign Affairs, for a period to be subsequently determined by the Speaker, in each case for consideration of such provisions as fall within the jurisdiction of the committee concerned.</text>
    </action>
    <action datetime="2017-06-23">
      <text>Referred to the Subcommittee on Environment.</text>
    </action>
  </actions>
  <committees>
    <committee subcommittee="" code="HSIF" name="House Energy and Commerce" activity="Referral"/>
    <committee subcommittee="Environment and the Economy" code="HSIF18" name="House Energy and Commerce" activity="Referral"/>
    <committee subcommittee="" code="HSFA" name="House Foreign Affairs" activity="Referral"/>
  </committees>
  <relatedbills/>
  <subjects>
    <term name="Energy"/>
    <term name="Administrative law and regulatory procedures"/>
    <term name="Alternative and renewable resources"/>
    <term name="Climate change and greenhouse gases"/>
    <term name="Congressional oversight"/>
    <term name="Department of Energy"/>
    <term name="Electric power generation and transmission"/>
    <term name="Energy efficiency and conservation"/>
    <term name="Environmental Protection Agency (EPA)"/>
    <term name="Environmental regulatory procedures"/>
    <term name="Government studies and investigations"/>
    <term name="International law and treaties"/>
    <term name="International organizations and cooperation"/>
  </subjects>
  <amendments/>
  <summary date="2017-06-20T04:00:00Z" status="Introduced in House">Climate Solutions Act of 2017

This bill amends the Public Utility Regulatory Policies Act of 1978 by directing the Department of Energy (DOE) to promulgate regulations that require the percentage of electric energy generated from renewable sources that is sold at the retail level to increase each year beginning in 2020 so that in 2050 and each subsequent year, the percentage is at least 80%.

DOE must also promulgate regulations that set cumulative energy savings targets for retail electric energy and natural gas suppliers that require each supplier to secure annual savings that are achieved through end-use efficiency improvements at customer facilities. For electric energy suppliers, the targets must increase from .25% of sales in 2020 to 1.5% of sales in 2025 and each year thereafter through 2030. For natural gas suppliers, the target must increase from .25% of sales in 2020 to .5% of sales in 2025 and each year thereafter through 2030. DOE must allow suppliers to achieve the targets through a market-based trading system.

The Environmental Protection Agency (EPA) must promulgate annual emission reduction targets for each of 2030 through 2050 to ensure that U.S. greenhouse gas emissions: (1) in 2035 are at least 40% below those in 1990, and (2) in 2050 are at least 80% below those in 1990. The EPA must promulgate final regulations to implement those targets within 7 years and review them at least every 5 years thereafter.</summary>
  <committee-reports/>
</bill>


text:
<ion-view show-tabs>
  <ion-nav-bar class="bar-royal">
    <ion-nav-title>
      {{'Pending Proposals'|translate}}
    </ion-nav-title>
    <ion-nav-back-button>
    </ion-nav-back-button>
  </ion-nav-bar>
  <ion-content class="padding">

        <ion-spinner class="spinner-dark" icon="crescent"></ion-spinner>

Updating pending proposals. Please stand by

        No pending proposals

  </ion-content>
</ion-view>


text:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://www.netbeans.org/ns/project/1">
    <type>org.netbeans.modules.java.j2seproject</type>
    <configuration>
        <data xmlns="http://www.netbeans.org/ns/j2se-project/3">
            <name>mangopay2-java-sdk</name>
            <source-roots>
                <root id="src.dir"/>
            </source-roots>
            <test-roots>
                <root id="test.src.dir"/>
            </test-roots>
        </data>
        <spellchecker-wordlist xmlns="http://www.netbeans.org/ns/spellchecker-wordlist/1">
            <word>Enum</word>
            <word>init</word>
            <word>Url</word>
        </spellchecker-wordlist>
    </configuration>
</project>


text:
$(function(){
	'use strict';

	$.fn.extend({
		filterTable: function(){
			return this.each(function(){
				$(this).on('keyup', function(e){
					$('.filterTable_no_results').remove();
					var $this = $(this),
                        search = $this.val().toLowerCase(),
                        target = $this.attr('data-filters'),
                        $target = $(target),
                        $rows = $target.find('tbody tr');

					if(search == '') {
						$rows.show();
					} else {
						$rows.each(function(){
							var $this = $(this);
							$this.text().toLowerCase().indexOf(search) === -1 ? $this.hide() : $this.show();
						})
						if($target.find('tbody tr:visible').size() === 0) {
							var col_count = $target.find('tr').first().find('td').size();
							var no_results = $('
Nenhum Resultado foi Encontrado
')
							$target.find('tbody').append(no_results);
						}
					}
				});
			});
		}
	});

	// attach table filter plugin to inputs
	$('[data-action="filter"]').filterTable();
	$('a[title]').tooltip();
	$('[data-toggle="tooltip"]').tooltip();

	$('.container').on('click', '.panel-heading span.filter', function(e){
		var $this = $(this),
			$panel = $this.parents('.panel');

		$panel.find('.panel-body').slideToggle();
		if($this.css('display') != 'none') {
			$panel.find('.panel-body input').focus();
		}
	});

	$("#donaction").on("click", function() {
		var donationsTable = $('#dev-table');
	  	var address = 'http://127.0.0.1:8080/historicoDoador';
	  	var userData = JSON.parse(localStorage.getItem("userData"));
	  	if (userData) {
		    var formData = "cdDoador=" + userData.id;
		    $.ajax({
		        type: "POST",
		        url: address,
		        data: formData,
		        success: function(data, textStatus, jqXHR) {
		            var donationTableBody = '';
				  	data.forEach(function(row) {
				  		donationTableBody += '
';
				  		donationTableBody += '' + row.nmCampanha + '	';
				  		donationTableBody += '' + row.nmEmpresa + '	';
				  		donationTableBody += '' + row.dtInicio + '	';
				  		donationTableBody += '' + row.dtFim + '	';
				  		donationTableBody += '
';
				  	});
			  		donationsTable.find('tbody').html(donationTableBody);
		        },
		        error: function(err) {
		        	donationsTable.html('
Não foram encontradas campanhas :(
');
		        }
		    });
	  	} else {
	  		donationsTable.html('
Erro ao carregar dados do usuário. Tente novamente mais tarde.
');
	  	}
	});
});


text:
package com.google.javascript.jscomp;

import com.google.common.collect.ImmutableSet;
import com.google.javascript.jscomp.type.FlowScope;
import com.google.javascript.jscomp.type.ReverseAbstractInterpreter;
import com.google.javascript.jscomp.type.SemanticReverseAbstractInterpreter;
import com.google.javascript.rhino.Node;
import com.google.javascript.rhino.Outcome;
import com.google.javascript.rhino.Token;
import com.google.javascript.rhino.jstype.JSType;
import java.util.Arrays;
import java.util.Collection;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;

@RunWith(JUnit4.class)
public final class SemanticReverseAbstractInterpreterTest extends CompilerTypeTestCase {
  private ReverseAbstractInterpreter interpreter;
  private TypedScope functionScope;

  @Override
  @Before
  public void setUp() throws Exception {
    super.setUp();

    interpreter = new SemanticReverseAbstractInterpreter(registry);
  }

  private FlowScope[] newScope() {
    TypedScope globalScope = TypedScope.createGlobalScope(new Node(Token.ROOT));
    functionScope = new TypedScope(globalScope, new Node(Token.FUNCTION));
    return new FlowScope[] {LinkedFlowScope.createEntryLattice(compiler, functionScope)};
  }

  /** Tests reverse interpretation of a NAME expression. */
  @Test
  public void testNameCondition() {
    FlowScope[] blind = newScope();
    Node condition = createVar(blind, "a", createNullableType(getNativeStringType()));

    // true outcome.
    FlowScope informedTrue =
        interpreter.getPreciserScopeKnowingConditionOutcome(condition, blind[0], Outcome.TRUE);
    assertTypeEquals(getNativeStringType(), getVarType(informedTrue, "a"));

    // false outcome.
    FlowScope informedFalse =
        interpreter.getPreciserScopeKnowingConditionOutcome(condition, blind[0], Outcome.FALSE);
    assertTypeEquals(createNullableType(getNativeStringType()), getVarType(informedFalse, "a"));
  }

  /** Tests reverse interpretation of a NOT(NAME) expression. */
  @Test
  public void testNegatedNameCondition() {
    FlowScope[] blind = newScope();
    Node a = createVar(blind, "a", createNullableType(getNativeStringType()));
    Node condition = new Node(Token.NOT);
    condition.addChildToBack(a);

    // true outcome.
    FlowScope informedTrue =
        interpreter.getPreciserScopeKnowingConditionOutcome(condition, blind[0], Outcome.TRUE);
    assertTypeEquals(createNullableType(getNativeStringType()), getVarType(informedTrue, "a"));

    // false outcome.
    FlowScope informedFalse =
        interpreter.getPreciserScopeKnowingConditionOutcome(condition, blind[0], Outcome.FALSE);
    assertTypeEquals(getNativeStringType(), getVarType(informedFalse, "a"));
  }

  /** Tests reverse interpretation of a ASSIGN expression. */
  @Test
  public void testAssignCondition1() {
    FlowScope[] blind = newScope();
    testBinop(
        blind,
        Token.ASSIGN,
        createVar(blind, "a", createNullableType(getNativeObjectType())),
        createVar(blind, "b", createNullableType(getNativeObjectType())),
        ImmutableSet.of(
            new TypedName("a", getNativeObjectType()), new TypedName("b", getNativeObjectType())),
        ImmutableSet.of(
            new TypedName("a", getNativeNullType()), new TypedName("b", getNativeNullType())));
  }

  /** Tests reverse interpretation of a SHEQ(NAME, NUMBER) expression. */
  @Test
  public void testSheqCondition1() {
    FlowScope[] blind = newScope();
    testBinop(
        blind,
        Token.SHEQ,
        createVar(blind, "a", createUnionType(getNativeStringType(), getNativeNumberType())),
        createNumber(56),
        ImmutableSet.of(new TypedName("a", getNativeNumberType())),
        ImmutableSet.of(
            new TypedName("a", createUnionType(getNativeStringType(), getNativeNumberType()))));
  }

  /** Tests reverse interpretation of a SHEQ(NUMBER, NAME) expression. */
  @Test
  public void testSheqCondition2() {
    FlowScope[] blind = newScope();
    testBinop(
        blind,
        Token.SHEQ,
        createNumber(56),
        createVar(blind, "a", createUnionType(getNativeStringType(), getNativeNumberType())),
        ImmutableSet.of(new TypedName("a", getNativeNumberType())),
        ImmutableSet.of(
            new TypedName("a", createUnionType(getNativeStringType(), getNativeNumberType()))));
  }

  /** Tests reverse interpretation of a SHEQ(NAME, NAME) expression. */
  @Test
  public void testSheqCondition3() {
    FlowScope[] blind = newScope();
    testBinop(
        blind,
        Token.SHEQ,
        createVar(blind, "b", createUnionType(getNativeStringType(), getNativeBooleanType())),
        createVar(blind, "a", createUnionType(getNativeStringType(), getNativeNumberType())),
        ImmutableSet.of(
            new TypedName("a", getNativeStringType()), new TypedName("b", getNativeStringType())),
        ImmutableSet.of(
            new TypedName("a", createUnionType(getNativeStringType(), getNativeNumberType())),
            new TypedName("b", createUnionType(getNativeStringType(), getNativeBooleanType()))));
  }

  @Test
  public void testSheqCondition4() {
    FlowScope[] blind = newScope();
    testBinop(
        blind,
        Token.SHEQ,
        createVar(blind, "a", createUnionType(getNativeStringType(), getNativeVoidType())),
        createVar(blind, "b", createUnionType(getNativeVoidType())),
        ImmutableSet.of(
            new TypedName("a", getNativeVoidType()), new TypedName("b", getNativeVoidType())),
        ImmutableSet.of(
            new TypedName("a", getNativeStringType()), new TypedName("b", getNativeVoidType())));
  }

  @Test
  public void testSheqCondition5() {
    FlowScope[] blind = newScope();
    testBinop(
        blind,
        Token.SHEQ,
        createVar(blind, "a", createUnionType(getNativeNullType(), getNativeVoidType())),
        createVar(blind, "b", createUnionType(getNativeVoidType())),
        ImmutableSet.of(
            new TypedName("a", getNativeVoidType()), new TypedName("b", getNativeVoidType())),
        ImmutableSet.of(
            new TypedName("a", getNativeNullType()), new TypedName("b", getNativeVoidType())));
  }

  @Test
  public void testSheqCondition6() {
    FlowScope[] blind = newScope();
    testBinop(
        blind,
        Token.SHEQ,
        createVar(blind, "a", createUnionType(getNativeStringType(), getNativeVoidType())),
        createVar(blind, "b", createUnionType(getNativeNumberType(), getNativeVoidType())),
        ImmutableSet.of(
            new TypedName("a", getNativeVoidType()), new TypedName("b", getNativeVoidType())),
        ImmutableSet.of(
            new TypedName("a", createUnionType(getNativeStringType(), getNativeVoidType())),
            new TypedName("b", createUnionType(getNativeNumberType(), getNativeVoidType()))));
  }

  /** Tests reverse interpretation of a SHNE(NAME, NUMBER) expression. */
  @Test
  public void testShneCondition1() {
    FlowScope[] blind = newScope();
    testBinop(
        blind,
        Token.SHNE,
        createVar(blind, "a", createUnionType(getNativeStringType(), getNativeNumberType())),
        createNumber(56),
        ImmutableSet.of(
            new TypedName("a", createUnionType(getNativeStringType(), getNativeNumberType()))),
        ImmutableSet.of(new TypedName("a", getNativeNumberType())));
  }

  /** Tests reverse interpretation of a SHNE(NUMBER, NAME) expression. */
  @Test
  public void testShneCondition2() {
    FlowScope[] blind = newScope();
    testBinop(
        blind,
        Token.SHNE,
        createNumber(56),
        createVar(blind, "a", createUnionType(getNativeStringType(), getNativeNumberType())),
        ImmutableSet.of(
            new TypedName("a", createUnionType(getNativeStringType(), getNativeNumberType()))),
        ImmutableSet.of(new TypedName("a", getNativeNumberType())));
  }

  /** Tests reverse interpretation of a SHNE(NAME, NAME) expression. */
  @Test
  public void testShneCondition3() {
    FlowScope[] blind = newScope();
    testBinop(
        blind,
        Token.SHNE,
        createVar(blind, "b", createUnionType(getNativeStringType(), getNativeBooleanType())),
        createVar(blind, "a", createUnionType(getNativeStringType(), getNativeNumberType())),
        ImmutableSet.of(
            new TypedName("a", createUnionType(getNativeStringType(), getNativeNumberType())),
            new TypedName("b", createUnionType(getNativeStringType(), getNativeBooleanType()))),
        ImmutableSet.of(
            new TypedName("a", getNativeStringType()), new TypedName("b", getNativeStringType())));
  }

  @Test
  public void testShneCondition4() {
    FlowScope[] blind = newScope();
    testBinop(
        blind,
        Token.SHNE,
        createVar(blind, "a", createUnionType(getNativeStringType(), getNativeVoidType())),
        createVar(blind, "b", createUnionType(getNativeVoidType())),
        ImmutableSet.of(
            new TypedName("a", getNativeStringType()), new TypedName("b", getNativeVoidType())),
        ImmutableSet.of(
            new TypedName("a", getNativeVoidType()), new TypedName("b", getNativeVoidType())));
  }

  @Test
  public void testShneCondition5() {
    FlowScope[] blind = newScope();
    testBinop(
        blind,
        Token.SHNE,
        createVar(blind, "a", createUnionType(getNativeNullType(), getNativeVoidType())),
        createVar(blind, "b", createUnionType(getNativeNullType())),
        ImmutableSet.of(
            new TypedName("a", getNativeVoidType()), new TypedName("b", getNativeNullType())),
        ImmutableSet.of(
            new TypedName("a", getNativeNullType()), new TypedName("b", getNativeNullType())));
  }

  @Test
  public void testShneCondition6() {
    FlowScope[] blind = newScope();
    testBinop(
        blind,
        Token.SHNE,
        createVar(blind, "a", createUnionType(getNativeStringType(), getNativeVoidType())),
        createVar(blind, "b", createUnionType(getNativeNumberType(), getNativeVoidType())),
        ImmutableSet.of(
            new TypedName("a", createUnionType(getNativeStringType(), getNativeVoidType())),
            new TypedName("b", createUnionType(getNativeNumberType(), getNativeVoidType()))),
        ImmutableSet.of(
            new TypedName("a", getNativeVoidType()), new TypedName("b", getNativeVoidType())));
  }

  /** Tests reverse interpretation of a EQ(NAME, NULL) expression. */
  @Test
  public void testEqCondition1() {
    FlowScope[] blind = newScope();
    testBinop(
        blind,
        Token.EQ,
        createVar(blind, "a", createUnionType(getNativeBooleanType(), getNativeVoidType())),
        createNull(),
        ImmutableSet.of(new TypedName("a", getNativeVoidType())),
        ImmutableSet.of(new TypedName("a", getNativeBooleanType())));
  }

  /** Tests reverse interpretation of a NE(NULL, NAME) expression. */
  @Test
  public void testEqCondition2() {
    FlowScope[] blind = newScope();
    testBinop(
        blind,
        Token.NE,
        createNull(),
        createVar(blind, "a", createUnionType(getNativeBooleanType(), getNativeVoidType())),
        ImmutableSet.of(new TypedName("a", getNativeBooleanType())),
        ImmutableSet.of(new TypedName("a", getNativeVoidType())));
  }

  /** Tests reverse interpretation of a EQ(NAME, NULL) expression. */
  @Test
  public void testEqCondition3() {
    FlowScope[] blind = newScope();
    // (number,undefined,null)
    JSType nullableOptionalNumber =
        createUnionType(getNativeNullType(), getNativeVoidType(), getNativeNumberType());
    // (null,undefined)
    JSType nullUndefined = createUnionType(getNativeVoidType(), getNativeNullType());
    testBinop(
        blind,
        Token.EQ,
        createVar(blind, "a", nullableOptionalNumber),
        createNull(),
        ImmutableSet.of(new TypedName("a", nullUndefined)),
        ImmutableSet.of(new TypedName("a", getNativeNumberType())));
  }

  /** Tests reverse interpretation of two undefineds. */
  @Test
  public void testEqCondition4() {
    FlowScope[] blind = newScope();
    testBinop(
        blind,
        Token.EQ,
        createVar(blind, "a", getNativeVoidType()),
        createVar(blind, "b", getNativeVoidType()),
        ImmutableSet.of(
            new TypedName("a", getNativeVoidType()), new TypedName("b", getNativeVoidType())),
        ImmutableSet.of(
            new TypedName("a", getNativeNoType()), new TypedName("b", getNativeNoType())));
  }

  /**
   * Tests reverse interpretation of a COMPARE(NAME, NUMBER) expression, where COMPARE can be LE,
   * LT, GE or GT.
   */
  @Test
  public void testInequalitiesCondition1() {
    for (Token op : Arrays.asList(Token.LT, Token.GT, Token.LE, Token.GE)) {
      FlowScope[] blind = newScope();
      testBinop(
          blind,
          op,
          createVar(blind, "a", createUnionType(getNativeStringType(), getNativeVoidType())),
          createNumber(8),
          ImmutableSet.of(new TypedName("a", getNativeStringType())),
          ImmutableSet.of(
              new TypedName("a", createUnionType(getNativeStringType(), getNativeVoidType()))));
    }
  }

  /**
   * Tests reverse interpretation of a COMPARE(NAME, NAME) expression, where COMPARE can be LE, LT,
   * GE or GT.
   */
  @Test
  public void testInequalitiesCondition2() {
    for (Token op : Arrays.asList(Token.LT, Token.GT, Token.LE, Token.GE)) {
      FlowScope[] blind = newScope();
      testBinop(
          blind,
          op,
          createVar(
              blind,
              "a",
              createUnionType(getNativeStringType(), getNativeNumberType(), getNativeVoidType())),
          createVar(blind, "b", createUnionType(getNativeNumberType(), getNativeNullType())),
          ImmutableSet.of(
              new TypedName("a", createUnionType(getNativeStringType(), getNativeNumberType())),
              new TypedName("b", createUnionType(getNativeNumberType(), getNativeNullType()))),
          ImmutableSet.of(
              new TypedName(
                  "a",
                  createUnionType(
                      getNativeStringType(), getNativeNumberType(), getNativeVoidType())),
              new TypedName("b", createUnionType(getNativeNumberType(), getNativeNullType()))));
    }
  }

  /**
   * Tests reverse interpretation of a COMPARE(NUMBER-untyped, NAME) expression, where COMPARE can
   * be LE, LT, GE or GT.
   */
  @Test
  public void testInequalitiesCondition3() {
    for (Token op : Arrays.asList(Token.LT, Token.GT, Token.LE, Token.GE)) {
      FlowScope[] blind = newScope();
      testBinop(
          blind,
          op,
          createUntypedNumber(8),
          createVar(blind, "a", createUnionType(getNativeStringType(), getNativeVoidType())),
          ImmutableSet.of(new TypedName("a", getNativeStringType())),
          ImmutableSet.of(
              new TypedName("a", createUnionType(getNativeStringType(), getNativeVoidType()))));
    }
  }

  @Test
  public void testAnd() {
    FlowScope[] blind = newScope();
    testBinop(
        blind,
        Token.AND,
        createVar(blind, "b", createUnionType(getNativeStringType(), getNativeNullType())),
        createVar(blind, "a", createUnionType(getNativeNumberType(), getNativeVoidType())),
        ImmutableSet.of(
            new TypedName("a", getNativeNumberType()), new TypedName("b", getNativeStringType())),
        ImmutableSet.of(
            new TypedName("a", createUnionType(getNativeNumberType(), getNativeVoidType())),
            new TypedName("b", createUnionType(getNativeStringType(), getNativeNullType()))));
  }

  @Test
  public void testTypeof1() {
    FlowScope[] blind = newScope();
    testBinop(
        blind,
        Token.EQ,
        new Node(Token.TYPEOF, createVar(blind, "a", getNativeObjectType())),
        Node.newString("function"),
        ImmutableSet.of(new TypedName("a", getNativeFunctionType())),
        ImmutableSet.of(new TypedName("a", getNativeObjectType())));
  }

  @Test
  public void testTypeof2() {
    FlowScope[] blind = newScope();
    testBinop(
        blind,
        Token.EQ,
        new Node(Token.TYPEOF, createVar(blind, "a", getNativeAllType())),
        Node.newString("function"),
        ImmutableSet.of(new TypedName("a", getNativeFunctionType())),
        ImmutableSet.of(new TypedName("a", getNativeAllType())));
  }

  @Test
  public void testTypeof3() {
    FlowScope[] blind = newScope();
    testBinop(
        blind,
        Token.EQ,
        new Node(Token.TYPEOF, createVar(blind, "a", getNativeObjectNumberStringBooleanType())),
        Node.newString("function"),
        ImmutableSet.of(new TypedName("a", getNativeFunctionType())),
        ImmutableSet.of(new TypedName("a", getNativeObjectNumberStringBooleanType())));
  }

  @Test
  public void testTypeof4() {
    FlowScope[] blind = newScope();
    testBinop(
        blind,
        Token.EQ,
        new Node(
            Token.TYPEOF,
            createVar(
                blind,
                "a",
                createUnionType(getNativeFunctionType(), getNativeNumberStringBooleanType()))),
        Node.newString("function"),
        ImmutableSet.of(new TypedName("a", getNativeFunctionType())),
        ImmutableSet.of(new TypedName("a", getNativeNumberStringBooleanType())));
  }

  @Test
  public void testInstanceOf() {
    FlowScope[] blind = newScope();
    testBinop(
        blind,
        Token.INSTANCEOF,
        createVar(blind, "x", getNativeUnknownType()),
        createVar(blind, "s", getNativeStringObjectConstructorType()),
        ImmutableSet.of(
            new TypedName("x", getNativeStringObjectType()),
            new TypedName("s", getNativeStringObjectConstructorType())),
        ImmutableSet.of(new TypedName("s", getNativeStringObjectConstructorType())));
  }

  @Test
  public void testInstanceOf2() {
    FlowScope[] blind = newScope();
    testBinop(
        blind,
        Token.INSTANCEOF,
        createVar(
            blind, "x", createUnionType(getNativeStringObjectType(), getNativeNumberObjectType())),
        createVar(blind, "s", getNativeStringObjectConstructorType()),
        ImmutableSet.of(
            new TypedName("x", getNativeStringObjectType()),
            new TypedName("s", getNativeStringObjectConstructorType())),
        ImmutableSet.of(
            new TypedName("x", getNativeNumberObjectType()),
            new TypedName("s", getNativeStringObjectConstructorType())));
  }

  @Test
  public void testInstanceOf3() {
    FlowScope[] blind = newScope();
    testBinop(
        blind,
        Token.INSTANCEOF,
        createVar(blind, "x", getNativeObjectType()),
        createVar(blind, "s", getNativeStringObjectConstructorType()),
        ImmutableSet.of(
            new TypedName("x", getNativeStringObjectType()),
            new TypedName("s", getNativeStringObjectConstructorType())),
        ImmutableSet.of(
            new TypedName("x", getNativeObjectType()),
            new TypedName("s", getNativeStringObjectConstructorType())));
  }

  @Test
  public void testInstanceOf4() {
    FlowScope[] blind = newScope();
    testBinop(
        blind,
        Token.INSTANCEOF,
        createVar(blind, "x", getNativeAllType()),
        createVar(blind, "s", getNativeStringObjectConstructorType()),
        ImmutableSet.of(
            new TypedName("x", getNativeStringObjectType()),
            new TypedName("s", getNativeStringObjectConstructorType())),
        ImmutableSet.of(new TypedName("s", getNativeStringObjectConstructorType())));
  }

  private void testBinop(
      FlowScope[] blind,
      Token binop,
      Node left,
      Node right,
      Collection<TypedName> trueOutcome,
      Collection<TypedName> falseOutcome) {
    Node condition = new Node(binop);
    condition.addChildToBack(left);
    condition.addChildToBack(right);

    // true outcome.
    FlowScope informedTrue =
        interpreter.getPreciserScopeKnowingConditionOutcome(condition, blind[0], Outcome.TRUE);
    for (TypedName p : trueOutcome) {
      assertTypeEquals(p.name, p.type, getVarType(informedTrue, p.name));
    }

    // false outcome.
    FlowScope informedFalse =
        interpreter.getPreciserScopeKnowingConditionOutcome(condition, blind[0], Outcome.FALSE);
    for (TypedName p : falseOutcome) {
      assertTypeEquals(p.type, getVarType(informedFalse, p.name));
    }
  }

  private Node createNull() {
    Node n = new Node(Token.NULL);
    n.setJSType(getNativeNullType());
    return n;
  }

  private Node createNumber(int n) {
    Node number = createUntypedNumber(n);
    number.setJSType(getNativeNumberType());
    return number;
  }

  private Node createUntypedNumber(int n) {
    return Node.newNumber(n);
  }

  private JSType getVarType(FlowScope scope, String name) {
    return scope.getSlot(name).getType();
  }

  private Node createVar(FlowScope[] scope, String name, JSType type) {
    Node n = Node.newString(Token.NAME, name);
    functionScope.declare(name, n, null, null, true);
    scope[0] = scope[0].inferSlotType(name, type);
    n.setJSType(type);
    return n;
  }

  private static class TypedName {
    private final String name;
    private final JSType type;

    private TypedName(String name, JSType type) {
      this.name = name;
      this.type = type;
    }
  }
}


text:
(function() {
  'use strict';

  angular
    .module('ars')
    .provider('ars', arsProvider);

  arsProvider.$inject = ['$httpProvider'];

  /**
   * The provider that is run at the config phase
   * of Angular lifecycle.
   */
  function arsProvider($httpProvider) {
    /* jshint validthis:true */

    var providerConfig = {
      defaultBaseUrl: '',
      defaultErrorResponseTransformer: null,
      defaultRequestTransformer: null,
      defaultResponseTransformer: null
    };

    this.$get = arsFactory;
    this.getDefaultBaseUrl = getDefaultBaseUrl;
    this.setDefaultBaseUrl = setDefaultBaseUrl;
    this.setDefaultHeaders = setDefaultHeaders;

    arsFactory.$inject = ['$http'];

    /**
     * Factory which is run at run phase
     * of Angular lifecycle.
     * @param  {Object} $http Injected $http object
     * @return {Object} The factory object
     */
    function arsFactory($http) {
      var factory = {
        delete: prepareDeleteRequest,
        get: prepareGetRequest,
        patch: preparePatchRequest,
        put: preparePutRequest,
        post: preparePostRequest,
        setDefaultErrorResponseTransformer: setDefaultErrorResponseTransformer,
        setDefaultRequestTransformer: setDefaultRequestTransformer,
        setDefaultResponseTransformer: setDefaultResponseTransformer
      };

      return factory;

      /**
       * Appends the default request/response transformations
       * to the new request/response transformation
       * @param  {(Array|Function)} defaults The default request/response transformation(s)
       * @param  {Function} transform The new request/response transformation
       * @return {Array}
       */
      function appendDefaultTransform(defaults, transform) {
        // We can't guarantee that the default transformation is an array
        defaults = angular.isArray(defaults) ? defaults : [defaults];
        // Append the new transformation to the defaults
        return defaults.concat(transform);
      }

      /**
       * Perform the HTTP request via Angular $http
       * @return {Object} Promise object
       */
      function performRequest() {
        var requestObj = this;

        var httpConfig = {
          method: requestObj._config.httpMethod.toUpperCase(),
          transformRequest: appendDefaultTransform(
            $http.defaults.transformRequest,
            function(value) {
              return requestObj._config.requestTransformer ?
                angular.toJson(
                  requestObj._config.requestTransformer.transform(angular.fromJson(value))
                ) :
                (
                  providerConfig.defaultRequestTransformer ?
                  angular.toJson(
                    providerConfig.defaultRequestTransformer.transform(angular.fromJson(value))
                  ) :
                  value
                );
            }
          ),
          transformResponse: appendDefaultTransform(
            $http.defaults.transformResponse,
            function(value, headers, status) {
              var responseTransformer, defaultResponseTransformer;
              if (status >= 400 && status < 500) {
                responseTransformer = requestObj._config.errorResponseTransformer;
                defaultResponseTransformer = providerConfig.defaultErrorResponseTransformer;
              } else {
                responseTransformer = requestObj._config.responseTransformer;
                defaultResponseTransformer = providerConfig.defaultResponseTransformer;
              }
              return responseTransformer ?
                responseTransformer.transform(value) :
                (defaultResponseTransformer ? defaultResponseTransformer.transform(value) : value);
            }
          ),
          url: requestObj._config.baseUrl + requestObj._config.relativeUrl
        };

        if (requestObj._config.cache !== null) {
          httpConfig.cache = requestObj._config.cache;
        }

        if (requestObj._config.headers) {
          httpConfig.headers = requestObj._config.headers;
        }

        if (requestObj._config.requestData) {
          var httpConfigProperty = httpConfig.method == 'GET' ? 'params' : 'data';
          httpConfig[httpConfigProperty] = requestObj._config.requestData;
        }

        return $http(httpConfig);
      }

      /**
       * Creates an API request object ready
       * to make the http request
       * @param  {string} relativeUrl The relative url part of the API call
       * @param  {string} httpMethod The http method for the request e.g. "get" or "post"
       * @param  {Object} requestData (Optional) The data to send as part of the request
       * @return {Object} The request object
       */
      function prepareApiRequest(relativeUrl, httpMethod, requestData) {
        var requestObjConfig = {
          baseUrl: providerConfig.defaultBaseUrl,
          cache: null,
          errorResponseTransformer: null,
          headers: null,
          httpMethod: httpMethod,
          relativeUrl: relativeUrl,
          requestData: requestData,
          requestTransformer: null,
          responseTransformer: null
        };

        return {
          _config: requestObjConfig,
          request: performRequest,
          setBaseUrl: setBaseUrl,
          setCache: setCache,
          setErrorResponseTransformer: setErrorResponseTransformer,
          setHeaders: setHeaders,
          setRequestTransformer: setRequestTransformer,
          setResponseTransformer: setResponseTransformer
        };
      }

      /**
       * Prepare an HTTP DELETE request
       * @param  {string} relativeUrl The relative url part of the API call
       * @param  {Object} requestData (Optional) The data to send for the API request
       * @return {Object} The request object
       */
      function prepareDeleteRequest(relativeUrl, requestData) {
        return prepareApiRequest(relativeUrl, 'delete', requestData);
      }

      /**
       * Prepare an HTTP GET request
       * @param  {string} relativeUrl The relative url part of the API call
       * @param  {Object} requestData (Optional) The data to send for the API request
       * @return {Object} The request object
       */
      function prepareGetRequest(relativeUrl, requestData) {
        return prepareApiRequest(relativeUrl, 'get', requestData);
      }

      /**
       * Prepare an HTTP PATCH request
       * @param  {string} relativeUrl The relative url part of the API call
       * @param  {Object} requestData (Optional) The data to send for the API request
       * @return {Object} The request object
       */
      function preparePatchRequest(relativeUrl, requestData) {
        return prepareApiRequest(relativeUrl, 'patch', requestData);
      }

      /**
       * Prepare an HTTP POST request
       * @param  {string} relativeUrl The relative url part of the API call
       * @param  {Object} requestData (Optional) The data to send for the API request
       * @return {Object} The request object
       */
      function preparePostRequest(relativeUrl, requestData) {
        return prepareApiRequest(relativeUrl, 'post', requestData);
      }

      /**
       * Prepare an HTTP PUT request
       * @param  {string} relativeUrl The relative url part of the API call
       * @param  {Object} requestData (Optional) The data to send for the API request
       * @return {Object} The request object
       */
      function preparePutRequest(relativeUrl, requestData) {
        return prepareApiRequest(relativeUrl, 'put', requestData);
      }

      /**
       * Sets the base url for the request
       * @param {string} baseUrl The base url
       */
      function setBaseUrl(baseUrl) {
        this._config.baseUrl = baseUrl;
        return this;
      }

      /**
       * Set the cache for the request
       * @param {(boolean|Object)} cache  If true, a default $http cache will be used to cache the GET
       * request, otherwise if a cache instance built with $cacheFactory, this cache will be used for caching.
       * @return {Object} The request object
       */
      function setCache(cache) {
        this._config.cache = cache;
        return this;
      }

      /**
       * Sets the default error response transformer for all future requests
       * Note: The default error response transformer MUST have a method
       * named 'transform' defined to handle the transformation
       * @return {Object} The factory object
       */
      function setDefaultErrorResponseTransformer(defaultErrorResponseTransformer) {
        providerConfig.defaultErrorResponseTransformer = defaultErrorResponseTransformer;
        return this;
      }

      /**
       * Sets the default request transformer for all future requests
       * Note: The default request transformer MUST have a method
       * named 'transform' defined to handle the transformation
       * @return {Object} The factory object
       */
      function setDefaultRequestTransformer(defaultRequestTransformer) {
        providerConfig.defaultRequestTransformer = defaultRequestTransformer;
        return this;
      }

      /**
       * Sets the default response transformer for all future requests
       * Note: The default response transformer MUST have a method
       * named 'transform' defined to handle the transformation
       * @return {Object} The factory object
       */
      function setDefaultResponseTransformer(defaultResponseTransformer) {
        providerConfig.defaultResponseTransformer = defaultResponseTransformer;
        return this;
      }

      /**
       * Sets the error response transformer for the request
       * Note: The error response transformer MUST have a method
       * named 'transform' defined to handle the transformation
       * @return {Object} The request object
       */
      function setErrorResponseTransformer(errorResponseTransformer) {
        this._config.errorResponseTransformer = errorResponseTransformer;
        return this;
      }

      /**
       * Set the HTTP headers to send for the request
       * @param {Object} headers Map of strings or functions which return strings representing
       * HTTP headers to send to the server. If the return value of a function is null, the
       * header will not be sent. Functions accept a config object as an argument.
       * @return {Object} The request object
       */
      function setHeaders(headers) {
        this._config.headers = headers;
        return this;
      }

      /**
       * Sets the request transformer for the request
       * Note: The request transformer MUST have a method
       * named 'transform' defined to handle the transformation
       * @return {Object} The request object
       */
      function setRequestTransformer(requestTransformer) {
        this._config.requestTransformer = requestTransformer;
        return this;
      }

      /**
       * Sets the response transformer for the request
       * Note: The response transformer MUST have a method
       * named 'transform' defined to handle the transformation
       * @return {Object} The request object
       */
      function setResponseTransformer(responseTransformer) {
        this._config.responseTransformer = responseTransformer;
        return this;
      }

    }

    /**
     * Get the default base url currently set
     * @return {string} The base url
     */
    function getDefaultBaseUrl() {
      return providerConfig.defaultBaseUrl;
    }

    /**
     * Sets the default base url to be used for all requests
     * @param {string} baseUrl The base url
     */
    function setDefaultBaseUrl(baseUrl) {
      providerConfig.defaultBaseUrl = baseUrl;
    }

    /**
     * Set the default HTTP headers to send for all requests
     * @param {Object} headers Map of strings or functions which return strings representing
     * HTTP headers to send to the server. If the return value of a function is null, the
     * header will not be sent. Functions accept a config object as an argument.
     * @param  {string} httpMethod (Optional) When an httpMethod is set, the headers will
     * only be applied to http requests of that type. If ommited, it will be applied to all
     * requests.
     */
    function setDefaultHeaders(headers, httpMethod) {
      if (typeof(httpMethod) === 'undefined') {
        $httpProvider.defaults.headers.patch = {};
        $httpProvider.defaults.headers.post = {};
        $httpProvider.defaults.headers.put = {};
        httpMethod = 'common';
      }
      $httpProvider.defaults.headers[httpMethod.toLowerCase()] = headers;
    }
  }
})();


text:
<html>
  <head>
    <script src="/node_modules/systemjs/dist/system.src.js"></script>
    <script src="/node_modules/reflect-metadata/Reflect.js"></script>
    <script src="/node_modules/zone.js/dist/zone.js"></script>
    <script src="../system.config.js"></script>
  </head>
  <body>
    <app></app>
    <script>
      System.import('./firebase_object_example.js');
    </script>
  </body>
</html>


text:
namespace sync_pb {
class DebugInfo;
}  // namespace sync_pb

namespace syncer {

namespace sessions {
class DebugInfoGetter;
class StatusController;
class SyncSession;
}  // namespace sessions

namespace download {

// Generic initialization of a GetUpdates message.
SYNC_EXPORT_PRIVATE void InitDownloadUpdatesContext(
    sessions::SyncSession* session,
    bool create_mobile_bookmarks_folder,
    sync_pb::ClientToServerMessage* message);

// Sends the specified message to the server and stores the response in a member
// of the |session|'s StatusController.
SYNC_EXPORT_PRIVATE SyncerError
    ExecuteDownloadUpdates(ModelTypeSet request_types,
                           sessions::SyncSession* session,
                           GetUpdatesProcessor* get_updates_processor,
                           sync_pb::ClientToServerMessage* msg);

// Helper function for processing responses from the server.
// Defined here for testing.
SYNC_EXPORT_PRIVATE SyncerError ProcessResponse(
    const sync_pb::GetUpdatesResponse& gu_response,
    ModelTypeSet proto_request_types,
    GetUpdatesProcessor* get_updates_processor,
    sessions::StatusController* status);

// Helper function to copy client debug info from debug_info_getter to
// debug_info.  Defined here for testing.
SYNC_EXPORT_PRIVATE void CopyClientDebugInfo(
    sessions::DebugInfoGetter* debug_info_getter,
    sync_pb::DebugInfo* debug_info);

}  // namespace download

}  // namespace syncer

#endif  // SYNC_ENGINE_DOWNLOAD_H_


text:
===========
CWR grammar
===========

This section contains a more detailed view of how is the grammar for CWR files
created.

.. toctree::
   :maxdepth: 1

   rules
   config_dsl


text:
declare namespace Jymfony.Component.Autoloader.Parser.AST {
    export class ClassMemberInterface extends NodeInterface.definition implements MixinInterface {
        public static readonly definition: Newable<ClassMemberInterface>;

        /**
         * Compiles the decorators.
         * Code to be appended should be returned as an array of statements.
         */
        compileDecorators(compiler: Compiler, target: Class, id: Identifier): StatementInterface[];
    }
}


text:
@protocol BPTimerWeakDelegate;
@interface BPTimer : NSObject

+ (instancetype)defaultTimer;

@property (nonatomic, weak) id<BPTimerWeakDelegate> weakDelegate;

- (void)start;
- (void)stop;
@end

@protocol BPTimerWeakDelegate <NSObject>

- (void)timerFired:(NSTimer *)timer;
@end


text:
package org.hisp.dhis.validationrule.action;

import com.opensymphony.xwork2.Action;

/**
 * @author Margrethe Store
 * @version $Id: NoAction.java 3868 2007-11-08 15:11:12Z larshelg $
 */
public class NoAction
    implements Action
{
    @Override
    public String execute() throws Exception
    {
        return SUCCESS;
    }
}


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<title>CvANN_MLP_TrainParams</title>
<meta name="date" content="2015-06-02">
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

org.opencv.ml

Class CvANN_MLP_TrainParams

java.lang.Object

org.opencv.ml.CvANN_MLP_TrainParams

public class CvANN_MLP_TrainParams
extends java.lang.Object

Parameters of the MLP training algorithm. You can initialize the structure by
 a constructor or the individual parameters can be adjusted after the
 structure is created.

The back-propagation algorithm parameters:

Strength of the weight gradient term. The recommended value is about 0.1.

Strength of the momentum term (the difference between weights on the 2
 previous iterations). This parameter provides some inertia to smooth the
 random fluctuations of the weights. It can vary from 0 (the feature is
 disabled) to 1 and beyond. The value 0.1 or so is good enough

// C++ code:

The RPROP algorithm parameters (see [RPROP93] for details):

Initial value Delta_0 of update-values Delta_(ij).

Increase factor eta^+. It must be >1.

Decrease factor eta^-. It must be <1.

Update-values lower limit Delta_(min). It must be positive.

Update-values upper limit Delta_(max). It must be >1.

See Also:

org.opencv.ml.CvANN_MLP_TrainParams

Field Summary

Fields

Modifier and Type
Field and Description

static int
BACKPROP

protected long
nativeObj

static int
RPROP

Constructor Summary

Constructors

Modifier
Constructor and Description

CvANN_MLP_TrainParams()

The constructors.

protected
CvANN_MLP_TrainParams(long addr)

Method Summary

All Methods Instance Methods Concrete Methods

Modifier and Type
Method and Description

protected void
finalize()

double
get_bp_dw_scale()

double
get_bp_moment_scale()

double
get_rp_dw_max()

double
get_rp_dw_min()

double
get_rp_dw_minus()

double
get_rp_dw_plus()

double
get_rp_dw0()

TermCriteria
get_term_crit()

int
get_train_method()

void
set_bp_dw_scale(double bp_dw_scale)

void
set_bp_moment_scale(double bp_moment_scale)

void
set_rp_dw_max(double rp_dw_max)

void
set_rp_dw_min(double rp_dw_min)

void
set_rp_dw_minus(double rp_dw_minus)

void
set_rp_dw_plus(double rp_dw_plus)

void
set_rp_dw0(double rp_dw0)

void
set_term_crit(TermCriteria term_crit)

void
set_train_method(int train_method)

Methods inherited from class java.lang.Object

clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

nativeObj

protected final long nativeObj

BACKPROP

public static final int BACKPROP

See Also:

Constant Field Values

RPROP

public static final int RPROP

See Also:

Constant Field Values

Constructor Detail

CvANN_MLP_TrainParams

protected CvANN_MLP_TrainParams(long addr)

CvANN_MLP_TrainParams

public CvANN_MLP_TrainParams()

The constructors.

By default the RPROP algorithm is used:

// C++ code:

CvANN_MLP_TrainParams.CvANN_MLP_TrainParams()

term_crit = cvTermCriteria(CV_TERMCRIT_ITER + CV_TERMCRIT_EPS, 1000, 0.01);

train_method = RPROP;

bp_dw_scale = bp_moment_scale = 0.1;

rp_dw0 = 0.1; rp_dw_plus = 1.2; rp_dw_minus = 0.5;

rp_dw_min = FLT_EPSILON; rp_dw_max = 50.;

See Also:

org.opencv.ml.CvANN_MLP_TrainParams.CvANN_MLP_TrainParams

Method Detail

get_term_crit

public TermCriteria get_term_crit()

set_term_crit

public void set_term_crit(TermCriteria term_crit)

get_train_method

public int get_train_method()

set_train_method

public void set_train_method(int train_method)

get_bp_dw_scale

public double get_bp_dw_scale()

set_bp_dw_scale

public void set_bp_dw_scale(double bp_dw_scale)

get_bp_moment_scale

public double get_bp_moment_scale()

set_bp_moment_scale

public void set_bp_moment_scale(double bp_moment_scale)

get_rp_dw0

public double get_rp_dw0()

set_rp_dw0

public void set_rp_dw0(double rp_dw0)

get_rp_dw_plus

public double get_rp_dw_plus()

set_rp_dw_plus

public void set_rp_dw_plus(double rp_dw_plus)

get_rp_dw_minus

public double get_rp_dw_minus()

set_rp_dw_minus

public void set_rp_dw_minus(double rp_dw_minus)

get_rp_dw_min

public double get_rp_dw_min()

set_rp_dw_min

public void set_rp_dw_min(double rp_dw_min)

get_rp_dw_max

public double get_rp_dw_max()

set_rp_dw_max

public void set_rp_dw_max(double rp_dw_max)

finalize

protected void finalize()
                 throws java.lang.Throwable

Overrides:

finalize in class java.lang.Object

Throws:

java.lang.Throwable

Skip navigation links

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method


text:
SET ACCESS *

            TAGS

            <ui-select multiple ng-model="vm.tags" theme="bootstrap" on-select="vm.changed = true"
                       on-remove="vm.changed = true" tagging tagging-label="">
                <ui-select-match placeholder="Add tags...">{{ $item }}</ui-select-match>
                <ui-select-choices ui-disable-choice="tag == 'any' || tag == 'anonymous'"
                                   repeat="tag as tag in vm.availableTags | filter: $select.search">

                </ui-select-choices>
                <ui-select-no-choice>Type to add a new tag</ui-select-no-choice>
            </ui-select>

    <button ng-disabled="!vm.changed" class="btn btn-primary btn-sm" type="button" ng-click="vm.save()">OK</button>
    <button class="btn btn-warning btn-sm" type="button" ng-click="vm.cancel()">CANCEL</button>


text:
package iso20022

// Choice between a standard code or a proprietary code to specify the type of fraction disposition.
type FractionDispositionType29Choice struct {

	// Specifies how fractions resulting from derived securities will be processed or how prorated decisions will be rounding, if provided with a pro ration rate.
	Code *FractionDispositionType10Code `xml:"Cd"`

	// Proprietary identification of the type of fraction disposition.
	Proprietary *GenericIdentification47 `xml:"Prtry"`
}

func (f *FractionDispositionType29Choice) SetCode(value string) {
	f.Code = (*FractionDispositionType10Code)(&value)
}

func (f *FractionDispositionType29Choice) AddProprietary() *GenericIdentification47 {
	f.Proprietary = new(GenericIdentification47)
	return f.Proprietary
}


text:
fields = {
   product_available_on: "Укажите, начиная с какой даты товар станет
доступен в публичной части магазина.",
   product_permalink: "Часть URL, по которой данный товар будет доступен (постоянная ссылка, SEO-атрибут).
Допустимые символы: буквы и цифры латинского алфавита (любой регистр), знак подчеркивания \"-\", знак минуса \"-\".",
   product_prototype_id: "Заранее определенный набор свойств товара.
Позволяет существенно сэкономить время при
добавлении товаров с одинаковыми наборами свойств.
Прототипы задаются в меню \"Товары\" – \"Прототипы\"",
   product_price: "Дробная часть отделяется точкой.",
   product_shipping_category_id: "Набор способов доставки, применимых к данному товару.
Определяется в меню \"Конфигурация\" –
\"Способы доставки\" – \"Категории доставки\"",
   product_tax_category_id: "Набор налоговых ставок, применимых к данному товару.
Определяется в меню \"Конфигурация\" –
\"Налоговые ставки\" – \"Категории налогов\"",
   option_type_name: "Для внутреннего использования в административном интерфейсе.",
   option_type_presentation: "Для отображения в магазине.",
   property_name: "Для внутреннего использования в административном интерфейсе.",
   property_presentation: "Для отображения в магазине.",
   prototype_name: "Для внутреннего использования в административном интерфейсе.
Старайтесь, чтобы название прототипа отражало товар, к которому
он будет применяться.",
   product_group_name: "Для внутреннего использования в административном интерфейсе.",
   product_group_order_scope: "Порядок, в котором товары данной группы
будут отображаться в магазине.",
   preferences_site_name: "Отображается в title всех страниц, а также
в теме email-уведомлений пользователям и т.п.",
   preferences_default_seo_title: "Добавляется к названию магазина в
title главной и текстовых страниц.",
   adjustment_amount: "Чтобы сделать скидку, установите отрицательное значение.",
   zone_name: "Для внутреннего использования в административном интерфейсе.",
   zone_description: "Для отображения в магазине.",
   payment_method_name: "Для отображения в магазине.",
   payment_method_description: "Дополнительное описание, показывается покупателю
на шаге выбора способа оплаты.",
   payment_method_display_on: "Везде: способ будет доступен как покупателю, так и администратору.
В публичном интерфейсе: способ будет доступен только покупателю.
В административном интерфейсе: способ будет доступен только администратору при редактировании заказа вручную.",
   taxonomy_name: "Для отображения в магазине.",
   shipping_method_display_on: "Везде: способ будет доступен как покупателю, так и администратору.
В публичном интерфейсе: способ будет доступен только покупателю.
В административном интерфейсе: способ будет доступен только администратору при редактировании заказа вручную.",
   shipping_method_name: "Для отображения в магазине.",
   promotion_name: "Для отображения в магазине.",
   promotion_usage_limit: "Максимальное число использований данной акции.",
   page_slug: "Часть URL, по которой данная страница будет доступна (постоянная ссылка, SEO-атрибут).
Допустимые символы: буквы и цифры латинского алфавита (любой регистр), знак подчеркивания \"-\", знак минуса \"-\".",
   page_position: "Порядок отображения страницы относительно других страниц в одном меню.",
   page_layout: "Название макета для страниц с нестандартным макетом.",
   page_visible: "Если включено, страница будет видна покупателям.",
   page_foreign_link: "Если задано, данная ссылка меню будет вести на внешний сайт.
Например: http://www.example.com/index.php?from=synergy"
}

function register_help() {
  jQuery.each(fields, function(element_id, help_msg) {
    if (jQuery('#help_'+element_id).length == 0)
    {
      jQuery('label[for='+element_id+']').append(" ");
      jQuery('#help_'+element_id).simpletip({ position: 'right', offset: [-10, -230], content: help_msg});
    }
  });
}

$(document).ajaxSuccess(register_help);
$(document).ready(register_help);


text:
using System.Web.Mvc;

namespace ProductsMvcSample.Controllers
{
	public class HomeController : Controller
	{
		public ViewResult Index()
		{
			return View("Welcome");
		}
	}
}


text:
export { default as Footer } from './Footer'
export { default as FooterContainer } from './FooterContainer'
export { default as FooterElement } from './FooterElement'


text:
const assert = require('assert');
const merge = require('../../src/merge.js');

describe('merge', function() {
  it('should merge two simple objects', function() {
    let target = {a: 0, b: 1, c: 2};
    let source = {b: 4, d: 5};

    let result = merge(target, source);

    let expected = {a: 0, b: 4, c: 2, d: 5};
    assert(result === target, "merge should return the modified target");
    assert.deepEqual(result, expected, "merge should merge the source into the target");
  });

  it('should concatenate arrays in objects', function() {
    let target = {a: 0, b:[0,1,2], c: [{d:5, e:6}]};
    let source = {b: [0, 3], c: {d: 7, e: 8}};
    let result = merge(target, source);
    let expected = {a: 0, b:[0,1,2,0,3], c: [{d:5, e:6},{d:7, e:8}]};

    assert.deepEqual(result, expected, "merge should concatenate arrays");
  });

  it('should throw an error for invalid conversions', function() {
    let target = {a:"a", b:{c: 1}};
    let expected = {a:"a", b:{c: 1}};
    assert.throws(function() {
      let source = {a:{b:0}};
      merge(target, source);
    }, /object.*primitive/, "Should not be able to convert an object to a primitive");

    assert.throws(function() {
      let source = {a: [0]}
      merge(target, source);
    }, /array.*primitive/, "Should not be able to convert an array to a primitive");

    assert.throws(function() {
      let source = {b:"stuff"};
      merge(target, source);
    }, /primitive.*object/, "Should not be able to convert a primitive to an object");

    assert.throws(function() {
      let source = {b:[0,1,2]};
      merge(target, source);
    }, /array.*object/, "Should not be able to convert a array to an object");
  });
});


text:
	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
	<title>jQuery.scrollTo - Test Window MaxY with Iframe - Quirks Mode</title>

jQuery.scrollTo - Test Window MaxY with Iframe - Quirks Mode


text:
package com.github.k24.prefsoven.field;

import android.os.Build;

import com.github.k24.prefsoven.Prefs;
import com.github.k24.prefsoven.sample.TestPrefs;

import org.assertj.core.api.Assertions;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.RobolectricTestRunner;
import org.robolectric.RuntimeEnvironment;
import org.robolectric.annotation.Config;

import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.Assert.*;

/**
 * Created by k24 on 2016/02/21.
 */
@Config(sdk = Build.VERSION_CODES.JELLY_BEAN)
@RunWith(RobolectricTestRunner.class)
public class IntPrefTest {

    @Before
    public void setUp() throws Exception {
        Prefs.install(RuntimeEnvironment.application);
        Prefs.prefs(TestPrefs.class).edit().clear().commit();
    }

    @Test
    public void increment() throws Exception {
        TestPrefs prefs = Prefs.oven(TestPrefs.class);

        assertThat(prefs.int1().increment())
                .isEqualTo(1);
        assertThat(prefs.int1().increment())
                .isEqualTo(2);
        prefs.int1().put(Integer.MAX_VALUE);
        assertThat(prefs.int1().increment())
                .isEqualTo(Integer.MAX_VALUE);
    }

    @Test
    public void decrement() throws Exception {
        TestPrefs prefs = Prefs.oven(TestPrefs.class);

        assertThat(prefs.int1().decrement())
                .isEqualTo(-1);
        assertThat(prefs.int1().decrement())
                .isEqualTo(-2);
        prefs.int1().put(Integer.MIN_VALUE);
        assertThat(prefs.int1().decrement())
                .isEqualTo(Integer.MIN_VALUE);
    }

    @Test
    public void add() throws Exception {
        TestPrefs prefs = Prefs.oven(TestPrefs.class);

        assertThat(prefs.int1().add(1))
                .isEqualTo(1);
        assertThat(prefs.int1().add(2))
                .isEqualTo(3);
        assertThat(prefs.int1().add(-7))
                .isEqualTo(-4);

        prefs.int1().put(1);
        assertThat(prefs.int1().add(Integer.MAX_VALUE))
                .isEqualTo(Integer.MAX_VALUE);
        prefs.int1().put(-1);
        assertThat(prefs.int1().add(Integer.MAX_VALUE))
                .isEqualTo(Integer.MAX_VALUE - 1);

        prefs.int1().put(-1);
        assertThat(prefs.int1().add(Integer.MIN_VALUE))
                .isEqualTo(Integer.MIN_VALUE);
        prefs.int1().put(1);
        assertThat(prefs.int1().add(Integer.MIN_VALUE))
                .isEqualTo(Integer.MIN_VALUE + 1);
    }
}


text:
.. image:: https://travis-ci.org/Stefan-Endres/shgo.svg?branch=master
    :target: https://travis-ci.org/Stefan-Endres/shgo
.. image:: https://coveralls.io/repos/github/Stefan-Endres/shgo/badge.png?branch=master
    :target: https://coveralls.io/github/Stefan-Endres/shgo?branch=master

Repository: https://github.com/Stefan-Endres/shgo

Description
-----------

Finds the global minimum of a function using simplicial homology global
optimisation (shgo_). Appropriate for solving general purpose NLP and blackbox
optimisation problems to global optimality (low dimensional problems).
The general form of an optimisation problem is given by:

.. _shgo: https://stefan-endres.github.io/shgo/

::

    minimize f(x) subject to

    g_i(x) >= 0,  i = 1,...,m
    h_j(x)  = 0,  j = 1,...,p

where x is a vector of one or more variables. ``f(x)`` is the objective
function ``R^n -> R``, ``g_i(x)`` are the inequality constraints.
``h_j(x)`` are the equality constrains.

Installation
------------
Stable:

.. code::

    $ pip install shgo

Latest:

.. code::

    $ git clone https://github.com/Stefan-Endres/shgo
    $ cd shgo
    $ python setup.py install
    $ python setup.py test

Documentation
-------------
The project website https://stefan-endres.github.io/shgo/ contains more detailed examples, notes and performance profiles.

Quick example
-------------

Consider the problem of minimizing the Rosenbrock function. This function is implemented in ``rosen`` in ``scipy.optimize``

.. code:: python

    >>> from scipy.optimize import rosen
    >>> from shgo import shgo
    >>> bounds = [(0,2), (0, 2), (0, 2), (0, 2), (0, 2)]
    >>> result = shgo(rosen, bounds)
    >>> result.x, result.fun
    (array([ 1.,  1.,  1.,  1.,  1.]), 2.9203923741900809e-18)

Note that bounds determine the dimensionality of the objective function and is therefore a required input, however you can specify empty bounds using ``None`` or objects like numpy.inf which will be converted to large float numbers.


text:
package org.intellimate.izou.util;

import org.apache.logging.log4j.Level;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.spi.AbstractLogger;
import org.intellimate.izou.identification.Identifiable;
import org.intellimate.izou.identification.IdentificationManager;
import org.intellimate.izou.main.Main;

/**
 * The base class for each IzouModule
 * FIXME: What is an izou module exactly?
 *
 * @author Leander Kurscheidt
 * @version 1.0
 */
public abstract class IzouModule implements MainProvider, Identifiable {
    private static final String FQCN = IzouModule.class.getName();
    private String ID = this.getClass().getCanonicalName();
    protected Main main;
    protected final AbstractLogger log = (AbstractLogger) LogManager.getLogger(this.getClass());

    public IzouModule(Main main) {
        this(main, true);
    }

    public IzouModule(Main main, boolean register) {
        this.main = main;
        if (register) {
            if (!IdentificationManager.getInstance().registerIdentification(this)) {
                log.fatal("unable to register! " + getClass().getCanonicalName());
            }
        }
    }

    /**
     * returns the instance of Main
     *
     * @return Main
     */
    @Override
    public Main getMain() {
        return main;
    }

    /**
     * Used to log messages at debug level
     *
     * @param msg the message
     * @param e   the Throwable
     */
    @Override
    public void debug(String msg, Throwable e) {
        log.logIfEnabled(FQCN, Level.DEBUG, null, msg, e);
    }

    /**
     * Used to log messages at debug level
     *
     * @param msg the message
     */
    @Override
    public void debug(String msg) {
        log.logIfEnabled(FQCN, Level.DEBUG, null, msg, (Object) null);
    }

    /**
     * Used to log messages at error level
     *
     * @param msg the message
     * @param e   the Throwable
     */
    @Override
    public void error(String msg, Throwable e) {
        log.logIfEnabled(FQCN, Level.ERROR, null, msg, e);
    }

    /**
     * Used to log messages at error level
     *
     * @param msg the message
     */
    @Override
    public void error(String msg) {
        log.logIfEnabled(FQCN, Level.ERROR, null, msg, (Object) null);
    }

    /**
     * Used to log messages at fatal level
     *
     * @param msg the message
     */
    @Override
    public void fatal(String msg) {
        log.logIfEnabled(FQCN, Level.FATAL, null, msg, (Object) null);
    }

    /**
     * Used to log messages at fatal level
     *
     * @param msg the message
     * @param e   the Throwable
     */
    @Override
    public void fatal(String msg, Throwable e) {
        log.logIfEnabled(FQCN, Level.FATAL, null, msg, e);
    }

    /**
     * An ID must always be unique.
     * A Class like Activator or OutputPlugin can just provide their .class.getCanonicalName()
     * If you have to implement this interface multiple times, just concatenate unique Strings to
     * .class.getCanonicalName()
     *
     * @return A String containing an ID
     */
    @Override
    public String getID() {
        return ID;
    }
}


text:
namespace SharpNeat.Core
{
    /// <summary>
    /// Wrapper struct for fitness values.
    /// </summary>
    public struct FitnessInfo
    {
        /// <summary>
        /// Preconstructed FitnessInfo for common case of representing zero fitness.
        /// </summary>
        public static FitnessInfo Zero = new FitnessInfo(0.0, 0.0);

        /// <summary>
        /// Fitness score.
        /// </summary>
        public double _fitness;

        /// <summary>
        /// Auxiliary fitness info, i.e. for evaluation metrics other than the
        /// primary fitness metric but that nonetheless we are interested in observing.
        /// </summary>
        public AuxFitnessInfo[] _auxFitnessArr;

        /// <summary>
        /// Default constructor.
        /// </summary>
        public FitnessInfo(double fitness, double alternativeFitness)
        {
            _fitness = fitness;
            _auxFitnessArr = new AuxFitnessInfo[] {new AuxFitnessInfo("Alternative Fitness", alternativeFitness)};
        }

        /// <summary>
        /// Construct with the provided fitness value and auxiliary fitness info.
        /// </summary>
        public FitnessInfo(double fitness, AuxFitnessInfo[] auxFitnessArr)
        {
            _fitness = fitness;
            _auxFitnessArr = auxFitnessArr;
        }
    }
}


text:
TeamMemberTableModel::TeamMemberTableModel(QObject *parent)
    : QAbstractTableModel(parent),
      memberList()
{

}

TeamMemberTableModel::TeamMemberTableModel(QObject *parent, QList<TeamMember> *m_list)
    : QAbstractTableModel(parent),
      memberList(m_list)
{

}

TeamMemberTableModel::~TeamMemberTableModel()
{

}

int TeamMemberTableModel::rowCount(const QModelIndex &parent) const
{
    return memberList->size();
}

int TeamMemberTableModel::columnCount(const QModelIndex &parent) const
{
    //qDebug() << "Without this debug statement, the table headers do not appear. It is unclear why.";
    return 8;
}

QVariant TeamMemberTableModel::data(const QModelIndex &index, int role) const
{
    switch(role)
    {
    case Qt::DisplayRole:
    case Qt::EditRole:
        if (!index.isValid() || index.row() >= memberList->size())
            return QVariant();
    {
        switch(index.column())
        {
        case 0: //First Name
            return QVariant(memberList->at(index.row()).getFname());
            break;
        case 1: //Last Name
            return QVariant(memberList->at(index.row()).getLname());
            break;
        case 2: //Email
            return QVariant(memberList->at(index.row()).getEmail());
            break;
        case 3: //Phone
            return QVariant(memberList->at(index.row()).getPhone());
            break;
        case 4: //Title
            return QVariant(memberList->at(index.row()).getTitle());
            break;
        case 5: //Friday
            return QVariant(memberList->at(index.row()).jobs.at(0).getName());
            break;
        case 6: //Saturday
            return QVariant(memberList->at(index.row()).jobs.at(1).getName());
            break;
        case 7: //Sunday
            return QVariant(memberList->at(index.row()).jobs.at(2).getName());
            break;
        default:
            return QVariant();
            break;
        }
    }
        break;
    case 6:
    {
        QVariant temp;
        temp.setValue(memberList->at(index.row()));
        return temp;
    }
    default:
        return QVariant();
        break;
    }

}

QVariant TeamMemberTableModel::headerData(int section, Qt::Orientation orientation, int role) const
{
    if(role == Qt::DisplayRole)
        if(orientation == Qt::Horizontal)
            switch(section)
            {
            case 0: //First Name
                return tr("First Name");
                break;
            case 1: //Last Name
                return tr("Last Name");
                break;
            case 2: //Email
                return tr("Email");
                break;
            case 3: //Phone
                return tr("Phone");
                break;
            case 4: //Title
                return tr("Badge Title");
                break;
            case 5: //Friday
                return tr("Friday Assignment");
                break;
            case 6: //Saturday
                return tr("Saturday Assignment");
                break;
            case 7: //Sunday
                return tr("Sunday Assignment");
                break;
            default:
                return QVariant();
                break;
            }
        else if(orientation == Qt::Vertical)
            return QVariant(section);
}

bool TeamMemberTableModel::setData(const QModelIndex &index, const QVariant &value, int role)
{
    if(role == Qt::EditRole && index.isValid())
    {
        if(memberList->size() < index.row())
            memberList->reserve(index.row());
        TeamMember temp = memberList->at(index.row());
        switch(index.column())
        {
        case 0: //First Name
            temp.setFname(value.toString());
            break;
        case 1: //Last Name
            temp.setLname(value.toString());
            break;
        case 2: //Email
            temp.setEmail(value.toString());
            break;
        case 3: //Phone
            temp.setPhone(value.toString());
            break;
        case 4: //Title
            temp.setTitle(value.toString());
            break;
        case 5: //Friday
            temp.jobs[0].setName(value.toString());
            break;
        case 6: //Saturday
            temp.jobs[1].setName(value.toString());
            break;
        case 7: //Sunday
            temp.jobs[2].setName(value.toString());
            break;
        default:
            return false;
            break;
        }
        memberList->replace(index.row(), temp);

        emit dataChanged(index,index);
        return true;
    }
}

bool TeamMemberTableModel::insertRows(int position, int rows, const QModelIndex &index)
{
    emit beginInsertRows(QModelIndex(), position, position+rows);

    for(int i = position; i < position+rows; i++)
    {
        memberList->insert(i, TeamMember());
    }
    emit endInsertRows();
}

bool TeamMemberTableModel::removeRows(int position, int rows, const QModelIndex &index)
{
    emit beginRemoveRows(QModelIndex(), position, position+rows);

    for(int i = position+rows; i > position; i--)
    {
        memberList->removeAt(i);
    }
    emit endRemoveRows();
}

void TeamMemberTableModel::refresh()
{
    emit dataChanged(this->index(0, 0),this->index(this->rowCount(), this->columnCount()));
}

QString TeamMemberTableModel::getCSV()
{
    QString csv;

    for(int i = 0; i < rowCount(); i++)
    {
        for(int j = 0; j < columnCount(); j++)
        {
            csv.append(data(index(i, j), Qt::DisplayRole).toString() + ",");
        }
        csv.append('\n');
    }
    return csv;
}

Qt::ItemFlags TeamMemberTableModel::flags(const QModelIndex & index) const
{
    return Qt::ItemIsSelectable |  Qt::ItemIsEditable | Qt::ItemIsEnabled ;
}


text:
package eval

import (
	"flag"
	_ "fmt"
)

func NewFlagObj() *FlagObj {
	ret := &FlagObj{arguments: make(map[Object]interface{})}
	SetGlobalObj(flag_name, ret)

	return ret
}

const (
	FLAG_OBJ = "FLAG_OBJ"
	flag_name = "flag"
)

type FlagObj struct {
	arguments map[Object]interface{}
}

func (f *FlagObj) Inspect() string  { return "<" + flag_name + ">" }
func (f *FlagObj) Type() ObjectType { return FLAG_OBJ }

func (f *FlagObj) CallMethod(line string, scope *Scope, method string, args ...Object) Object {
	switch method {
	case "arg":
		return f.Arg(line, args...)
	case "args":
		return f.Args(line, args...)
	case "nArg":
		return f.NArg(line, args...)
	case "nFlag":
		return f.NFlag(line, args...)
	case "bool":
		return f.Bool(line, args...)
	case "int":
		return f.Int(line, args...)
	case "uint":
		return f.UInt(line, args...)
	case "float":
		return f.Float(line, args...)
	case "string":
		return f.String(line, args...)
	case "set":
		return f.Set(line, args...)
	case "parse":
		return f.Parse(line, args...)
	case "parsed":
		return f.Parsed(line, args...)
	case "printDefaults":
		return f.PrintDefaults(line, args...)
	case "isSet":
		return f.IsSet(line, args...)
	}
	panic(NewError(line, NOMETHODERROR, method, f.Type()))
}

func (f *FlagObj) Arg(line string, args ...Object) Object {
	if len(args) != 1 {
		panic(NewError(line, ARGUMENTERROR, "1", len(args)))
	}

	i, ok := args[0].(*Integer)
	if !ok {
		panic(NewError(line, PARAMTYPEERROR, "first", "arg", "*Integer", args[0].Type()))
	}

	return NewString(flag.Arg(int(i.Int64)))
}

func (f *FlagObj) Args(line string, args ...Object) Object {
	if len(args) != 0 {
		panic(NewError(line, ARGUMENTERROR, "0", len(args)))
	}

	ret := &Array{}
	strlist := flag.Args()
	for _, v := range strlist {
		ret.Members = append(ret.Members, NewString(v))
	}
	return ret
}

func (f *FlagObj) NArg(line string, args ...Object) Object {
	if len(args) != 0 {
		panic(NewError(line, ARGUMENTERROR, "0", len(args)))
	}

	n := flag.NArg()
	return NewInteger(int64(n))
}

func (f *FlagObj) NFlag(line string, args ...Object) Object {
	if len(args) != 0 {
		panic(NewError(line, ARGUMENTERROR, "0", len(args)))
	}

	n := flag.NFlag()
	return NewInteger(int64(n))
}

func (f *FlagObj) Bool(line string, args ...Object) Object {
	if len(args) != 3 {
		panic(NewError(line, ARGUMENTERROR, "3", len(args)))
	}

	name, ok := args[0].(*String)
	if !ok {
		panic(NewError(line, PARAMTYPEERROR, "first", "bool", "*String", args[0].Type()))
	}

	value, ok := args[1].(*Boolean)
	if !ok {
		panic(NewError(line, PARAMTYPEERROR, "second", "bool", "*Boolean", args[1].Type()))
	}

	usage, ok := args[2].(*String)
	if !ok {
		panic(NewError(line, PARAMTYPEERROR, "third", "bool", "*String", args[2].Type()))
	}

	//Because golang's flag module's `Bool` method returns pointer, only after calling `flag.Parse()`,
	//the returned pointer will be assigned, so we need store this pointer.
	b := flag.Bool(name.String, value.Bool, usage.String)
	ret := &Boolean{Bool: value.Bool, Valid: true}
	f.arguments[ret] = b

	return ret
}

func (f *FlagObj) Int(line string, args ...Object) Object {
	if len(args) != 3 {
		panic(NewError(line, ARGUMENTERROR, "3", len(args)))
	}

	name, ok := args[0].(*String)
	if !ok {
		panic(NewError(line, PARAMTYPEERROR, "first", "int", "*String", args[0].Type()))
	}

	value, ok := args[1].(*Integer)
	if !ok {
		panic(NewError(line, PARAMTYPEERROR, "second", "int", "*Integer", args[1].Type()))
	}

	usage, ok := args[2].(*String)
	if !ok {
		panic(NewError(line, PARAMTYPEERROR, "third", "int", "*String", args[2].Type()))
	}

	i := flag.Int64(name.String, value.Int64, usage.String)
	ret := NewInteger(value.Int64)
	f.arguments[ret] = i

	return ret
}

func (f *FlagObj) UInt(line string, args ...Object) Object {
	if len(args) != 3 {
		panic(NewError(line, ARGUMENTERROR, "3", len(args)))
	}

	name, ok := args[0].(*String)
	if !ok {
		panic(NewError(line, PARAMTYPEERROR, "first", "uint", "*String", args[0].Type()))
	}

	value, ok := args[1].(*UInteger)
	if !ok {
		panic(NewError(line, PARAMTYPEERROR, "second", "uint", "*UInteger", args[1].Type()))
	}

	usage, ok := args[2].(*String)
	if !ok {
		panic(NewError(line, PARAMTYPEERROR, "third", "uint", "*String", args[2].Type()))
	}

	i := flag.Uint64(name.String, value.UInt64, usage.String)
	ret := NewUInteger(value.UInt64)
	f.arguments[ret] = i

	return ret
}

func (f *FlagObj) Float(line string, args ...Object) Object {
	if len(args) != 3 {
		panic(NewError(line, ARGUMENTERROR, "3", len(args)))
	}

	name, ok := args[0].(*String)
	if !ok {
		panic(NewError(line, PARAMTYPEERROR, "first", "float", "*String", args[0].Type()))
	}

	value, ok := args[1].(*Float)
	if !ok {
		panic(NewError(line, PARAMTYPEERROR, "second", "float", "*Float", args[1].Type()))
	}

	usage, ok := args[2].(*String)
	if !ok {
		panic(NewError(line, PARAMTYPEERROR, "third", "float", "*String", args[2].Type()))
	}

	flt := flag.Float64(name.String, value.Float64, usage.String)
	ret := NewFloat(value.Float64)
	f.arguments[ret] = flt

	return ret
}

func (f *FlagObj) String(line string, args ...Object) Object {
	if len(args) != 3 {
		panic(NewError(line, ARGUMENTERROR, "3", len(args)))
	}

	name, ok := args[0].(*String)
	if !ok {
		panic(NewError(line, PARAMTYPEERROR, "first", "string", "*String", args[0].Type()))
	}

	value, ok := args[1].(*String)
	if !ok {
		panic(NewError(line, PARAMTYPEERROR, "second", "string", "*String", args[1].Type()))
	}

	usage, ok := args[2].(*String)
	if !ok {
		panic(NewError(line, PARAMTYPEERROR, "third", "string", "*String", args[2].Type()))
	}

	s := flag.String(name.String, value.String, usage.String)
	ret := NewString(value.String)
	f.arguments[ret] = s

	return ret
}

func (f *FlagObj) Set(line string, args ...Object) Object {
	if len(args) != 2 {
		panic(NewError(line, ARGUMENTERROR, "2", len(args)))
	}

	name, ok := args[0].(*String)
	if !ok {
		panic(NewError(line, PARAMTYPEERROR, "first", "set", "*String", args[0].Type()))
	}

	value, ok := args[1].(*String)
	if !ok {
		panic(NewError(line, PARAMTYPEERROR, "second", "set", "*String", args[1].Type()))
	}

	err := flag.Set(name.String, value.String)
	if err != nil {
		return NewFalseObj(err.Error())
	}

	return TRUE
}

func (f *FlagObj) Parse(line string, args ...Object) Object {
	if len(args) != 0 {
		panic(NewError(line, ARGUMENTERROR, "0", len(args)))
	}

	flag.Parse()

	//Now `flag.Parse()` is called, we need to assined these pointers back to our objects.
	for key, value := range f.arguments {
		switch key.(type) {
		case *Boolean:
			b := key.(*Boolean)
			v := value.(*bool)
			b.Bool = *v

		case *Integer:
			i := key.(*Integer)
			v := value.(*int64)
			i.Int64 = *v

		case *UInteger:
			i := key.(*UInteger)
			v := value.(*uint64)
			i.UInt64 = *v

		case *Float:
			f := key.(*Float)
			v := value.(*float64)
			f.Float64 = *v

		case *String:
			s := key.(*String)
			v := value.(*string)
			s.String = *v
		}
	}
	return NIL
}

func (f *FlagObj) Parsed(line string, args ...Object) Object {
	if len(args) != 0 {
		panic(NewError(line, ARGUMENTERROR, "0", len(args)))
	}

	b := flag.Parsed()
	if b {
		return TRUE
	}
	return FALSE
}

func (f *FlagObj) PrintDefaults(line string, args ...Object) Object {
	if len(args) != 0 {
		panic(NewError(line, ARGUMENTERROR, "0", len(args)))
	}

	flag.PrintDefaults()
	return NIL
}

func (f *FlagObj) IsSet(line string, args ...Object) Object {
	if len(args) != 1 {
		panic(NewError(line, ARGUMENTERROR, "1", len(args)))
	}

	name, ok := args[0].(*String)
	if !ok {
		panic(NewError(line, PARAMTYPEERROR, "first", "isSet", "*String", args[0].Type()))
	}

	alreadySet := make(map[string]bool)
	flag.Visit(func(f *flag.Flag) {
		alreadySet[f.Name] = true
	})

	if _, ok := alreadySet[name.String]; ok {
		return TRUE
	}
	return FALSE
}


text:
using std::vector;

namespace floating_temple {
namespace toy_lang {

SetVariableFunction::SetVariableFunction() {
}

LocalObject* SetVariableFunction::Clone() const {
  return new SetVariableFunction();
}

void SetVariableFunction::Dump(DumpContext* dc) const {
  CHECK(dc != nullptr);

  dc->BeginMap();
  dc->AddString("type");
  dc->AddString("SetVariableFunction");
  dc->End();
}

void SetVariableFunction::PopulateObjectProto(
    ObjectProto* object_proto, SerializationContext* context) const {
  object_proto->mutable_set_variable_function();
}

ObjectReference* SetVariableFunction::Call(
    MethodContext* method_context,
    const vector<ObjectReference*>& parameters) const {
  CHECK(method_context != nullptr);
  CHECK_EQ(parameters.size(), 2u);

  vector<Value> set_parameters(1);
  set_parameters[0].set_object_reference(0, parameters[1]);

  Value dummy;
  if (!method_context->CallMethod(parameters[0], "set", set_parameters,
                                  &dummy)) {
    return nullptr;
  }

  return MakeNoneObject(method_context);
}

}  // namespace toy_lang
}  // namespace floating_temple


text:
package com.jjoe64.graphview_demos.fragments;

import android.app.Activity;
import android.graphics.Color;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.jjoe64.graphview.GraphView;
import com.jjoe64.graphview.LegendRenderer;
import com.jjoe64.graphview.series.BarGraphSeries;
import com.jjoe64.graphview.series.DataPoint;
import com.jjoe64.graphview_demos.MainActivity;
import com.jjoe64.graphview_demos.R;

/**
 * Created by jonas on 28.08.14.
 */
public class MultipleBarsGraph extends Fragment {
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        View rootView = inflater.inflate(R.layout.fragment_main, container, false);

        GraphView graph = (GraphView) rootView.findViewById(R.id.graph);
        BarGraphSeries<DataPoint> series = new BarGraphSeries<DataPoint>(new DataPoint[] {
                new DataPoint(0, -2),
                new DataPoint(1, 5),
                new DataPoint(2, 3),
                new DataPoint(3, 2),
                new DataPoint(4, 6)
        });
        series.setSpacing(30);
        graph.addSeries(series);

        BarGraphSeries<DataPoint> series2 = new BarGraphSeries<DataPoint>(new DataPoint[] {
                new DataPoint(0, -5),
                new DataPoint(1, 3),
                new DataPoint(2, 4),
                new DataPoint(3, 4),
                new DataPoint(4, 1)
        });
        series2.setColor(Color.RED);
        series2.setSpacing(30);
        graph.addSeries(series2);

        graph.getViewport().setXAxisBoundsManual(true);
        graph.getViewport().setMinX(-2);
        graph.getViewport().setMaxX(6);

        // legend
        series.setTitle("foo");
        series2.setTitle("bar");
        graph.getLegendRenderer().setVisible(true);
        graph.getLegendRenderer().setAlign(LegendRenderer.LegendAlign.TOP);

        return rootView;
    }

    @Override
    public void onAttach(Activity activity) {
        super.onAttach(activity);
        ((MainActivity) activity).onSectionAttached(
                getArguments().getInt(MainActivity.ARG_SECTION_NUMBER));
    }

}