text:
// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"

#include "wx/dialog.h"

#ifndef WX_PRECOMP
    #include "wx/cursor.h"
#endif // WX_PRECOMP

#include "wx/evtloop.h"

#include "wx/scopedptr.h"

#include <gtk/gtk.h>

// this is defined in src/gtk/toplevel.cpp
extern int wxOpenModalDialogsCount;

wxDEFINE_TIED_SCOPED_PTR_TYPE(wxGUIEventLoop)

//-----------------------------------------------------------------------------
// wxDialog
//-----------------------------------------------------------------------------

IMPLEMENT_DYNAMIC_CLASS(wxDialog,wxTopLevelWindow)

void wxDialog::Init()
{
    m_modalLoop = NULL;
    m_returnCode = 0;
    m_modalShowing = false;
    m_themeEnabled = true;
}

wxDialog::wxDialog( wxWindow *parent,
                    wxWindowID id, const wxString &title,
                    const wxPoint &pos, const wxSize &size,
                    long style, const wxString &name )
{
    Init();

    (void)Create( parent, id, title, pos, size, style, name );
}

bool wxDialog::Create( wxWindow *parent,
                       wxWindowID id, const wxString &title,
                       const wxPoint &pos, const wxSize &size,
                       long style, const wxString &name )
{
    SetExtraStyle(GetExtraStyle() | wxTOPLEVEL_EX_DIALOG);

    // all dialogs should have tab traversal enabled
    style |= wxTAB_TRAVERSAL;

    return wxTopLevelWindow::Create(parent, id, title, pos, size, style, name);
}

bool wxDialog::Show( bool show )
{
    if (!show && IsModal())
    {
        EndModal( wxID_CANCEL );
    }

    if (show && CanDoLayoutAdaptation())
        DoLayoutAdaptation();

    bool ret = wxDialogBase::Show(show);

    if (show)
        InitDialog();

    return ret;
}

wxDialog::~wxDialog()
{
    // if the dialog is modal, this will end its event loop
    if ( IsModal() )
        EndModal(wxID_CANCEL);
}

bool wxDialog::IsModal() const
{
    return m_modalShowing;
}

void wxDialog::SetModal( bool WXUNUSED(flag) )
{
    wxFAIL_MSG( wxT("wxDialog:SetModal obsolete now") );
}

int wxDialog::ShowModal()
{
    wxASSERT_MSG( !IsModal(), "ShowModal() can't be called twice" );

    // release the mouse if it's currently captured as the window having it
    // will be disabled when this dialog is shown -- but will still keep the
    // capture making it impossible to do anything in the modal dialog itself
    wxWindow * const win = wxWindow::GetCapture();
    if ( win )
        win->GTKReleaseMouseAndNotify();

    wxWindow * const parent = GetParentForModalDialog();
    if ( parent )
    {
        gtk_window_set_transient_for( GTK_WINDOW(m_widget),
                                      GTK_WINDOW(parent->m_widget) );
    }

    wxBusyCursorSuspender cs; // temporarily suppress the busy cursor

    Show( true );

    m_modalShowing = true;

    wxOpenModalDialogsCount++;

    // NOTE: gtk_window_set_modal internally calls gtk_grab_add() !
    gtk_window_set_modal(GTK_WINDOW(m_widget), TRUE);

    // Run modal dialog event loop.
    {
        wxGUIEventLoopTiedPtr modal(&m_modalLoop, new wxGUIEventLoop());
        m_modalLoop->Run();
    }

    gtk_window_set_modal(GTK_WINDOW(m_widget), FALSE);

    wxOpenModalDialogsCount--;

    return GetReturnCode();
}

void wxDialog::EndModal( int retCode )
{
    SetReturnCode( retCode );

    if (!IsModal())
    {
        wxFAIL_MSG( "either wxDialog:EndModal called twice or ShowModal wasn't called" );
        return;
    }

    m_modalShowing = false;

    // Ensure Exit() is only called once. The dialog's event loop may be terminated
    // externally due to an uncaught exception.
    if (m_modalLoop && m_modalLoop->IsRunning())
        m_modalLoop->Exit();

    Show( false );
}


text:
export class SaltRequest {
	constructor(public username: string, public newUser: boolean) {}
}

redpajama_set_name: RedPajamaGithub


text:
module.exports = function(config){
   config.set({
      basePath : '../',

      files : [
         'test/lib/angular/angular.js',
         'test/lib/angular/angular-route.js',
         'test/lib/firebase/firebase-debug.js',
         'test/lib/firebase/firebase-simple-login.js',
         'test/lib/firebase/angularfire.js',
         'test/lib/angular/angular-mocks.js',
         'app/js/**/*.js',
         'test/unit/**/*.js'
      ],

      autoWatch : true,

      frameworks: ['jasmine'],

      browsers : ['Chrome'],

      plugins : [
         'karma-junit-reporter',
         'karma-chrome-launcher',
         'karma-firefox-launcher',
         'karma-jasmine'
      ],

      junitReporter : {
         outputFile: 'test_out/unit.xml',
         suite: 'unit'
      }

   })}


text:
<ion-content scroll="false">

</ion-content>
<ion-footer-bar class="bar-dark">
  Find Me
</ion-footer-bar>


text:
module.exports = {
  description: "",
  ns: "react-material-ui",
  type: "ReactNode",
  dependencies: {
    npm: {
      "material-ui/svg-icons/action/class": require('material-ui/svg-icons/action/class')
    }
  },
  name: "ActionClass",
  ports: {
    input: {},
    output: {
      component: {
        title: "ActionClass",
        type: "Component"
      }
    }
  }
}


text:
package aws

import (
	"fmt"
	"log"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/service/ec2"
	"github.com/hashicorp/terraform/helper/schema"
)

func dataSourceAwsRouteTable() *schema.Resource {
	return &schema.Resource{
		Read: dataSourceAwsRouteTableRead,

		Schema: map[string]*schema.Schema{
			"subnet_id": {
				Type:     schema.TypeString,
				Optional: true,
				Computed: true,
			},
			"route_table_id": {
				Type:     schema.TypeString,
				Optional: true,
				Computed: true,
			},
			"vpc_id": {
				Type:     schema.TypeString,
				Optional: true,
				Computed: true,
			},
			"filter": ec2CustomFiltersSchema(),
			"tags":   tagsSchemaComputed(),
			"routes": {
				Type:     schema.TypeList,
				Computed: true,
				Elem: &schema.Resource{
					Schema: map[string]*schema.Schema{
						"cidr_block": {
							Type:     schema.TypeString,
							Computed: true,
						},

						"ipv6_cidr_block": {
							Type:     schema.TypeString,
							Computed: true,
						},

						"egress_only_gateway_id": {
							Type:     schema.TypeString,
							Computed: true,
						},

						"gateway_id": {
							Type:     schema.TypeString,
							Computed: true,
						},

						"instance_id": {
							Type:     schema.TypeString,
							Computed: true,
						},

						"nat_gateway_id": {
							Type:     schema.TypeString,
							Computed: true,
						},

						"transit_gateway_id": {
							Type:     schema.TypeString,
							Computed: true,
						},

						"vpc_peering_connection_id": {
							Type:     schema.TypeString,
							Computed: true,
						},

						"network_interface_id": {
							Type:     schema.TypeString,
							Computed: true,
						},
					},
				},
			},
			"associations": {
				Type:     schema.TypeList,
				Computed: true,
				Elem: &schema.Resource{
					Schema: map[string]*schema.Schema{
						"route_table_association_id": {
							Type:     schema.TypeString,
							Computed: true,
						},

						"route_table_id": {
							Type:     schema.TypeString,
							Computed: true,
						},

						"subnet_id": {
							Type:     schema.TypeString,
							Computed: true,
						},

						"main": {
							Type:     schema.TypeBool,
							Computed: true,
						},
					},
				},
			},
			"owner_id": {
				Type:     schema.TypeString,
				Computed: true,
			},
		},
	}
}

func dataSourceAwsRouteTableRead(d *schema.ResourceData, meta interface{}) error {
	conn := meta.(*AWSClient).ec2conn
	req := &ec2.DescribeRouteTablesInput{}
	vpcId, vpcIdOk := d.GetOk("vpc_id")
	subnetId, subnetIdOk := d.GetOk("subnet_id")
	rtbId, rtbOk := d.GetOk("route_table_id")
	tags, tagsOk := d.GetOk("tags")
	filter, filterOk := d.GetOk("filter")

	if !vpcIdOk && !subnetIdOk && !tagsOk && !filterOk && !rtbOk {
		return fmt.Errorf("One of route_table_id, vpc_id, subnet_id, filters, or tags must be assigned")
	}
	req.Filters = buildEC2AttributeFilterList(
		map[string]string{
			"route-table-id":        rtbId.(string),
			"vpc-id":                vpcId.(string),
			"association.subnet-id": subnetId.(string),
		},
	)
	req.Filters = append(req.Filters, buildEC2TagFilterList(
		tagsFromMap(tags.(map[string]interface{})),
	)...)
	req.Filters = append(req.Filters, buildEC2CustomFilterList(
		filter.(*schema.Set),
	)...)

	log.Printf("[DEBUG] Reading Route Table: %s", req)
	resp, err := conn.DescribeRouteTables(req)
	if err != nil {
		return err
	}
	if resp == nil || len(resp.RouteTables) == 0 {
		return fmt.Errorf("Your query returned no results. Please change your search criteria and try again.")
	}
	if len(resp.RouteTables) > 1 {
		return fmt.Errorf("Multiple Route Table matched; use additional constraints to reduce matches to a single Route Table")
	}

	rt := resp.RouteTables[0]

	d.SetId(aws.StringValue(rt.RouteTableId))
	d.Set("route_table_id", rt.RouteTableId)
	d.Set("vpc_id", rt.VpcId)
	d.Set("tags", tagsToMap(rt.Tags))
	d.Set("owner_id", rt.OwnerId)
	if err := d.Set("routes", dataSourceRoutesRead(rt.Routes)); err != nil {
		return err
	}

	if err := d.Set("associations", dataSourceAssociationsRead(rt.Associations)); err != nil {
		return err
	}

	return nil
}

func dataSourceRoutesRead(ec2Routes []*ec2.Route) []map[string]interface{} {
	routes := make([]map[string]interface{}, 0, len(ec2Routes))
	// Loop through the routes and add them to the set
	for _, r := range ec2Routes {
		if r.GatewayId != nil && *r.GatewayId == "local" {
			continue
		}

		if r.Origin != nil && *r.Origin == "EnableVgwRoutePropagation" {
			continue
		}

		if r.DestinationPrefixListId != nil {
			// Skipping because VPC endpoint routes are handled separately
			// See aws_vpc_endpoint
			continue
		}

		m := make(map[string]interface{})

		if r.DestinationCidrBlock != nil {
			m["cidr_block"] = *r.DestinationCidrBlock
		}
		if r.DestinationIpv6CidrBlock != nil {
			m["ipv6_cidr_block"] = *r.DestinationIpv6CidrBlock
		}
		if r.EgressOnlyInternetGatewayId != nil {
			m["egress_only_gateway_id"] = *r.EgressOnlyInternetGatewayId
		}
		if r.GatewayId != nil {
			m["gateway_id"] = *r.GatewayId
		}
		if r.NatGatewayId != nil {
			m["nat_gateway_id"] = *r.NatGatewayId
		}
		if r.InstanceId != nil {
			m["instance_id"] = *r.InstanceId
		}
		if r.TransitGatewayId != nil {
			m["transit_gateway_id"] = *r.TransitGatewayId
		}
		if r.VpcPeeringConnectionId != nil {
			m["vpc_peering_connection_id"] = *r.VpcPeeringConnectionId
		}
		if r.NetworkInterfaceId != nil {
			m["network_interface_id"] = *r.NetworkInterfaceId
		}

		routes = append(routes, m)
	}
	return routes
}

