text:
cask 'ipe' do
  version '7.2.7'
  sha256 '13bd32ecfb77d7c3e073436f4b7e8b8532706a80aeec9575172670dc91908b25'

  # bintray.com/otfried was verified as official when first introduced to the cask
  url "https://dl.bintray.com/otfried/generic/ipe/#{version.major_minor}/ipe-#{version}-mac.dmg"
  appcast 'http://ipe.otfried.org/',
          checkpoint: 'bd56cea213718b2f59da8fb146cd3f120e70d3b908c7364d230db6235c7b25ae'
  name 'Ipe'
  homepage 'http://ipe.otfried.org/'

  depends_on macos: '>= :mavericks'

  app 'Ipe.app'

  zap trash: [
               '~/.ipe',
               '~/Library/Application Support/com.apple.sharedfilelist/com.apple.LSSharedFileList.ApplicationRecentDocuments/org.otfried.ipe.ipe.sfl*',
               '~/Library/Application Support/com.apple.sharedfilelist/com.apple.LSSharedFileList.ApplicationRecentDocuments/org.otfried.ipe.sfl*',
               '~/Library/Preferences/org.otfried.ipe.Ipe.plist',
               '~/Library/Saved Application State/org.otfried.ipe.savedState',
             ]
end


text:
<!-- Scrollspy Scripts -->

  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.0/jquery.min.js"></script>
  <script src="/bootstrap/bootstrap.min.js"></script>
<style>
  body {
      position: relative;
  }
  .affix {
      top:0;
      width: 100%;
      z-index: 9999 !important;
  }
  .navbar {
      margin-bottom: 0px;
  }

  .affix ~ .container-fluid {
     position: relative;
     top: 50px;
  }
</style>

redpajama_set_name: RedPajamaGithub


text:
__author__ = 'Harald Floor Wilhelmsen'

class Server(object):
    status = '\x033,1oppe\x03'

    def __init__(self, hostname, owner, prettyname, statusgroup, notifygroup):
        self.hostname = hostname
        self.owner = owner
        self.prettyname = prettyname
        self.statusgroup = statusgroup
        self.notifygroup = notifygroup

    def __str__(self):
        string = self.hostname + " " + self.owner + ": " + self.prettyname + " " + self.statusgroup + " " + self.notifygroup
        return string

    def __repr__(self):
        return self.__str__()


text:
* https://github.com/kbparagua/paloma/pull/75 - Explicitly insert hook in view.

## 4.1.2
* https://github.com/kbparagua/paloma/issues/73 - Fix `js false` issue.

## 4.1.1
* https://github.com/kbparagua/paloma/pull/57 - Fix Turbolinks Issues.
* https://github.com/kbparagua/paloma/pull/55 - Fix issues when Paloma hook is not found.

## 4.1.0
* Support for Turbolinks.
* `Paloma.executeHook()` to manually run the hook from the DOM.
* Paloma hook will be appended using all `render` calls, except for calls that has the following keys `[:json, :js, :xml, :file]`.
* Restore `Paloma.engine.start()` to start processing queued request.

## 4.0.0
* https://github.com/kbparagua/paloma/issues/26 - Paloma requests are not saved on `session`.
* https://github.com/kbparagua/paloma/issues/26 - Chaining with redirect is removed.
* Routing from javascript is removed.
* Routing from Rails controller is added.
* Ability to have a controller-wide setting.
* https://github.com/kbparagua/paloma/issues/29 - Disable `console.log` and `console.warn` for non-development environments.

## 3.0.2
* Bug Fix: Converting Rails controller name to singular form.

## 3.0.1
* Bug Fix: Can't handle Rails controller with Multi-word name.
* Bug Fix: Paloma Engine is halting when a warning is encountered.
* Don't create Paloma request if rendering js, json, xml, or file.

## 3.0.0
* Rewrite Initial Release


text:
'use strict';

// =============================================================
// =                     User Profile List                     =
// =============================================================
damControllers.controller('authLoginCtrl', function(globalContent, Site, Authorization, $scope) {
	globalContent.hideSidebar = true;
	globalContent.hideSite = true;
	globalContent.hideUser = true;

	$scope.username = "";
	$scope.password = "";
	$scope.lock = false;

	// UI
	setTimeout(function() {
		$("#username").focus();
	});

	// Login
	$scope.login = function(event, forceSubmit) {
		if($scope.lock) return;

		if(event.which === 13 || forceSubmit) {
			$scope.lock = true;

			Authorization.login($scope.username, $scope.password).then(function(success) {
				if(success) {
					Site.refresh();
					Authorization.refresh();
					Authorization.path(true);
				} else {
					$.dialog({
						title: "OPS",
						content: "User name or password not correct."
					}).on("hidden.bs.modal", function() {
						$("#username").focus();
					});
				}
			}).finally(function() {
				$scope.lock = false;
			});
		}
	};
});


text:
package cmd

import (
	biinstallmanifest "github.com/cloudfoundry/bosh-init/installation/manifest"
	birelsetmanifest "github.com/cloudfoundry/bosh-init/release/set/manifest"
	bosherr "github.com/cloudfoundry/bosh-utils/errors"
)

type ReleaseSetAndInstallationManifestParser struct {
	ReleaseSetParser   birelsetmanifest.Parser
	InstallationParser biinstallmanifest.Parser
}

func (y ReleaseSetAndInstallationManifestParser) ReleaseSetAndInstallationManifest(deploymentManifestPath string) (birelsetmanifest.Manifest, biinstallmanifest.Manifest, error) {
	releaseSetManifest, err := y.ReleaseSetParser.Parse(deploymentManifestPath)
	if err != nil {
		return birelsetmanifest.Manifest{}, biinstallmanifest.Manifest{}, bosherr.WrapErrorf(err, "Parsing release set manifest '%s'", deploymentManifestPath)
	}

	installationManifest, err := y.InstallationParser.Parse(deploymentManifestPath, releaseSetManifest)
	if err != nil {
		return birelsetmanifest.Manifest{}, biinstallmanifest.Manifest{}, bosherr.WrapErrorf(err, "Parsing installation manifest '%s'", deploymentManifestPath)
	}
	return releaseSetManifest, installationManifest, nil
}


text:
using FizzWare.NBuilder.Tests.Integration.Models;

using Shouldly;
using Xunit;

namespace FizzWare.NBuilder.Tests.Integration
{
    public class HierarchyBuilderTests
    {

        [Fact]
        public void CreatingAHierarchyOfCategoriesUsingRepositories()
        {
            var builderSetup = new RepositoryBuilderSetup().DoSetup();
            const int depth = 3;
            const int minChildren = 3;
            const int maxChildren = 8;

            var builder = new Builder(builderSetup);
            var hierarchySpec = builder.CreateNew<HierarchySpec<Category>>()
                .With(x => x.AddMethod = (parent, child) => parent.AddChild(child))
                .With(x => x.Depth = depth)
                .With(x => x.MinimumChildren = minChildren)
                .With(x => x.MaximumChildren = maxChildren)
                .With(x => x.NamingMethod = (parent, child) => parent.Title = "Category " + child)
                .With(x => x.NumberOfRoots = 5)
                .Build();

            var categories = builder
                .CreateListOfSize<Category>(10000)
                .All()
                .PersistHierarchy(hierarchySpec);

            foreach (var root in categories)
            {
                root.Children.Count.ShouldBeGreaterThanOrEqualTo(minChildren);
                root.Children.Count.ShouldBeLessThanOrEqualTo(maxChildren);

                foreach (var child1 in root.Children)
                {
                    child1.Children.Count.ShouldBeGreaterThanOrEqualTo(minChildren);
                    child1.Children.Count.ShouldBeLessThanOrEqualTo(maxChildren);

                    foreach (var child2 in child1.Children)
                    {
                        child2.Children.Count.ShouldBeGreaterThanOrEqualTo(minChildren);
                        child2.Children.Count.ShouldBeLessThanOrEqualTo(maxChildren);
                    }
                }
            }
        }

