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

<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<TITLE>
Uses of Interface edu.uci.ics.jung.graph.Forest (jung2 2.0.1 API)
</TITLE>

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../../stylesheet.css" TITLE="Style">

      Overview
      Package
      Class
    Use
      Tree
      Deprecated
      Index
      Help

 PREV
 NEXT

  FRAMES
 NO FRAMES

  All Classes

Uses of Interface
edu.uci.ics.jung.graph.Forest

Packages that use Forest

edu.uci.ics.jung.algorithms.layout
Algorithms for assigning 2D coordinates (typically used for graph visualizations)
to vertices.

edu.uci.ics.jung.algorithms.shortestpath
Provides interfaces and classes for calculating (geodesic) distances and shortest paths.

edu.uci.ics.jung.graph
Interfaces for the JUNG graph types, and some representative implementations.

edu.uci.ics.jung.graph.util
Utility interfaces and classes for the JUNG API.

edu.uci.ics.jung.visualization.subLayout
Visualization mechanisms relating to grouping or hiding specified element sets.

Uses of Forest in edu.uci.ics.jung.algorithms.layout

Fields in edu.uci.ics.jung.algorithms.layout declared as Forest

protected  Forest<V,E>
TreeLayout.graph

Constructors in edu.uci.ics.jung.algorithms.layout with parameters of type Forest

BalloonLayout(Forest<V,E> g)

          Creates an instance based on the input forest.

RadialTreeLayout(Forest<V,E> g)

          Creates an instance for the specified graph with default X and Y distances.

RadialTreeLayout(Forest<V,E> g,
                 int distx)

          Creates an instance for the specified graph and X distance with
 default Y distance.

RadialTreeLayout(Forest<V,E> g,
                 int distx,
                 int disty)

          Creates an instance for the specified graph, X distance, and Y distance.

TreeLayout(Forest<V,E> g)

          Creates an instance for the specified graph with default X and Y distances.

TreeLayout(Forest<V,E> g,
           int distx)

          Creates an instance for the specified graph and X distance with
 default Y distance.

TreeLayout(Forest<V,E> g,
           int distx,
           int disty)

          Creates an instance for the specified graph, X distance, and Y distance.

Uses of Forest in edu.uci.ics.jung.algorithms.shortestpath

Fields in edu.uci.ics.jung.algorithms.shortestpath declared as Forest

protected  Forest<V,E>
MinimumSpanningForest.forest

protected  Forest<V,E>
MinimumSpanningForest2.forest

Methods in edu.uci.ics.jung.algorithms.shortestpath that return Forest

 Forest<V,E>
MinimumSpanningForest.getForest()

          Returns the generated forest.

 Forest<V,E>
MinimumSpanningForest2.getForest()

          Returns the generated forest.

Constructors in edu.uci.ics.jung.algorithms.shortestpath with parameters of type Forest

MinimumSpanningForest(Graph<V,E> graph,
                      Forest<V,E> forest,
                      V root)

          Creates a minimum spanning forest from the supplied graph, populating the
 supplied Forest, which must be empty.

Uses of Forest in edu.uci.ics.jung.graph

Subinterfaces of Forest in edu.uci.ics.jung.graph

 interface
Tree<V,E>

          A subtype of Graph which is a (directed, rooted) tree.

Classes in edu.uci.ics.jung.graph that implement Forest

 class
DelegateForest<V,E>

          An implementation of Forest<V,E> that delegates to a specified DirectedGraph
 instance.

 class
DelegateTree<V,E>

          An implementation of Tree<V,E> that delegates to
 a specified instance of DirectedGraph<V,E>.

 class
OrderedKAryTree<V,E>

          An implementation of Tree in which each vertex has
 <= k children.

Uses of Forest in edu.uci.ics.jung.graph.util

Methods in edu.uci.ics.jung.graph.util with parameters of type Forest

static

<V,E> void

TreeUtils.addFromSubTree(Forest<V,E> tree,
               Forest<V,E> subTree,
               E edge,
               V parent,
               V root)

          Adds the trees in source to destination.

static

<V,E> void

TreeUtils.addFromSubTree(Forest<V,E> tree,
               Forest<V,E> subTree,
               E edge,
               V parent,
               V root)

          Adds the trees in source to destination.

static

<V,E> void

TreeUtils.addSubTree(Forest<V,E> tree,
           Forest<V,E> subTree,
           V node,
           E connectingEdge)

          Connects subTree to tree by attaching it as a child
 of node with edge connectingEdge.

static

<V,E> void

TreeUtils.addSubTree(Forest<V,E> tree,
           Forest<V,E> subTree,
           V node,
           E connectingEdge)

          Connects subTree to tree by attaching it as a child
 of node with edge connectingEdge.

static

<V,E> List<V>

TreeUtils.getRoots(Forest<V,E> forest)

          Returns the roots of this forest.

static

<V,E> Tree<V,E>

TreeUtils.getSubTree(Forest<V,E> forest,
           V root)

          Returns the subtree of tree which is rooted at root as a Forest<V,E>.

static

<V,E> void

TreeUtils.growSubTree(Forest<V,E> tree,
            Forest<V,E> subTree,
            V root)

          Populates subtree with the subtree of tree
 which is rooted at root.

static

<V,E> void

TreeUtils.growSubTree(Forest<V,E> tree,
            Forest<V,E> subTree,
            V root)

          Populates subtree with the subtree of tree
 which is rooted at root.

static

<V,E> edu.uci.ics.jung.graph.util.Graphs.SynchronizedForest<V,E>

Graphs.synchronizedForest(Forest<V,E> forest)

          Returns a synchronized Forest backed by the passed Forest.

static

<V,E> edu.uci.ics.jung.graph.util.Graphs.UnmodifiableForest<V,E>

Graphs.unmodifiableForest(Forest<V,E> forest)

          Returns an unmodifiable Forest backed by the passed forest.

Uses of Forest in edu.uci.ics.jung.visualization.subLayout

Methods in edu.uci.ics.jung.visualization.subLayout with parameters of type Forest

 void
TreeCollapser.collapse(Layout layout,
         Forest tree,
         Object subRoot)

 void
TreeCollapser.expand(Forest tree,
       Forest subTree)

 void
TreeCollapser.expand(Forest tree,
       Forest subTree)

      Overview
      Package
      Class
    Use
      Tree
      Deprecated
      Index
      Help

 PREV
 NEXT

  FRAMES
 NO FRAMES

  All Classes

Copyright © 2010 null. All Rights Reserved.


text:
title: Style Guide
type: guide
order: 4
---