func dataSourceAssociationsRead(ec2Assocations []*ec2.RouteTableAssociation) []map[string]interface{} {
	associations := make([]map[string]interface{}, 0, len(ec2Assocations))
	// Loop through the routes and add them to the set
	for _, a := range ec2Assocations {

		m := make(map[string]interface{})
		m["route_table_id"] = *a.RouteTableId
		m["route_table_association_id"] = *a.RouteTableAssociationId
		// GH[11134]
		if a.SubnetId != nil {
			m["subnet_id"] = *a.SubnetId
		}
		m["main"] = *a.Main
		associations = append(associations, m)
	}
	return associations
}


text:
package org.khannex.action;

import org.khannex.io.Request;

public class CommandFactory {

    public Command createCommand(Request request) {
        Command retval = null;

        if (request.getCommand() != null) {
            switch (request.getCommand()) {
                case "setParam":
                    retval = new SetParam();
                    break;
                case "getLocation":
                    retval = new GetLocation();
                    break;
                case "setDeviceType":
                    retval = new SetDeviceType();
                    break;
                case "getDeviceType":
                    retval = new GetDeviceType();
                    break;
                case "makeSign":
                    retval = new MakeSign();
                    retval.addParam(request.getParam1());
                    break;
                case "getLastError":
                    retval = new GetLastError();
                    break;
                case "getNonstandardChars":
                    retval = new GetNonstandardChars();
                    break;
                default:
                    throw new IllegalArgumentException(String.format("unknown command [%s]", request.getCommand()));
            }
        }

        return retval;
    }

}


text:
<?xml version="1.0" encoding="UTF-8"?>
<filter>
	<action_widget id="aw1">
			account
			<class>buttonui</class>
	</action_widget>
	<action_widget id="aw1">
			cart
			<class>buttonui</class>
	</action_widget>
	<action_widget id="aw1">
			help
			<class>buttonui</class>
	</action_widget>
	<action_widget id="aw1">
			check out
			<class>buttonui</class>
	</action_widget>
	<action_widget id="aw1">
			ok
			<class>buttonui</class>
	</action_widget>
</filter>


text:
<?php

/**
 *
 *
 * NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually.
 *
 */
class ListAnnotationsResult {

  static $swaggerTypes = array(
      'documentGuid' => 'string',
      'sessionGuid' => 'string',
      'annotations' => 'array[AnnotationInfo]',
      'serverTime' => 'string'

    );

  public $documentGuid; // string
  public $sessionGuid; // string
  public $annotations; // array[AnnotationInfo]
  public $serverTime; // string
  }


text:
from django.template import Context, loader
from django.core.context_processors import csrf

def render_template(name, request, dict_):
    template = loader.get_template(name)
    dict_.update({'authenticated': request.user.is_authenticated(),
                  'name': request.user.username})
    dict_.update(csrf(request))
    context = Context(dict_)
    return template.render(context)


text:
package org.apache.geode.experimental.driver;

import static org.apache.geode.cache.Region.SEPARATOR;
import static org.apache.geode.distributed.ConfigurationProperties.SSL_CIPHERS;
import static org.apache.geode.distributed.ConfigurationProperties.SSL_ENABLED_COMPONENTS;
import static org.apache.geode.distributed.ConfigurationProperties.SSL_KEYSTORE;
import static org.apache.geode.distributed.ConfigurationProperties.SSL_KEYSTORE_PASSWORD;
import static org.apache.geode.distributed.ConfigurationProperties.SSL_KEYSTORE_TYPE;
import static org.apache.geode.distributed.ConfigurationProperties.SSL_PROTOCOLS;
import static org.apache.geode.distributed.ConfigurationProperties.SSL_REQUIRE_AUTHENTICATION;
import static org.apache.geode.distributed.ConfigurationProperties.SSL_TRUSTSTORE;
import static org.apache.geode.distributed.ConfigurationProperties.SSL_TRUSTSTORE_PASSWORD;
import static org.apache.geode.internal.Assert.assertTrue;
import static org.apache.geode.test.util.ResourceUtils.createTempFileFromResource;
import static org.hamcrest.Matchers.anyOf;
import static org.hamcrest.Matchers.instanceOf;
import static org.junit.Assert.assertEquals;

import java.io.IOException;
import java.net.SocketException;
import java.util.Collections;
import java.util.Properties;
import java.util.Set;

import javax.net.ssl.SSLException;

import org.junit.After;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.contrib.java.lang.system.RestoreSystemProperties;
import org.junit.experimental.categories.Category;
import org.junit.rules.ExpectedException;

import org.apache.geode.cache.Cache;
import org.apache.geode.cache.CacheFactory;
import org.apache.geode.cache.RegionShortcut;
import org.apache.geode.cache.server.CacheServer;
import org.apache.geode.distributed.ConfigurationProperties;
import org.apache.geode.distributed.Locator;
import org.apache.geode.internal.net.SocketCreatorFactory;
import org.apache.geode.test.junit.categories.ClientServerTest;

@Category({ClientServerTest.class})
public class SSLTest {
  @Rule
  public RestoreSystemProperties restoreSystemProperties = new RestoreSystemProperties();

  @Rule
  public ExpectedException expectedException = ExpectedException.none();

  private final String DEFAULT_KEY_STORE =
      createTempFileFromResource(SSLTest.class, "default.keystore").getAbsolutePath();
  private final String SERVER_KEY_STORE =
      createTempFileFromResource(SSLTest.class, "cacheserver.keystore")
          .getAbsolutePath();
  private final String SERVER_TRUST_STORE =
      createTempFileFromResource(SSLTest.class, "cacheserver.truststore")
          .getAbsolutePath();
  private final String BOGUSSERVER_KEY_STORE =
      createTempFileFromResource(SSLTest.class, "bogusserver.keystore")
          .getAbsolutePath();
  private final String BOGUSCLIENT_KEY_STORE =
      createTempFileFromResource(SSLTest.class, "bogusclient.keystore")
          .getAbsolutePath();
  private final String CLIENT_KEY_STORE =
      createTempFileFromResource(SSLTest.class, "client.keystore").getAbsolutePath();
  private final String CLIENT_TRUST_STORE =
      createTempFileFromResource(SSLTest.class, "client.truststore")
          .getAbsolutePath();
  private Locator locator;
  private Cache cache;
  private Driver driver;
  private int locatorPort;

  @Before
  public void enableProtobuf() throws Exception {
    System.setProperty("geode.feature-protobuf-protocol", "true");
  }

  private void startLocator(String keyStore, String trustStore, boolean twoWayAuthentication,
      String protocols, String ciphers) throws IOException {
    // Create a cache
    Properties properties = new Properties();
    properties.put(SSL_ENABLED_COMPONENTS, "all");
    properties.put(SSL_KEYSTORE_TYPE, "jks");
    properties.put(SSL_KEYSTORE, keyStore);
    properties.put(SSL_PROTOCOLS, protocols);
    properties.put(SSL_CIPHERS, ciphers);
    properties.put(SSL_KEYSTORE_PASSWORD, "password");
    properties.put(SSL_TRUSTSTORE, trustStore);
    properties.put(SSL_TRUSTSTORE_PASSWORD, "password");
    properties.put(SSL_REQUIRE_AUTHENTICATION, String.valueOf(twoWayAuthentication));

    CacheFactory cf = new CacheFactory(properties);
    cf.set(ConfigurationProperties.MCAST_PORT, "0");
    cache = cf.create();
    cache.createRegionFactory(RegionShortcut.REPLICATE).create("region");

    // Start a locator
    locator = Locator.startLocatorAndDS(0, null, properties);
    locatorPort = locator.getPort();
  }

  private void startServer() throws IOException {
    CacheServer server = cache.addCacheServer();
    server.setPort(0);
    server.start();
  }

  @After
  public void cleanup() {
    cache.close();
    locator.stop();
    SocketCreatorFactory.close();
  }

  @Test
  public void driverFailsToConnectWhenThereAreNoServers() throws Exception {
    // using TLSv1.2 specifically so that in jdk11 (by default using TLSv1.3) this won't take
    // too long to finish.
    startLocator(SERVER_KEY_STORE, SERVER_TRUST_STORE, true, "TLSv1.2", "any");
    expectedException.expect(IOException.class);
    driver = new DriverFactory().addLocator("localhost", locatorPort).create();
  }

  @Test
  public void driverCanConnectWithTwoWayAuthentication() throws Exception {
    startLocator(DEFAULT_KEY_STORE, DEFAULT_KEY_STORE, true, "any", "any");
    startServer();
    driver = new DriverFactory().addLocator("localhost", locatorPort)
        .setTrustStorePath(DEFAULT_KEY_STORE).setKeyStorePath(DEFAULT_KEY_STORE).create();
    Set<String> regionsOnServer = driver.getRegionNames();
    assertEquals(Collections.singleton(SEPARATOR + "region"), regionsOnServer);
    assertTrue(driver.isConnected());
  }

  @Test
  public void driverCannotConnectWithBogusClientKeystore() throws Exception {
    startLocator(DEFAULT_KEY_STORE, DEFAULT_KEY_STORE, true, "any", "any");
    startServer();
    expectedException
        .expect(anyOf(instanceOf(SSLException.class), instanceOf(SocketException.class)));
    driver = new DriverFactory().addLocator("localhost", locatorPort)
        .setTrustStorePath(CLIENT_TRUST_STORE).setKeyStorePath(BOGUSCLIENT_KEY_STORE).create();
  }

  @Test
  public void driverCannotConnectWithBogusServerKeystore() throws Exception {
    // using TLSv1.2 specifically so that in jdk11 (by default using TLSv1.3) this won't take
    // too long to finish.
    startLocator(BOGUSSERVER_KEY_STORE, SERVER_TRUST_STORE, true, "TLSv1.2", "any");
    startServer();
    expectedException.expect(SSLException.class);
    driver = new DriverFactory().addLocator("localhost", locatorPort)
        .setTrustStorePath(CLIENT_TRUST_STORE).setKeyStorePath(CLIENT_KEY_STORE).create();
  }

  @Test
  public void driverCanConnectWithOneWayAuthentication() throws Exception {
    startLocator(DEFAULT_KEY_STORE, DEFAULT_KEY_STORE, false, "any", "any");
    startServer();
    driver = new DriverFactory().addLocator("localhost", locatorPort)
        .setTrustStorePath(DEFAULT_KEY_STORE).create();
    Set<String> regionsOnServer = driver.getRegionNames();
    assertEquals(Collections.singleton(SEPARATOR + "region"), regionsOnServer);
    assertTrue(driver.isConnected());
  }

  @Test
  public void driverCannotConnectIfProtocolsMismatch() throws Exception {
    startLocator(SERVER_KEY_STORE, SERVER_TRUST_STORE, true, "TLSv1.1", "any");
    startServer();
    expectedException.expect(SSLException.class);
    driver = new DriverFactory().addLocator("localhost", locatorPort)
        .setTrustStorePath(CLIENT_TRUST_STORE).setKeyStorePath(CLIENT_KEY_STORE)
        .setProtocols("TLSv1.2").create();
  }

  @Test
  public void driverCannotConnectIfCiphersMismatch() throws Exception {
    startLocator(SERVER_KEY_STORE, SERVER_TRUST_STORE, true, "any",
        "TLS_DHE_DSS_WITH_AES_128_CBC_SHA256");
    startServer();
    expectedException.expect(SSLException.class);
    driver = new DriverFactory().addLocator("localhost", locatorPort)
        .setTrustStorePath(CLIENT_TRUST_STORE).setKeyStorePath(CLIENT_KEY_STORE)
        .setCiphers("TLS_DHE_DSS_WITH_AES_128_CBC_SHA").create();
  }
}


text:
/**
 *
 */
package com.ahuralab.farsialphabet;

import android.content.Context;
import android.content.Intent;
import android.media.MediaPlayer;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

/**
 * @author michele.sama@gmail.com
 * @author panteha.s@gmail.com
 *
 */
public class LetterListAdapter extends BaseAdapter {

	private final Context context;
	private final LetterItem[] items;