        [Fact]
        public void CreatingAHierarchyOfCategoriesUsingEntityFramework()
        {
            //var builderSetup = new PersistenceTestsBuilderSetup().SetUp();
            const int depth = 3;
            const int minChildren = 3;
            const int maxChildren = 8;

            var builder = new Builder(new RepositoryBuilderSetup().DoSetup());
            var hierarchySpec = builder.CreateNew< HierarchySpec<Category>>()
                .With(x => x.AddMethod = (parent, child) => parent.AddChild(child))
                .With(x => x.Depth = depth)
                .With(x => x.MinimumChildren = minChildren)
                .With(x => x.MaximumChildren = maxChildren)
                .With(x => x.NamingMethod = (parent, child) => parent.Title = "Category " + child)
                .With(x => x.NumberOfRoots = 5)
                .Build();

            var categories = builder
                .CreateListOfSize<Category>(10000)
                .All()
                .PersistHierarchy(hierarchySpec);

            foreach (var root in categories)
            {
                root.Children.Count.ShouldBeGreaterThanOrEqualTo(minChildren);
                root.Children.Count.ShouldBeLessThanOrEqualTo(maxChildren);

                foreach (var child1 in root.Children)
                {
                    child1.Children.Count.ShouldBeGreaterThanOrEqualTo(minChildren);
                    child1.Children.Count.ShouldBeLessThanOrEqualTo(maxChildren);

                    foreach (var child2 in child1.Children)
                    {
                        child2.Children.Count.ShouldBeGreaterThanOrEqualTo(minChildren);
                        child2.Children.Count.ShouldBeLessThanOrEqualTo(maxChildren);
                    }
                }
            }
        }

    }
}


text:
class CreateNotifications < ActiveRecord::Migration
  def change
    create_table :notifications do |t|
      t.string   :text,    null: false
      t.boolean  :read,    null: false,  default: false

      t.timestamps
    end
  end
end


text:
package org.seqcode.genome.sequence.seqfunctions;

/**
 * Converts the sequence into a 2xL matrix of aMino/Keto base frequencies
 * @author mahony
 *
 */
public class MKBaseFrequencyFunction implements SeqFunction{

	//Variables
	final int scoreDimension = 2;
	final int scoringOffset = 0;
	final int scoreWindowSize = 1;
	final boolean isBetweenNucs = false;
	final String[] labels = {"M", "K"};
	final String description = "aMino/Keto base frequencies";

	public double[][] score(String seq) throws SeqFunctionException {
		if(seq.length()<scoreWindowSize)
			throw new SeqFunctionException("Sequence too short for MKBaseFrequencyFunction");

		double [][] scores = new double[scoreDimension][seq.length()];
		String seqU = seq.toUpperCase();
		for(int i=0; i<seqU.length(); i++){
			char b = seqU.charAt(i);
			for(int x=0; x<scoreDimension; x++){ scores[x][i]=0;}

			switch(b){
				case 'A': scores[0][i]=1; break;
				case 'C': scores[0][i]=1; break;
				case 'G': scores[1][i]=1; break;
				case 'T': scores[1][i]=1; break;
				case 'N': case 'S': case 'R': case 'W': case 'Y': default: scores[0][i]=0.5; scores[1][i]=0.5; break;
				case 'M' : scores[0][i]=1; break;
				case 'K' : scores[1][i]=1; break;
			}
		}
		return scores;
	}

	public int scoreDimension() {
		return scoreDimension;
	}

	public int scoringOffset() {
		return scoringOffset;
	}

	public int scoreWindowSize() {
		return scoreWindowSize;
	}

	public boolean isBetweenNucleotides() {
		return isBetweenNucs;
	}

	public String[] dimensionLabels() {
		return labels;
	}

	public String scoreDescription() {
		return description;
	}

	public double getMaxScore(){return 1.0;}
	public double getMinScore(){return 0.0;}
}


text:
<?php

class AuthenticationManager extends CApplicationComponent {
    public function login(LoginForm $form, CHttpRequest $request = null) {
        if ($form->login()) {

            return $form->identity->user;
        }
    }
}
?>


text:
/**
 * This file tests migration invariants from schema version 19 to the current
 * schema version.
 */

////////////////////////////////////////////////////////////////////////////////
//// Globals

const kGuidAnnotationName = "placesInternal/GUID";

function getTotalGuidAnnotationsCount(aStorageConnection) {
  stmt = aStorageConnection.createStatement(
    "SELECT count(*) "
  + "FROM moz_items_annos a "
  + "JOIN moz_anno_attributes b ON a.anno_attribute_id = b.id "
  + "WHERE b.name = :attr_name"
  );
  try {
    stmt.params.attr_name = kGuidAnnotationName;
    do_check_true(stmt.executeStep());
    return stmt.getInt32(0);
  } finally {
    stmt.finalize();
  }
}

////////////////////////////////////////////////////////////////////////////////
//// Tests

function run_test()
{
  setPlacesDatabase("places_v19.sqlite");
  run_next_test();
}

add_test(function test_initial_state()
{
  let dbFile = gProfD.clone();
  dbFile.append(kDBName);
  let db = Services.storage.openUnsharedDatabase(dbFile);

  // There should be an obsolete bookmark GUID annotation.
  do_check_eq(getTotalGuidAnnotationsCount(db), 1);

  // Check our schema version to make sure it is actually at 19.
  do_check_eq(db.schemaVersion, 19);

  db.close();
  run_next_test();
});

add_test(function test_bookmark_guid_annotation_removed()
{

  // There should be no obsolete bookmark GUID annotation anymore.
  do_check_eq(getTotalGuidAnnotationsCount(DBConn()), 0);

  run_next_test();
});


text:
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class com_supermap_data_GeometristNative */