This section expands on [Clojure Best Practices](https://github.com/bbatsov/clojure-style-guide) adding additional suggestions that I feel were not clear / or not included in the above.  Mostly though, the above is all you need.

## File Naming Conventions

Everything is lisp case - file names, folder names etc.  Here is a sample folder structure using lisp-case

```clojure
└── project-name/
    └── src/
        └── project-name/
            └── core.clj
```

This seems to fall under a broder category of `Delimiter-Separated` which just means that multiple words are separated by a special character like a hyphen `-` or an underscore `_`.

redpajama_set_name: RedPajamaGithub


text:
[![Ember.js Ottawa logo](../../img/ember-ottawa.jpeg)](http://www.meetup.com/Ember-js-Ottawa/)

Wednesday, 4th February, 6:30pm @ bv02

Follow [@EmberOttawa](http://www.twitter.com/EmberOttawa)

--

### Call for Speakers

- Beginner or Advanced topic
- Project you're working on
- Workshop/hack night

---

### [EmberConf](http://emberconf.com/)

--

### Ottawa.js Meetup

[![Ottawa.js logo](../../img/ottawajs.png)](http://www.meetup.com/Ottawa-JavaScript/)

Wednesday, 14th January @ 6:30pm

Follow [@ottawa_js](http://www.twitter.com/ottawa_js)

--

Also, check out the [Ottawa Meetup Calendar](http://ottawa.infilexfil.com/)

by [@INFILEXFIL](http://www.twitter.com/INFILEXFIL)


text:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<feed><tipo>Rua</tipo><logradouro>D</logradouro><bairro>Ponto Novo</bairro><cidade>Aracaju</cidade><uf>SE</uf><cep>49097656</cep></feed>


text:
package org.apache.geode.modules.session;

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

import java.beans.PropertyChangeEvent;
import java.io.PrintWriter;
import java.io.Serializable;

import javax.servlet.http.HttpSession;

import com.meterware.httpunit.GetMethodWebRequest;
import com.meterware.httpunit.WebConversation;
import com.meterware.httpunit.WebRequest;
import com.meterware.httpunit.WebResponse;
import org.apache.catalina.core.StandardWrapper;
import org.apache.logging.log4j.Logger;
import org.junit.ClassRule;
import org.junit.Rule;
import org.junit.Test;

import org.apache.geode.cache.Region;
import org.apache.geode.logging.internal.log4j.api.LogService;
import org.apache.geode.modules.session.catalina.DeltaSessionManager;
import org.apache.geode.test.dunit.rules.CacheRule;
import org.apache.geode.test.dunit.rules.DistributedRule;

public abstract class TestSessionsTomcat8Base implements Serializable {

  @ClassRule
  public static DistributedRule distributedTestRule = new DistributedRule();

  @Rule
  public CacheRule cacheRule = new CacheRule();
  protected Logger logger = LogService.getLogger();

  int port;
  EmbeddedTomcat8 server;
  StandardWrapper servlet;
  Region<String, HttpSession> region;
  DeltaSessionManager sessionManager;

  public void basicConnectivityCheck() throws Exception {
    WebConversation wc = new WebConversation();
    assertThat(wc).describedAs("WebConversation was").isNotNull();
    logger.debug("Sending request to http://localhost:{}/test", port);
    WebRequest req = new GetMethodWebRequest(String.format("http://localhost:%d/test", port));
    assertThat(req).describedAs("WebRequest was").isNotNull();
    req.setParameter("cmd", QueryCommand.GET.name());
    req.setParameter("param", "null");
    WebResponse response = wc.getResponse(req);
    assertThat(response).describedAs("WebResponse was").isNotNull();
    assertThat(response.getNewCookieNames()[0]).describedAs("SessionID was")
        .isEqualTo("JSESSIONID");
  }

  /**
   * Test callback functionality. This is here really just as an example. Callbacks are useful to
   * implement per test actions which can be defined within the actual test method instead of in a
   * separate servlet class.
   */
  @Test
  public void testCallback() throws Exception {
    final String helloWorld = "Hello World";
    Callback c = (request, response) -> {
      PrintWriter out = response.getWriter();
      out.write(helloWorld);
    };
    servlet.getServletContext().setAttribute("callback", c);

    WebConversation wc = new WebConversation();
    WebRequest req = new GetMethodWebRequest(String.format("http://localhost:%d/test", port));
    req.setParameter("cmd", QueryCommand.CALLBACK.name());
    req.setParameter("param", "callback");

    WebResponse response = wc.getResponse(req);
    assertThat(response.getText()).isEqualTo(helloWorld);
  }

  /**
   * Test that calling session.isNew() works for the initial as well as subsequent requests.
   */
  @Test
  public void testIsNew() throws Exception {
    Callback c = (request, response) -> {
      HttpSession session = request.getSession();
      response.getWriter().write(Boolean.toString(session.isNew()));
    };
    servlet.getServletContext().setAttribute("callback", c);

    WebConversation wc = new WebConversation();
    WebRequest req = new GetMethodWebRequest(String.format("http://localhost:%d/test", port));

    req.setParameter("cmd", QueryCommand.CALLBACK.name());
    req.setParameter("param", "callback");

    WebResponse response = wc.getResponse(req);
    assertThat(response.getText()).isEqualTo("true");
    response = wc.getResponse(req);
    assertThat(response.getText()).isEqualTo("false");
  }

  /**
   * Check that our session persists. The values we pass in as query params are used to set
   * attributes on the session.
   */
  @Test
  public void testSessionPersists1() throws Exception {
    String key = "value_testSessionPersists1";
    String value = "Foo";

    WebConversation wc = new WebConversation();
    WebRequest req = new GetMethodWebRequest(String.format("http://localhost:%d/test", port));
    req.setParameter("cmd", QueryCommand.SET.name());
    req.setParameter("param", key);
    req.setParameter("value", value);
    WebResponse response = wc.getResponse(req);

    String sessionId = response.getNewCookieValue("JSESSIONID");
    assertThat(sessionId).as("No apparent session cookie").isNotNull();

    // The request retains the cookie from the prior response...
    req.setParameter("cmd", QueryCommand.GET.name());
    req.setParameter("param", key);
    req.removeParameter("value");

    response = wc.getResponse(req);
    assertThat(response.getText()).isEqualTo(value);
  }

  /**
   * Test that invalidating a session makes it's attributes inaccessible.
   */
  @Test
  public void testInvalidate() throws Exception {
    String key = "value_testInvalidate";
    String value = "Foo";

    WebConversation wc = new WebConversation();
    WebRequest req = new GetMethodWebRequest(String.format("http://localhost:%d/test", port));

    // Set an attribute
    req.setParameter("cmd", QueryCommand.SET.name());
    req.setParameter("param", key);
    req.setParameter("value", value);
    wc.getResponse(req);

    // Invalidate the session
    req.removeParameter("param");
    req.removeParameter("value");
    req.setParameter("cmd", QueryCommand.INVALIDATE.name());
    wc.getResponse(req);

    // The attribute should not be accessible now...
    req.setParameter("cmd", QueryCommand.GET.name());
    req.setParameter("param", key);

    WebResponse response = wc.getResponse(req);
    assertThat(response.getText()).isEmpty();
  }

  /**
   * Test setting the session expiration
   */
  @Test
  public void testSessionExpiration1() throws Exception {
    // TestSessions only live for a second
    sessionManager.setMaxInactiveInterval(1);

    String key = "value_testSessionExpiration1";
    String value = "Foo";

    WebConversation wc = new WebConversation();
    WebRequest req = new GetMethodWebRequest(String.format("http://localhost:%d/test", port));

    // Set an attribute
    req.setParameter("cmd", QueryCommand.SET.name());
    req.setParameter("param", key);
    req.setParameter("value", value);
    wc.getResponse(req);

    // Sleep a while
    Thread.sleep(65000);

    // The attribute should not be accessible now...
    req.setParameter("cmd", QueryCommand.GET.name());
    req.setParameter("param", key);

    WebResponse response = wc.getResponse(req);
    assertThat(response.getText()).isEmpty();
  }

  /**
   * Test setting the session expiration via a property change as would happen under normal
   * deployment conditions.
   */
  @Test
  public void testSessionExpiration2() {
    // TestSessions only live for a minute
    sessionManager
        .propertyChange(new PropertyChangeEvent(server.getRootContext(), "sessionTimeout", 30, 1));

    // Check that the value has been set to 60 seconds
    assertThat(sessionManager.getMaxInactiveInterval()).isEqualTo(60);
  }

  /**
   * Test expiration of a session by the tomcat container, rather than gemfire expiration
   */
  @Test
  public void testSessionExpirationByContainer() throws Exception {
    String key = "value_testSessionExpiration1";
    String value = "Foo";

    WebConversation wc = new WebConversation();
    WebRequest req = new GetMethodWebRequest(String.format("http://localhost:%d/test", port));

    // Set an attribute
    req.setParameter("cmd", QueryCommand.SET.name());
    req.setParameter("param", key);
    req.setParameter("value", value);
    wc.getResponse(req);

    // Set the session timeout of this one session.
    req.setParameter("cmd", QueryCommand.SET_MAX_INACTIVE.name());
    req.setParameter("value", "1");
    wc.getResponse(req);

    // Wait until the session should expire
    Thread.sleep(2000);

    // Do a request, which should cause the session to be expired
    req.setParameter("cmd", QueryCommand.GET.name());
    req.setParameter("param", key);

    WebResponse response = wc.getResponse(req);
    assertThat(response.getText()).isEmpty();
  }

  /**
   * Test that removing a session attribute also removes it from the region
   */
  @Test
  public void testRemoveAttribute() throws Exception {
    String key = "value_testRemoveAttribute";
    String value = "Foo";

    WebConversation wc = new WebConversation();
    WebRequest req = new GetMethodWebRequest(String.format("http://localhost:%d/test", port));

    // Set an attribute
    req.setParameter("cmd", QueryCommand.SET.name());
    req.setParameter("param", key);
    req.setParameter("value", value);
    WebResponse response = wc.getResponse(req);
    String sessionId = response.getNewCookieValue("JSESSIONID");

    // Implicitly remove the attribute
    req.removeParameter("value");
    wc.getResponse(req);

    // The attribute should not be accessible now...
    req.setParameter("cmd", QueryCommand.GET.name());
    req.setParameter("param", key);

    response = wc.getResponse(req);
    assertThat(response.getText()).isEmpty();
    assertThat(region.get(sessionId).getAttribute(key)).isNull();
  }

  /**
   * Test that a session attribute gets set into the region too.
   */
  @Test
  public void testBasicRegion() throws Exception {
    String key = "value_testBasicRegion";
    String value = "Foo";

    WebConversation wc = new WebConversation();
    WebRequest req = new GetMethodWebRequest(String.format("http://localhost:%d/test", port));

    // Set an attribute
    req.setParameter("cmd", QueryCommand.SET.name());
    req.setParameter("param", key);
    req.setParameter("value", value);
    WebResponse response = wc.getResponse(req);

    String sessionId = response.getNewCookieValue("JSESSIONID");
    assertThat(region.get(sessionId).getAttribute(key)).isEqualTo(value);
  }

  /**
   * Test that a session attribute gets removed from the region when the session is invalidated.
   */
  @Test
  public void testRegionInvalidate() throws Exception {
    String key = "value_testRegionInvalidate";
    String value = "Foo";

    WebConversation wc = new WebConversation();
    WebRequest req = new GetMethodWebRequest(String.format("http://localhost:%d/test", port));

    // Set an attribute
    req.setParameter("cmd", QueryCommand.SET.name());
    req.setParameter("param", key);
    req.setParameter("value", value);
    WebResponse response = wc.getResponse(req);
    String sessionId = response.getNewCookieValue("JSESSIONID");

    // Invalidate the session
    req.removeParameter("param");
    req.removeParameter("value");
    req.setParameter("cmd", QueryCommand.INVALIDATE.name());

    wc.getResponse(req);
    assertThat(region.get(sessionId)).as("The region should not have an entry for this session")
        .isNull();
  }

  /**
   * Test that multiple attribute updates, within the same request result in only the latest one
   * being effective.
   */
  @Test
  public void testMultipleAttributeUpdates() throws Exception {
    final String key = "value_testMultipleAttributeUpdates";
    Callback c = (request, response) -> {
      HttpSession session = request.getSession();
      for (int i = 0; i < 1000; i++) {
        session.setAttribute(key, Integer.toString(i));
      }
    };
    servlet.getServletContext().setAttribute("callback", c);

    WebConversation wc = new WebConversation();
    WebRequest req = new GetMethodWebRequest(String.format("http://localhost:%d/test", port));

    // Execute the callback
    req.setParameter("cmd", QueryCommand.CALLBACK.name());
    req.setParameter("param", "callback");
    WebResponse response = wc.getResponse(req);

    String sessionId = response.getNewCookieValue("JSESSIONID");
    assertThat(region.get(sessionId).getAttribute(key)).isEqualTo("999");
  }

  /**
   * Test for issue #38 CommitSessionValve throws exception on invalidated sessions
   */
  @Test
  public void testCommitSessionValveInvalidSession() throws Exception {
    Callback c = (request, response) -> {
      HttpSession session = request.getSession();
      session.invalidate();
      response.getWriter().write("done");
    };
    servlet.getServletContext().setAttribute("callback", c);

    WebConversation wc = new WebConversation();
    WebRequest req = new GetMethodWebRequest(String.format("http://localhost:%d/test", port));

    // Execute the callback
    req.setParameter("cmd", QueryCommand.CALLBACK.name());
    req.setParameter("param", "callback");

    WebResponse response = wc.getResponse(req);
    assertThat(response.getText()).isEqualTo("done");
  }

  /**
   * Test for issue #45 Sessions are being created for every request
   */
  @Test
  public void testExtraSessionsNotCreated() throws Exception {
    Callback c = (request, response) -> {
      // Do nothing with sessions
      response.getWriter().write("done");
    };
    servlet.getServletContext().setAttribute("callback", c);

    WebConversation wc = new WebConversation();
    WebRequest req = new GetMethodWebRequest(String.format("http://localhost:%d/test", port));

    // Execute the callback
    req.setParameter("cmd", QueryCommand.CALLBACK.name());
    req.setParameter("param", "callback");

    WebResponse response = wc.getResponse(req);
    assertThat(response.getText()).isEqualTo("done");
    assertThat(region.size()).as("The region should contain one entry").isEqualTo(1);
  }

  /**
   * Test for issue #46 lastAccessedTime is not updated at the start of the request, but only at the
   * end.
   */
  @Test
  public void testLastAccessedTime() throws Exception {
    Callback c = (request, response) -> {
      HttpSession session = request.getSession();
      // Hack to expose the session to our test context
      session.getServletContext().setAttribute("session", session);
      session.setAttribute("lastAccessTime", session.getLastAccessedTime());
      try {
        Thread.sleep(100);
      } catch (InterruptedException ignored) {
      }
      session.setAttribute("somethingElse", 1);
      request.getSession();
      response.getWriter().write("done");
    };
    servlet.getServletContext().setAttribute("callback", c);

    WebConversation wc = new WebConversation();
    WebRequest req = new GetMethodWebRequest(String.format("http://localhost:%d/test", port));

    // Execute the callback
    req.setParameter("cmd", QueryCommand.CALLBACK.name());
    req.setParameter("param", "callback");
    wc.getResponse(req);

    HttpSession session = (HttpSession) servlet.getServletContext().getAttribute("session");
    Long lastAccess = (Long) session.getAttribute("lastAccessTime");
    assertThat(lastAccess <= session.getLastAccessedTime())
        .as("Last access time not set correctly: " + lastAccess + " not <= "
            + session.getLastAccessedTime())
        .isTrue();
  }
}


text:
/**
* billsync.directives Module
*
* A bunch of directives used over app
*/
angular.module('billsync.directives', [])

.directive('checklist', ['$http', '$rootScope', '$ionicModal', 'CurrentIndividualRes','$baseUrl', '$state',
function($http, $rootScope, $ionicModal, CurrentIndividualRes, $baseUrl, $state){
  return {
    // scope: {}, // {} = isolate, true = child, false/undefined = no change
    // controller: function($scope, $element, $attrs, $transclude) {},
    restrict: 'E',
    templateUrl: 'templates/checklist.tpl.html',
    link: function($scope, iElm, iAttrs, controller) {
      $rootScope.checklists = [
        { done: true,  msg: "Sign up" },//signUp:        0
        { done: false,  msg: "Add email" },//email:         1
        { done: false,  msg: "Add mobile number" },//mobileNumber:  2
        { done: false, msg: "Confirm email" },//confirmedEmail: 3
        { done: false, msg: "Add first bill (text, email, upload)" },//firstBill:     4
        { done: false, msg: "Add banking information" },//bankInfo:      5
        { done: false, msg: "Pay first bill on Due Date", disabled: true },//firstPayd:     6
        { done: false, msg: "Setup an auto-pay", disabled: true }//autoPay:       7
      ];

      $scope.$watch('currentIndividual', function (individual, oldIndividual) {
        if ( individual || oldIndividual) {
          var this_individual = individual || oldIndividual;

          $rootScope.checklists[1].done = this_individual.user.has_email;

          $rootScope.checklists[2].done = this_individual.user.has_mobile_number;
          $rootScope.checklists[2].url = 'app.tabs.profile';
          $rootScope.checklists[2].internal = true;

          $rootScope.checklists[3].done = this_individual.user.confirmed_email;

          $rootScope.checklists[4].done = this_individual.user.has_bills;
          $rootScope.checklists[4].url = 'http://bill-sync.com/save-time-take-a-picture-and-move-on/';

          $rootScope.checklists[5].done = this_individual.user.valid_user;
          $rootScope.checklists[5].url = 'app.tabs.profile';
          $rootScope.checklists[5].internal = true;

          $rootScope.checklists[6].done = this_individual.user.pay_first_bill;
          $rootScope.checklists[6].url = 'http://bill-sync.com/stay-focused-getting-to-know-the-home-screen/';

          $rootScope.checklists[7].done = this_individual.user.has_autopay;
          $rootScope.checklists[7].url = 'http://bill-sync.com/intelligent-auto-pay/';

          $rootScope.checkListValue = $scope.getCompletationPersent();

          if ($rootScope.checklists[4].done) {
            $rootScope.checklists[6].disabled = false;
            $rootScope.checklists[7].disabled = false;
          }

        }
      });

      $rootScope.valueBadge = 0;
      $scope.getCompletationPersent = function () {
        var percent = 0;
        angular.forEach($rootScope.checklists, function (list) {
          if ( list.done ) {
            percent++;
          }
          return true;
        });
        $rootScope.valueBadge = 8 - percent;
        return 8 - percent;
      };
      /*$scope.getCompletationPersent = function () {
        var percent = 0;
        angular.forEach($rootScope.checklists, function (list) {
          if ( list.done ) {
            percent++;
          }
          return true;
        });

        return 8 - percent;
      };*/

      $scope.toggleChecklist = function(){

      };

      $scope.openUrl = function (check) {
        if (check.internal) {
          $scope.popover.hide();
          $state.go(check.url);
        }
        else {
          window.open(check.url, '_system');
        }
      };
      /*$scope.unlockTreat = function() {
        var modalInstance = $modal.open({
          templateUrl: 'common/dilbert-completation-checklist.tpl.html',
          size: 'lg',
          controller: function ($scope, $modalInstance) {
            $scope.close = function () {
              $modalInstance.dismiss('cancel');
            };
          }
        });

        modalInstance.result.then(function () {
          $scope.markModalUsed();
          console.log('Upload Completed!');
        }, function () {
          $scope.markModalUsed();

          console.log('Modal dismissed at: ' + new Date());
        });
      };

      $scope.markModalUsed = function() {
        $scope.individualResource = new CurrentIndividualRes($scope.currentIndividual);
        $scope.individualResource.user.modal_used = true;
        $scope.individualResource.$update(function(response) {
          console.log('scucess');
          $scope.$emit('refresh:currentIndividual', {individual: response});
        });
      };*/

    }
  };
}]);


text:
<?PHP

namespace Openbizx\Easy\Element;

//include_once(OPENBIZ_BIN."/Easy/element/InputElement.php");

/**
 * InputText class is element for input text
 *
 * @package openbiz.bin.easy.element
 * @author Rocky Swen
 * @copyright Copyright (c) 2005-2009
 * @access public
 */
class BarcodeScanner extends InputElement
{
	protected function readMetaData(&$xmlArr){
		parent::readMetaData($xmlArr);
		$this->cssClass = isset($xmlArr["ATTRIBUTES"]["CSSCLASS"]) ? $xmlArr["ATTRIBUTES"]["CSSCLASS"] : "input_barcodescanner";
		$this->cssErrorClass = isset($xmlArr["ATTRIBUTES"]["CSSERRORCLASS"]) ? $xmlArr["ATTRIBUTES"]["CSSERRORCLASS"] : $this->cssClass."_error";
		$this->cssFocusClass = isset($xmlArr["ATTRIBUTES"]["CSSFOCUSCLASS"]) ? $xmlArr["ATTRIBUTES"]["CSSFOCUSCLASS"] : $this->cssClass."_focus";
	}
    /**
     * Render, draw the control according to the mode
     *
     * @return string HTML text
     */
    public function render()
    {
    	if($this->value!=null){
    		$value = $this->value;
    	}else{
    		$value = $this->getText();
    	}

    	if($value==""){
    		$value = $this->getDefaultValue();
    	}
        $disabledStr = ($this->getEnabled() == "N") ? "READONLY=\"true\"" : "";
        $style = $this->getStyle();
        $func = $this->getFunction();

        $formobj = $this->GetFormObj();
    	if($formobj->errors[$this->objectName]){
			$func .= "onchange=\"this.className='$this->cssClass'\"";
		}else{
			$func .= "onfocus=\"this.className='$this->cssFocusClass'\" onblur=\"this.className='$this->cssClass'\"";
		}

		$sHTML = "
objectName . "_reader\" $disabledStr $this->htmlAttr $style $func >
        				objectName ."_code\" >$value

<input ReadOnly=\"Enabled\" type=\"hidden\" NAME=\"" . $this->objectName . "\" ID=\"" . $this->objectName ."\" VALUE=\"\" />

";

		$elementName = $this->objectName;
        $sHTML .= "";

        return $sHTML;
    }

}

?>


text:
package com.becomejavasenior.service;

import com.becomejavasenior.dao.OrderDao;
import com.becomejavasenior.dao.ProductDao;
import com.becomejavasenior.dao.UserDao;
import com.becomejavasenior.model.Order;
import com.becomejavasenior.model.Product;
import com.becomejavasenior.model.User;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

/*
This class contains methods annotated with @Transactional
@author: sks
 */
public class TransactionalMethods {

	private OrderDao orderDaoImpl;
	private ProductDao productDaoImpl;
	private UserDao userDaoImpl;

	public TransactionalMethods(OrderDao orderDao, ProductDao productDao, UserDao userDao) {
		this.orderDaoImpl = orderDao;
		this.productDaoImpl = productDao;
		this.userDaoImpl = userDao;
	}

	@Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
	public Order findOrderById(Integer id) {
		return orderDaoImpl.getById(id);

	}

	@Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
	public Product findProductById(Integer id) {
		return productDaoImpl.getById(id);
	}

	@Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
	public User findUserById(Integer id) {
		return userDaoImpl.getById(id);
	}

	@Transactional(propagation = Propagation.REQUIRES_NEW)
	public long deleteItemsById(Integer id) {
		long time = System.nanoTime();
		try {
			orderDaoImpl.delete(findOrderById(id));
			productDaoImpl.delete(findProductById(id));
			userDaoImpl.delete(findUserById(id));
		} catch (NullPointerException e) {
			System.err.println("Error! Record not found, updates rolled back.");
		} catch (Exception e) {
			System.err.printf("Error! Exception %s, updates rolled back.\n", e.getClass().toString());
		} finally {
			return System.nanoTime() - time;
		}
	}

	@Transactional(propagation = Propagation.REQUIRES_NEW)
	public long updateProductById(Integer id) {
		long time = System.nanoTime();
		try {
			Product product = findProductById(id);
			product.setFvchar("UPDATED VALUE!");
			productDaoImpl.update(product);
			return System.nanoTime() - time;
		} catch (NullPointerException e) {
			System.err.println("Error! Record not found, updates rolled back.");
		} catch (Exception e) {
			System.err.printf("Error! Exception %s, updates rolled back.\n", e.getClass().toString());
		} finally {
			return System.nanoTime() - time;
		}
	}
}


text:
<?xml version='1.0' encoding='utf-8'?>
<manifest android:hardwareAccelerated="true" android:versionCode="10107" android:versionName="1.1.7" android:windowSoftInputMode="stateHidden|adjustResize" package="chaffy.chaffy" xmlns:android="http://schemas.android.com/apk/res/android">
    <supports-screens android:anyDensity="true" android:largeScreens="true" android:normalScreens="true" android:resizeable="true" android:smallScreens="true" android:xlargeScreens="true" />
    <uses-permission android:name="android.permission.INTERNET" />
    <application android:hardwareAccelerated="true" android:icon="@drawable/icon" android:label="@string/app_name">
        <activity android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale" android:fitsSystemWindows="true" android:label="@string/app_name" android:launchMode="singleTop" android:name="Talk2" android:theme="@android:style/Theme.Black.NoTitleBar" android:windowSoftInputMode="stateHidden|adjustResize">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>
    <uses-sdk android:minSdkVersion="11" android:targetSdkVersion="20" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
</manifest>


text:
/**
 * https://github.com/facebook/react-native/blob/master/Libraries/Components/View/ViewStylePropTypes.js
 */
import React from 'react';
import ColorPropType from './ColorPropType';
import LayoutPropTypes from './LayoutPropTypes';
import ShadowPropTypesIOS from './ShadowPropTypesIOS';
import TransformPropTypes from './TransformPropTypes';

const { PropTypes } = React;

/**
 * Warning: Some of these properties may not be supported in all releases.
 */
var ViewStylePropTypes = {
  ...LayoutPropTypes,
  ...ShadowPropTypesIOS,
  ...TransformPropTypes,
  backfaceVisibility: PropTypes.oneOf(['visible', 'hidden']),
  backgroundColor: ColorPropType,
  borderColor: ColorPropType,
  borderTopColor: ColorPropType,
  borderRightColor: ColorPropType,
  borderBottomColor: ColorPropType,
  borderLeftColor: ColorPropType,
  borderRadius: PropTypes.number,
  borderTopLeftRadius: PropTypes.number,
  borderTopRightRadius: PropTypes.number,
  borderBottomLeftRadius: PropTypes.number,
  borderBottomRightRadius: PropTypes.number,
  borderStyle: PropTypes.oneOf(['solid', 'dotted', 'dashed']),
  borderWidth: PropTypes.number,
  borderTopWidth: PropTypes.number,
  borderRightWidth: PropTypes.number,
  borderBottomWidth: PropTypes.number,
  borderLeftWidth: PropTypes.number,
  opacity: PropTypes.number,
  overflow: PropTypes.oneOf(['visible', 'hidden']),
  /**
   * (Android-only) Sets the elevation of a view, using Android's underlying
   * [elevation API](https://developer.android.com/training/material/shadows-clipping.html#Elevation).
   * This adds a drop shadow to the item and affects z-order for overlapping views.
   * Only supported on Android 5.0+, has no effect on earlier versions.
   * @platform android
   */
  elevation: PropTypes.number,
};

module.exports = ViewStylePropTypes;


text:
bootstrap-tabdrop
=================

*****************************************************************
NOTE: THIS IS A CUSTOM FIXED VERSION!!!!!!!!!!!!!!!!!!!!!!
- THE ORIGINAL HAS A MEMORY LEAK, SO WE'VE HAD TO EMBED THIS
  INTO THE CORE WITH THE FIX

--- UMBRACO CORE TEAM
*****************************************************************

A dropdown tab tool for @twitter bootstrap forked from Stefan Petre's (of eyecon.ro),

The dropdown tab appears when your tabs do not all fit in the same row.

Original site and examples: http://www.eyecon.ro/bootstrap-tabdrop/

Added functionality: Displays the text of an active tab selected from the dropdown list instead of the text option on the dropdown tab.

## Requirements

* [Bootstrap](http://twitter.github.com/bootstrap/) 2.0.4+
* [jQuery](http://jquery.com/) 1.7.1+

## Example

No additional HTML needed - the script adds it when the dropdown tab is needed.

Using bootstrap-tabdrop.js
Call the tab drop via javascript on .nav-tabs and .nav-pills:
```js
$('.nav-pills, .nav-tabs').tabdrop()
```

### Options

#### text
Type: string
Default: icon
```html
<i class="icon-align-justify"></i>
```
To change the default value, call
```javascript
.tabdrop({text: "your text here"});
```
when initalizing the tabdrop. The displayed value will change when a tab is selected from the dropdown list.

### Methods

```js
.tabdrop(options)
```

Initializes an tab drop.

```js
.tabdrop('layout')
```

Checks if the tabs fit in one single row.


text:
package tk.ultimatedev.jailplusplus.commands;

import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.plugin.PluginDescriptionFile;
import tk.ultimatedev.jailplusplus.ExceptionHandler;
import tk.ultimatedev.jailplusplus.JailPlugin;
import tk.ultimatedev.jailplusplus.util.Messenger;

import java.util.Arrays;
import java.util.HashMap;
import java.util.Vector;

/**
 * @author YoshiGenius
 */
public class CommandHandler implements CommandExecutor {
    private HashMap<String, SubCommand> commands;
    private ExceptionHandler exceptionHandler;
    private JailPlugin plugin;

    public CommandHandler(JailPlugin plugin) {
        plugin.getCommand("jail").setExecutor(new JailCmd());
        this.plugin = plugin;
        this.exceptionHandler = new ExceptionHandler(this.plugin);
        this.commands = new HashMap<String, SubCommand>();
        loadCommands();
    }

    private void loadCommands() {
        commands.put("wand", new Wand());
        commands.put("about", new About());
        commands.put("jailstick", new JailStick());
    }

    @Override
    public boolean onCommand(CommandSender sender, Command cmd1, String commandLabel, String[] args) {
        String cmd = cmd1.getName();
        PluginDescriptionFile pdfFile = plugin.getDescription();

        if (cmd.equalsIgnoreCase("jpp")) {
            if (!sender.hasPermission("jpp.main")) {
                Messenger.sendNoPermissionError(sender);

                return true;
            }

            if ((args == null) || (args.length < 1)) {
                Messenger.sendMessage(sender, "Jail++ v" + pdfFile.getVersion());
                Messenger.sendMessage(sender, "Need help? Type /jail help for assistance.");

                return true;
            }

            if (args[0].equalsIgnoreCase("help")) {
                help(sender);

                return true;
            }

            String sub = args[0];

            if (!commands.containsKey(sub)) {
                Messenger.sendMessage(sender, "That's not a valid command!", true);

                return true;
            }

            Vector<String> l = new Vector<String>();

            l.addAll(Arrays.asList(args));
            l.remove(0);
            args = l.toArray(new String[l.size()]);

            if (commands.get(sub).playerOnly()) {
                if (!(sender instanceof Player)) {
                    Messenger.sendError(sender, "This command is only allowed for players!", true);

                    return true;
                }

                Player player = (Player) sender;

                try {
                    if (player.hasPermission(commands.get(sub).permission())
                            || player.hasPermission(commands.get(sub).kitPermission())
                            || player.hasPermission("jail.*") || player.hasPermission("jail.admin")) {
                        commands.get(sub).onCommand(player, args);

                        return true;
                    } else {
                        Messenger.sendNoPermissionError(sender);

                        return true;
                    }
                } catch (Exception e) {
                    exceptionHandler.logException(e);
                }
            } else {
                try {
                    if (sender.hasPermission(commands.get(sub).permission())
                            || sender.hasPermission(commands.get(sub).kitPermission()) || sender.hasPermission("jpp.*")) {
                        commands.get(sub).onCommand(sender, args);

                        return true;
                    } else {
                        Messenger.sendNoPermissionError(sender);

                        return true;
                    }
                } catch (Exception e) {
                    exceptionHandler.logException(e);
                }
            }
        }

        return false;
    }

    public void help(CommandSender sender) {
        Messenger.sendMessage(sender, "Jail++: Available Commands");

        if (sender instanceof Player) {
            for (SubCommand command : commands.values()) {
                if (sender.hasPermission(command.permission()) || sender.hasPermission(command.kitPermission())
                        || sender.hasPermission("jpp.*")) {
                    Messenger.sendMessage(sender, ChatColor.GRAY + "    - " + command.help(sender));
                }
            }
        } else {
            for (SubCommand command : commands.values()) {
                if (!command.playerOnly()) {
                    Messenger.sendMessage(sender, ChatColor.GRAY + "    - " + command.help(sender));
                }
            }
        }
    }
}


text:
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>W26913_text</title>
        <link rel="stylesheet" type="text/css" href="style.css" />

                «

    <p class="styleSans33.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">
NORTH DAKOTA
Oil and Gas Division
Lynn D. Helms - Director Bruce E. Hicks - Assistant Director
Department of Mineral Resources Lynn D. Helms - Director North Dakota Industrial Commissio
OIL AND GAS DIVISION wwwdmnndgov/oilgas/

    <p class="styleSans8.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">SARAH CARSON
HRC OPERATING, LLC
1801 CALIFORNIA STREET SUITE 3500 DENVER, CO 80202 USA
RE: CORES AND SAMPLES

    <p class="styleSans10.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">Well Name: Location: Permit Type: Field:

    <p class="styleSans11.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">Dear SARAH CARSON:
North Dakota Century Code (NDCC) Section 38-08-04 provides for the preservation of cores and samples and their shipment to the State Geologist when requested, The following is required on the above referenced well:
1) All cores, core chips and samples must be submitted to the State Geologist as provided for the NDCC Section 3808-04 and North Dakota Administrative Code 43-02-03-38. l.
2) Samples shall include all cuttings from:

    <p class="styleSans8.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">Base of the Last Charles Salt

    <p class="styleSans11.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">Samples of Cuttings shall be taken at 30' maximum intervals through all vertical, build and horizontal sections. Samples must be washed, dried, packed in sample envelopes in correct order with labels showing operator, well name, location and depth, and forwarded in standard boxes to the State Geologist within 30 days of the
completion of drilling operations.

    <p class="styleSans11.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">3) Cores: ALL CORES cut shall be preserved in correct order, properly boxed, and forwarded to the State Geologist within 90 days of completion of drilling operations. Any extension of time must have written approval from the State Geologist.

    <p class="styleSans11.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">4) All cores, core chips, and samples must be shipped, prepaid, to the State Geologist at the following address:

    <p class="styleSans10.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">ND Geological Survey Core Libi'ary Campus Road and Cornell Grand Forks, ND 58202

    <p class="styleSans11.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">5) NDCC Section 38-08-16 allows for a civil penalty for any Violation of Chapter 38 08 not to exceed $12,500 for each offense, and each day's violation is a separate offense.

    <p class="styleSans20.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">Sincerely
fivfl
Stephen Fried Geologist

    <p class="styleSans9.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">600 E Boulévard Ave — Dept 405, Bismarck, North Dakota 58505-0840 Phone (701)328-8020 Fax (701)328-8022

    <p class="styleSans8.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">Date: 11/5/2013

    <p class="styleSans8.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">FORT BERTHOLD 152-93-19D-18-5H Well File No.: 26913 SESE 19-152-93 County: MCKENZIE
Development - HORIZONTAL FOUR BEARS Target Horizon: MIDDLE BAKKEN

    <p class="styleSans1.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">

    <p class="styleSans311.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">


text:
require File.dirname(__FILE__) + '/../lib/dnf_translator'
require File.dirname(__FILE__) + '/../lib/dnf_translator/test_case'

LIT_ONE           = DNFTranslator::Parser::Element::Literal.new(  'one')
LIT_not_ONE       = DNFTranslator::Parser::Element::Literal.new( '-one')
LIT_not_TWO       = DNFTranslator::Parser::Element::Literal.new( '-two')
LIT_TWO           = DNFTranslator::Parser::Element::Literal.new(  'two')
LIT_THREE         = DNFTranslator::Parser::Element::Literal.new('three')
LIT_FOUR          = DNFTranslator::Parser::Element::Literal.new( 'four')
LIT_FIVE          = DNFTranslator::Parser::Element::Literal.new( 'five')

AND_ONE_TWO       = DNFTranslator::Parser::Element::AndExpression.new(LIT_ONE,    LIT_TWO)
AND_THREE_FOUR    = DNFTranslator::Parser::Element::AndExpression.new(LIT_THREE,  LIT_FOUR)
OR_ONE_TWO        = DNFTranslator::Parser::Element::OrExpression.new(LIT_ONE,     LIT_TWO)
OR_NOT_ONE_TWO    = DNFTranslator::Parser::Element::OrExpression.new(LIT_not_ONE, LIT_TWO)
OR_ONE_TWO_THREE  = DNFTranslator::Parser::Element::OrExpression.new(LIT_ONE,     LIT_TWO, LIT_THREE)
OR_THREE_FOUR     = DNFTranslator::Parser::Element::OrExpression.new(LIT_THREE,   LIT_FOUR)


text:
coverage run --source=api,web manage.py test
coverage report


text:
<Simulation verbosity = 'debug'>

  <TestInfo>
    <name>framework/OutStreams.SamplePlot</name>
    <author>talbpaul</author>
    <created>2021-04-01</created>
    <classesTested>OutStreams.SamplePlot</classesTested>
    <description>
      Tests use of the SamplePlot plotter.
      Samples data, then plots the samples using the SamplePlot plotter.
    </description>
  </TestInfo>

  <RunInfo>
    <WorkingDir>SamplePlot</WorkingDir>
    <Sequence>sample,plot</Sequence>
  </RunInfo>

  <Steps>
    <MultiRun name="sample">
      <Input class="DataObjects" type="PointSet">placeholder</Input>
      <Model class="Models" type="ExternalModel">projectile</Model>
      <Sampler class="Samplers" type="MonteCarlo">mc</Sampler>
      <Output class="DataObjects" type="HistorySet">samples</Output>
    </MultiRun>
    <IOStep name="plot">
      <Input class="DataObjects" type="HistorySet">samples</Input>
      <Output class="OutStreams" type="Plot">plotter</Output>
    </IOStep>
  </Steps>

  <DataObjects>
    <PointSet name="placeholder"/>
    <PointSet name="samples">
      <Input>v0,angle</Input>
      <Output>r</Output>
    </PointSet>
  </DataObjects>

  <Models>
    <ExternalModel ModuleToLoad="../../AnalyticModels/projectile.py" name="projectile" subType="">
      <variables>v0,angle,r</variables>
    </ExternalModel>
  </Models>

  <Samplers>
    <MonteCarlo name="mc">
      <samplerInit>
        <limit>100</limit>
        <initialSeed>42</initialSeed>
      </samplerInit>
      <variable name="v0">
        <distribution>vel_dist</distribution>
      </variable>
      <variable name="angle">
        <distribution>angle_dist</distribution>
      </variable>
    </MonteCarlo>
  </Samplers>

  <Distributions>
    <Uniform name="vel_dist">
      <lowerBound>1</lowerBound>
      <upperBound>60</upperBound>
    </Uniform>
    <Uniform name="angle_dist">
      <lowerBound>5</lowerBound>
      <upperBound>85</upperBound>
    </Uniform>
  </Distributions>

  <OutStreams>
    <Plot name="plotter" subType="SamplePlot">
      <source>samples</source>
      <vars>v0,angle,r</vars>
    </Plot>
  </OutStreams>

</Simulation>


text:
<?php

namespace ZendTest\View\Model\TestAsset;

use Iterator;

class Variable implements Iterator
{
    public function current()
    {
    }

    public function key()
    {
    }

    public function next()
    {
    }

    public function rewind()
    {
    }

    public function valid()
    {
    }
}


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

<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<TITLE>
org.apache.wicket.request.handler.logger (Wicket Parent 1.5.7 API)
</TITLE>

<META NAME="keywords" CONTENT="org.apache.wicket.request.handler.logger package">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../../stylesheet.css" TITLE="Style">

org.apache.wicket.request.handler.logger

Classes

DelegateLogData

ListenerInterfaceLogData

NoLogData

PageLogData

ResourceReferenceLogData

ResourceStreamLogData


text:
@class ONEUserItem;

@interface ONEAllHotAuthorView : UIView

@property (strong, nonatomic) NSArray<ONEUserItem *> *hotAuthorList;

+ (instancetype)hotAuthorViewWithClickOperation:(void(^)(ONEUserItem *author))operation;

@end


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

  var namespace = {};

  ;(function(namespace) {

  'use strict';

  /**
   * A hash of the currently loaded APIs. Used to enable connect
   * command to be lazy and enable reference to api objects only
   * when they are loaded.
   */
  namespace.registry = {};

}(namespace));

  ;(function(namespace) {
  'use strict';

  /**
   * Represents an API that emits events and supports
   * registration of subscribers, or, more generally: an
   * interface between two software components that you
   * want loosely-coupled.
   * An instance of this constructor function should
   * form the prototype of each sub-type.
   * @constructor
   */
  var api = {};

  /**
   * An 'enumeration' (i.e. a simple object map) of the
   * events that this API can raise.
   * This approach keeps your code DRY.
   */
  api.events = {};

  /**
   * Objects within the software component associated with this
   * API should call this method to notify subscribers of the specified event.
   * @param {Number} event - A member of the events enumeration.
   */
  api.emit = function(event) {
    var args;

    if (event == null) {
      throw 'event not supplied.'
    }

    args = Array.prototype.slice.call(arguments, 1); //Skip the event name

    if (!this.subscribers) {
      return; // Subscribers not initialized.
    }

    this.subscribers[event].forEach(function(s) {
      s.cb.apply(this, args);
    });
  };

  /**
   * Clients should register for notification of events
   * raised by this API using this method.
   * Note: there is no corresponding 'off' method. To
   * stop communication between two components, use
   * the `unload` method on the connector.
   * @param {Number/String} event - A member of the events enumeration.
   */
  api.on = function(event) {
    if (event == null) {
      throw 'event not supplied.';
    }

    // subscriber: The api instance subscribing to the event.
    // methodName: The name of the method on `subscriber` that will be invoked when an event is raised.
    return {
      notify: function(subscriber) {
        if (subscriber == null) {
          throw 'subscriber not supplied.';
        }

        return {
          byCalling: function(methodName) {
            if (methodName == null || methodName === '') {
              throw 'methodName not supplied.';
            }

            configureOn.call(this, event, subscriber, methodName);
          }.bind(this)
        };
      }.bind(this)
    };
  };

  function configureOn(event, subscriber, methodName) {
    var cb = subscriber[methodName];

    if (cb === undefined) {
      throw 'methodName not present on subscriber.';
    }
    if (typeof cb !== 'function') {
      throw 'methodName not a function.';
    }

    this.subscribers = this.subscribers || {};
    this.subscribers[event] = this.subscribers[event] || [];

    if (this.subscribers[event]
      .some(function(el) {
        return el.cb === cb;
      })) {
      return; // Duplicate subscription.
    }

    this.subscribers[event].push({
      name: subscriber.name,
      cb: cb
    });
  }

  namespace.api = api;
}(namespace));

  ;(function(namespace) {

  'use strict';

  /**
   * Coordinates the running of connect-commands to wire-up APIs
   * and controls the loading and unloading of APIs at runtime.

   * @param {Array} connectCommands - An array containing all
   * the commands used to wire-up all the different possible types
   * of API. Each command should have an `subjectApiName` property
   * corresponding to the name of the associated API, and
   * a `run()` method.
   * @param {Object} options - A property on this literal named `initialApisToLoad`
   * may be supplied to indicate which APIs to load when the coordinator is
   * instantiated.
   * @constructor
   */
  function Connector(connectCommands, options) {
    if (connectCommands == null || !connectCommands.length) {
      throw 'connectCommands not supplied.';
    }

    options = options || {};
    options.initialApisToLoad = options.initialApisToLoad || [];

    this.connectCommands = connectCommands.reduce(function(prev, curr) {
      if (curr.subjectApiName == null) {
        throw 'connectCommand missing subjectApiName.';
      }

      prev[curr.subjectApiName] = curr;
      return prev;
    }, {});

    //Create maps from the supplied arrays for faster indexing.
    this.registry = options.initialApisToLoad.reduce(function(prev, curr) {
      if (!curr.name) {
        throw 'Required api.name property is empty.';
      }
      prev[curr.name] = curr;
      return prev;
    }, {});

    Object.getOwnPropertyNames(this.registry).forEach(function(key) {
      var cmd = this.connectCommands[key];
      if (cmd) {
        cmd.run(this.registry);
      }
    }.bind(this));
  }

  Connector.prototype.apis = {};

  Connector.prototype.connectCommands = {};

  /**
   * Wires-up an API into the application so that it
   * can send to and receive events from the wider application.
   * @param {Api} api - The API instance to load.
   */
  Connector.prototype.loadApi = function(api) {
    var apiName, connectCmd;

    if (api == null) {
      throw 'api not supplied.';
    }
    if (!api.name) {
      throw 'Required api.name property is empty.';
    }

    apiName = api.name;

    //Add to the APIs collection.
    this.registry[apiName] = api;

    //Run any connect commands for the api that can be run given the loaded APIs.
    connectCmd = this.connectCommands[apiName];
    if (connectCmd) {
      connectCmd.run(this.registry);
    }

    //Re-run any connect commands that use this new API.
    Object.getOwnPropertyNames(this.connectCommands)
      .forEach(function(currentCommandName) {
        var currentCommand = this.connectCommands[currentCommandName];
        if (currentCommand.subjectApiName === apiName) {
          return;
        }

        if ((currentCommand.objectApiNames || []).some(function(i) {
            return i === apiName;
          })) {
          if (this.registry[currentCommand.subjectApiName]) {
            //Only run the command if the associated API is loaded.
            currentCommand.run(this.registry);
          }
        }
      }.bind(this));
  };

  /**
   * Removes an API from the application so that it
   * can no longer receive events and may be garbage collected.
   * @param {String} apiName - The name of the API to unload.
   */
  Connector.prototype.unloadApi = function(apiName) {
    if (apiName == null || apiName === '') {
      throw "apiName not supplied."
    }
    if (this.registry[apiName] == null) {
      return;
    }

    Object.getOwnPropertyNames(this.registry)
      .forEach(function(currentApiName) {
        var currentApi = this.registry[currentApiName];
        if (currentApi.subscribers) {
          Object.getOwnPropertyNames(currentApi.subscribers)
            .forEach(function(eventName) {
              currentApi.subscribers[eventName] =
                (currentApi.subscribers[eventName].filter(function(subscriber) {
                  return subscriber.name !== apiName;
                }));
            });
        }
      }.bind(this));

    delete this.registry[apiName];
  };

  namespace.Connector = Connector;

}(namespace));

  if ((typeof exports === 'object') && module) {
    module.exports = namespace; // CommonJS
  } else if ((typeof define === 'function') && define.amd) {
    define(function() {
      return namespace;
    }); // AMD
  } else {
    root.eventApi = namespace; // Browser
  }
}(this));


text:
SmartyML adds multilingual support for the popular PHP-written template engine Smarty.
The current version, **SmartyML 2**, supports Smarty 3 or newer, including Smarty 4.
For Smarty 2.x, please check out older versions of SmartyML, like SmartyML 1.x.

## About
SmartyML extends Smarty by multilingual support.
Placeholders in templates are replaced by translations during template compilation.
Once a template is compiled, there is no further latency impact in comparison without using SmartyML.

Because variables in templates are handled after compilation, SmartyML also offers the replacement of placeholders for assigned strings.
This enables using placeholders in variables, e.g. for alerts or other dynamic values.

## Requirements (SmartyML 2.x)
* Smarty 3 or newer
  * https://github.com/smarty-php/smarty
  * SmartyML officially supports Smarty 4
* PHP 7.4 or newer
  * Official support for PHP 8.0 and 8.1
* mbstring-extension for PHP

## Installation
1. Add SmartyML-class to your repository and make sure, your classloader can find the class.
2. Create a directory, where translation files will be stored. This directory is typically named "locales" and is located at the root directory of the project.
3. Create files for each language you want to support in the locales directory. Nonexisting files for defined languages will cause an exception.

### SPFW
If you use the SPFW framework, SmartyML is already included and ready to use.

## Configuration

### Language files
For each language, a language file has to be created in the locales directory.
The file name has to match the language name combined with the postfix ".txt", e.g. "en.txt" for English.

The language file contains key-value pairs.
The keys are placeholders for later usage in template files.
Each line can contain one definition.
The key and value are separated by an equals symbol, like:

```
question=Möchten Sie fortfahren
Yes=Ja
No=Nein
```

A few noticeable information:
* Empty lines are ignored
* Lines, beginning with double slash "//", are also ignored
* The first equal symbol is interpreted as key-value separator, while the value is able to contain unlimited amounts of equal symbols. This means an equal symbol cannot be used as part of the placeholder.
* A double number sign cannot be used as part of the placeholder, because it is used for indicating a placeholder in templates (see Usage > Templates section in this README).
* SmartyML does not check, if all language files define the identical placeholders. Also, the order of definitions does not matter.

### Setting up languages
Because SmartyML extends Smarty, it can be used just like Smarty.
Replace Smarty-class by SmartyML-class wherever you need a template with multilingual support.
By default, the English language is the available and default language.

To use more than one language (the reason, why you use SmartyML ;-)), you need to make them manually available.
This and other multilingual options are set in the constructor of SmartyML:
* Available languages,
* default language (default: "en" for English),
* current language (default: default language) and
* location of the locales directory, when other than _../locales/_.

Example:
```
$available_languages = ['de', 'en', 'es'];  // default: ['en']
$default_language = 'de';                   // default: 'en'
$current_language = 'es';                   // default: default language, here: 'en'
$locales_dir = '../../lang/';               // default: '../locales/'

$smarty = new SmartyML(
    $available_languages,
    $default_language,
    $current_language,
    $locales_dir
);
```

Unfortunately these parameters always have to be set, when SmartyML is instantiated.
If SmartyML is used at a few different places, you should consider an additional solution.
A solution strongly depends on how your settings are defined (hopefully not global variables).
There are a few popular techniques how to mitigate the overhead:
* Create a class which returns a pre-configured SmartyML-object (like View-class in SPFW) or
* extend SmartyML by an init-method, which returns a pre-configured SmartyML-object.

Note:
It is recommended to use the short forms of a language, e.g. "es" for Spanish.
Short forms can be useful when combining different techniques for localization or internationalization.
SmartyML does not force to use a specific language terminology.

### SPFW
The SPFW-version of SmartyML has only one difference to the stand-alone-version:
There is an init-method for initializing SmartyML by SmartyMlConfig.
The SmartyMlConfig-class is provided by SPFW and can be used for defining Smarty-configuration.
This makes it easier to create instances of SmartyML, because constructor variables are already filled.

## Usage
To use the power of translation, you just need to use the defined placeholders in your existing templates.

### Templates
Each defined placeholder in language files can be used in the templates when wrapped by two number signs: `##placeholder##`.

Example:
```
<div>
    <p>##question##?</p>
    <div>
        <a href="agree">##Yes##</a>
        <a href="abort">##No##</a>
    </div>
</div>
```

This example contains the placeholders _question_, _Yes_ and _No_.

If a placeholder is not defined in a translation file, it is ignored (technically replaced by empty string).

#### Special variable
To access the current language, SmartyML assigns the variable `$lang` to the template.
This can be useful in master templates

Example:
```
<html lang="{$lang}">
[...]
</html>
```

### Assigning variables
When variables are assigned by Smarty's `assign()`-method, they are not modified.
To make SmartyML translating placeholders in assigned variables, they need to be assigned by `assignML()`-method.
`assignML()` has the same method signature than Smarty's `assign()` (see Smarty docs: https://smarty-php.github.io/smarty/designers/language-variables/language-assigned-variables.html).
While `assignML()` accepts any type of variable, **only strings are taken into account for translation**.

Example:
```
$smartyML_object->assignML(
    'question',
    '##question##?'
);
```

## Contact / Support
If you have any questions, please feel free to use the issue section on GitHub.
I am happy to receive bug reports to make SmartyML even better.
When you fix a bug yourself, please consider opening a pull request for SmartyML on GitHub.

For the SPFW integration, please contact the SPFW community.

## Credits
SmartyML 2.0 is a full new development for PHP > 7 and Smarty > 3.x.
The original idea is based on published code from André Rabold on the previous official Smarty discussion board:
http://smarty.incutio.com/?page=SmartyMultiLanguageSupport


text:
var RTCPeerConnection = null;
var getUserMedia = null;
var attachMediaStream = null;
var reattachMediaStream = null;
var webrtcDetectedBrowser = null;

if (navigator.mozGetUserMedia) {
  console.log("This appears to be Firefox");

  webrtcDetectedBrowser = "firefox";

  // The RTCPeerConnection object.
  RTCPeerConnection = mozRTCPeerConnection;

  // The RTCSessionDescription object.
  RTCSessionDescription = mozRTCSessionDescription;

  // The RTCIceCandidate object.
  RTCIceCandidate = mozRTCIceCandidate;

  // Get UserMedia (only difference is the prefix).
  // Code from Adam Barth.
  getUserMedia = navigator.mozGetUserMedia.bind(navigator);

  // Attach a media stream to an element.
  attachMediaStream = function(element, stream) {
    console.log("Attaching media stream");
    element.src = URL.createObjectURL(stream);;
    element.play();
  };

  reattachMediaStream = function(to, from) {
    console.log("Reattaching media stream");
    to.mozSrcObject = from.mozSrcObject;
    to.play();
  };

  // Fake get{Video,Audio}Tracks
  MediaStream.prototype.getVideoTracks = function() {
    return [];
  };

  MediaStream.prototype.getAudioTracks = function() {
    return [];
  };
} else if (navigator.webkitGetUserMedia) {
  console.log("This appears to be Chrome");

  webrtcDetectedBrowser = "chrome";

  // The RTCPeerConnection object.
  RTCPeerConnection = webkitRTCPeerConnection;

  // Get UserMedia (only difference is the prefix).
  // Code from Adam Barth.
  getUserMedia = navigator.webkitGetUserMedia.bind(navigator);

  // Attach a media stream to an element.
  attachMediaStream = function(element, stream) {
    element.src = webkitURL.createObjectURL(stream);
  };

  reattachMediaStream = function(to, from) {
    to.src = from.src;
  };

  // The representation of tracks in a stream is changed in M26.
  // Unify them for earlier Chrome versions in the coexisting period.
  if (!webkitMediaStream.prototype.getVideoTracks) {
    webkitMediaStream.prototype.getVideoTracks = function() {
      return this.videoTracks;
    };
    webkitMediaStream.prototype.getAudioTracks = function() {
      return this.audioTracks;
    };
  }

  // New syntax of getXXXStreams method in M26.
  if (!webkitRTCPeerConnection.prototype.getLocalStreams) {
    webkitRTCPeerConnection.prototype.getLocalStreams = function() {
      return this.localStreams;
    };
    webkitRTCPeerConnection.prototype.getRemoteStreams = function() {
      return this.remoteStreams;
    };
  }
} else {
  console.log("Browser does not appear to be WebRTC-capable");
}


text:
  Applicant {{ app.application.first_name }} {{ app.application.last_name }} owns {{ app.application.owned_address }} and requests the lot on {{ app.lot.address}}

  This applicant has{% if not app.application.eds_received %} not{% endif %} submitted an Economic Disclosure Statement. This applicant has{% if not app.application.ppf_received %} not{% endif %} submitted a Principal Profile Form.

Step 1

  {% for step, description in steps %}
    {% if app.current_step.step == step %}

Step {{ step }}: {{ description }}

    {% else %}

Step {{ step }}

    {% endif %}
  {% endfor %}


text:
require File.dirname(__FILE__) + '/../../../spec_helper'
require 'mathn'

ruby_version_is '1.9' do
  describe 'Kernel#Complex' do
    it 'returns an Integer if imaginary part is 0' do
      Complex(42,0).should == 42
      Complex(42,0).class.should == Fixnum
      Complex(bignum_value,0).should == bignum_value
      Complex(bignum_value,0).class.should == Bignum
    end
  end
end


text:
import typescript from 'rollup-plugin-typescript2'
import commonjs from 'rollup-plugin-commonjs'
import external from 'rollup-plugin-peer-deps-external'
import postcss from 'rollup-plugin-postcss-modules'
import resolve from 'rollup-plugin-node-resolve'
import url from 'rollup-plugin-url'

import pkg from './package.json'

export default {
  input: 'src/index.tsx',
  output: [
    {
      file: pkg.main,
      format: 'cjs',
      exports: 'named',
      sourcemap: true
    },
    {
      file: pkg.module,
      format: 'es',
      exports: 'named',
      sourcemap: true
    }
  ],
  plugins: [
    external(),
    postcss({
      modules: true,
      writeDefinitions: true
    }),
    url(),
    resolve(),
    typescript({
      rollupCommonJSResolveHack: true
    }),
    commonjs({
      namedExports: {
        'node_modules/react-is/index.js': [
          'isElement',
          'isValidElementType',
          'ForwardRef',
        ],
      }
    })
  ]
}


text:
using namespace fst;
using namespace std;

namespace kaldi {

typedef unordered_map<pair<int32, vector<int32> >, int32,
                      HmmCacheHash> Log2PhysMapType;

struct MakeArcTypeOpts {
  MakeArcTypeOpts ()
    : prob_scale(1.0f), logical2physical(false), use_trans_ids(false) { }
  BaseFloat prob_scale;
  bool logical2physical;
  bool use_trans_ids;
};

fst::VectorFst<fst::StdArc>*
GetHmmAsFstWithLoops(std::vector<int32> phone_window,
                  const ContextDependencyInterface& ctx_dep,
                  const TransitionModel& trans_model,
                  const MakeArcTypeOpts& opts) {
  using namespace fst;

  if (static_cast<int32>(phone_window.size()) != ctx_dep.ContextWidth())
    KALDI_ERR <<"Context size mismatch, ilabel-info [from context FST is "
              <<(phone_window.size())<<", context-dependency object "
        "expects "<<(ctx_dep.ContextWidth());

  int P = ctx_dep.CentralPosition();
  int32 phone = phone_window[P];
  KALDI_ASSERT(phone != 0);

  const HmmTopology &topo = trans_model.GetTopo();
  const HmmTopology::TopologyEntry &entry  = topo.TopologyForPhone(phone);

  VectorFst<StdArc> *ans = new VectorFst<StdArc>;

  // Create a mini-FST with a superfinal state [in case we have emitting
  // final-states, which we usually will.]
  typedef StdArc Arc;
  typedef Arc::Weight Weight;
  typedef Arc::StateId StateId;
  typedef Arc::Label Label;

  std::vector<StateId> state_ids;
  for (size_t i = 0; i < entry.size(); i++)
    state_ids.push_back(ans->AddState());
  assert(state_ids.size() > 1);  // Or invalid topology entry.
  ans->SetStart(state_ids[0]);
  StateId final = state_ids.back();
  ans->SetFinal(final, Weight::One());

  for (int32 hmm_state = 0;
       hmm_state < static_cast<int32>(entry.size());
       hmm_state++) {
    int32 pdf_class = entry[hmm_state].pdf_class, pdf;
    if (pdf_class == kNoPdf)
      pdf = kNoPdf;  // nonemitting state;
    //not generally used.
    else {
      bool ans = ctx_dep.Compute(phone_window, pdf_class, &pdf);
      KALDI_ASSERT(ans && "Context-dependency computation failed.");
    }
    int32 trans_idx;
    for (trans_idx = 0;
        trans_idx < static_cast<int32>(entry[hmm_state].transitions.size());
        trans_idx++) {
      BaseFloat log_prob;
      Label label = kNoLabel;
      int32 dest_state = entry[hmm_state].transitions[trans_idx].first;
      bool is_self_loop = (dest_state == hmm_state);
      if (pdf_class == kNoPdf) {
        // no pdf, hence non-estimated probability.  very unusual case.
        // [would not happen with normal topology] .  There is
        // no transition-state involved in this case.
        KALDI_ASSERT(!is_self_loop);
        log_prob = log(entry[hmm_state].transitions[trans_idx].second);
        label = 0;
      } else {  // normal probability.
        int32 trans_state =
            trans_model.TripleToTransitionState(phone, hmm_state, pdf);
        int32 trans_id =
            trans_model.PairToTransitionId(trans_state, trans_idx);
        log_prob = opts.prob_scale * trans_model.GetTransitionLogProb(trans_id);
        // log_prob is a negative number (or zero)...
        //int32 hmm_state = trans_model.TransitionIdToHmmState(trans_id);

        label = opts.use_trans_ids ? trans_id : pdf + 1;
      }
      ans->AddArc(state_ids[hmm_state],
                  Arc(label, label, Weight(-log_prob), state_ids[dest_state]));
    }
  }
  return ans;
}

template<class Arc>
void MakeArcTypes(const std::vector<std::vector<int32> > &ilabel_info,
                                   const ContextDependencyInterface &ctx_dep,
                                   const TransitionModel &trans_model,
                                   std::vector<int32> *disambig_syms_left,
                                   vector<VectorFst<Arc>* >* fsts,
                                   vector<int>* log2phys,
                                   const MakeArcTypeOpts& opts) {
  typedef typename Arc::Weight Weight;
  typedef typename Arc::StateId StateId;
  typedef typename Arc::Label Label;
  assert(ilabel_info.size() >= 1 && ilabel_info[0].size() == 0);
  // make sure that eps == eps.
  // "cache" is an optimization that prevents GetHmmAsFst repeating work
  // unnecessarily.
  Log2PhysMapType log2physmap;
  fsts->clear();
  fsts->reserve(ilabel_info.size());
  std::vector<int32> phones = trans_model.GetPhones();

  VectorFst<Arc>* epsfst = new VectorFst<Arc>;
  epsfst->AddState();
  epsfst->AddState();
  epsfst->SetStart(0);
  epsfst->SetFinal(1, Weight::One());
  epsfst->AddArc(0, Arc(0, 0, 0, 1));
  fsts->push_back(epsfst);
  assert(disambig_syms_left != 0);
  disambig_syms_left->clear();
  log2phys->push_back(0);
  int32 first_disambig_sym = trans_model.NumTransitionIds() + 1;
  // First disambig symbol we can have on the input side.
  int32 next_disambig_sym = first_disambig_sym;

  if (ilabel_info.size() > 0)
    assert(ilabel_info[0].size() == 0);  // make sure epsilon is epsilon...

  for (int32 j = 1; j < static_cast<int32>(ilabel_info.size()); j++) {
    // zero is eps.
    assert(!ilabel_info[j].empty());
    if (ilabel_info[j].size() == 1 &&
      ilabel_info[j][0] <= 0) {  // disambig symbol

      // disambiguation symbol.
      int32 disambig_sym_left = next_disambig_sym++;
      disambig_syms_left->push_back(disambig_sym_left);
      // get acceptor with one path with "disambig_sym" on it.
      VectorFst<Arc> *fst = new VectorFst<Arc>;
      fst->AddState();
      fst->AddState();
      fst->SetStart(0);
      fst->SetFinal(1, Weight::One());
      fst->AddArc(0, Arc(disambig_sym_left, disambig_sym_left,
            Weight::One(), 1));
      //Map the disam to an epsilon transition
      log2phys->push_back(0);
      fsts->push_back(fst);
      KALDI_VLOG(2) << "disambiguation symbol " <<  disambig_sym_left;
    } else {  // Real phone-in-context.
      int P = ctx_dep.CentralPosition();
      std::vector<int32> phone_window = ilabel_info[j];
      int phone = phone_window[P];
      const HmmTopology &topo = trans_model.GetTopo();
      // vector of the pdfs, indexed by pdf-class (pdf-classes must start
      //from zero  and be contiguous).
      std::vector<int32> pdfs(topo.NumPdfClasses(phone));
      for (int32 pdf_class = 0;
           pdf_class < static_cast<int32>(pdfs.size());
           pdf_class++) {
        if (! ctx_dep.Compute(phone_window, pdf_class, &(pdfs[pdf_class]))) {
          std::ostringstream ctx_ss;
          for (size_t i = 0; i < phone_window.size(); i++)
            ctx_ss << phone_window[i] << ' ';
          KALDI_ERR << "GetHmmAsFst: context-dependency object could not produce "
                    << "an answer: pdf-class = " << pdf_class << " ctx-window = "
                    << ctx_ss.str() << ".  This probably points "
              "to either a coding error in some graph-building process, "
              "a mismatch of topology with context-dependency object, the "
              "wrong FST being passed on a command-line, or something of "
              " that general nature.";
        }
      }

      pair<int32, vector<int32> > cache_index(phone, pdfs);
      if (log2physmap.find(cache_index) != log2physmap.end()) {
        log2phys->push_back(log2physmap[cache_index]);
      } else {
        VectorFst<Arc>* fst =  GetHmmAsFstWithLoops(phone_window,
                                         ctx_dep,
                                         trans_model,
                                         opts);
        if (opts.logical2physical)
          log2physmap[cache_index] = fsts->size();
        log2phys->push_back(fsts->size());
        fsts->push_back(fst);
      }
    }
  }

  KALDI_VLOG(2) << "Number of input labels " <<  ilabel_info.size();
  KALDI_VLOG(2) << "Number of logical phones " << log2phys->size();
  KALDI_VLOG(2) << "Number of physical phones " << fsts->size();
  KALDI_VLOG(2) << "Number of disamb symbols " << disambig_syms_left->size();
  vector<int> uniq = *log2phys;
  SortAndUniq(&uniq);
  KALDI_VLOG(2) << "Unique phone ids " << uniq.size();

  //return ans;
}
}

template<class Arc>
bool WriteArcTypesAsFsts(const string& path,
                         const vector<VectorFst<Arc>*>& fsts) {
  ofstream ofs(path.c_str(), ostream::binary);
  if (!ofs.is_open())
    return false;
  int numfsts = fsts.size();
  WriteType(ofs, numfsts);
  for (int i = 0; i != fsts.size(); ++i)
    fsts[i]->Write(ofs, FstWriteOptions(path));
  return true;
}

template<class Arc>
bool WriteArcTypesAsFar(const string& path,
                        const vector<VectorFst<Arc>*>& fsts) {
  return false;
}

template<class Arc>
bool WriteArcTypesAsTxt(const string& path,
                        const vector<VectorFst<Arc>*>& fsts) {
  ofstream ofs(path.c_str());
  if (!ofs.is_open())
    return false;
  int numfsts = fsts.size();
  ofs << "# " << numfsts << endl;
  for (int i = 0; i != fsts.size(); ++i) {
    const Fst<Arc> &fst = *fsts[i];
    for (StateIterator<Fst<Arc> > siter(fst); !siter.Done(); siter.Next()) {
    }
  }
  return true;
}

DECLARE_int32(v);

int main(int argc, char *argv[]) {
  try {
    using namespace kaldi;
    typedef kaldi::int32 int32;
    using fst::SymbolTable;
    using fst::VectorFst;
    using fst::StdArc;

    const char *usage =
        "Make arc types for the dynamic expansion inside the decoder phones, \n"
        " without self-loops [use add-self-loops to add them]\n"
        "Usage:   make-arc-types ilabel-info-file tree-file"
        "transition-gmm/acoustic-model [arcs-far-out]\n"
        "e.g.: \n"
        " make-arc-types ilabels 1.tree 1.mdl > arcs.far\n";
    ParseOptions po(usage);

    MakeArcTypeOpts opts;
    string disambig_out_filename;
    string type = "fsts";
    po.Register("disambig-syms-out", &disambig_out_filename, "List of"
        "disambiguation symbols on input of H [to be output from this program]");
    po.Register("use_trans_ids", &opts.use_trans_ids, "Use transition ids"
        "for HMM input arc labels.  Required for native Kaldi compatibility.");
    po.Register("type", &type, "Output format when writing the arcs");
    po.Read(argc, argv);

    if (po.NumArgs() < 3 || po.NumArgs() > 5) {
      po.PrintUsage();
      exit(1);
    }

    std::string ilabel_info_filename = po.GetArg(1);
    std::string tree_filename = po.GetArg(2);
    std::string model_filename = po.GetArg(3);
    std::string arcs_out_filename;
    string log2phys_out_filename;

    if (po.NumArgs() >= 4)
      arcs_out_filename = po.GetArg(4);

    if (po.NumArgs() >= 5) {
      log2phys_out_filename = po.GetArg(5);
      opts.logical2physical = true;
    }

    if (arcs_out_filename == "-")
      arcs_out_filename = "/dev/stdout";

    if (log2phys_out_filename == "-") {
      if (arcs_out_filename == "/dev/stdout")
        KALDI_ERR << "Attempting to write arcs and mapping table to stdout";
      else
        log2phys_out_filename = "/dev/stdout";
    }

    std::vector<std::vector<int32> > ilabel_info;
    {
      bool binary_in;
      Input ki(ilabel_info_filename, &binary_in);
      fst::ReadILabelInfo(ki.Stream(), binary_in, &ilabel_info);
    }

    ContextDependency ctx_dep;
    ReadKaldiObject(tree_filename, &ctx_dep);

    TransitionModel trans_model;
    ReadKaldiObject(model_filename, &trans_model);

    std::vector<int32> disambig_syms_out;

    vector<StdVectorFst*> fsts;
    vector<int> log2phys;
    MakeArcTypes(ilabel_info, ctx_dep, trans_model, &disambig_syms_out,
                 &fsts, &log2phys, opts);

    if (type == "fsts")
      WriteArcTypesAsFsts(arcs_out_filename, fsts);
    else if (type == "far")
      WriteArcTypesAsFar(arcs_out_filename, fsts);
    else if (type == "txt")
      WriteArcTypesAsTxt(arcs_out_filename, fsts);
    else
      KALDI_ERR << "Unknown type " << type;

    if (!log2phys_out_filename.empty()) {
      ofstream ofs(log2phys_out_filename.c_str());
      if (ofs.is_open()) {
        for (int i = 0; i != log2phys.size(); ++i)
          ofs << i << " " << log2phys[i] << endl;
      }
    }
    if (disambig_out_filename != "") {  // if option specified..
      if (disambig_out_filename == "-")
        disambig_out_filename = "";
      if (! WriteIntegerVectorSimple(disambig_out_filename, disambig_syms_out))
        KALDI_ERR << "Could not write disambiguation symbols to "
                   << (disambig_out_filename == "" ?
                       "standard output" : disambig_out_filename);
    }
    return 0;
  } catch(const std::exception &e) {
    std::cerr << e.what();
    return -1;
  }
}


text:
package org.elevenfifty.smoothie.beans;

public class Base extends AbstractIngredient implements Comparable<Base> {

// Added to AbstractIngredient by Jeff Roberg 11/12/2015
//	@Override
//	public boolean equals(Object obj) {
//		// TODO Replace with code from Produce copied from equals builder docs
//		if (obj instanceof Base) {
//			Base base = (Base) obj;
//			try {
//				return this.name.equalsIgnoreCase(base.getName());
//			} catch (NullPointerException npe) {
//				npe.printStackTrace();
//				// Check to see if the other object has a null value for name.
//				// If both null they are equal
//				return base.getName() == null;
//			}
//		} else {
//			return false;
//		}
//	}

//	@Override
//	public String toString() {
//		return super.toString() + " = " + "Calories " + calories + "; Price " + price + "; Weight " + weight + ";";
//	}

//	@Override
//	public int hashCode() {
//		return this.name.toLowerCase().hashCode();
//	}

	@Override
	public int compareTo(Base base) {
		// return (int) this.price - (int) base.getPrice();
		return this.name.compareToIgnoreCase(base.getName());
	}

	public static void main(String args[]) {
		Integer x = 5;

		System.out.println(x.toString());
		System.out.println(Integer.toString(12));
	}
}


text:
<?php

namespace GoogleGlass\Api\Contacts;

use GoogleGlass\Api\ApiAbstract;
use Zend\Http\Request;

class ListApi extends ApiAbstract
{
    public function execute($data = null)
    {
        $client = $this->getHttpClient('/mirror/v1/contacts', Request::METHOD_GET);

        $response = $this->executeRequest($client);

        $list = new \ArrayObject();

        foreach($response['items'] as $contact) {
            $contactObj = $this->getServiceLocator()->get('GoogleGlass\Contact');
            $contactObj->fromJsonResult($contact);
            $list[] = clone $contactObj;
        }

        return $list;
    }
}


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

{% block title %}
    404
{% endblock %}

{% block content %}

404

Page not found

{% endblock %}


text:
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="CoreNLP-to-HTML.xsl" type="text/xsl"?>
<root>
  <document>
    <sentences>
      <sentence id="1">
        <tokens>
          <token id="1">
            <word>thumb</word>
            <lemma>thumb</lemma>
            <CharacterOffsetBegin>0</CharacterOffsetBegin>
            <CharacterOffsetEnd>5</CharacterOffsetEnd>
            <POS>NN</POS>
          </token>
          <token id="2">
            <word>one</word>
            <lemma>one</lemma>
            <CharacterOffsetBegin>6</CharacterOffsetBegin>
            <CharacterOffsetEnd>9</CharacterOffsetEnd>
            <POS>CD</POS>
          </token>
          <token id="3">
            <word>'s</word>
            <lemma>'s</lemma>
            <CharacterOffsetBegin>9</CharacterOffsetBegin>
            <CharacterOffsetEnd>11</CharacterOffsetEnd>
            <POS>POS</POS>
          </token>
          <token id="4">
            <word>nose</word>
            <lemma>nose</lemma>
            <CharacterOffsetBegin>12</CharacterOffsetBegin>
            <CharacterOffsetEnd>16</CharacterOffsetEnd>
            <POS>NN</POS>
          </token>
          <token id="5">
            <word>disrespect</word>
            <lemma>disrespect</lemma>
            <CharacterOffsetBegin>17</CharacterOffsetBegin>
            <CharacterOffsetEnd>27</CharacterOffsetEnd>
            <POS>NN</POS>
          </token>
        </tokens>
        <parse>(ROOT (NP (NP (NN thumb)) (NP (NP (NP (CD one) (POS 's)) (NN nose)) (NP (NN disrespect))))) </parse>
        <dependencies type="basic-dependencies">
          <dep type="root">
            <governor idx="0">ROOT</governor>
            <dependent idx="1">thumb</dependent>
          </dep>
          <dep type="poss">
            <governor idx="4">nose</governor>
            <dependent idx="2">one</dependent>
          </dep>
          <dep type="possessive">
            <governor idx="2">one</governor>
            <dependent idx="3">'s</dependent>
          </dep>
          <dep type="dep">
            <governor idx="1">thumb</governor>
            <dependent idx="4">nose</dependent>
          </dep>
          <dep type="dep">
            <governor idx="4">nose</governor>
            <dependent idx="5">disrespect</dependent>
          </dep>
        </dependencies>
        <dependencies type="collapsed-dependencies">
          <dep type="root">
            <governor idx="0">ROOT</governor>
            <dependent idx="1">thumb</dependent>
          </dep>
          <dep type="poss">
            <governor idx="4">nose</governor>
            <dependent idx="2">one</dependent>
          </dep>
          <dep type="dep">
            <governor idx="1">thumb</governor>
            <dependent idx="4">nose</dependent>
          </dep>
          <dep type="dep">
            <governor idx="4">nose</governor>
            <dependent idx="5">disrespect</dependent>
          </dep>
        </dependencies>
        <dependencies type="collapsed-ccprocessed-dependencies">
          <dep type="root">
            <governor idx="0">ROOT</governor>
            <dependent idx="1">thumb</dependent>
          </dep>
          <dep type="poss">
            <governor idx="4">nose</governor>
            <dependent idx="2">one</dependent>
          </dep>
          <dep type="dep">
            <governor idx="1">thumb</governor>
            <dependent idx="4">nose</dependent>
          </dep>
          <dep type="dep">
            <governor idx="4">nose</governor>
            <dependent idx="5">disrespect</dependent>
          </dep>
        </dependencies>
      </sentence>
    </sentences>
  </document>
</root>


text:
package Testing.Package;

import java.io.File;
import steamgameselector.*;
import org.junit.*;
import static org.junit.Assert.*;
import java.util.ArrayList;
import java.util.Set;
import java.util.HashSet;

/**
 *
 * @author sfcook
 */
public class SteamDataTest {
    private SteamUtils sUtils;
    private SteamData sdb;

    @Before
    public void init()
    {
        //delete steamdata.db
        File db=new File("steamdata.db");
        db.delete();

        sUtils=new SteamUtils();
        sdb=new SteamData(sUtils);
    }

    @Test
    public void testDB()
    {
        assertTrue(sdb!=null);
    }

    @Test
    public void testBadAccount()
    {
        Account account1=new Account();
        Account account2=new Account();
        Account account3=new Account();

        Game game=new Game();
        game.appid=0;
        game.title="Fake Game";
        game.tags.add("Fake");

        account1.name="Frank";
        account1.games.add(game);

        account2.name="Frank";
        account2.steamid="9000";

        account3.games.add(game);
        account3.steamid="9000";

        assertTrue(sdb.addAccount(account1)==-1);
        assertTrue(sdb.addAccount(account2)==-1);
        assertTrue(sdb.addAccount(account3)==-1);
    }

    @Test
    public void testAccount()
    {
        Account account=new Account();
        account.name="Frank";
        account.games.add(sdb.getGame(sdb.addGame(10))); //appid for CS
        account.steamid="1"; //techincally vaild but doesn't seem to be a real id

        assertTrue(sdb.addAccount(account)>0);

        Account result=sdb.getAccount("1");

        assertTrue(result!=null && result.name.equals(account.name));
    }

    @Test
    public void testAccount2()
    {
        assertTrue(sdb.addAccount("http://steamcommunity.com/id/wireteam")>0);

        Account result=sdb.getAccounts().get(0);

        assertFalse(result.steamid.isEmpty());
    }

    @Test
    public void testGetAccounts()
    {
        Account account1=new Account();
        Account account2=new Account();
        Account account3=new Account();

        account1.name="Frank1";
        account1.steamid="1";
        account1.games.add(sdb.getGame(sdb.addGame(10)));

        account2.name="Frank2";
        account2.steamid="2";
        account2.games.add(sdb.getGame(sdb.addGame(10)));

        account3.name="Frank3";
        account3.games.add(sdb.getGame(sdb.addGame(10)));
        account3.steamid="3";

        assertTrue(sdb.addAccount(account1)>0);
        assertTrue(sdb.addAccount(account2)>0);
        assertTrue(sdb.addAccount(account3)>0);

        ArrayList<Account> accounts=sdb.getAccounts();

        for(Account account:accounts)
        {
            account.accountid=-1;
        }

        assertTrue(accounts.contains(account1));
        assertTrue(accounts.contains(account2));
        assertTrue(accounts.contains(account3));
    }

    @Test
    public void testTag()
    {
        String tag="Next-gen tag all the kids are talking about";
        int tagid=sdb.addTag(tag);

        assertTrue(tagid>=0);
        assertTrue(tagid==sdb.getTagId(tag));

        String result=sdb.getTag(tagid);

        assertTrue(result!=null && result.equals(tag));
    }

    @Test
    public void testTagDup()
    {
        String tag="Next-gen tag all the kids are talking about";
        int tagid1=sdb.addTag(tag);
        int tagid2=sdb.addTag(tag);

        assertTrue(tagid1==tagid2);
    }

    @Test
    public void testGetTagsArray()
    {
        String tag1="one";
        String tag2="two";
        String tag3="three";

        sdb.addTag(tag1);
        sdb.addTag(tag2);
        sdb.addTag(tag3);

        ArrayList<String> tags=sdb.getTags();

        assertTrue(tags.contains(tag1));
        assertTrue(tags.contains(tag2));
        assertTrue(tags.contains(tag3));
    }

    @Test
    public void testGetTagsGameid()
    {
        Game game=new Game();
        game.tags.add("one");
        game.tags.add("two");
        game.tags.add("three");
        String title="Fake Game";
        game.title=title;

        int gameid=sdb.addGame(game);

        assertTrue(sdb.getGame(gameid).title.equals(title));

        ArrayList<String> tags=sdb.getTags(gameid);
        for(String tag:game.tags)
        {
            assertTrue(tags.contains(tag));
        }
    }

    @Test
    public void testGame()
    {
        Game game=new Game();
        String title="Fake Game";
        game.title=title;

        int gameid=sdb.addGame(game);

        assertTrue(sdb.getGame(gameid).title.equals(title));
    }

    @Test
    public void testGame2()
    {
        Game game=new Game();
        game.tags.add("one");
        game.tags.add("two");
        game.tags.add("three");
        String title="Fake Game";
        game.title=title;

        int gameid=sdb.addGame(game);

        Game result=sdb.getGame(gameid);
        assertTrue(result.title.equals(title));

        for(String tag:game.tags)
        {
            assertTrue(result.tags.contains(tag));
        }
    }

    @Test
    public void testAddSteamGame()
    {
        int gameid=sdb.addGame(10);
        Game cs1=sdb.getSteamGame(10);
        Game cs2=sdb.getGame(gameid);

        assertTrue(cs1.title.equals(cs2.title));
        assertTrue(cs1.title.equals("Counter-Strike"));
    }

    private void buildTestAccount()
    {
        Account account=new Account();
        account.steamid="0";
        account.name="Fake Account";

        ArrayList<Integer> games=new ArrayList();
        games.add(10); //counter-strike
        games.add(20); //team fortress classic
        games.add(70); //half-life
        games.add(220); //half-life 2
        games.add(240); //counter-strike: source
        games.add(400); //portal
        games.add(440); //teaam fortress 2
        games.add(550); //left 4 dead 2
        games.add(630); //alien swarm
        games.add(570); //dota 2
        games.add(730); //counter-strike: global offensive
        games.add(1250); //killing floor

        for(Integer appid:games)
        {
            sdb.addGame(appid);
            account.games.add(sdb.getSteamGame(appid));
        }

        sdb.addAccount(account);
    }
    @Test
    public void testAndFilter()
    {
        buildTestAccount();

        Set<Integer> tags=new HashSet();
        tags.add(sdb.getTagId("Steam Trading Cards"));
        tags.add(sdb.getTagId("Co-op"));
        ArrayList<Game> filtered=sdb.getFilteredGames(tags, null, null);

        assertTrue(filtered.size()==3);
        assertTrue(filtered.contains(sdb.getSteamGame(550)));
        assertTrue(filtered.contains(sdb.getSteamGame(570)));
        assertTrue(filtered.contains(sdb.getSteamGame(1250)));
    }
    @Test
    public void testOrFilter()
    {
        buildTestAccount();

        Set<Integer> tags=new HashSet();
        tags.add(sdb.getTagId("Free to Play"));
        tags.add(sdb.getTagId("Co-op"));
        ArrayList<Game> filtered=sdb.getFilteredGames(null, tags, null);

        assertTrue(filtered.size()==5);
        assertTrue(filtered.contains(sdb.getSteamGame(440)));
        assertTrue(filtered.contains(sdb.getSteamGame(550)));
        assertTrue(filtered.contains(sdb.getSteamGame(570)));
        assertTrue(filtered.contains(sdb.getSteamGame(630)));
        assertTrue(filtered.contains(sdb.getSteamGame(1250)));
    }
    @Test
    public void testNotFilter()
    {
        buildTestAccount();

        Set<Integer> tags=new HashSet();
        tags.add(sdb.getTagId("Free to Play"));
        ArrayList<Game> filtered=sdb.getFilteredGames(null, null, tags);

        assertTrue(filtered.size()==10);
        assertFalse(filtered.contains(sdb.getSteamGame(440)));
        assertFalse(filtered.contains(sdb.getSteamGame(570)));
    }
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MinMethod
{
    class Program
    {
        static void Main(string[] args)
        {
            int num1 = int.Parse(Console.ReadLine());
            int num2 = int.Parse(Console.ReadLine());
            int num3 = int.Parse(Console.ReadLine());

            Console.WriteLine(GetMin(GetMin(num1, num2), num3));
        }

        static int GetMin(int num1, int num2)
        {
            if (num1 > num2)
            {
                return num2;
            }
            else
            {
                return num1;
            }
        }
    }
}


text:
import numpy as np

def CreateIntegerDataWithDispersedFRB(startTime=1,DM=0,inputArray=None,
                                      lenSeries=65536,numChannels=4096,
                                      fMin=400,fMax=800,sampTime=1E-3):
    """
    Returns an array of zeros with dtype int16. Adds an dispersed FRB signal to inputArray (optional). This is intended as a numerical precision test of the FDMT algorithm vs brute force.
    The background will be zeros and the FRB will have an amplitude of 1/channel and a width of 1 time bin.

    Input:
    startTime=1,      : FRB start time (seconds)
    DM=0,             : DM in pc cm^-3
    inputArray=None,  : inputArray (of integers, not checked). If you want to add multiple FRBs
    lenSeries=65536,  : Number of time bins. Taken from inputArray size if specified.
    numChannels=4096, : Num freq channels. Ditto as above.
    fMin=400,         : min freq (MHz)
    fMax=800,         : max freq (MHz)
    sampTime=1E-3     : time bin size (seconds)
    """

    if inputArray is None:
        inputArray = np.zeros((numChannels,lenSeries),dtype=np.int16)
    else:
        inputArray = np.int16(inputArray)

        numChannels,lenSeries = inputArray.shape

    ## Calculate time axis indices for every freq channel (i.e. calculate the DM curve).
    df = (fMax - fMin)/np.float(numChannels)  #bandwidth per channel
    f = np.arange(fMin,fMax,df)+df/2          #(adding half df to get the center of the band)

    dt = 4.148808*DM*1E3*(1/f**2-1/fMax**2)/sampTime # This gives the timeBin shifts.
                                                     # The -1/fMax**2 sets high freq origin = 0

    ## now shift the dispersion curve by startTime
    dt = np.int32(dt+startTime/sampTime)

    for i in range(numChannels):
        ## Make sure that the max is within lenSeries
        if dt[i]<lenSeries and dt[i]>=0:
            inputArray[i,dt[i]] += 1

    return inputArray