	public LetterListAdapter(Context context) {
		this.context = context;
		items = LetterItem.FARSI;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		final LetterItem item = (LetterItem) getItem(position);

		View letterView = null;
		if (convertView == null) {
			LayoutInflater li = LayoutInflater.from(context);
			letterView = li.inflate(R.layout.list_row_layout, null);
		} else {
			// Reuse
			letterView = convertView;
		}

		((TextView) letterView.findViewById(R.id.letterName))
				.setText(item.name);

		TextView isolatedView = ((TextView) letterView
				.findViewById(R.id.letterIsolated));
		isolatedView.setText(item.isolated);
		// Add sound
		isolatedView.setOnClickListener(new PlayOnceOnCLickListener(context,
				item));

		TextView beginView = ((TextView) letterView
				.findViewById(R.id.letterBegin));
		beginView.setText(item.begin);
		beginView.setOnClickListener(new DrawingOnClickListener(context, item,
				LetterPracticeActivity.BEGIN));

		TextView middleView = ((TextView) letterView
				.findViewById(R.id.letterMiddle));
		middleView.setText(item.middle);
		middleView.setOnClickListener(new DrawingOnClickListener(context, item,
				LetterPracticeActivity.MIDDLE));

		TextView endView = ((TextView) letterView.findViewById(R.id.letterEnd));
		endView.setText(item.end);
		endView.setOnClickListener(new DrawingOnClickListener(context, item,
				LetterPracticeActivity.END));

		return letterView;
	}

	@Override
	public int getCount() {
		return items.length;
	}

	@Override
	public Object getItem(int position) {
		return items[position];
	}

	@Override
	public long getItemId(int position) {
		// TODO Auto-generated method stub
		return 0;
	}

	/**
	 * Play a sound if not already playing.
	 */
	private static class PlayOnceOnCLickListener implements
			View.OnClickListener {

		private volatile boolean playing = false;
		private final Context context;
		private final LetterItem letter;

		public PlayOnceOnCLickListener(Context context, LetterItem letter) {
			this.context = context;
			this.letter = letter;
		}

		@Override
		public void onClick(View v) {
			if (playing == false) {
				playing = true;
				final MediaPlayer mp = MediaPlayer.create(context,
						letter.soundId);
				if (mp == null) {
					return;
				}
				mp.setOnCompletionListener(new MediaPlayer.OnCompletionListener() {
					@Override
					public void onCompletion(MediaPlayer mp) {
						mp.release();
						playing = false;
					}
				});
				mp.start();
			}
		}

	}

	private static class DrawingOnClickListener implements View.OnClickListener {

		private final Context context;
		private final LetterItem letterItem;
		private final int startIndex;

		public DrawingOnClickListener(Context context, LetterItem letterItem,
				int startIndex) {
			this.context = context;
			this.letterItem = letterItem;
			this.startIndex = startIndex;
		}

		@Override
		public void onClick(View v) {
			Intent intent = new Intent(context, LetterPracticeActivity.class);
			intent.putExtra(LetterPracticeActivity.LETTER_INTENT_EXTRA,
					letterItem);
			intent.putExtra(LetterPracticeActivity.INDEX_INTENT_EXTRA,
					startIndex);
			context.startActivity(intent);
		}

	}
}


text:
All notable changes to `menu` will be documented in this file.

## 3.0.0 - 2021-03-24

- Support PHP 8+
- Drop support for PHP 7.x
- Use PHP 8 syntax where possible

## 2.10.3 - 2021-03-16
- Ensure `Items` are transformed to string before prepending or appending

## 2.10.2 - 2020-12-02
- Fix `methods_exists` check in PHP8

## 2.10.1 - 2020-12-02
- Ensure the necessary methods exist to check if a menu is active

## 2.10.0 - 2020-12-02
- Support `Item` instances in `Menu::prepend` so headers can be set active

## 2.9.0 - 2020-11-06
- Drop support for versions older than PHP 7.1

## 2.8.0 - 2018-11-05
- Add `exact-active` class to links that exactly match the current URL. This is accompanied by a `setExactActiveClass(string $class)` method to set the class name

## 2.7.0 - 2018-10-23
- Add `IteratorAggregate` interface to `Menu` class

## 2.6.0 - 2018-09-10
- Add `beforeRender` and `willRender` hooks that are called when an item is rendered

## 2.5.0 - 2018-03-02
- This release adds a few methods to create non-`ul` menus, which allows for Bootstrap 4 compatibility
- Added `Menu::setWrapperTag` and `Menu::withoutWrapperTag` to set a custom wrapper tag name for the menu list. Default: `ul`
- Added `Menu::setParentTag` & `Menu::withoutParentTag` to determine which tag should be used for the item's parent element. Default: `li`
- Added `Menu::setActiveClassOnLink` and `Menu::setActiveClassOnParent` to determine where the active class should be applied

## 2.4.1 - 2017-11-13
- Allow invokable classes as callbacks

## 2.4.0 - 2017-10-17
- Added `Menu::empty` and `Html::empty` method for adding empty list items

## 2.3.1 - 2017-08-29
- Extracted a `ActiveUrlChecker` class for public use

## 2.3.0 - 2017-08-28
- Added `append` and `prepend` methods to `Link`

## 2.2.2 - 2017-07-11
- Fixed returning a menu instance is now optional with `fill` and `build`

## 2.2.1 - 2017-03-07
- Fixed setting items active with urls that start with the same string

## 2.2.0 - 2017-02-09
- Added `if` function

## 2.1.3
- Fixed setting an active url when the url is exactly the same

## 2.1.1
- Added the request root path when setting the active path

## 2.1.0
- Added optional third `$initial` parameter in `Menu::build`

## 2.0.1
- Fixed require `^1.0.0` of spatie/url

## 2.0.0
- Added added the static `Menu::build` and non-static `Menu::fill` methods to create menu's from arrays.
- Added the `setActive` method on `Activatable` now also accepts a non-strict boolean or callable parameter to set `$active` to true or false.
- Added `Menu::html` and `Menu::htmlIf` now accept a `$parentAttributes` array as their second arguments.
- Changed the `HtmlAttributes` and `ParentAttributes` traits have been renamed to `HasHtmlAttributes` and `HasParentAttributes`.
- Changed the `HasUrl` interface and trait has been removed. Url-related methods now also are part of the `Activatable` interface and trait.
- Removed the `void` and `voidIf` have been removed. These can be replaced by `html` and `htmlIf`, with empty strings as their first arguments
- Removed the `prefixLinks` and `prefixUrls` methods have been removed because they were too unpredictable in some case. There currently isn't an alternative for these, besides writing your own logic and applying it with `applyToAll`.

## 1.4.0
- Added a `HasUrl` trait
- Deprecated `prefixLinks` in favor of `prefixUrls`

## 1.3.0
- Added `submenuIf`

## 1.2.1
- Internal refactors

## 1.2.0
- New methods on `Menu`:
    - `submenu` for submenus with optional headers
    - `void` and `voidIf` for empty list items
    - `wrap` to wrap the menu in an html tag with optional attributes
    - A `blueprint` method to copy the menu without it's contents
    - Html item convenience methods: `addItemClass`, `setItemAttribute`
    - Html parent convenience methods: `addItemParentClass`, `setItemParentAttribute`
- Added `HasHtmlAttributes` and `HasParentAttributes` interfaces
- `HtmlAttributes` and `ParentAttributes` now also have a `setAttributes` method

## 1.1.1
- Fixed `setActive` when setting active from a URL

## 1.1.0
- Added conditional `add` functions, `addIf`, `linkIf` and `htmlIf`

## 1.0.0
- First release


text:
<?php

namespace FCF\FloraBundle\Form;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
use Doctrine\ORM\EntityRepository;

class EspecieType extends AbstractType {

    public function buildForm(FormBuilderInterface $builder, array $options) {
        $builder
                ->add('epitetoEspecifico', 'text', array(
                    'attr' => array('class' => 'form-control'),)
                )
                ->add('siglaAutor', 'text', array(
                    'attr' => array('class' => 'form-control'),)
                )
                ->add('nombreComun', 'text', array(
                    'attr' => array('class' => 'form-control'),
                    'required' => false)
                )
                ->add('tipoHoja', 'text', array(
                    'attr' => array('class' => 'form-control'),
                    'required' => false)
                )
                ->add('filotaxis', 'text', array(
                    'attr' => array('class' => 'form-control'),
                    'required' => false)
                )
                ->add('estipula', 'text', array(
                    'attr' => array('class' => 'form-control'),
                    'required' => false)
                )
                ->add('diseno', 'text', array(
                    'attr' => array('class' => 'form-control'),
                    'required' => false)
                )
                ->add('estructura', 'text', array(
                    'attr' => array('class' => 'form-control'),
                    'required' => false)
                )
                ->add('color', 'text', array(
                    'attr' => array('class' => 'form-control'),
                    'required' => false)
                )
                ->add('observaciones', 'textarea', array(
                    'attr' => array('class' => 'form-control'),
                    'required' => false)
                )
                ->add('Genero', 'entity', array(
                    'class' => 'FCFFloraBundle:Genero',
                    'query_builder' => function(EntityRepository $er) {
                        return $er->createQueryBuilder('g')
                                ->orderBy('g.nombre','ASC');
                    }
                    ))
                ->add('Habito')
                ->add('distribucion')
                ->add('sinonimos','collection',array(
                    'type' => new SinonimoType(),
                    'allow_add' => true,
                    'by_reference' => false,
                    'allow_delete' => true,
                    ))
        ;
    }

    public function setDefaultOptions(OptionsResolverInterface $resolver) {
        $resolver->setDefaults(array(
            'data_class' => 'FCF\FloraBundle\Entity\Especie'
        ));
    }

    public function getName() {
        return 'fcf_florabundle_especietype';
    }

}


text:
<?php
// src/VersionControl/GitControlBundle/Form/RegistrationType.php

namespace VersionControl\GitControlBundle\Form;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
use FOS\UserBundle\Form\Type\ProfileFormType;

class EditUserType extends AbstractType
{
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder->add('name')

                ->add('admin', CheckboxType::class, array(
                'label' => 'Admin',
                'required' => false,
                ));
    }

    public function getParent()
    {
        return ProfileFormType::class;
    }

    public function getBlockPrefix()
    {
        return 'version_control_user_edit';
    }
}


text:
package jp.ne.opt.redshiftfake

import java.sql.{DriverManager, Connection}
import java.util.Properties

import jp.ne.opt.redshiftfake.util.Loan.using
import org.scalatest.{Outcome, fixture}

trait H2Sandbox { self: fixture.TestSuite =>

  type FixtureParam = Connection

  override def withFixture(test: OneArgTest): Outcome = {
    val url = "jdbc:h2redshift:mem:redshift;MODE=PostgreSQL;DATABASE_TO_UPPER=false"
    val prop = new Properties()
    prop.setProperty("driver", "org.h2.jdbc.FakeH2Driver")
    prop.setProperty("user", "sa")

    Class.forName("org.h2.jdbc.FakeH2Driver")
    using(DriverManager.getConnection(url, prop))(test)
  }
}


text:
SYNONYM

#### According to
Index Fungorum

#### Published in
null

#### Original name
Sphaeria alnea Fr., 1815

### Remarks
null


text:
use Edx;

SET foreign_key_checks=0;
DROP TABLE LoadInfo, EdxTrackEvent, Answer, InputState, CorrectMap, State;
use EdxPrivate;
DROP TABLE Account;
SET foreign_key_checks=1;


text:
    <ui-gmap-google-map center='map.center' zoom='map.zoom'>
      <ui-gmap-markers models="markers" coords="'self'" icon="'icon'"></ui-gmap-markers>
    </ui-gmap-google-map>

      <input type="text" placeholder="Filter places to {{searchItem}}...">

        {{business.business_name}}

    <button ng-class="{disabled: !isLoggedIn}" class="ui labeled icon button" ui-sref="home.add-business({filterNum: searchItems.indexOf(searchItem)})">

      Add Business
    </button>


text:
MINIGAME.Time = 60

---------------------------------------------------------
--
---------------------------------------------------------