#ifndef _Included_com_supermap_data_GeometristNative
#define _Included_com_supermap_data_GeometristNative
#ifdef __cplusplus
extern "C" {
#endif
	/*
	* Class:     com_supermap_data_GeometristNative
	* Method:    jni_IsIdentical
	* Signature: (JJ)Z
	*/
	JNIEXPORT jboolean JNICALL Java_com_supermap_data_GeometristNative_jni_1IsIdentical
		(JNIEnv *, jclass, jlong, jlong);

	/*
	* Class:     com_supermap_data_GeometristNative
	* Method:    jni_IsDisjointed
	* Signature: (JJ)Z
	*/
	JNIEXPORT jboolean JNICALL Java_com_supermap_data_GeometristNative_jni_1IsDisjointed
		(JNIEnv *, jclass, jlong, jlong);

	/*
	* Class:     com_supermap_data_GeometristNative
	* Method:    jni_HasIntersection
	* Signature: (JJ)Z
	*/
	JNIEXPORT jboolean JNICALL Java_com_supermap_data_GeometristNative_jni_1HasIntersection
		(JNIEnv *, jclass, jlong, jlong);

	/*
	* Class:     com_supermap_data_GeometristNative
	* Method:    jni_HasTouch
	* Signature: (JJ)Z
	*/
	JNIEXPORT jboolean JNICALL Java_com_supermap_data_GeometristNative_jni_1HasTouch
		(JNIEnv *, jclass, jlong, jlong);

	/*
	* Class:     com_supermap_data_GeometristNative
	* Method:    jni_HasOverlap
	* Signature: (JJ)Z
	*/
	JNIEXPORT jboolean JNICALL Java_com_supermap_data_GeometristNative_jni_1HasOverlap
		(JNIEnv *, jclass, jlong, jlong);

	/*
	* Class:     com_supermap_data_GeometristNative
	* Method:    jni_HasCross
	* Signature: (JJ)Z
	*/
	JNIEXPORT jboolean JNICALL Java_com_supermap_data_GeometristNative_jni_1HasCross
		(JNIEnv *, jclass, jlong, jlong);

	/*
	* Class:     com_supermap_data_GeometristNative
	* Method:    jni_IsWithin
	* Signature: (JJ)Z
	*/
	JNIEXPORT jboolean JNICALL Java_com_supermap_data_GeometristNative_jni_1IsWithin
		(JNIEnv *, jclass, jlong, jlong);

	/*
	* Class:     com_supermap_data_GeometristNative
	* Method:    jni_CanContain
	* Signature: (JJ)Z
	*/
	JNIEXPORT jboolean JNICALL Java_com_supermap_data_GeometristNative_jni_1CanContain
		(JNIEnv *, jclass, jlong, jlong);

	/*
	* Class:     com_supermap_data_GeometristNative
	* Method:    jni_HasCommonPoint
	* Signature: (JJ)Z
	*/
	JNIEXPORT jboolean JNICALL Java_com_supermap_data_GeometristNative_jni_1HasCommonPoint
		(JNIEnv *, jclass, jlong, jlong);

	/*
	* Class:     com_supermap_data_GeometristNative
	* Method:    jni_HasCommonLine
	* Signature: (JJ)Z
	*/
	JNIEXPORT jboolean JNICALL Java_com_supermap_data_GeometristNative_jni_1HasCommonLine
		(JNIEnv *, jclass, jlong, jlong);

	/*
	* Class:     com_supermap_data_GeometristNative
	* Method:    jni_Intersect
	* Signature: (JJ)J
	*/
	JNIEXPORT jlong JNICALL Java_com_supermap_data_GeometristNative_jni_1Intersect
		(JNIEnv *, jclass, jlong, jlong);

	/*
	* Class:     com_supermap_data_GeometristNative
	* Method:    jni_Union
	* Signature: (JJ)J
	*/
	JNIEXPORT jlong JNICALL Java_com_supermap_data_GeometristNative_jni_1Union
		(JNIEnv *, jclass, jlong, jlong);

	/*
	* Class:     com_supermap_data_GeometristNative
	* Method:    jni_Erase
	* Signature: (JJ)J
	*/
	JNIEXPORT jlong JNICALL Java_com_supermap_data_GeometristNative_jni_1Erase
		(JNIEnv *, jclass, jlong, jlong);

	/*
	* Class:     com_supermap_data_GeometristNative
	* Method:    jni_Update
	* Signature: (JJ)J
	*/
	JNIEXPORT jlong JNICALL Java_com_supermap_data_GeometristNative_jni_1Update
		(JNIEnv *, jclass, jlong, jlong);

	/*
	* Class:     com_supermap_data_GeometristNative
	* Method:    jni_Identity
	* Signature: (JJ)J
	*/
	JNIEXPORT jlong JNICALL Java_com_supermap_data_GeometristNative_jni_1Identity
		(JNIEnv *, jclass, jlong, jlong);

	/*
	* Class:     com_supermap_data_GeometristNative
	* Method:    jni_XOR
	* Signature: (JJ)J
	*/
	JNIEXPORT jlong JNICALL Java_com_supermap_data_GeometristNative_jni_1XOR
		(JNIEnv *, jclass, jlong, jlong);

	/*
	* Class:     com_supermap_data_GeometristNative
	* Method:    jni_Clip
	* Signature: (JJ)J
	*/
	JNIEXPORT jlong JNICALL Java_com_supermap_data_GeometristNative_jni_1Clip
		(JNIEnv *, jclass, jlong, jlong);

	/*
	* Class:     com_supermap_data_GeometristNative
	* Method:    jni_Resample
	* Signature: (J)J
	*/
	JNIEXPORT jlong JNICALL Java_com_supermap_data_GeometristNative_jni_1Resample
		(JNIEnv *, jclass, jlong,jdouble);

	/*
	 * Class:     com_supermap_data_GeometristNative
	 * Method:    jni_Distance
	 * Signature: (JJ)D
	 */
	JNIEXPORT jdouble JNICALL Java_com_supermap_data_GeometristNative_jni_1Distance
	  (JNIEnv *, jclass, jlong, jlong);

#ifdef __cplusplus
}
#endif
#endif


text:
<TITLE>Review for Hot Shots! Part Deux (1993)</TITLE>
<LINK REL="STYLESHEET" TYPE="text/css" HREF="/ramr.css">

Hot Shots! Part Deux (1993)

reviewed by
Gregory N. Bond

                              HOT SHOTS! PART DEUX
                       A film review by Gregory N. Bond
                        Copyright 1993 Gregory N. Bond

[Again, just released locally but probably old news to many of you.
FLYING HIGH was released as AIRPLANE! in the U.S.]

     This is made by (one of) the same people who did FLYING HIGH, TOP
SECRET and the original HOT SHOTS.  Like all of the above, it is chock
full of sight gags, one liners, running jokes and not very subtle
parodies of other movies. I noticed among others: Just about every
RAMBO film, a huge swipe at BASIC INSTINCT, CASABLANCA, TERMINATOR 2,
ROBIN HOOD - PRINCE OF THIEVES (and most other sword-and-valour
flicks), APOCALYPSE NOW, SPACEBALLS, STAR WARS, and probably a dozen
more that I couldn't exactly place.

     The basic story is RAMBO 2 done over: got to get the hostages out,
this time from Iraq.  Plenty of gags about Hussein, none of which are
complimentary.  Lloyd Bridges is completely over the top as the
befuddled U.S. President, Charlie Sheen with a fair bit of added bulk
does a good line in brooding, and a bunch of look-alikes in various
supporting roles.  I found that as a whole it worked better than the
previous HOT SHOTS, with more laughs and a more even production.
However, the style is not universally favoured.  If you are the type
left cold by FLYING HIGH, this movie is not for you.

     All in all it works very well, and I laughed a lot.  Worth a look
at $7.50 prices, certainly worth it for a video night.  Rated M for
some fairly heavy sexual innuendo, but no skin shown.

The Second Test at Lords on the Sid and Nancy scale.
--
Gregory Bond <A HREF="mailto:<gnb@bby.com.au>"><gnb@bby.com.au> Burdett Buckeridge & Young Ltd Melbourne Australia

.

The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).

The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.

Please direct comments/criticisms of the review to relevant newsgroups.

Broken URLs inthe reviews are the responsibility of the author.

The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.

Related links: index of all rec.arts.movies.reviews reviews


text:
try { __dactyl_eval_result = eval(__dactyl_eval_string); }
catch (e) { __dactyl_eval_error = e; }

// IMPORTANT: The eval statement *must* remain on the first line
// in order for line numbering in any errors to remain correct.

// Copyright (c) 2008-2012 Kris Maglione <maglione.k at Gmail>
//
// This work is licensed for reuse under an MIT license. Details are
// given in the LICENSE.txt file included with this file.

// vim: set fdm=marker sw=4 sts=4 ts=8 et:


text:
package org.batfish.representation.juniper;

import static org.junit.Assert.assertEquals;

import com.google.common.collect.ImmutableList;
import java.util.List;
import org.batfish.datamodel.HeaderSpace;
import org.batfish.datamodel.IpProtocol;
import org.batfish.datamodel.TcpFlags;
import org.batfish.datamodel.TcpFlagsMatchConditions;
import org.batfish.datamodel.TraceElement;
import org.batfish.datamodel.acl.MatchHeaderSpace;
import org.junit.Test;

/** Test for {@link FwFromTcpFlags} */
public class FwFromTcpFlagsTest {