function MINIGAME:Initialize()
	self.BaseClass.Initialize(self)

	local entity = ents.FindByClass("info_minigame_headsup")[1]

	if (IsValid(entity)) then
		local position = entity:GetPos()
		local min, max = Vector(-460, -460, 0), Vector(460, 460, 0)

		self.spawnOrigin = {position, min, max}
	end
end

---------------------------------------------------------
--
---------------------------------------------------------

function MINIGAME:Start()
	print(self.Name .. " has started.")

	self.BaseClass.Start(self)

	self.nextDrop = CurTime() +1
	self.bombVelocity = 0.1

	self.minDrop = 4
	self.maxDrop = 8

	self.nextDrop = CurTime() + 3
end

---------------------------------------------------------
--
---------------------------------------------------------

function MINIGAME:Finish(timeLimit)
	self.BaseClass.Finish(self, timeLimit)

	print(self.Name .. " has finished.")
end

---------------------------------------------------------
--
---------------------------------------------------------

function MINIGAME:HasRequirements(players, teams)
	return teams > 1
end

---------------------------------------------------------
--
---------------------------------------------------------

function MINIGAME:Think()
	if (self.nextDrop <= CurTime() and self.spawnOrigin) then
		local data = self.spawnOrigin

		self.bombVelocity = math.Clamp(self.bombVelocity -0.5, -15, 0)

		for k, player in pairs(self.players) do
			if (IsValid(player)) then
				local position = player:GetPos()
				local posx = math.Clamp(position.x, data[1].x + data[2].x, data[1].x + data[3].x)
				local posy = math.Clamp(position.y, data[1].y + data[2].y, data[1].y + data[3].y)

				position = Vector(posx, posy, data[1].z)

				local entity = ents.Create("info_minigame_bomb")
				entity:SetPos(position)
				entity:Spawn()

				timer.Simple(0, function()
					local physicsObject = entity:GetPhysicsObject()

					if (IsValid(physicsObject)) then
						physicsObject:SetVelocity(Vector(0, 0, self.bombVelocity))
					end
				end)
			end
		end

		for i = 1, math.random(self.minDrop, self.maxDrop) do
			local position = Vector(data[1].x +math.random(data[2].x, data[3].x), data[1].y +math.random(data[2].y, data[3].y), data[1].z)

			local entity = ents.Create("info_minigame_bomb")
			entity:SetPos(position)
			entity:Spawn()

			timer.Simple(0, function()
				local physicsObject = entity:GetPhysicsObject()

				if (IsValid(physicsObject)) then
					physicsObject:SetVelocity(Vector(0, 0, self.bombVelocity))
				end
			end)
		end

		self.minDrop = self.minDrop + 2
		self.maxDrop = self.maxDrop + 2

		self.nextDrop = CurTime() + 3
	end
end

---------------------------------------------------------
--
---------------------------------------------------------

function MINIGAME:DoPlayerDeath(victim, inflictor, dmginfo)
	timer.Simple(0, function()
		self:RemovePlayer(victim)

		local won = self:AnnounceWin()

		if (won) then
			self:Finish()
		end
	end)
end

---------------------------------------------------------
--
---------------------------------------------------------

function MINIGAME:CanPlayerSuicide(player)
	return false
end


text:
FROM ubuntu:latest
MAINTAINER KorriganMaster <contact@korrigansoft.com>
ARG BUILD_DATE
ARG VCS_REF
LABEL 	com.korrigansoft.build-date=$BUILD_DATE \
		com.korrigansoft.docker.dockerfile="/Dockerfile" \
		com.korrigansoft.license="MIT" \
		com.korrigansoft.name="Teeworlds server Docker image" \
		com.korrigansoft.vcs-ref=$VCS_REF \
		com.korrigansoft.vcs-type="Git" \
		com.korrigansoft.vcs-url="https://github.com/KorriganMaster/teeworlds-server"
RUN apt-get update && apt-get install -y \
		teeworlds-server \
	&& rm -rf /var/lib/apt/lists/*
RUN ln -s /usr/games/teeworlds-server /usr/local/bin/teeworlds-server
RUN useradd teeworlds --home /teeworlds --create-home
COPY ./entrypoint.sh /
RUN chmod a+x /entrypoint.sh
COPY ./serverconfig.cfg /teeworlds
RUN mkdir /teeworlds/datas
RUN chown -R teeworlds:teeworlds /teeworlds
USER teeworlds
WORKDIR /teeworlds
EXPOSE 8303/udp
ENTRYPOINT /entrypoint.sh


text:
<?php namespace Cms\Helper;

// here you can define custom actions
// all public methods declared in helper class will be available in $I

use Gzero\Cms\Models\Block;
use Gzero\Cms\Models\BlockTranslation;
use Gzero\Cms\Models\Content;
use Gzero\Cms\Models\ContentTranslation;
use Gzero\Core\Models\Route;
use Gzero\Core\Models\User;

class Unit extends \Codeception\Module {

    /**
     * Create user and return entity
     *
     * @param array $attributes
     *
     * @return \Gzero\Core\Models\User
     */
    public function haveUser($attributes = [])
    {
        return factory(User::class)->create($attributes);
    }

    /**
     * Create content with translations and routes and return entity
     *
     * @param array $attributes
     *
     * @return \Gzero\Cms\Models\Content
     */
    public function haveContent($attributes = [])
    {
        $data            = array_except($attributes, ['translations']);
        $transByLangCode = collect(array_get($attributes, 'translations'))->groupBy('language_code');

        $content = factory(Content::class)->make($data);
        $content->setAsRoot();

        if (empty($transByLangCode)) {
            return $content;
        }

        $transByLangCode->each(function ($translations) use ($content) {
            $firstTranslation = array_first($translations);

            // Create route translation based on the first translations in this language
            $content->routes()
                ->save(
                    factory(Route::class)
                        ->make(
                            [
                                'routable_id'   => $content->id,
                                'routable_type' => Content::class,
                                'language_code' => $firstTranslation['language_code'],
                                'path'          => str_slug($firstTranslation['title']),
                                'is_active'     => array_get($firstTranslation, 'is_active', true)
                            ]
                        )
                );

            // Create content translations
            foreach ($translations as $translation) {
                $content->translations()
                    ->save(
                        factory(ContentTranslation::class)
                            ->make($translation)
                    );
            }
        });

        return $content;
    }

    /**
     * Create content with translations and routes and returns collection
     *
     * @param array $contents
     *
     * @return array
     */
    public function haveContents($contents = [])
    {

        $result = [];

        foreach ($contents as $attributes) {
            $result[] = $this->haveContent($attributes);
        }

        return $result;
    }

    /**
     * Create block with translations and return entity
     *
     * @param array $attributes
     *
     * @return \Gzero\Cms\Models\Block
     */
    public function haveBlock($attributes = [])
    {
        $data            = array_except($attributes, ['translations']);
        $transByLangCode = collect(array_get($attributes, 'translations'))->groupBy('language_code');

        $block = factory(Block::class)->make($data);
        $block->save();

        if (empty($transByLangCode)) {
            return $block;
        }

        $transByLangCode->each(function ($translations) use ($block) {
            // Create block translations
            foreach ($translations as $translation) {
                $block->translations()
                    ->save(
                        factory(BlockTranslation::class)
                            ->make($translation)
                    );
            }
        });

        return $block;
    }

    /**
     * Create block with translations and returns collection
     *
     * @param array $blocks
     *
     * @return array
     */
    public function haveBlocks($blocks = [])
    {

        $result = [];

        foreach ($blocks as $attributes) {
            $result[] = $this->haveBlock($attributes);
        }

        return $result;
    }
}


text:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% == AIT CSIM Handout LaTeX Template ==
% == Credit ==
% Assoc. Prof. Matthew N. Dailey
% Computer Science and Information Management
% Asian Insitute of Technology
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\documentclass{article}

\usepackage{a4, url, upquote}
\usepackage{graphicx}
\usepackage{hyperref}
\usepackage[cmex10]{amsmath}
\usepackage{amssymb}
\usepackage{placeins}
\usepackage{listings}

\setlength{\textwidth}{6.5in}
\setlength{\textheight}{9in}
\setlength{\oddsidemargin}{0in}
\setlength{\evensidemargin}{0in}
\setlength{\topmargin}{0in}
\setlength{\headheight}{0in}
\setlength{\headsep}{0in}
\setlength{\footskip}{0.5in}