  @Test
  public void testToAclLineMatchExpr_tcpEstablished() {
    assertEquals(
        FwFromTcpFlags.TCP_ESTABLISHED.toAclLineMatchExpr(null, null, null),
        new MatchHeaderSpace(
            HeaderSpace.builder()
                .setIpProtocols(IpProtocol.TCP)
                .setTcpFlags(
                    ImmutableList.of(
                        TcpFlagsMatchConditions.builder()
                            .setTcpFlags(TcpFlags.builder().setAck(true).build())
                            .setUseAck(true)
                            .build(),
                        TcpFlagsMatchConditions.builder()
                            .setTcpFlags(TcpFlags.builder().setRst(true).build())
                            .setUseRst(true)
                            .build()))
                .build(),
            TraceElement.of("Matched tcp-flags tcp-established")));
  }

  @Test
  public void testToAclLineMatchExpr_tcpInitial() {
    assertEquals(
        FwFromTcpFlags.TCP_INITIAL.toAclLineMatchExpr(null, null, null),
        new MatchHeaderSpace(
            HeaderSpace.builder()
                .setIpProtocols(IpProtocol.TCP)
                .setTcpFlags(
                    ImmutableList.of(
                        TcpFlagsMatchConditions.builder()
                            .setTcpFlags(TcpFlags.builder().setAck(true).setSyn(true).build())
                            .setUseAck(true)
                            .setUseSyn(true)
                            .build()))
                .build(),
            TraceElement.of("Matched tcp-flags tcp-initial")));
  }

  @Test
  public void testToAclLineMatchExpr_tcpFlags() {
    List<TcpFlagsMatchConditions> tcpFlags =
        ImmutableList.of(
            TcpFlagsMatchConditions.ACK_TCP_FLAG, TcpFlagsMatchConditions.RST_TCP_FLAG);
    FwFromTcpFlags from = FwFromTcpFlags.fromTcpFlags(tcpFlags);

    assertEquals(
        from.toAclLineMatchExpr(null, null, null),
        new MatchHeaderSpace(
            HeaderSpace.builder().setIpProtocols(IpProtocol.TCP).setTcpFlags(tcpFlags).build(),
            TraceElement.of(
                String.format(
                    "Matched tcp-flags %s %s",
                    TcpFlagsMatchConditions.ACK_TCP_FLAG.toString(),
                    TcpFlagsMatchConditions.RST_TCP_FLAG.toString()))));
  }
}


text:
package fm.last.moji.tracker.impl;

import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;
import static org.mockito.Mockito.when;

import java.util.Collections;
import java.util.HashMap;
import java.util.Map;

import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.ArgumentCaptor;
import org.mockito.Captor;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;

import fm.last.moji.tracker.TrackerException;

@RunWith(MockitoJUnitRunner.class)
public class GetDeviceStatusesOperationTest {

  private static final String DOMAIN = "domain";

  @Mock
  private RequestHandler mockRequestHandler;
  @Mock
  private Response mockResponse;
  @Mock
  private Response mockEmptyResponse;
  @Mock
  private Response mockFailResponse;

  @Captor
  private ArgumentCaptor<Request> captorRequest;

  private GetDeviceStatusesOperation operation;

  @Before
  public void setUp() throws TrackerException {
    when(mockResponse.getStatus()).thenReturn(ResponseStatus.OK);
    when(mockResponse.getValue("devices")).thenReturn("2");

    Map<String, String> valueMap = new HashMap<String, String>();
    valueMap.put("dev1_utilization", "0.5");
    valueMap.put("dev1_observed_state", "ok");
    valueMap.put("dev1_mb_total", "100");
    valueMap.put("dev1_mb_used", "51");
    valueMap.put("dev1_mb_free", "49");
    valueMap.put("dev1_reject_bad_md5", "1");
    valueMap.put("dev1_weight", "10");
    valueMap.put("dev1_devid", "1");
    valueMap.put("dev1_status", "failed");
    valueMap.put("dev1_hostid", "1");

    valueMap.put("dev2_utilization", "0.1");
    valueMap.put("dev2_observed_state", "error");
    valueMap.put("dev2_mb_total", "200");
    valueMap.put("dev2_mb_used", "51");
    valueMap.put("dev2_mb_free", "149");
    valueMap.put("dev2_reject_bad_md5", "1");
    valueMap.put("dev2_weight", "5");
    valueMap.put("dev2_devid", "2");
    valueMap.put("dev2_status", "ok");
    valueMap.put("dev2_hostid", "2");

    when(mockResponse.getValueMap()).thenReturn(valueMap);

    when(mockEmptyResponse.getStatus()).thenReturn(ResponseStatus.OK);

    when(mockFailResponse.getStatus()).thenReturn(ResponseStatus.ERROR);
    when(mockFailResponse.getMessage()).thenReturn("unexpected error");
  }

  @Test
  public void requestNormal() throws TrackerException {
    when(mockRequestHandler.performRequest(captorRequest.capture())).thenReturn(mockResponse);

    operation = new GetDeviceStatusesOperation(mockRequestHandler, DOMAIN);
    operation.execute();

    Request request = captorRequest.getValue();
    assertThat(request.getCommand(), is("get_devices"));
    assertThat(request.getArguments().size(), is(1));
    assertThat(request.getArguments().get("domain"), is(DOMAIN));
  }

  @Test
  public void responseNormal() throws TrackerException {
    when(mockRequestHandler.performRequest(captorRequest.capture())).thenReturn(mockResponse);

    operation = new GetDeviceStatusesOperation(mockRequestHandler, DOMAIN);
    operation.execute();

    Map<String, Map<String, String>> parametersByDevice = operation.getParametersByDevice();
    assertThat(parametersByDevice.size(), is(2));

    Map<String, String> device1params = parametersByDevice.get("dev1");
    assertThat(device1params.size(), is(10));
    assertThat(device1params.get("utilization"), is("0.5"));
    assertThat(device1params.get("observed_state"), is("ok"));
    assertThat(device1params.get("mb_total"), is("100"));
    assertThat(device1params.get("mb_used"), is("51"));
    assertThat(device1params.get("mb_free"), is("49"));
    assertThat(device1params.get("reject_bad_md5"), is("1"));
    assertThat(device1params.get("weight"), is("10"));
    assertThat(device1params.get("devid"), is("1"));
    assertThat(device1params.get("status"), is("failed"));
    assertThat(device1params.get("hostid"), is("1"));

    Map<String, String> device2params = parametersByDevice.get("dev2");
    assertThat(device2params.size(), is(10));
    assertThat(device2params.get("utilization"), is("0.1"));
    assertThat(device2params.get("observed_state"), is("error"));
    assertThat(device2params.get("mb_total"), is("200"));
    assertThat(device2params.get("mb_used"), is("51"));
    assertThat(device2params.get("mb_free"), is("149"));
    assertThat(device2params.get("reject_bad_md5"), is("1"));
    assertThat(device2params.get("weight"), is("5"));
    assertThat(device2params.get("devid"), is("2"));
    assertThat(device2params.get("status"), is("ok"));
    assertThat(device2params.get("hostid"), is("2"));
  }

  @Test
  public void emptyResponse() throws TrackerException {
    when(mockResponse.getValue("devices")).thenReturn("0");

    Map<String, String> valueMap = Collections.emptyMap();
    when(mockResponse.getValueMap()).thenReturn(valueMap);

    when(mockRequestHandler.performRequest(captorRequest.capture())).thenReturn(mockResponse);

    operation = new GetDeviceStatusesOperation(mockRequestHandler, DOMAIN);
    operation.execute();

    Map<String, Map<String, String>> parametersByDevice = operation.getParametersByDevice();
    assertThat(parametersByDevice.size(), is(0));
  }

  @Test(expected = TrackerException.class)
  public void unexpectedError() throws TrackerException {
    when(mockRequestHandler.performRequest(captorRequest.capture())).thenReturn(mockFailResponse);

    operation = new GetDeviceStatusesOperation(mockRequestHandler, DOMAIN);
    operation.execute();
  }

}


text:
/**
 *	\version $Id: alustusvirhe.cc 2677 2013-02-20 13:03:17Z voutilai $
 *  \file alustusvirhe.cc
 *  \brief Alustusvirhe-luokan toteutus. ($Revision: 2677 $)
 *  \author ©2010 Eero Salonen <eero.j.salonen@tut.fi>
 */

#include "../alustusvirhe.hh"
#include <string>

#include "hyodykkeet.hh"

// Standardikirjastot
#include <map>
using std::map;

// Using-lauseet otsikkotiedostossa käytteen otetuille asioille.
using std::basic_ostream;
using std::string;

using Julkinen::Alustusvirhe;

namespace
{
    typedef
    map<Alustusvirhe::Virhekoodi, char const*>
    Virheviestit;

    typedef
    Virheviestit::value_type
    Virheviesti;

    Virheviestit::value_type const VIRHEVIESTIARVOT[] = {
            Virheviesti(
                    Alustusvirhe::VIRHE_PALASSA_ON_JO_ESINE,
                    "Koordinaatissa on jo esine."
                  ),
            Virheviesti(
                    Alustusvirhe::VIRHEELLINEN_SIJAINTI,
                    "Annettu koordinaatti on pelialueen ulkopuolella."
                  ),

            Virheviesti(
                    Alustusvirhe::VIRHE_ANNETTUA_PELAAJAA_EI_LOYTYNYT,
                    "Esineelle annettua pelaajaa ei loytynyt pelaajien joukosta."
                  ),
            Virheviesti(
                    Alustusvirhe::VIRHE_LIIKAA_PARAMETREJA,
                    "Liikaa parametreja."
                  ),
            Virheviesti(
                    Alustusvirhe::VIRHE_TUNNISTAMATON,
                    "Tunnistamaton virhe."
                  )
          };

    Virheviestit VIRHEVIESTIT(
            VIRHEVIESTIARVOT,
            VIRHEVIESTIARVOT +
                sizeof(VIRHEVIESTIARVOT)/sizeof(Virheviestit::value_type)
          );
/*
    char const*
    muunnaViestiksi(Alustusvirhe::Virhekoodi virhe)
    {
        Virheviestit::const_iterator viesti(VIRHEVIESTIT.find(virhe));

        if (VIRHEVIESTIT.end() == viesti)
        {
            viesti = VIRHEVIESTIT.find(Alustusvirhe::VIRHE_TUNNISTAMATON);
        }

        return viesti->second;
    }
 */
}

Alustusvirhe::Alustusvirhe(std::string const& virheviesti)
    : Virhe(virheviesti), virhe_(VIRHE_TUNNISTAMATON)
{
}

Alustusvirhe::Alustusvirhe(Virhekoodi virhekoodi)
    : Virhe(muunna(virhekoodi, VIRHEVIESTIT, VIRHE_TUNNISTAMATON)),
        virhe_(virhekoodi)
{
}

Alustusvirhe::Alustusvirhe(Alustusvirhe const& toinen)
    : Virhe(toinen), virhe_(toinen.virhe_)
{
}

Alustusvirhe::Virhekoodi
Alustusvirhe::virhe()
    const
{
    return virhe_;
}

Alustusvirhe&
Alustusvirhe::operator=(Alustusvirhe const& toinen)
{
    Virhe::operator=(toinen);

    if (this != &toinen)
    {
        virhe_ = toinen.virhe_;
    }

    return *this;
}

basic_ostream<char>&
Alustusvirhe::tulosta(basic_ostream<char>& tuloste)
    const
{
    tuloste << "VIRHE: ";
    Virhe::tulosta(tuloste);

    return tuloste;
}


text:
import Store from 'ember-magic-man/store';

export function initialize(container, application) {
  application.register('store:main', Store);

  application.inject('route', 'store', 'store:main');
  application.inject('controller', 'store', 'store:main');
  application.inject('model', 'store', 'store:main');
}

export default {
  name: 'ember-magic-man',
  initialize: initialize
};


text:
package org.apache.rya.indexing.pcj.functions.geo;

public class SfIntersectsRdf4J extends FunctionAdapter {
    public SfIntersectsRdf4J() {
        super(new org.eclipse.rdf4j.query.algebra.evaluation.function.geosparql.SfIntersects());
    }
}


text: Touch framework for conducting and participating in triangle tests


text:
const assert = require("assert");
const request = require("supertest");

const utils = require("./utils");

describe("plugin", () => {
  describe("basic", () => {
    it("should attack simple plugin", done => {
      const app = utils.createAppSuppressLog();

      app.route("/route", (req, res) => {
        res.send(req.query);
      });

      request(app.start().server)
        .get("/route?foo=bar")
        .expect(200)
        .end((err, res) => {
          if (err) {
            return done(err);
          }
          assert.equal(res.text, '{"foo":"bar"}');
          done();
        });
    });
  });
});


text:
<?php

// compatibility with root-relative-urls plugin
add_action("plugins_loaded", "rfs_compat_root_relative_urls", 2);
function rfs_compat_root_relative_urls() {
	$rru_fix_upload_paths = array(
		'MP_WP_Root_Relative_URLS',
		'fix_upload_paths'
	);
	$rru_proper_root_relative_url = array(
		'MP_WP_Root_Relative_URLS',
		'proper_root_relative_url'
	);
	$rru_root_relative_image_urls = array(
		'MP_WP_Root_Relative_URLS',
		'root_relative_image_urls'
	);
	$rru_root_relative_media_urls = array(
		'MP_WP_Root_Relative_URLS',
		'root_relative_media_urls'
	);

	remove_filter('upload_dir', $rru_fix_upload_paths, 1);
	remove_filter('attachment_link', $rru_proper_root_relative_url, 1);
	remove_filter('wp_get_attachment_url', $rru_proper_root_relative_url, 1);
	remove_filter('image_send_to_editor', $rru_root_relative_image_urls, 1);
	remove_filter('media_send_to_editor', $rru_root_relative_image_urls, 1);
	remove_filter('media_send_to_editor', $rru_root_relative_media_urls, 1);
}


text:
local dependencies = require "bsrocks.rocks.dependencies"
local download = require "bsrocks.downloaders"
local install = require "bsrocks.rocks.install"
local patchspec = require "bsrocks.rocks.patchspec"
local rockspec = require "bsrocks.rocks.rockspec"
local settings = require "bsrocks.lib.settings"
local utils = require "bsrocks.lib.utils"

local servers = settings.servers
local printColoured, writeColoured = utils.printColoured, utils.writeColoured