\newcommand{\bheading}[1]{\vspace{10pt} \noindent \textbf{#1}}

\begin{document}

\begin{tabbing}
  \`\=\kill
  \textbf{Workshop:} Agile Engineering Practices
  \` March 8, 2018 \\
  \textbf{Course:} AT70.19 Software Development and Quality Improvement (Jan
  2018) \` CSIM, AIT \\
  \textbf{Instructor:} Kan Ouivirach ({\tt \small kan@prontomarketing.com}) \\
  \textbf{Company:} Pronto Tools ({\tt \small http://www.prontotools.io/})
\end{tabbing}

\hrule

\vspace{.25in}

\begin{center}
  \textbf{\Large Agile Engineering Practices:} \\
  \vspace{.1in}
  \textbf{\large Test-Driven Development \& Acceptance Test-Driven Development}
\end{center}

\vspace{.15in}

\noindent {\bf Prerequisite:} Participants should have the following software
tools, especially Python and Chrome, installed on their machine.

\begin{itemize}
  \item Python -- {\tt https://www.python.org/}
  \item Virtualenv -- {\tt https://virtualenv.pypa.io/}
  \item Git -- {\tt https://git-scm.com/}
  \item Firefox or Chrome Browser
\end{itemize}

\noindent \textbf{Introduction:} This workshop aims for anyone who wants to
learn the Agile engineering practices. Participants will learn how to use the
test-driven development (TDD) and acceptance-test driven development (ATDD) to
develop high-quality software. In this workshop, we will use Python to program
since it is relatively easy to get started with and it will take less effort to
learn compared to most programming languages. It also makes us able to focus
more on building software rather than worrying about the code syntax. By the
end of this workshop, participants should be able to use the practices they
experience in the real-world software development. \\

\noindent \textbf{Warning:} Even though Python 2.7 will retire in 2 years from
now, we still choose to use Python 2.7 here to avoid any incompatibility issue
with the Selenium2Library library. However, after this workshop, every
participant is encouraged to try to upgrade the code and libraries to Python
3+.

\section*{Solving FizzBuzz using Test-Driven Development}

\noindent In this section, we will solve the FizzBuzz problem using the
test-driven development (TDD). FizzBuzz has 4 simple rules:

\begin{enumerate}
  \item If the number is divisible by 3, we get ``Fizz.''
  \item If the number is divisible by 5, we get ``Buzz.''
  \item If the number is divisible by 3 and 5, we get ``FizzBuzz.''
  \item Otherwise, we get the same number as we input.
\end{enumerate}

\noindent We will set up a test suite first. Let's create a Python script named
{\tt fizzbuzz\_test.py} and start with the code below.

\begin{verbatim}
import unittest

class FizzBuzzTest(unittest.TestCase):
    pass

if __name__ == '__main__':
    unittest.main()
\end{verbatim}

\noindent Run the script using the command:

\begin{verbatim}
$ python fizzbuzz_test.py
\end{verbatim}

\noindent We should see the output like this:

\begin{verbatim}
----------------------------------------------------------------------
Ran 0 tests in 0.000s

OK
\end{verbatim}

\noindent This means we have 0 tests and this is what we expect since we have
not written any test yet. Let's add a test case with the code below to the test
suite.

\begin{verbatim}
class FizzBuzzTest(unittest.TestCase):
    def test_input_3_should_return_fizz(self):
        result = fizzbuzz(3)
        self.assertEqual(result, 'Fizz')
\end{verbatim}

\noindent \textbf{Note:} When we write a test case, we design the way how we
will use the method (or function). \\

\noindent Let's run the script again. We should see the output like this:

\begin{verbatim}
E
======================================================================
ERROR: test_input_3_should_return_fizz (__main__.FizzBuzzTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "fizzbuzz_test.py", line 6, in test_input_3_should_return_fizz
    result = fizzbuzz(3)
NameError: global name 'fizzbuzz' is not defined

----------------------------------------------------------------------
Ran 1 test in 0.000s

FAILED (errors=1)
\end{verbatim}

\noindent We got an error here. Again this is what we expect since we have not
written any code for FizzBuzz yet. See what the error said and we will follow
it. \\

\noindent Let's fix the error first and try to make the test fails. Create a
new separate Python script named {\tt fizzbuzz.py} then write the code below.

\begin{verbatim}
def fizzbuzz():
    pass
\end{verbatim}

\noindent Import our code into our test suite by adding the code below to {\tt
fizzbuzz\_test.py}.

\begin{verbatim}
from fizzbuzz import fizzbuzz
\end{verbatim}

\noindent Run the test suite again. We should get the output like this:

\begin{verbatim}
E
======================================================================
ERROR: test_input_3_should_return_fizz (__main__.FizzBuzzTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "fizzbuzz_test.py", line 8, in test_input_3_should_return_fizz
    result = fizzbuzz(3)
TypeError: fizzbuzz() takes no arguments (1 given)

----------------------------------------------------------------------
Ran 1 test in 0.000s

FAILED (errors=1)
\end{verbatim}

\noindent The error has changed now. We design our FizzBuzz program to take one
argument, so we need to implement our program that way. Let's change our {\tt
fizzbuzz} method in {\tt fizzbuzz.py} to take one parameter.

\begin{verbatim}
def fizzbuzz(number):
    pass
\end{verbatim}

\noindent Run the test suite again.

\begin{verbatim}
F
======================================================================
FAIL: test_input_3_should_return_fizz (__main__.FizzBuzzTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "fizzbuzz_test.py", line 9, in test_input_3_should_return_fizz
    self.assertEqual(result, 'Fizz')
AssertionError: None != 'Fizz'

----------------------------------------------------------------------
Ran 1 test in 0.000s

FAILED (failures=1)
\end{verbatim}

\noindent Our test fails now! We can then continue the TDD process. Take your
time. :-)

\section*{Solving FizzBuzz using Acceptance Test-Driven Development}

\noindent In this section, we will develop a Web application for FizzBuzz using
the acceptance test-driven development (ATDD). The application contains a form
to take a number as input then prints out the result from the FizzBuzz program
we have done in the previous section. Before jumping in the ATDD section, let's
learn the tools we will use first:

\begin{itemize}
  \item Robot Framework
  \item Flask
\end{itemize}

\subsection*{Robot Framework}

\noindent We will learn the Robot Framework in this section and use it for the
ATDD later. Let's follow the steps below:

\begin{enumerate}
  \item Go to the GitHub {\tt https://github.com/zkan/hello-robotframework}.
  \item Clone the code to the local machine.
  \item Follow the readme on the GitHub.
\end{enumerate}

\noindent If we set it up correctly, we should be able to run the command below
without any error.

\begin{verbatim}
$ robot testcases/google.robot
\end{verbatim}

\noindent We should see a browser fired up and the output gets printed out like
this:

\begin{verbatim}
==============================================================================
Google
==============================================================================
Google for robot framework                                            | PASS |
------------------------------------------------------------------------------
Google                                                                | PASS |
1 critical test, 1 passed, 0 failed
1 test total, 1 passed, 0 failed
==============================================================================
Output:  /Users/zkan/Projects/hello-robotframework/output.xml
Log:     /Users/zkan/Projects/hello-robotframework/log.html
Report:  /Users/zkan/Projects/hello-robotframework/report.html
\end{verbatim}

\subsection*{Flask (A Python Microframework)}

\noindent Flask is a Web microframework for Python. We can get a Web
application up and running easily in minutes using this framework. We will use
it to develop our Web application in this workshop. Let's follow the steps
below:

\begin{enumerate}
  \item Go to the GitHub {\tt https://github.com/zkan/fizzbuzz-flask}.
  \item Clone the code to the local machine.
  \item Follow the readme on the GitHub.
\end{enumerate}

\noindent We then should be able to start a Web server with the command below:

\begin{verbatim}
$ python web/app.py
\end{verbatim}

\noindent Open the browser and go to {\tt http://0.0.0.0:5000} or {\tt
http://localhost:5000}. We should see the page as shown in
Figure~\ref{fig:flask-web-server-local}. \\

\begin{figure}[t]
  \centering
  \includegraphics[width=4in]{figures/flask-web-server-local}
  \caption{Flask Web server on local machine.}
  \label{fig:flask-web-server-local}
\end{figure}

\noindent Let's see the code in {\tt app.py} under the {\tt web} folder.

\begin{verbatim}
from flask import Flask, render_template, request

from fizzbuzz import fizzbuzz

app = Flask(__name__)

@app.route('/', methods=['GET', 'POST'])
def index():
    result = '?'

    if request.method == 'POST':
        number = int(request.form.get('number'))
        result = fizzbuzz(number)

    return render_template('index.html', result=result)

if __name__ == '__main__':
    app.run(host='0.0.0.0', port=5000, debug=True)
\end{verbatim}

\noindent Play around with the application and take some minutes to understand
how the code works.

\subsection*{Getting Started with ATDD using Robot Framework}

\noindent Let's go back to the folder {\tt hello-robotframework} and open the
script {\tt fizzbuzz.robot} under the folder {\tt testcases}.

\begin{verbatim}
*** Settings ***
Resource         ../resources/common_res.txt
Test Setup       Go to homepage
Test Teardown    Close Browser

*** Variables ***
${HOMEPAGE}    http://localhost:5000/
${BROWSER}     chrome

*** Keywords ***
Go to homepage
    Open Browser    ${HOMEPAGE}    ${BROWSER}

*** Test Cases ***
Go to app and see the initial page
    Page Should Contain              Input:
    Page Should Contain              Result: ?
    Page Should Contain Textfield    name=number
    Page Should Contain Button       Submit

Go to app and input 3 then should see Fizz
    Input Text             name=number    3
    Submit Form
    Page Should Contain    Result: Fizz
\end{verbatim}

\noindent Here we already have two test cases. Let's try running it using the
command below:

\begin{verbatim}
$ robot testcases/fizzbuzz.robot
\end{verbatim}

\noindent See if the script works or not. If it does, let's take a minute to
understand the output before we move on. \\

\noindent {\bf Note:} Keep the FizzBuzz Web application up and running and use
the right virtual environment. \\

\noindent Now we want to continue developing the FizzBuzz program. We want it
to print ``Fizz'' out if the input is 6; therefore, we add a new test case.

\begin{verbatim}
Go to app and input 6 then should see Fizz
    Input Text             name=number    6
    Submit Form
    Page Should Contain    Result: Fizz
\end{verbatim}

\noindent Run the robot again. We should get the output like this:

\begin{verbatim}
==============================================================================
Fizzbuzz
==============================================================================
Go to app and see the initial page                                    | PASS |
------------------------------------------------------------------------------
Go to app and input 3 then should see Fizz                            | PASS |
------------------------------------------------------------------------------
Go to app and input 6 then should see Fizz                            | FAIL |
Page should have contained text 'Result: Fizz' but did not
------------------------------------------------------------------------------
Fizzbuzz                                                              | FAIL |
3 critical tests, 2 passed, 1 failed
3 tests total, 2 passed, 1 failed
==============================================================================
Output:  /Users/zkan/Projects/hello-robotframework/output.xml
Log:     /Users/zkan/Projects/hello-robotframework/log.html
Report:  /Users/zkan/Projects/hello-robotframework/report.html
\end{verbatim}

\noindent As seen in the output above, our new test case fails as expected. We
first create a new test case then we fix it by implementing that feature in the
actual code. This is the ATDD process. The feedback loop starts now.  Take your
time. :-) \\\\

\noindent ``Learning is experience. Everything else is just information.'' ---
Albert Einstein

\end{document}


text:
1. Download the repo
2. Make sure you're into the jackson5 directory
3. `npm install`

# You will need a .env file. Ask team leads about this
1. the .env file will go in the root directory of the app
2. it will be used to store server configurations (we used (https://mlab.com/)[https://mlab.com/] )
3. __This .env file should never be pushed to github__

# How To run entire app
1. npm start
2. This will run on port 3000 and you can access the web app at <http://localhost:3000/>

# How to test our app
1. npm test
2. This will run all of our tests cases in test/app.js

# How to build the API Docs
1. Go to the root of the project
2. apidoc -i controllers/ -o apidoc/ -t template/
3. This will build new API docs that will be located in apidoc/

API Documentation is located at <http://receptional.s3-website-us-west-1.amazonaws.com/>

###Ireception Heroku:
https://ireception50911.herokuapp.com/


text:
package com.cloud.network.security;

import java.util.UUID;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

@Entity
@Table(name = ("security_group"))
public class SecurityGroupVO implements SecurityGroup {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id")
    private long id;

    @Column(name = "name")
    private String name;

    @Column(name = "description")
    private String description;

    @Column(name = "domain_id")
    private long domainId;

    @Column(name = "account_id")
    private long accountId;

    @Column(name = "uuid")
    private String uuid;

    public SecurityGroupVO() {
        uuid = UUID.randomUUID().toString();
    }

    public SecurityGroupVO(String name, String description, long domainId, long accountId) {
        this.name = name;
        this.description = description;
        this.domainId = domainId;
        this.accountId = accountId;
        uuid = UUID.randomUUID().toString();
    }

    @Override
    public long getId() {
        return id;
    }

    @Override
    public String getName() {
        return name;
    }

    @Override
    public String getDescription() {
        return description;
    }

    @Override
    public long getDomainId() {
        return domainId;
    }

    @Override
    public long getAccountId() {
        return accountId;
    }

    @Override
    public String getUuid() {
        return uuid;
    }

    public void setUuid(String uuid) {
        this.uuid = uuid;
    }

    @Override
    public Class<?> getEntityType() {
        return SecurityGroup.class;
    }
}


text:
{% extends "base.html" %}

{% block title %}Suppression query - {% endblock %}

{% block content %}
<form action="/suppression_query" method="get">
<input type="text" name="suppression_query" value="{{ suppression_query }}" />
<input type="submit" value="search" />
</form>

next page

  timestamp
  step name
  builder
  logs

{% for result in suppression_results %}

  {{ result.time_finished }}
  {{ result.step_name }}
  {{ result.parent.builder }}

    {% if result.parent.log_gs %}
    log
    {% else %}
    log
    {% endif %}

{% endfor %}

next page
{% endblock %}


text:
// See docs in ../ops/array_ops.cc.

#define EIGEN_USE_THREADS

#include <memory>
#include <string>
#include <utility>

#include "tensorflow/core/kernels/spacetodepth_op.h"

#include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor"
#include "tensorflow/core/framework/op.h"
#include "tensorflow/core/framework/op_kernel.h"
#include "tensorflow/core/framework/register_types.h"
#include "tensorflow/core/framework/tensor.h"
#include "tensorflow/core/framework/tensor_shape.h"
#include "tensorflow/core/framework/tensor_types.h"
#include "tensorflow/core/framework/types.h"
#include "tensorflow/core/platform/logging.h"
#include "tensorflow/core/platform/types.h"
#include "tensorflow/core/util/tensor_format.h"

namespace tensorflow {

namespace {
template <typename T>
struct RawType {
  using type = T;
};

template <>
struct RawType<qint8> {
  // spacetodepth_op_gpu.cu.cc does not instantiate SpaceToDepthOpFunctor for
  // int8, so we map qint8 to uint8. Instantiating int8 could slow down
  // compilation and the code generated is almost the same as for uint8.
  using type = uint8;
};
}  // namespace

typedef Eigen::ThreadPoolDevice CPUDevice;
typedef Eigen::GpuDevice GPUDevice;

template <typename Device, typename T>
class SpaceToDepthOp : public OpKernel {
 public:
  explicit SpaceToDepthOp(OpKernelConstruction* context) : OpKernel(context) {
    string data_format_str;
    OP_REQUIRES_OK(context, context->GetAttr("data_format", &data_format_str));
    OP_REQUIRES(context, FormatFromString(data_format_str, &data_format_),
                errors::InvalidArgument("Invalid data format"));

    OP_REQUIRES_OK(context, context->GetAttr("block_size", &block_size_));
    OP_REQUIRES(context, block_size_ > 1,
                errors::InvalidArgument("Block size should be > 1, but was: ",
                                        block_size_));

    if (std::is_same<Device, CPUDevice>::value) {
      OP_REQUIRES(
          context, data_format_ == FORMAT_NHWC,
          errors::InvalidArgument(
              "Only NHWC data_format supported on CPU. Got ", data_format_str));
    }
  }

  void Compute(OpKernelContext* context) override {
    const Tensor& input = context->input(0);
    const int dims = input.dims();

    const bool is_int8x4 = (data_format_ == FORMAT_NCHW_VECT_C);
    const int vect = is_int8x4 ? 4 : 1;
    if (is_int8x4) {
      OP_REQUIRES(
          context, dims == 5,
          errors::InvalidArgument("Input rank should be 5 instead of ", dims));
    } else {
      OP_REQUIRES(
          context, dims == 4,
          errors::InvalidArgument("Input rank should be 4 instead of ", dims));
    }

    constexpr int kNumSpatialDims = 2;
    const int batch_size =
        input.dim_size(GetTensorDimIndex<kNumSpatialDims>(data_format_, 'N'));
    const int height =
        input.dim_size(GetTensorDimIndex<kNumSpatialDims>(data_format_, 'H'));
    const int width =
        input.dim_size(GetTensorDimIndex<kNumSpatialDims>(data_format_, 'W'));
    const int input_depth =
        input.dim_size(GetTensorDimIndex<kNumSpatialDims>(data_format_, 'C')) *
        vect;

    // Both width and height must be divisible by block_size.
    OP_REQUIRES(context,
                (width % block_size_) == 0 && (height % block_size_) == 0,
                errors::InvalidArgument(
                    "Image width ", width, " and height ", height,
                    " should be divisible by block_size: ", block_size_));

    // The 'spatial' block of size block_size_ X block_size_ will be moved
    // to depth.
    const int output_depth = input_depth * block_size_ * block_size_;
    const int output_width = width / block_size_;
    const int output_height = height / block_size_;

    // Allocate output tensor.
    Tensor* outputs_tensor = nullptr;
    OP_REQUIRES_OK(context,
                   context->allocate_output(
                       0,
                       ShapeFromFormat(data_format_, batch_size, output_height,
                                       output_width, output_depth),
                       &outputs_tensor));

    if (std::is_same<Device, GPUDevice>::value) {
      using RT = typename RawType<T>::type;
      if (data_format_ == FORMAT_NCHW_VECT_C) {
        // NCHW_VECT_C with 4 x qint8 can be treated as NCHW int32.
        auto Tinput_v = input.template reinterpret_last_dimension<int32, 4>();
        auto Toutput_v = outputs_tensor->reinterpret_last_dimension<int32, 4>();
        functor::SpaceToDepthOpFunctor<Device, int32, FORMAT_NCHW> functor;
        functor(context->eigen_device<Device>(), Tinput_v, block_size_,
                Toutput_v);
      } else if (data_format_ == FORMAT_NCHW) {
        CHECK((std::is_same<T, RT>::value));
        functor::SpaceToDepthOpFunctor<Device, RT, FORMAT_NCHW> functor;
        functor(context->eigen_device<Device>(), input.tensor<RT, 4>(),
                block_size_, outputs_tensor->tensor<RT, 4>());
      } else {
        CHECK((std::is_same<T, RT>::value));
        functor::SpaceToDepthOpFunctor<Device, RT, FORMAT_NHWC> functor;
        functor(context->eigen_device<Device>(), input.tensor<RT, 4>(),
                block_size_, outputs_tensor->tensor<RT, 4>());
      }
    } else {
      // NOTE: Assumes data_format_ == FORMAT_NHWC here, since we have rejected
      // (CPU && data_format_ != FORMAT_NHWC) in the constructor.
      functor::SpaceToDepthOpFunctor<Device, T, FORMAT_NHWC> functor;
      functor(context->eigen_device<Device>(), input.tensor<T, 4>(),
              block_size_, outputs_tensor->tensor<T, 4>());
    }
  };

 private:
  int block_size_;
  TensorFormat data_format_;
};

// Partial specialization of SpaceToDepthOpFunctor for a CPUDevice.
namespace functor {
template <typename T>
struct SpaceToDepthOpFunctor<CPUDevice, T, FORMAT_NHWC> {
  void operator()(const CPUDevice& d, typename TTypes<T, 4>::ConstTensor input,
                  int block_size, typename TTypes<T, 4>::Tensor output) {
    const int batch_size = output.dimension(0);
    const int input_height = input.dimension(1);
    const int input_width = input.dimension(2);
    const int input_depth = input.dimension(3);

    for (int b = 0; b < batch_size; ++b) {
      for (int h = 0; h < input_height; ++h) {
        const int out_h = h / block_size;
        const int offset_h = (h % block_size);
        for (int w = 0; w < input_width; ++w) {
          const int out_w = w / block_size;
          const int offset_w = (w % block_size);
          const int offset_d = (offset_h * block_size + offset_w) * input_depth;
          for (int d = 0; d < input_depth; ++d) {
            const int out_d = d + offset_d;
            output(b, out_h, out_w, out_d) = input(b, h, w, d);
          }
        }
      }
    }
  }
};
}  // namespace functor

#define REGISTER(type)                                                \
  REGISTER_KERNEL_BUILDER(Name("SpaceToDepth")                        \
                              .Device(DEVICE_CPU)                     \
                              .TypeConstraint<type>("T")              \
                              .AttrConstraint("data_format", "NHWC"), \
                          SpaceToDepthOp<CPUDevice, type>);

TF_CALL_ALL_TYPES(REGISTER);
TF_CALL_qint8(REGISTER);
#undef REGISTER

#if GOOGLE_CUDA || TENSORFLOW_USE_ROCM
REGISTER_KERNEL_BUILDER(
    Name("SpaceToDepth").Device(DEVICE_GPU).TypeConstraint<float>("T"),
    SpaceToDepthOp<GPUDevice, float>);
REGISTER_KERNEL_BUILDER(
    Name("SpaceToDepth").Device(DEVICE_GPU).TypeConstraint<Eigen::half>("T"),
    SpaceToDepthOp<GPUDevice, Eigen::half>);
REGISTER_KERNEL_BUILDER(
    Name("SpaceToDepth").Device(DEVICE_GPU).TypeConstraint<qint8>("T"),
    SpaceToDepthOp<GPUDevice, qint8>);
REGISTER_KERNEL_BUILDER(
    Name("SpaceToDepth").Device(DEVICE_GPU).TypeConstraint<uint8>("T"),
    SpaceToDepthOp<GPUDevice, uint8>);
#endif  // GOOGLE_CUDA || TENSORFLOW_USE_ROCM

}  // end namespace tensorflow


text:
from __future__ import absolute_import, unicode_literals

import os

from itertools import product
from pathlib import PurePath

from scss.extension.core import CoreExtension
from scss.source import SourceFile

from ..utils import get_file_and_storage

class DjangoExtension(CoreExtension):
    name = 'django'

    def handle_import(self, name, compilation, rule):
        """
        Re-implementation of the core Sass import mechanism, which looks for
        files using the staticfiles storage and staticfiles finders.
        """
        original_path = PurePath(name)

        search_exts = list(compilation.compiler.dynamic_extensions)
        if original_path.suffix and original_path.suffix in search_exts:
            basename = original_path.stem
        else:
            basename = original_path.name

        if original_path.is_absolute():
            # Remove the beginning slash
            search_path = original_path.relative_to('/').parent
        elif rule.source_file.origin:
            search_path = rule.source_file.origin
            if original_path.parent:
                search_path = os.path.normpath(str(search_path / original_path.parent))
        else:
            search_path = original_path.parent

        for prefix, suffix in product(('_', ''), search_exts):
            filename = PurePath(prefix + basename + suffix)

            full_filename, storage = get_file_and_storage(str(search_path / filename))

            if full_filename:
                with storage.open(full_filename) as f:
                    return SourceFile.from_file(f, origin=search_path, relpath=filename)


text:
<?xml version="1.0" encoding="UTF-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >

    <item android:id="@android:id/background">
        <shape>
            <corners android:radius="50dip" />

            <gradient
                android:angle="270"
                android:centerColor="#000000"
                android:centerY="0.50"
                android:endColor="#000000"
                android:startColor="#000000" />
        </shape>
    </item>
    <item android:id="@android:id/progress">
        <clip>
            <shape>
                <corners android:radius="50dip" />

                <gradient
                    android:angle="90"
                    android:endColor="#7CFC00"
                    android:startColor="#7CFC00" />
            </shape>
        </clip>
    </item>

</layer-list>


text:
{% extends 'base.html' %}
{% load i18n %}
{% block title %}{% trans "Volume Type Encryption Details" %}{% endblock %}

{% block page_header %}
  {% include "horizon/common/_page_header.html" with title=_("Volume Type Encryption Details") %}
{% endblock page_header %}

{% block main %}

  {% include "admin/volumes/volume_types/_volume_encryption_type_detail.html" %}

{% endblock %}


text:
using System;
using System.Xml;

using SharpVectors.Dom.Events;

namespace SharpVectors.Dom
{
	/// <summary>
	/// Summary description for Text.
	/// </summary>
	public class Text
		: XmlText
		, IText
		, INode
		, IEventTargetSupport
	{
		#region Private Fields

		private EventTarget eventTarget;

		#endregion

		#region Constructors

		protected internal Text(
			string data,
			Document document)
			: base(data, document)
		{
			eventTarget = new EventTarget(this);
		}

		#endregion

		#region IEventTarget interface

		#region Methods

		#region DOM Level 2

		void IEventTarget.AddEventListener(
			string type,
			EventListener listener,
			bool useCapture)
		{
			eventTarget.AddEventListener(type, listener, useCapture);
		}

		void IEventTarget.RemoveEventListener(
			string type,
			EventListener listener,
			bool useCapture)
		{
			eventTarget.RemoveEventListener(type, listener, useCapture);
		}

		bool IEventTarget.DispatchEvent(
			IEvent @event)
		{
			return eventTarget.DispatchEvent(@event);
		}

		#endregion

		#region DOM Level 3 Experimental

		void IEventTarget.AddEventListenerNs(
			string namespaceUri,
			string type,
			EventListener listener,
			bool useCapture,
			object eventGroup)
		{
			eventTarget.AddEventListenerNs(namespaceUri, type, listener, useCapture, eventGroup);
		}

		void IEventTarget.RemoveEventListenerNs(
			string namespaceUri,
			string type,
			EventListener listener,
			bool useCapture)
		{
			eventTarget.RemoveEventListenerNs(namespaceUri, type, listener, useCapture);
		}

		bool IEventTarget.WillTriggerNs(
			string namespaceUri,
			string type)
		{
			return eventTarget.WillTriggerNs(namespaceUri, type);
		}

		bool IEventTarget.HasEventListenerNs(
			string namespaceUri,
			string type)
		{
			return eventTarget.HasEventListenerNs(namespaceUri, type);
		}

		#endregion

		#endregion

		#endregion

		#region XmlNode interface

		public override string Value
		{
			get
			{
				return base.Value;
			}
			set
			{
				base.Value = value;

				// Mutation events: Notify document.
				Document document = this.OwnerDocument as Document;

				if (document != null)
				{
					document.ReplacedText(this);
				}
			}
		}

		#endregion

		#region NON-DOM

		void IEventTargetSupport.FireEvent(
			IEvent @event)
		{
			eventTarget.FireEvent(@event);
		}

		#endregion
	}
}


text:
{% extends "base.html" %}

{% block title %}Issues | {{ block.super }} {% endblock %}

{% load fb_versions %}

{% block smmeta %}

	<meta name="description" content="A bi-monthly magazine in Rochester, New York. We tell the hidden and untold story of Rochester's innovators, artists, entrepreneurs, dreamers, and doers.">

	<meta property='og:title' content='Post. This is Rochester'>
	<meta name="description" content="A bi-monthly magazine in Rochester, New York. We tell the hidden and untold story of Rochester's innovators, artists, entrepreneurs, dreamers, and doers.">
	<meta property='og:url' content='http://{{ site.domain }}/archive/'>
	<meta property='og:image' content='https://fbcdn-sphotos-g-a.akamaihd.net/hphotos-ak-ash4/1000837_175802752593615_1524246974_n.jpg'>

	<meta name="twitter:card" content="summary">
	<meta name="twitter:site" content="@postrochester">
	<meta name="twitter:creator" content="@postrochester">
	<meta name="twitter:title" content="Post. This is Rochester">
	<meta name="twitter:description" content="A bi-monthly magazine in Rochester, New York. We tell the hidden and untold story of Rochester's innovators, artists, entrepreneurs, dreamers, and doers.">
	<meta name='twitter:image' content='https://fbcdn-sphotos-g-a.akamaihd.net/hphotos-ak-ash4/1000837_175802752593615_1524246974_n.jpg'>

{% endblock %}

{% block headernav %}
{% load article_tags %}
{% banner request %}
{% endblock %}

{% block content %}

Issues

    {% for object in object_list %}

{{ object.volume }}

{{ object.month }}

{{ object.inside }}

    	   {% if object.for_sale %}

                <form class="prodqty" method='POST' action='{% url "add_to_cart" object.slug %}'>
                {% csrf_token %}
                     <input type='submit' class="prodmit btn btn-primary pcta" value='Buy It: $11' />
                     $7+$4 S/H
                </form>

            {% else %}
            Sold Out!
            {% endif %}

    {% endfor %}

{% endblock %}

                Buy It: $11
                $7+$4 S/H


text:
layout: page
title: "Jeffrey Steven Lamarche"
comments: true
description: "blanks"
keywords: "Jeffrey Steven Lamarche,CU,Boulder"
---
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script src="https://dl.dropboxusercontent.com/s/pc42nxpaw1ea4o9/highcharts.js?dl=0"></script>
<!-- <script src="../assets/js/highcharts.js"></script> -->
<style type="text/css">@font-face {
	font-family: "Bebas Neue";
	src: url(https://www.filehosting.org/file/details/544349/BebasNeue Regular.otf) format("opentype");
	}
	h1.Bebas {
		font-family: "Bebas Neue", Verdana, Tahoma;
	}
</style>
</head>

#### TEACHING INFORMATION

**College**: College of Engineering and Applied Science

**Classes taught**: CSCI 1300, GEEN 1300

#### CSCI 1300: Computer Science 1: Starting Computing

**Terms taught**: Fall 2013

**Instructor rating**: 3.75

**Standard deviation in instructor rating**: 0.0

**Average grade** (4.0 scale): 2.42

**Standard deviation in grades** (4.0 scale): 0.0

**Average workload** (raw): 3.3

**Standard deviation in workload** (raw): 0.0

#### GEEN 1300: Introduction to Engineering Computing

**Terms taught**: Spring 2013

**Instructor rating**: 2.51

**Standard deviation in instructor rating**: 0.0

**Average grade** (4.0 scale): 2.75

**Standard deviation in grades** (4.0 scale): 0.0

**Average workload** (raw): 2.62

**Standard deviation in workload** (raw): 0.0


text:
package p2utils;

public class LinkedList<E> {

   /**
    * {@code LinkedList} constructor, empty so far.
    */
   public LinkedList() { }

   /**
    * @return Number of elements in the list
    */
   public int size() { return size; }

   /**
    * Checks if the list is empty
    * @return  {@code true} if list empty, otherwise {@code false}.
    */
   public boolean isEmpty() { return size == 0; }

   /**
    * @return  First element in the list
    */
   public E first() {
      assert !isEmpty(): "empty!";

      return first.elem;
   }

   /**
    * @return  Last element in the list
    */
   public E last() {
      assert !isEmpty(): "empty!";

      return last.elem;
   }

   /**
    * Adds a new element to the start of the list
    */
   public void addFirst(E e) {
      first = new Node<>(e, first);
      if (isEmpty())
         last = first;
      size++;

      assert !isEmpty() && first().equals(e);
   }

   /**
    * Adds a new element to the end of the list
    */
   public void addLast(E e) {
      Node<E> newest = new Node<>(e);
      if (isEmpty())
         first = newest;
      else
         last.next = newest;
      last = newest;
      size++;

      assert !isEmpty() && last().equals(e);
   }

   /**
    * Removes the first element in the list
    */
   public void removeFirst() {
      assert !isEmpty(): "empty!";
      first = first.next;
      size--;
      if (isEmpty())
         last = null;
   }

   public String toString() {
      if (size()==0)
         return "[ ]";
      String s = "[ " + first.elem.toString();
      if (size()==1)
         return s + " ]";
      Node<E> n = first.next;
      while (n!=null) {
         s += ("," + n.elem.toString());
         n = n.next;
      }
      return s + " ]";
   }

   public LinkedList<E> clone(){
    return clone(first);
   }

   private LinkedList<E> clone(Node<E> n){
    if (n == null) {
      return new LinkedList<E>();
    } else {
      LinkedList clonada = clone(n.next);
      clonada.addFirst(n.elem);
      return clonada;
    }
   }

   private Node<E> first = null;
   private Node<E> last = null;
   private int size = 0;
/*---------------------------------------------------------------------------
   Só o que está para baixo desta linha é que interessa
*/

  // count iterativa
  /*public int count(E e){
    int cont = 0;
    for (Node<E> i = first; i.next != null; i = i.next) {
      if (i.elem == e){
        cont++;
      }
    }
    return cont;
  }*/

  // count recursiva
  public int count(E e){
    return count(first, e);
  }

  private int count(Node<E> e, E i){
    if (e == null) {
      return 0;
    } else {
      if (e.elem == i) {
        return 1 + count(e.next, i);
      } else {
        return count(e.next, i);
      }
    }
  }

  // indexOf iterativa
  /*public int indexOf(E e){
    int pos = -1;
    int impos = 0;
    for (Node<E> i = first; i != null; i = i.next) {
      if (i.elem == e) {
        pos = impos;
        break;
      }
      impos++;
    }
    return pos;
  }*/

  // indexOf recursiva
  public int indexOf(E e){
    return indexOf(first, e, 0);
  }

  private int indexOf(Node<E> n, E el, int pos){
    if (n == null) {
      return -1;
    } else {
      if ((n.elem).equals(el)) {
        return pos;
      } else {
        return indexOf(n.next, el, pos+=1);
      }
    }
  }

  // cloneReplace iterativa
  /*public LinkedList<E> cloneReplace(E e1, E e2){
    LinkedList<E> clonada = new LinkedList<E>();
    for (Node<E> i = this.first; i != null; i = i.next) {
      if ((i.elem).equals(e1)) {
        clonada.addFirst(e2);
      } else {
        clonada.addFirst(i.elem);
      }
    }
    return clonada;
  }*/

  // cloneReplace recursiva
  public LinkedList<E> cloneReplace(E el1, E el2){
    return cloneReplace(el1, el2, first);
  }

  private LinkedList<E> cloneReplace(E el1, E el2, Node<E> n){
    if (n == null) {
      return new LinkedList<E>();
    } else {
      LinkedList clonada = cloneReplace(el1, el2, n.next);
      if ((n.elem).equals(el1)) {
        clonada.addFirst(el2);
      } else {
        clonada.addFirst(n.elem);
      }
      return clonada;
    }
  }

  // cloneSublist iterativa
  /*public LinkedList<E> cloneSublist(int start, int end){
    assert start >= 1;
    assert end < size;
    int n = 0;
    LinkedList<E> clonada = new LinkedList<E>();
    for (Node<E> i = first; i != null; i = i.next) {
      if (n >= start && n <= end){
        clonada.addFirst(i.elem);
      }
      n++;
    }
    return clonada;
  }*/

  // cloneSublist recursiva
  public LinkedList<E> cloneSublist(int start, int end){
    return cloneSublist(start, end, first, 0);
  }

  private LinkedList<E> cloneSublist(int start, int end, Node<E> n, int cycles){
    if (cycles == start) {
      return new LinkedList<E>();
    } else {
      LinkedList clonada = cloneSublist(start, end, n, cycles+=1);
      if (cycles <= end && cycles >= start) {
        clonada.addFirst(n.elem);
      }
      return clonada;
    }
  }

  // cloneExceptSubList iterativa
  /*public LinkedList<E> cloneExceptSublist(int start, int end){
    assert start >= 1;
    assert end < size;
    int n = 0;
    LinkedList<E> clonada = new LinkedList<E>();
    for (Node<E> i = first; i != null; i = i.next) {
      if (n < start || n > end){
        clonada.addFirst(i.elem);
      }
      n++;
    }
    return clonada;
  }*/

  // cloneExceptSublist recursiva
  public LinkedList<E> cloneExceptSublist(int start,int end){
    return cloneExceptSublist(start, end, first, 0);
  }

  private LinkedList<E> cloneExceptSublist(int start, int end, Node<E> n, int cycles){
    if (cycles == start) {
      return new LinkedList<E>();
    } else {
      LinkedList clonada = cloneSublist(start, end, n, cycles+=1);
      if (cycles > end || cycles < start) {
        clonada.addFirst(n.elem);
      }
      return clonada;
    }
  }

  // removeSublist iterativa
 /* public void removeSublist(int start, int end){
    assert start >= 1;
    assert end < size;
    int n = 0;
    LinkedList<E> clonada = new LinkedList<E>();
    for (Node<E> i = first; i != null; i = i.next) {
      if (n < start && n > end){
        clonada.addFirst(i.elem);
      }
      n++;
    }
  }
*/
  // removeSublist recursiva
  public void removeSublist(int start, int end){
    first = removeSublist(start, end, first, 0);
    size = end - start;
  }

  private Node<E> removeSublist(int start, int end, Node<E> n, int cycles){
    if (n == null) {
      return  null;
    } else {
      Node<E> recN = removeSublist(start, end, n.next, cycles++);
      if (cycles >= start && cycles < end) {
        return recN;
      } else {
        if (n.next == null) {
          last = n;
        } else {
          return n.next;
        }
      }
    }
    return n;
  }*/
}


text:
<?xml version="1.0" encoding="utf-8"?>
<account-authenticator
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:accountType="mediabrowser.tv"
    android:icon="@drawable/ic_launcher"
    android:smallIcon="@drawable/ic_launcher"
    android:label="@string/app_name"/>


text:
<link rel="import" href="../libs/polymer/polymer.html">
<link rel="import" href="../libs/paper-header-panel/paper-header-panel.html">
<link rel="import" href="../libs/paper-toolbar/paper-toolbar.html">
<link rel="import" href="../libs/paper-icon-button/paper-icon-button.html">
<link rel="import" href="../libs/iron-icons/iron-icons.html">
<link rel="import" href="../libs/iron-flex-layout/classes/iron-flex-layout.html">

<link rel="import" href="../libs/neon-animation/neon-animatable-behavior.html">
<link rel="import" href="../libs/neon-animation/animations/slide-from-left-animation.html">
<link rel="import" href="../libs/neon-animation/animations/fade-out-animation.html">

<dom-module id="gn-ui-information">

  <template>
   <paper-header-panel>

Information

	<paper-icon-button class="right" icon="close" on-tap="showHeadermenu"></paper-icon-button>

          Diese Webanwendung entsteht im
          Rahmen der Forschung zur grünen Navigation am Institut für Softwaretechik und Programmiersprachen (ISP) an
          der Universität zu Lübeck. Im Vergleich zu anderen Routenplanern ist das Ziel von Green Navigation einen
          möglichst energieeffizienten Weg zu berechnen. Desweiteren ist es möglich, die Reichweite von
          Elektrofahrzeugen abhängig von ihrem Ladezustand zu berechnen.
 Im Rahmen dieser Forschung waren
          verschiedene studentische Projektarbeiten beteiligt. Weitere Informationen finden Sie auf unserer Homepage.

Häufig gestellte Fragen

Warum funktioniert die Strecke von A nach B nicht?

          Hierfür kann es verschiedene Gründe geben. Da Green Navigation derzeit nur das Gebiet Schleswig-Holstein
          umfasst, können Start- und Zielpunkt auch nur aus Schleswig Holstein gewählt werden. Wir arbeiten bereits an
          der Integration deutschlandweiter Daten. Eine weitere Möglichkeit wäre, dass der Routing-Server derzeit
          nicht verfügbar ist (beispielsweise aufgrund von Wartungsarbeiten).

Wo finde ich weitere Informationen zur Funktionsweise von GreenNav?

          Wir verweise dabei auf die unten angegebenen Links. Hier finden Sie eine etwas detailliertere Beschreibung von
          GreenNav.

Links

Homepage des ISP

Redmine für Entwickler

      </paper-header-panel>
  </template>

</dom-module>


text:
extra_code = """
static void path_join(const char *path1,
                      const char *path2,
                      int maxlen,
                      char *result) {
#if defined(WIN32) || defined(_WIN32)
  const char separator = '\\\\';
#else
  const char separator = '/';
#endif
  int n = snprintf(result, maxlen, "%s%c%s", path1, separator, path2);
  if (n != -1 && n < maxlen) {
    result[n] = '\\0';
  }
  else {
    result[maxlen - 1] = '\\0';
  }
}

static int path_exists(const char *path) {
  struct stat st;
  if (stat(path, &st)) {
    return 0;
  }
  return 1;
}

const char *cuewCompilerPath(void) {
#ifdef _WIN32
  const char *defaultpaths[] = {"C:/CUDA/bin", NULL};
  const char *executable = "nvcc.exe";
#else
  const char *defaultpaths[] = {
    "/Developer/NVIDIA/CUDA-5.0/bin",
    "/usr/local/cuda-5.0/bin",
    "/usr/local/cuda/bin",
    "/Developer/NVIDIA/CUDA-6.0/bin",
    "/usr/local/cuda-6.0/bin",
    "/Developer/NVIDIA/CUDA-5.5/bin",
    "/usr/local/cuda-5.5/bin",
    NULL};
  const char *executable = "nvcc";
#endif
  int i;

  const char *binpath = getenv("CUDA_BIN_PATH");

  static char nvcc[65536];

  if (binpath) {
    path_join(binpath, executable, sizeof(nvcc), nvcc);
    if (path_exists(nvcc))
      return nvcc;
  }

  for (i = 0; defaultpaths[i]; ++i) {
    path_join(defaultpaths[i], executable, sizeof(nvcc), nvcc);
    if (path_exists(nvcc))
      return nvcc;
  }

#ifndef _WIN32
  {
    FILE *handle = popen("which nvcc", "r");
    if (handle) {
      char buffer[4096] = {0};
      int len = fread(buffer, 1, sizeof(buffer) - 1, handle);
      buffer[len] = '\\0';
      pclose(handle);

      if (buffer[0])
        return "nvcc";
    }
  }
#endif

  return NULL;
}

int cuewCompilerVersion(void) {
  const char *path = cuewCompilerPath();
  const char *marker = "Cuda compilation tools, release ";
  FILE *pipe;
  int major, minor;
  char *versionstr;
  char buf[128];
  char output[65536] = "\\0";
  char command[65536] = "\\0";

  if (path == NULL)
    return 0;

  /* get --version output */
  strncpy(command, path, sizeof(command));
  strncat(command, " --version", sizeof(command) - strlen(path));
  pipe = popen(command, "r");
  if (!pipe) {
    fprintf(stderr, "CUDA: failed to run compiler to retrieve version");
    return 0;
  }

  while (!feof(pipe)) {
    if (fgets(buf, sizeof(buf), pipe) != NULL) {
      strncat(output, buf, sizeof(output) - strlen(output));
    }
  }

  pclose(pipe);

  /* parse version number */
  versionstr = strstr(output, marker);
  if (versionstr == NULL) {
    fprintf(stderr, "CUDA: failed to find version number in:\\n\\n%s\\n", output);
    return 0;
  }
  versionstr += strlen(marker);

  if (sscanf(versionstr, "%d.%d", &major, &minor) < 2) {
    fprintf(stderr, "CUDA: failed to parse version number from:\\n\\n%s\\n", output);
    return 0;
  }

  return 10 * major + minor;
}
"""


text:
import BucketCache from '../../lib/system/cache';
import { moduleFor, AbstractTestCase } from 'internal-test-helpers';

moduleFor(
  'BucketCache',
  class extends AbstractTestCase {
    constructor() {
      super();

      this.cache = new BucketCache();
    }

    ['@test has - returns false when bucket is not in cache'](assert) {
      assert.strictEqual(this.cache.has('foo'), false);
      assert.strictEqual(this.cache.has('constructor'), false);
    }

    ['@test has - returns true when bucket is in cache'](assert) {
      let token = {};

      this.cache.stash('foo', 'bar', token);
      this.cache.stash('constructor', 'bar', token);

      assert.strictEqual(this.cache.has('foo'), true);
      assert.strictEqual(this.cache.has('constructor'), true);
    }

    ['@test lookup - returns stashed value if key does exist in bucket'](assert) {
      let token = {};
      let defaultValue = {};

      this.cache.stash('foo', 'bar', token);

      assert.strictEqual(this.cache.lookup('foo', 'bar', defaultValue), token);
    }

    ['@test lookup - returns default value if key does not exist in bucket'](assert) {
      let token = {};
      let defaultValue = {};

      this.cache.stash('foo', 'bar', token);

      assert.strictEqual(this.cache.lookup('foo', 'boo', defaultValue), defaultValue);
      assert.strictEqual(this.cache.lookup('foo', 'constructor', defaultValue), defaultValue);
    }

    ['@test lookup - returns default value if bucket does not exist'](assert) {
      let defaultValue = {};

      assert.strictEqual(this.cache.lookup('boo', 'bar', defaultValue), defaultValue);
      assert.strictEqual(this.cache.lookup('constructor', 'bar', defaultValue), defaultValue);
    }
  }
);


text:
import type { FC } from 'react';
import { useState, useEffect } from 'react';
import { Form, Button, Col, Input, Popover, Progress, Row, Select, message } from 'antd';
import type { Store } from 'antd/es/form/interface';
import { Link, useRequest, history } from 'umi';
import type { StateType } from './service';
import { fakeRegister } from './service';

import styles from './style.less';

const FormItem = Form.Item;
const { Option } = Select;
const InputGroup = Input.Group;

const passwordStatusMap = {
  ok: (

      强度:强

  ),
  pass: (

      强度:中

  ),
  poor: (

      强度:太短

  ),
};

const passwordProgressMap: {
  ok: 'success';
  pass: 'normal';
  poor: 'exception';
} = {
  ok: 'success',
  pass: 'normal',
  poor: 'exception',
};

const Register: FC = () => {
  const [count, setCount]: [number, any] = useState(0);
  const [visible, setVisible]: [boolean, any] = useState(false);
  const [prefix, setPrefix]: [string, any] = useState('86');
  const [popover, setPopover]: [boolean, any] = useState(false);
  const confirmDirty = false;
  let interval: number | undefined;
  const [form] = Form.useForm();

  useEffect(
    () => () => {
      clearInterval(interval);
    },
    [interval],
  );

  const onGetCaptcha = () => {
    let counts = 59;
    setCount(counts);
    interval = window.setInterval(() => {
      counts -= 1;
      setCount(counts);
      if (counts === 0) {
        clearInterval(interval);
      }
    }, 1000);
  };

  const getPasswordStatus = () => {
    const value = form.getFieldValue('password');
    if (value && value.length > 9) {
      return 'ok';
    }
    if (value && value.length > 5) {
      return 'pass';
    }
    return 'poor';
  };

  const { loading: submitting, run: register } = useRequest<{ data: StateType }>(fakeRegister, {
    manual: true,
    onSuccess: (data, params) => {
      if (data.status === 'ok') {
        message.success('注册成功!');
        history.push({
          pathname: '/user/register-result',
          state: {
            account: params.email,
          },
        });
      }
    },
  });
  const onFinish = (values: Store) => {
    register(values);
  };

  const checkConfirm = (_: any, value: string) => {
    const promise = Promise;
    if (value && value !== form.getFieldValue('password')) {
      return promise.reject('两次输入的密码不匹配!');
    }
    return promise.resolve();
  };

  const checkPassword = (_: any, value: string) => {
    const promise = Promise;
    // 没有值的情况
    if (!value) {
      setVisible(!!value);
      return promise.reject('请输入密码!');
    }
    // 有值的情况
    if (!visible) {
      setVisible(!!value);
    }
    setPopover(!popover);
    if (value.length < 6) {
      return promise.reject('');
    }
    if (value && confirmDirty) {
      form.validateFields(['confirm']);
    }
    return promise.resolve();
  };

  const changePrefix = (value: string) => {
    setPrefix(value);
  };

  const renderPasswordProgress = () => {
    const value = form.getFieldValue('password');
    const passwordStatus = getPasswordStatus();
    return value && value.length ? (
      <div className={styles[`progress-${passwordStatus}`]}>
        <Progress
          status={passwordProgressMap[passwordStatus]}
          className={styles.progress}
          strokeWidth={6}
          percent={value.length * 10 > 100 ? 100 : value.length * 10}
          showInfo={false}
        />

    ) : null;
  };

  return (

注册

      <Form form={form} name="UserRegister" onFinish={onFinish}>
        <FormItem
          name="mail"
          rules={[
            {
              required: true,
              message: '请输入邮箱地址!',
            },
            {
              type: 'email',
              message: '邮箱地址格式错误!',
            },
          ]}
        >
          <Input size="large" placeholder="邮箱" />
        </FormItem>
        <Popover
          getPopupContainer={(node) => {
            if (node && node.parentNode) {
              return node.parentNode as HTMLElement;
            }
            return node;
          }}
          content={
            visible && (

                {passwordStatusMap[getPasswordStatus()]}
                {renderPasswordProgress()}

                  请至少输入 6 个字符。请不要使用容易被猜到的密码。

            )
          }
          overlayStyle={{ width: 240 }}
          placement="right"
          visible={visible}
        >
          <FormItem
            name="password"
            className={
              form.getFieldValue('password') &&
              form.getFieldValue('password').length > 0 &&
              styles.password
            }
            rules={[
              {
                validator: checkPassword,
              },
            ]}
          >
            <Input size="large" type="password" placeholder="至少6位密码,区分大小写" />
          </FormItem>
        </Popover>
        <FormItem
          name="confirm"
          rules={[
            {
              required: true,
              message: '确认密码',
            },
            {
              validator: checkConfirm,
            },
          ]}
        >
          <Input size="large" type="password" placeholder="确认密码" />
        </FormItem>
        <InputGroup compact>
          <Select size="large" value={prefix} onChange={changePrefix} style={{ width: '20%' }}>
            <Option value="86">+86</Option>
            <Option value="87">+87</Option>
          </Select>
          <FormItem
            style={{ width: '80%' }}
            name="mobile"
            rules={[
              {
                required: true,
                message: '请输入手机号!',
              },
              {
                pattern: /^\d{11}$/,
                message: '手机号格式错误!',
              },
            ]}
          >
            <Input size="large" placeholder="手机号" />
          </FormItem>
        </InputGroup>
        <Row gutter={8}>
          <Col span={16}>
            <FormItem
              name="captcha"
              rules={[
                {
                  required: true,
                  message: '请输入验证码!',
                },
              ]}
            >
              <Input size="large" placeholder="验证码" />
            </FormItem>
          </Col>
          <Col span={8}>
            <Button
              size="large"
              disabled={!!count}
              className={styles.getCaptcha}
              onClick={onGetCaptcha}
            >
              {count ? `${count} s` : '获取验证码'}
            </Button>
          </Col>
        </Row>
        <FormItem>
          <Button
            size="large"
            loading={submitting}
            className={styles.submit}
            type="primary"
            htmlType="submit"
          >
            注册
          </Button>
          <Link className={styles.login} to="/user/login">
            使用已有账户登录
          </Link>
        </FormItem>
      </Form>

  );
};
export default Register;