local function execute(name)
	if not name then error("Expected <name>", 0) end
	name = name:lower()

	local installed, installedPatches = install.getInstalled()

	local isInstalled = true
	local spec, patchS = installed[name], installedPatches[name]

	if not spec then
		isInstalled = false
		local manifest = rockspec.findRockspec(name)

		if not manifest then error("Cannot find '" .. name .. "'", 0) end

		local patchManifest = patchspec.findPatchspec(name)

		local version
		if patchManifest then
			version = patchManifest.patches[name]
		else
			version = rockspec.latestVersion(manifest, name, constraints)
		end

		spec = rockspec.fetchRockspec(manifest.server, name, version)
		patchS = patchManifest and patchspec.fetchPatchspec(patchManifest.server, name)
	end

	write(name .. ": " .. spec.version .. " ")
	if spec.builtin then
		writeColoured("Built In", colours.magenta)
	elseif isInstalled then
		writeColoured("Installed", colours.green)
	else
		writeColoured("Not installed", colours.red)
	end

	if patchS then
		writeColoured(" (+Patchspec)", colours.lime)
	end
	print()

	local desc = spec.description
	if desc then
		if desc.summary then printColoured(desc.summary, colours.cyan) end
		if desc.detailed then
			local detailed = desc.detailed
			local ident = detailed:match("^(%s+)")
			if ident then
				detailed = detailed:sub(#ident + 1):gsub("\n" .. ident, "\n")
			end

			-- Remove leading and trailing whitespace
			detailed = detailed:gsub("^\n+", ""):gsub("%s+$", "")
			printColoured(detailed, colours.white)
		end

		if desc.homepage then
			printColoured("URL: " .. desc.homepage, colours.lightBlue)
		end
	end

	if not isInstalled then
		local error, issues = install.findIssues(spec, patchS)
		if #issues > 0 then
			printColoured("Issues", colours.orange)
			if error then
				printColoured("This package is incompatible", colors.red)
			end

			for _, v in ipairs(issues) do
				local color = colors.yellow
				if v[2] then color = colors.red end

				printColoured(" " .. v[1], color)
			end
		end
	end

	local deps = spec.dependencies
	if patchS and patchS.dependencies then
		deps = patchS.dependencies
	end
	if deps and #deps > 0 then
		printColoured("Dependencies", colours.orange)
		local len = 0
		for _, deps in ipairs(deps) do len = math.max(len, #deps) end

		len = len + 1
		for _, deps in ipairs(deps) do
			local dependency = dependencies.parseDependency(deps)
			local name = dependency.name
			local current = installed[name]

			write(" " .. deps .. (" "):rep(len - #deps))

			if current then
				local version = dependencies.parseVersion(current.version)
				if not dependencies.matchConstraints(version, dependency.constraints) then
					printColoured("Wrong version", colours.yellow)
				elseif current.builtin then
					printColoured("Built In", colours.magenta)
				else
					printColoured("Installed", colours.green)
				end
			else
				printColoured("Not installed", colours.red)
			end
		end
	end
end

local description = [[
  <name>  The name of the package to search for.

Prints a description about the package, listing its description, dependencies and other useful information.
]]
return {
	name = "desc",
	help = "Print a description about a package",
	description = description,
	syntax = "<name>",
	execute = execute,
}


text:
import borderColor from '../borderColor'

describe('borderColor', () => {
  it('properly applies a value when passed only one', () => {
    expect(borderColor('red')).toEqual({
      borderBottomColor: 'red',
      borderLeftColor: 'red',
      borderRightColor: 'red',
      borderTopColor: 'red',
    })
  })
  it('properly applies values when passed two', () => {
    expect(borderColor('red', 'blue')).toEqual({
      borderBottomColor: 'red',
      borderLeftColor: 'blue',
      borderRightColor: 'blue',
      borderTopColor: 'red',
    })
  })
  it('properly applies values when passed three', () => {
    expect(borderColor('red', 'blue', 'green')).toEqual({
      borderBottomColor: 'green',
      borderLeftColor: 'blue',
      borderRightColor: 'blue',
      borderTopColor: 'red',
    })
  })
  it('properly applies values when passed four', () => {
    expect(borderColor('red', 'blue', 'green', 'yellow')).toEqual({
      borderBottomColor: 'green',
      borderLeftColor: 'yellow',
      borderRightColor: 'blue',
      borderTopColor: 'red',
    })
  })
})


text:
package eu.bcvsolutions.idm.core.scheduler.service.impl;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.fail;

import java.util.List;
import java.util.Map;
import java.time.Instant;
import java.time.ZonedDateTime;
import java.time.ZoneId;

import org.junit.Assert;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;

import eu.bcvsolutions.idm.core.scheduler.api.dto.AbstractTaskTrigger;
import eu.bcvsolutions.idm.core.scheduler.api.dto.CronTaskTrigger;
import eu.bcvsolutions.idm.core.scheduler.api.dto.SimpleTaskTrigger;
import eu.bcvsolutions.idm.core.scheduler.api.dto.Task;
import eu.bcvsolutions.idm.core.scheduler.api.dto.TaskTriggerState;
import eu.bcvsolutions.idm.core.scheduler.api.service.SchedulableTaskExecutor;
import eu.bcvsolutions.idm.core.scheduler.api.service.SchedulerManager;
import eu.bcvsolutions.idm.core.scheduler.task.impl.TestTaskExecutor;
import eu.bcvsolutions.idm.test.api.AbstractIntegrationTest;

/**
 * Test check initialized test task and his parameters and triggers.
 *
 * @author Ondrej Kopr <kopr@xyxy.cz>
 *
 */
public class AbstractScheduledTaskInitializerTest extends AbstractIntegrationTest {

	public static String TEST_DESCRIPTION = "TEST DESCRIPTION";
	public static String TEST_INSTANCE = "idm-test";

	private static String KEY_1 = "core:instanceId";
	private static String KEY_2 = "count";
	private static String KEY_3 = "test";

	private static String VALUE_1 = "idm-test";
	private static String VALUE_2 = "5";
	private static String VALUE_3 = "test";

	private static String TEST_CRON = "0 0 1 ? * *";
	private static ZonedDateTime TEST_FIRE_TIME = ZonedDateTime.ofInstant(Instant.ofEpochMilli(4102441200000l), ZoneId.systemDefault());

	@Autowired
	private SchedulerManager schedulerService;

	@Test
	public void testInitTask() {
		List<Task> tasks = schedulerService.getAllTasks();
		//
		// found test task, other will be skip
		for (Task task : tasks) {
			if (task.getTaskType().equals(TestTaskExecutor.class)) {
				assertEquals(TEST_DESCRIPTION, task.getDescription());
				assertEquals(TEST_INSTANCE, task.getInstanceId());
				// assertEquals(InitTestScheduledTask.TEST_MODULE, task.getModule()); // module not working in Task

				Map<String, String> parameters = task.getParameters();
				assertEquals(4, parameters.size());

				String value1 = parameters.get(KEY_1);
				assertEquals(VALUE_1, value1);

				String value2 = parameters.get(KEY_2);
				assertEquals(VALUE_2, value2);

				String value3 = parameters.get(KEY_3);
				assertEquals(VALUE_3, value3);

				Assert.assertNotNull(parameters.get(SchedulableTaskExecutor.PARAMETER_MODIFIED));

				List<AbstractTaskTrigger> triggers = task.getTriggers();
				assertEquals(2, triggers.size());
				for (AbstractTaskTrigger trigger : triggers) {
					assertEquals(TaskTriggerState.ACTIVE, trigger.getState());
					if (trigger.getClass().equals(CronTaskTrigger.class)) {
						CronTaskTrigger cronTrigger = (CronTaskTrigger)trigger;
						assertEquals(TEST_CRON, cronTrigger.getCron());
					} else if (trigger.getClass().equals(SimpleTaskTrigger.class)){
						SimpleTaskTrigger simpleTrigger = (SimpleTaskTrigger)trigger;
						assertEquals(TEST_FIRE_TIME, simpleTrigger.getFireTime());
					} else {
						fail();
					}
				}
				// success
				return;
			}
		}
		// test task is not initialized
		fail();
	}

}


text:
@interface RDDropboxSyncMetaModel : NSManagedObject

@property (nonatomic, retain) NSString * location;
@property (nonatomic, retain) NSString * locationHash;

@end


text:
/* eslint-env mocha */

import should from 'should';

import config from '../test-config.js';
import {
  openDb,
  getDb,
  closeDb,
  importGtfs,
  getStopsAsGeoJSON,
} from '../../index.js';

describe('getStopsAsGeoJSON(): ', () => {
  before(async () => {
    await openDb(config);
    await importGtfs(config);
  });

  after(async () => {
    const db = getDb(config);
    await closeDb(db);
  });

  it('should return geojson with an empty features array if no stops exist', async () => {
    const stopId = 'fake-stop-id';
    const geojson = await getStopsAsGeoJSON({
      stop_id: stopId,
    });

    should.exist(geojson);
    geojson.type.should.equal('FeatureCollection');
    geojson.features.should.have.length(0);
  });

  it('should return geojson with stops if they exist', async () => {
    const geojson = await getStopsAsGeoJSON();

    should.exist(geojson);
    geojson.type.should.equal('FeatureCollection');
    geojson.features.length.should.be.above(1);
    should.exist(geojson.features[0].geometry.coordinates);
    geojson.features[0].geometry.coordinates.length.should.equal(2);
  });

  it('should return geojson with stops if they exist for a specific stopId', async () => {
    const stopId = '70031';

    const geojson = await getStopsAsGeoJSON({
      stop_id: stopId,
    });

    should.exist(geojson);
    geojson.type.should.equal('FeatureCollection');
    geojson.features.length.should.equal(1);
    should.exist(geojson.features[0].geometry.coordinates);
    geojson.features[0].geometry.coordinates.length.should.equal(2);
  });

  it('should return geojson with stops if they exist for a specific shapeId', async () => {
    const shapeId = 'cal_sf_tam';

    const geojson = await getStopsAsGeoJSON({
      shape_id: shapeId,
    });

    should.exist(geojson);
    geojson.type.should.equal('FeatureCollection');
    geojson.features.length.should.equal(25);
    should.exist(geojson.features[0].geometry.coordinates);
    geojson.features[0].geometry.coordinates.length.should.equal(2);
  });
});


text:
<?php

namespace Magento\Customer\Test\Block\Account\Dashboard;

use Magento\Mtf\Block\Block;

/**
 * Class Address
 * Customer Dashboard Address Book block
 */
class Address extends Block
{
    /**
     * Default Billing Address Edit link
     *
     * @var string
     */
    protected $defaultBillingAddressEdit = '[data-ui-id=default-billing-edit-link]';

    /**
     * Shipping address block selector
     *
     * @var string
     */
    protected $shippingAddressBlock = '.box-shipping-address';

    /**
     * Billing address block selector
     *
     * @var string
     */
    protected $billingAddressBlock = '.box-billing-address';

    /**
     * Edit Default Billing Address
     *
     * @return void
     */
    public function editBillingAddress()
    {
        $this->_rootElement->find($this->defaultBillingAddressEdit)->click();
    }

    /**
     * Returns Default Billing Address Text
     *
     * @return array|string
     */
    public function getDefaultBillingAddressText()
    {
        return $this->_rootElement->find($this->billingAddressBlock)->getText();
    }

    /**
     * Returns Default Shipping Address Text
     *
     * @return array|string
     */
    public function getDefaultShippingAddressText()
    {
        return $this->_rootElement->find($this->shippingAddressBlock)->getText();
    }
}


text:
class TreeBuilderAutomateSimulationResults < TreeBuilder
  has_kids_for Hash, [:x_get_tree_hash_kids]
  def initialize(name, type, sandbox, build = true, root = nil)
    @root = root
    super(name, type, sandbox, build)
  end

  private

  def tree_init_options(_tree_name)
    {
      :full_ids => true,
      :add_root => false,
      :expand   => true,
      :lazy     => false
    }
  end

  def set_locals_for_render
    locals = super
    locals.merge!(:id_prefix     => "aesimulation_",
                  :autoload      => false,
                  :cfme_no_click => true,
                  :onclick       => false)
  end

  def root_options
    []
  end

  def x_get_tree_roots(_count_only = false, _options = {})
    objects = []
    xml = MiqXml.load(@root).root
    xml.each_element do |el|
      objects.push(get_root_elements(el, xml.index(el)))
    end
    objects
  end

  def choose_correct_attr(el, attrs)
    if el.name == "MiqAeObject"
      attrs[:MiqAeObject]
    elsif el.name == "MiqAeAttribute"
      attrs[:MiqAeAttribute]
    elsif !el.text.blank?
      attrs[:not_blank]
    else
      attrs[:other]
    end
  end

  def get_element_title(el)
    titles = {
      :MiqAeObject    => "#{el.attributes["namespace"]} / "\
                         "#{el.attributes["class"]} / "\
                         "#{el.attributes["instance"]}",
      :MiqAeAttribute => el.attributes["name"],
      :not_blank      => el.text,
      :other          => el.name
    }
    choose_correct_attr(el, titles)
  end

  def get_element_icon(el)
    icons = {
      :MiqAeObject    => "q",
      :MiqAeAttribute => "attribute",
      :not_blank      => el.name.underscore,
      :other          => el.name.underscore.sub(/^miq_ae_service_/, '')
    }
    choose_correct_attr(el, icons)
  end

  def get_root_elements(el, idx)
    title = get_element_title(el)
    object = {:id       => "e_#{idx}",
              :text     => _(title).html_safe,
              :image    => get_element_icon(el),
              :tip      => _(title).html_safe,
              :elements => el.each_element { |e| e },
              :addClass => "cfme-no-cursor-node"
             }
    object[:attributes] = el.attributes if title == el.name
    object
  end

  def x_get_tree_hash_kids(parent, count_only)
    kids = []
    if parent[:attributes]
      parent[:attributes].each_with_index do |k, idx|
        object = {
          :id       => "a_#{idx}",
          :image    => "attribute",
          :addClass => "cfme-no-cursor-node",
          :text     => "#{k.first} = #{k.last}".html_safe
        }
        kids.push(object)
      end
    end
    Array(parent[:elements]).each_with_index do |el, i|
      kids.push(get_root_elements(el, i))
    end
    count_only_or_objects(count_only, kids)
  end
end


text:
ACCEPTED

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Notes Roy. Bot. Gard. Edinburgh 35:49. 1976

#### Original name
null

### Remarks
null


text:
document.addEventListener("DOMContentLoaded", function() {
  var refreshButton = document.querySelector('.refresh');
  var closeButton1 = document.querySelector('.close1');
  var closeButton2 = document.querySelector('.close2');
  var closeButton3 = document.querySelector('.close3');

  // ...

  // Rendering ---------------------------------------------------
  function renderSuggestion(suggestedUser, selector) {
      var suggestionEl = document.querySelector(selector);
      if (suggestedUser === null) {
          suggestionEl.style.visibility = 'hidden';
      } else {
          suggestionEl.style.visibility = 'visible';
          var usernameEl = suggestionEl.querySelector('.username');
          usernameEl.href = suggestedUser.html_url;
          usernameEl.textContent = suggestedUser.login;
          var imgEl = suggestionEl.querySelector('img');
          imgEl.src = "";
          imgEl.src = suggestedUser.avatar_url;
      }
  }

  // ...

});


text:
package com.helger.photon.bootstrap4.form;

import java.util.Locale;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import javax.annotation.concurrent.NotThreadSafe;

import com.helger.commons.annotation.OverrideOnDemand;
import com.helger.commons.error.list.IErrorList;
import com.helger.commons.string.StringHelper;
import com.helger.html.hc.IHCNode;
import com.helger.html.hc.ext.HCExtHelper;
import com.helger.html.hc.html.IHCElementWithChildren;
import com.helger.html.hc.html.grouping.HCDiv;
import com.helger.html.hc.impl.HCNodeList;
import com.helger.html.hc.impl.HCTextNode;
import com.helger.photon.bootstrap4.base.AbstractBootstrapObject;
import com.helger.photon.core.EPhotonCoreText;
import com.helger.photon.uicore.html.formlabel.ELabelType;
import com.helger.photon.uicore.html.formlabel.HCFormLabel;

/**
 * Represents a single form group.
 *
 * @author Philip Helger
 */
@NotThreadSafe
public class BootstrapFormGroup extends AbstractBootstrapObject <BootstrapFormGroup>
{
  private HCFormLabel m_aLabel;
  private IHCNode m_aCtrl;
  private HCNodeList m_aHelpText;
  private IErrorList m_aErrorList;

  public BootstrapFormGroup ()
  {}

  @Nonnull
  public final BootstrapFormGroup setLabel (@Nullable final String sLabel)
  {
    return setLabel (sLabel == null ? null : HCFormLabel.createOptional (sLabel));
  }

  @Nonnull
  public final BootstrapFormGroup setLabel (@Nullable final IHCElementWithChildren <?> aLabel)
  {
    return setLabel (aLabel == null ? null : HCFormLabel.createOptional (aLabel));
  }

  @Nonnull
  public final BootstrapFormGroup setLabelMandatory (@Nullable final String sLabel)
  {
    return setLabel (sLabel == null ? null : HCFormLabel.createMandatory (sLabel));
  }

  @Nonnull
  public final BootstrapFormGroup setLabelMandatory (@Nullable final IHCElementWithChildren <?> aLabel)
  {
    return setLabel (aLabel == null ? null : HCFormLabel.createMandatory (aLabel));
  }

  @Nonnull
  public final BootstrapFormGroup setLabelAlternative (@Nullable final String sLabel)
  {
    return setLabel (sLabel == null ? null : HCFormLabel.createAlternative (sLabel));
  }

  @Nonnull
  public final BootstrapFormGroup setLabelAlternative (@Nullable final IHCElementWithChildren <?> aLabel)
  {
    return setLabel (aLabel == null ? null : HCFormLabel.createAlternative (aLabel));
  }

  @Nonnull
  public final BootstrapFormGroup setLabel (@Nullable final String sLabel, @Nonnull final ELabelType eLabelType)
  {
    return setLabel (sLabel == null ? null : new HCFormLabel (sLabel, eLabelType));
  }

  @Nonnull
  public final BootstrapFormGroup setLabelForCheckBox (@Nullable final String sLabel)
  {
    return setLabel (sLabel == null ? null : HCFormLabel.createForCheckBox (sLabel));
  }

  /**
   * Called after the label cell was altered.
   *
   * @param aLabel
   *        The newly set label. May be null
   */
  @OverrideOnDemand
  protected void onLabelModified (@Nullable final HCFormLabel aLabel)
  {}

  @Nonnull
  public final BootstrapFormGroup setLabel (@Nullable final HCFormLabel aLabel)
  {
    m_aLabel = aLabel;
    onLabelModified (aLabel);
    return this;
  }

  @Nullable
  public final HCFormLabel getLabel ()
  {
    return m_aLabel;
  }

  /**
   * Called after the control was changed
   *
   * @param aCtrl
   *        The new control. May be null.
   */
  @OverrideOnDemand
  protected void onCtrlModified (@Nullable final IHCNode aCtrl)
  {}

  @Nonnull
  public final BootstrapFormGroup setCtrl (@Nullable final String sValue)
  {
    if (StringHelper.hasNoText (sValue))
      return this;

    return setCtrl (new HCDiv ().addChild (sValue));
  }

  @Nonnull
  public final BootstrapFormGroup setCtrl (@Nullable final String... aValues)
  {
    final HCNodeList aNodeList = new HCNodeList ();
    if (aValues != null)
      for (final String sValue : aValues)
        aNodeList.addChild (new HCDiv ().addChild (sValue));
    return setCtrl (aNodeList);
  }

  @Nonnull
  public final BootstrapFormGroup setCtrl (final boolean bYesOrNo, @Nonnull final Locale aDisplayLocale)
  {
    return setCtrl (EPhotonCoreText.getYesOrNo (bYesOrNo, aDisplayLocale));
  }

  @Nonnull
  public final BootstrapFormGroup setCtrl (@Nullable final IHCNode aCtrl)
  {
    m_aCtrl = aCtrl;
    onCtrlModified (aCtrl);
    return this;
  }

  @Nonnull
  public final BootstrapFormGroup setCtrl (@Nullable final IHCNode... aCtrls)
  {
    return setCtrl (new HCNodeList ().addChildren (aCtrls));
  }

  @Nonnull
  public final BootstrapFormGroup setCtrl (@Nullable final Iterable <? extends IHCNode> aCtrls)
  {
    return setCtrl (new HCNodeList ().addChildren (aCtrls));
  }

  @Nullable
  public final IHCNode getCtrl ()
  {
    return m_aCtrl;
  }

  @Nonnull
  public final BootstrapFormGroup setErrorList (@Nullable final IErrorList aErrorList)
  {
    m_aErrorList = aErrorList;
    return this;
  }

  @Nullable
  public final IErrorList getErrorList ()
  {
    return m_aErrorList;
  }

  /**
   * Called after the help text was altered.
   *
   * @param aNote
   *        The new help text node. May be null.
   */
  @OverrideOnDemand
  protected void onHelpTextModified (@Nullable final IHCNode aNote)
  {}

  @Nonnull
  public final BootstrapFormGroup setHelpText (@Nullable final String sHelpText)
  {
    return setHelpText (new HCNodeList ().addChildren (HCExtHelper.nl2divList (sHelpText)));
  }

  @Nonnull
  public final BootstrapFormGroup setHelpText (@Nullable final HCNodeList aHelpText)
  {
    m_aHelpText = aHelpText;
    onHelpTextModified (aHelpText);
    return this;
  }

  @Nonnull
  public final BootstrapFormGroup setHelpText (@Nullable final IHCNode aHelpText)
  {
    return setHelpText (aHelpText instanceof HCNodeList ? (HCNodeList) aHelpText : new HCNodeList ().addChild (aHelpText));
  }

  @Nonnull
  public final BootstrapFormGroup setHelpText (@Nullable final String... aHelpTexts)
  {
    return setHelpText (new HCNodeList ().addChildren (aHelpTexts));
  }

  @Nonnull
  public final BootstrapFormGroup setHelpText (@Nullable final IHCNode... aHelpTexts)
  {
    return setHelpText (new HCNodeList ().addChildren (aHelpTexts));
  }

  @Nonnull
  public final BootstrapFormGroup setHelpText (@Nullable final Iterable <? extends IHCNode> aHelpTexts)
  {
    return setHelpText (new HCNodeList ().addChildren (aHelpTexts));
  }

  @Nonnull
  public final BootstrapFormGroup addHelpText (@Nullable final String sHelpText)
  {
    return addHelpText (HCTextNode.createOnDemand (sHelpText));
  }

  @Nonnull
  public final BootstrapFormGroup addHelpText (@Nullable final IHCNode aHelpText)
  {
    if (aHelpText != null)
    {
      if (m_aHelpText == null)
        m_aHelpText = new HCNodeList ();
      m_aHelpText.addChild (aHelpText);
      onHelpTextModified (m_aHelpText);
    }
    return this;
  }

  @Nonnull
  public final BootstrapFormGroup addHelpText (@Nullable final String... aHelpTexts)
  {
    return addHelpText (new HCNodeList ().addChildren (aHelpTexts));
  }

  @Nonnull
  public final BootstrapFormGroup addHelpText (@Nullable final IHCNode... aHelpTexts)
  {
    return addHelpText (new HCNodeList ().addChildren (aHelpTexts));
  }

  @Nonnull
  public final BootstrapFormGroup addHelpText (@Nullable final Iterable <? extends IHCNode> aHelpTexts)
  {
    return addHelpText (new HCNodeList ().addChildren (aHelpTexts));
  }

  @Nullable
  public final IHCNode getHelpText ()
  {
    return m_aHelpText;
  }
}


text:
using LiteNetLib.Utils;

public struct PackedInt : INetSerializable
{
    public static implicit operator PackedInt(int value) { return new PackedInt(value); }
    public static implicit operator int(PackedInt value) { return value.value; }
    private int value;
    public PackedInt(int value)
    {
        this.value = value;
    }

    public void Serialize(NetDataWriter writer)
    {
        writer.PutPackedInt(value);
    }

    public void Deserialize(NetDataReader reader)
    {
        value = reader.GetPackedInt();
    }
}