text:
// Copyright 2014 The Bazel Authors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//    http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package com.google.devtools.build.lib.vfs;

import static com.google.common.truth.Truth.assertThat;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotSame;
import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;

import com.google.common.collect.Lists;
import com.google.common.testing.EqualsTester;
import com.google.common.testing.GcFinalization;
import com.google.devtools.build.lib.util.BlazeClock;
import com.google.devtools.build.lib.vfs.inmemoryfs.InMemoryFileSystem;

import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;

import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.lang.ref.WeakReference;
import java.util.Collections;
import java.util.List;

/**
 * A test for {@link Path}.
 */
@RunWith(JUnit4.class)
public class PathTest {
  private FileSystem filesystem;
  private Path root;

  @Before
  public void setUp() throws Exception {
    filesystem = new InMemoryFileSystem(BlazeClock.instance());
    root = filesystem.getRootDirectory();
    Path first = root.getChild("first");
    first.createDirectory();
  }

  @Test
  public void testStartsWithWorksForSelf() {
    assertStartsWithReturns(true, "/first/child", "/first/child");
  }

  @Test
  public void testStartsWithWorksForChild() {
    assertStartsWithReturns(true,
        "/first/child", "/first/child/grandchild");
  }

  @Test
  public void testStartsWithWorksForDeepDescendant() {
    assertStartsWithReturns(true,
        "/first/child", "/first/child/grandchild/x/y/z");
  }

  @Test
  public void testStartsWithFailsForParent() {
    assertStartsWithReturns(false, "/first/child", "/first");
  }

  @Test
  public void testStartsWithFailsForSibling() {
    assertStartsWithReturns(false, "/first/child", "/first/child2");
  }

  @Test
  public void testStartsWithFailsForLinkToDescendant()
      throws Exception {
    Path linkTarget = filesystem.getPath("/first/linked_to");
    FileSystemUtils.createEmptyFile(linkTarget);
    Path second = filesystem.getPath("/second/");
    second.createDirectory();
    second.getChild("child_link").createSymbolicLink(linkTarget);
    assertStartsWithReturns(false, "/first", "/second/child_link");
  }

  @Test
  public void testStartsWithFailsForNullPrefix() {
    try {
      filesystem.getPath("/first").startsWith(null);
      fail();
    } catch (Exception e) {
    }
  }

  private void assertStartsWithReturns(boolean expected,
                                       String ancestor,
                                       String descendant) {
    Path parent = filesystem.getPath(ancestor);
    Path child = filesystem.getPath(descendant);
    assertEquals(expected, child.startsWith(parent));
  }

  @Test
  public void testGetChildWorks() {
    assertGetChildWorks("second");
    assertGetChildWorks("...");
    assertGetChildWorks("....");
  }

  private void assertGetChildWorks(String childName) {
    assertEquals(filesystem.getPath("/first/" + childName),
        filesystem.getPath("/first").getChild(childName));
  }

  @Test
  public void testGetChildFailsForChildWithSlashes() {
    assertGetChildFails("second/third");
    assertGetChildFails("./third");
    assertGetChildFails("../third");
    assertGetChildFails("second/..");
    assertGetChildFails("second/.");
    assertGetChildFails("/third");
    assertGetChildFails("third/");
  }

  private void assertGetChildFails(String childName) {
    try {
      filesystem.getPath("/first").getChild(childName);
      fail();
    } catch (IllegalArgumentException e) {
      // Expected.
    }
  }

  @Test
  public void testGetChildFailsForDotAndDotDot() {
    assertGetChildFails(".");
    assertGetChildFails("..");
  }

  @Test
  public void testGetChildFailsForEmptyString() {
    assertGetChildFails("");
  }

  @Test
  public void testRelativeToWorks() {
    assertRelativeToWorks("apple", "/fruit/apple", "/fruit");
    assertRelativeToWorks("apple/jonagold", "/fruit/apple/jonagold", "/fruit");
  }

  @Test
  public void testGetRelativeWithStringWorks() {
    assertGetRelativeWorks("/first/x/y", "y");
    assertGetRelativeWorks("/y", "/y");
    assertGetRelativeWorks("/first/x/x", "./x");
    assertGetRelativeWorks("/first/y", "../y");
    assertGetRelativeWorks("/", "../../../../..");
  }

  @Test
  public void testAsFragmentWorks() {
    assertAsFragmentWorks("/");
    assertAsFragmentWorks("//");
    assertAsFragmentWorks("/first");
    assertAsFragmentWorks("/first/x/y");
    assertAsFragmentWorks("/first/x/y.foo");
  }

  @Test
  public void testGetRelativeWithFragmentWorks() {
    Path dir = filesystem.getPath("/first/x");
    assertEquals("/first/x/y",
                 dir.getRelative(new PathFragment("y")).toString());
    assertEquals("/first/x/x",
                 dir.getRelative(new PathFragment("./x")).toString());
    assertEquals("/first/y",
                 dir.getRelative(new PathFragment("../y")).toString());

  }

  @Test
  public void testGetRelativeWithAbsoluteFragmentWorks() {
    Path root = filesystem.getPath("/first/x");
    assertEquals("/x/y",
                 root.getRelative(new PathFragment("/x/y")).toString());
  }

  @Test
  public void testGetRelativeWithAbsoluteStringWorks() {
    Path root = filesystem.getPath("/first/x");
    assertEquals("/x/y", root.getRelative("/x/y").toString());
  }

  @Test
  public void testComparableSortOrder() {
    Path zzz = filesystem.getPath("/zzz");
    Path ZZZ = filesystem.getPath("/ZZZ");
    Path abc = filesystem.getPath("/abc");
    Path aBc = filesystem.getPath("/aBc");
    Path AbC = filesystem.getPath("/AbC");
    Path ABC = filesystem.getPath("/ABC");
    List<Path> list = Lists.newArrayList(zzz, ZZZ, ABC, aBc, AbC, abc);
    Collections.sort(list);
    assertThat(list).containsExactly(ABC, AbC, ZZZ, aBc, abc, zzz).inOrder();
  }

  @Test
  public void testParentOfRootIsRoot() {
    assertSame(root, root.getRelative(".."));

    assertSame(root.getRelative("dots"),
               root.getRelative("broken/../../dots"));
  }

  @Test
  public void testSingleSegmentEquivalence() {
    assertSame(
        root.getRelative("aSingleSegment"),
        root.getRelative("aSingleSegment"));
  }

  @Test
  public void testSiblingNonEquivalenceString() {
    assertNotSame(
        root.getRelative("aSingleSegment"),
        root.getRelative("aDifferentSegment"));
  }

  @Test
  public void testSiblingNonEquivalenceFragment() {
    assertNotSame(
        root.getRelative(new PathFragment("aSingleSegment")),
        root.getRelative(new PathFragment("aDifferentSegment")));
  }

  @Test
  public void testHashCodeStableAcrossGarbageCollections() {
    Path parent = filesystem.getPath("/a");
    PathFragment childFragment = new PathFragment("b");
    Path child = parent.getRelative(childFragment);
    WeakReference<Path> childRef = new WeakReference<>(child);
    int childHashCode1 = childRef.get().hashCode();
    assertEquals(childHashCode1, parent.getRelative(childFragment).hashCode());
    child = null;
    GcFinalization.awaitClear(childRef);
    int childHashCode2 = parent.getRelative(childFragment).hashCode();
    assertEquals(childHashCode1, childHashCode2);
  }

  @Test
  public void testSerialization() throws Exception {
    FileSystem oldFileSystem = Path.getFileSystemForSerialization();
    try {
      Path.setFileSystemForSerialization(filesystem);
      Path root = filesystem.getPath("/");
      Path p1 = filesystem.getPath("/foo");
      Path p2 = filesystem.getPath("/foo/bar");

      ByteArrayOutputStream bos = new ByteArrayOutputStream();
      ObjectOutputStream oos = new ObjectOutputStream(bos);

      oos.writeObject(root);
      oos.writeObject(p1);
      oos.writeObject(p2);

      ByteArrayInputStream bis = new ByteArrayInputStream(bos.toByteArray());
      ObjectInputStream ois = new ObjectInputStream(bis);

      Path dsRoot = (Path) ois.readObject();
      Path dsP1 = (Path) ois.readObject();
      Path dsP2 = (Path) ois.readObject();

      new EqualsTester()
          .addEqualityGroup(root, dsRoot)
          .addEqualityGroup(p1, dsP1)
          .addEqualityGroup(p2, dsP2)
          .testEquals();

      assertTrue(p2.startsWith(p1));
      assertTrue(p2.startsWith(dsP1));
      assertTrue(dsP2.startsWith(p1));
      assertTrue(dsP2.startsWith(dsP1));

      // Regression test for a very specific bug in compareTo involving our incorrect usage of
      // reference equality rather than logical equality.
      String relativePathStringA = "child/grandchildA";
      String relativePathStringB = "child/grandchildB";
      assertEquals(
          p1.getRelative(relativePathStringA).compareTo(p1.getRelative(relativePathStringB)),
          p1.getRelative(relativePathStringA).compareTo(dsP1.getRelative(relativePathStringB)));
    } finally {
      Path.setFileSystemForSerialization(oldFileSystem);
    }
  }

  private void assertAsFragmentWorks(String expected) {
    assertEquals(new PathFragment(expected), filesystem.getPath(expected).asFragment());
  }

  private void assertGetRelativeWorks(String expected, String relative) {
    assertEquals(filesystem.getPath(expected),
        filesystem.getPath("/first/x").getRelative(relative));
  }

  private void assertRelativeToWorks(String expected, String relative, String original) {
    assertEquals(new PathFragment(expected),
                 filesystem.getPath(relative).relativeTo(filesystem.getPath(original)));
  }
}


text:
require('1param_node');

function LGraphCos()
{
    this._ctor(LGraphCos.title);

    this.code_name = "cos";
    this.output_types = null;
    this.out_extra_info = {types_list: {float:1, vec3:1, vec4:1, vec2:1},   use_t:1};
    this.intput_types = null;
    this.in_extra_info = {types_list: {float:1, vec3:1, vec4:1, vec2:1},   use_t:1};
    LGraph1ParamNode.call( this);
}

LGraphCos.prototype = Object.create(LGraph1ParamNode); // we inherit from Entity
LGraphCos.prototype.constructor = LGraphCos;

LGraphCos.title = "Cos";
LGraphCos.desc = "cosine of input";

LiteGraph.extendClass(LGraphCos,LGraph1ParamNode);
LiteGraph.registerNodeType("math/"+LGraphCos.title, LGraphCos);

redpajama_set_name: RedPajamaGithub


text:
/* Define the Repository that interfaces with Restangular */
app.factory('PostRepository', ['Restangular', 'AbstractRepository',
	function (restangular, AbstractRepository) {

		function PostRepository() {
			AbstractRepository.call(this, restangular, 'posts');
		}

		AbstractRepository.extend(PostRepository);
		return new PostRepository();
	 }
]);


text:
import type { ISize } from "../../../Interfaces/Particles/Size/ISize";
import { SizeAnimation } from "./SizeAnimation";
import type { RecursivePartial } from "../../../../Types/RecursivePartial";
import { SizeRandom } from "./SizeRandom";
export declare class Size implements ISize {
    get anim(): SizeAnimation;
    set anim(value: SizeAnimation);
    animation: SizeAnimation;
    random: SizeRandom;
    value: number;
    constructor();
    load(data?: RecursivePartial<ISize>): void;
}


text:
DepthFloatFrame.CameraParameters Property
=========================================

Gets the camera parameters associated with the frame.

Syntax
======

<colgroup>
<col width="100%" />
</colgroup>

C++

public:
property CameraParameters CameraParameters {
         CameraParameters get ();
}

<colgroup>
<col width="100%" />
</colgroup>

C#

public CameraParameters CameraParameters { get; }

<colgroup>
<col width="100%" />
</colgroup>

JavaScript

var cameraParameters = depthFloatFrame.cameraParameters;

#### Property value

Type: [CameraParameters](../../CameraParameters_Structure.md)
The camera parameters associated with the frame.

Requirements
============

**Namespace:**Microsoft.Kinect.Fusion
**Metadata:**microsoft.kinect.fusion.winmd

See also
========

#### Reference

[DepthFloatFrame Class](../../DepthFloatFrame_Class.md)
 [Microsoft.Kinect.Fusion Namespace](../../../Kinect.Fusion.md)


text:
<?xml version="1.0" encoding="UTF-8"?>
<axis2 xmlns="http://www.netbeans.org/ns/axis2/1">
    <service name="pixmgr">
        <service-class>com.vangent.hieos.services.pixpdqv3.serviceimpl.PatientIdentifierCrossReferenceManager</service-class>
    </service>
    <service name="pds">
        <service-class>com.vangent.hieos.services.pixpdqv3.serviceimpl.PatientDemographicsSupplier</service-class>
    </service>
</axis2>


text:
require 'spec_helper'

describe ParcelApi do
  it 'has a version number' do
    expect(ParcelApi::VERSION).not_to be nil
  end

  it 'does something useful' do
    expect(true).to eq(true)
  end
end


text:
package br.uff.ic.dyevc.application.branchhistory.chart;

import br.uff.ic.dyevc.application.IConstants;
import br.uff.ic.dyevc.application.branchhistory.view.CreateProjectValuesService;
import br.uff.ic.dyevc.application.branchhistory.view.ProjectService;
import br.uff.ic.dyevc.application.branchhistory.view.ProjectValues;
import br.uff.ic.dyevc.application.branchhistory.chart.BasicRepositoryHistoryGraph;
import br.uff.ic.dyevc.application.branchhistory.metric.LCSAbsoluteMetric;
import br.uff.ic.dyevc.application.branchhistory.metric.LCSMetric;
import br.uff.ic.dyevc.application.branchhistory.metric.Metric;
import br.uff.ic.dyevc.application.branchhistory.metric.NumberOfBytes;
import br.uff.ic.dyevc.application.branchhistory.model.ProjectRevisions;
import br.uff.ic.dyevc.application.branchhistory.model.VersionedProject;
import br.uff.ic.dyevc.application.branchhistory.chart.RepositoryHistoryLayout;
import br.uff.ic.dyevc.application.branchhistory.metric.MetricBucket;
import br.uff.ic.dyevc.graph.transform.commithistory.CHVertexLabelTransformer;
import br.uff.ic.dyevc.graph.transform.common.ClusterVertexShapeTransformer;
import br.uff.ic.dyevc.model.CommitInfo;
import br.uff.ic.dyevc.model.CommitRelationship;
import br.uff.ic.dyevc.model.MonitoredRepository;
import edu.uci.ics.jung.algorithms.filters.EdgePredicateFilter;
import edu.uci.ics.jung.algorithms.filters.Filter;
import edu.uci.ics.jung.algorithms.filters.VertexPredicateFilter;
import java.awt.BorderLayout;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.geom.Point2D;
import java.util.Collection;
import java.util.HashSet;
import java.util.Set;

import javax.swing.BorderFactory;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JPanel;

import org.apache.commons.collections15.Predicate;
import org.apache.commons.collections15.Transformer;

import edu.uci.ics.jung.algorithms.layout.Layout;
import edu.uci.ics.jung.graph.DirectedOrderedSparseMultigraph;
import edu.uci.ics.jung.graph.Graph;
import edu.uci.ics.jung.visualization.DefaultVisualizationModel;
import edu.uci.ics.jung.visualization.GraphZoomScrollPane;
import edu.uci.ics.jung.visualization.VisualizationModel;
import edu.uci.ics.jung.visualization.VisualizationViewer;
import edu.uci.ics.jung.visualization.control.CrossoverScalingControl;
import edu.uci.ics.jung.visualization.control.DefaultModalGraphMouse;
import edu.uci.ics.jung.visualization.control.ModalGraphMouse;
import edu.uci.ics.jung.visualization.control.ScalingControl;
import edu.uci.ics.jung.visualization.decorators.EdgeShape;
import edu.uci.ics.jung.visualization.renderers.Renderer;
import edu.uci.ics.jung.visualization.subLayout.GraphCollapser;
import edu.uci.ics.jung.visualization.util.PredicatedParallelEdgeIndexFunction;
import java.awt.Paint;
import javax.swing.DefaultComboBoxModel;
import javax.swing.ToolTipManager;

/**
 * Displays the commit history for the specified repository
 *
 * @author cristiano
 */
public class CommitHistoryWindow extends javax.swing.JFrame {
    private static final long serialVersionUID = 1689885032823010309L;
    private ProjectRevisions rep;
    private Graph graph;
    private Graph collapsedGraph;
    private VisualizationViewer vv;
    private Layout layout;
    private GraphCollapser collapser;
    Filter<CommitInfo, CommitRelationship> edgeFilter;
    Filter<CommitInfo, CommitRelationship> nodeFilter;
    private JComboBox edgeLineShapeCombo;
    private JComboBox mouseModesCombo;
    private JButton plus;
    private JButton minus;
    private JButton collapse;
    private JButton expand;
    private JButton reset;
    private final DefaultModalGraphMouse graphMouse = new DefaultModalGraphMouse();
    private final ScalingControl scaler = new CrossoverScalingControl();

    private JButton atualizarButton;
    JComboBox metricComboBox;

    GraphZoomScrollPane gzsp;

    Set exclusions;

    public CommitHistoryWindow(ProjectRevisions rep) {
        this.rep = rep;

        ProjectService projectService = new ProjectService();
        CreateProjectValuesService createProjectValuesService = new CreateProjectValuesService();
        VersionedProject versionedProject = projectService.getVersionedProject(rep);
        Metric metric = null;
            metric =  new NumberOfBytes();

        ProjectValues projectValues = createProjectValuesService.getProjectValues(rep, versionedProject,metric);

        initGraphComponent(projectValues);

        System.out.println("VV: "+vv);

        initComponents();
    }

    // <editor-fold defaultstate="collapsed" desc="initComponents">
    private void initComponents() {
        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setTitle("Commit History for repository " + rep.getName());
        java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
        setBounds((screenSize.width - 700) / 2, (screenSize.height - 750) / 2, 700, 750);

        mouseModesCombo = graphMouse.getModeComboBox();
        mouseModesCombo.addItemListener(graphMouse.getModeListener());
        graphMouse.setMode(ModalGraphMouse.Mode.PICKING);

        plus = new JButton("+");
        plus.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                scaler.scale(vv, 1.1f, vv.getCenter());
            }
        });

        minus = new JButton("-");
        minus.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                scaler.scale(vv, 1 / 1.1f, vv.getCenter());
            }
        });

        collapse = new JButton("Collapse");
        collapse.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                collapseActionPerformed(e);
            }
        });

        expand = new JButton("Expand");
        expand.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                expandActionPerformed(e);
            }
        });

        reset = new JButton("Reset");
        reset.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                ResetActionPerformed(e);
            }
        });

        edgeLineShapeCombo = new JComboBox();
        this.edgeLineShapeCombo.setModel(new DefaultComboBoxModel(new String[]{"QuadCurve", "Line", "CubicCurve"}));
        this.edgeLineShapeCombo.setSelectedItem("Line");
        this.edgeLineShapeCombo.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent evt) {
                edgeLineShapeSelectionActionPerformed(evt);
            }
        });

        String metricItems[];
        metricItems = new String[MetricBucket.getInstance().getMetricCasingList().size()];
        for (int i = 0; i < metricItems.length; i++) {
            metricItems[i] = MetricBucket.getInstance().getMetricCasingList().get(i).getName();
        }
        metricComboBox = new JComboBox(metricItems);

        atualizarButton = new JButton("atualizar");
        ActionListener act = new ActionListener() {

                @Override
                public void actionPerformed(ActionEvent e) {
                    atualizar();
                }
        };
        atualizarButton.addActionListener(act);

        Container content = getContentPane();
        gzsp = new GraphZoomScrollPane(vv);
        content.add(gzsp);
        //content.remove(gzsp);
        //gzsp = new GraphZoomScrollPane(vv);
        //content.add(gzsp);

        JPanel controls = new JPanel();
        JPanel zoomControls = new JPanel(new GridLayout(2, 1));
        zoomControls.setBorder(BorderFactory.createTitledBorder("Zoom"));
        zoomControls.add(plus);
        zoomControls.add(minus);
        controls.add(zoomControls);
        JPanel collapseControls = new JPanel(new GridLayout(3, 1));
        collapseControls.setBorder(BorderFactory.createTitledBorder("Picked"));
        collapseControls.add(collapse);
        collapseControls.add(expand);
        collapseControls.add(reset);
        controls.add(collapseControls);
        controls.add(mouseModesCombo);
        controls.add(edgeLineShapeCombo);
        controls.add(metricComboBox);
        controls.add(atualizarButton);
        content.add(controls, BorderLayout.SOUTH);
        this.setSize(new Dimension(730, 616));

    }// </editor-fold>

    private void atualizar(){
        ProjectService projectService = new ProjectService();
        CreateProjectValuesService createProjectValuesService = new CreateProjectValuesService();
        VersionedProject versionedProject = projectService.getVersionedProject(rep);
        Metric metric = null;
        int selected = metricComboBox.getSelectedIndex();

        metric = MetricBucket.getInstance().getMetricCasingList().get(selected).getMetric();

        ProjectValues projectValues = createProjectValuesService.getProjectValues(rep, versionedProject,metric);
        Container content = getContentPane();
        content.removeAll();
        initGraphComponent(projectValues);
        initComponents();
        metricComboBox.setSelectedIndex(selected);
       /* Container content = getContentPane();
        System.out.println("gzsp: "+gzsp.getSize());
        content.remove(gzsp);

        gzsp = new GraphZoomScrollPane(vv);
        gzsp.setSize(new Dimension(727,616));
        System.out.println("gzsp: "+gzsp.getSize());

        content.add(gzsp, BorderLayout.NORTH);
        resetGraph();
        this.repaint();*/

    }

    // <editor-fold defaultstate="collapsed" desc="initGraphComponent">
    private void initGraphComponent(ProjectValues projectValues) {
        // create the commit history graph with all commits from repository
        graph = BasicRepositoryHistoryGraph.createBasicRepositoryHistoryGraph(rep);
        collapsedGraph = graph;

        // Choosing layout
        layout = new RepositoryHistoryLayout(graph);
        Dimension preferredSize = new Dimension(620, 580);

        VisualizationModel visualizationModel =
                new DefaultVisualizationModel(layout, preferredSize);
        vv = new VisualizationViewer(visualizationModel, preferredSize);

        //Scales the graph to show more nodes
        scaler.scale(vv, 0.4761905F, vv.getCenter());
        vv.scaleToLayout(scaler);

        collapser = new GraphCollapser(graph);

        PredicatedParallelEdgeIndexFunction eif = PredicatedParallelEdgeIndexFunction.getInstance();
        exclusions = new HashSet();
        eif.setPredicate(new Predicate<CommitInfo>() {
            @Override
            public boolean evaluate(CommitInfo e) {
                return exclusions.contains(e);
            }
        });
        vv.getRenderContext().setParallelEdgeIndexFunction(eif);

        vv.setBackground(IConstants.BACKGROUND_COLOR);

        // Adds interaction via mouse
        vv.setGraphMouse(graphMouse);
        vv.addKeyListener(graphMouse.getModeKeyListener());

        nodeFilter = new VertexPredicateFilter(new Predicate<CommitInfo>() {
            @Override
            public boolean evaluate(CommitInfo ci) {
                return true;
            }
        });

        edgeFilter = new EdgePredicateFilter(new Predicate<CommitRelationship>() {
            @Override
            public boolean evaluate(CommitRelationship cr) {
                return true;
            }
        });

        // <editor-fold defaultstate="collapsed" desc="vertex tooltip transformer">
        Transformer<Object, String> vertexTooltip = new CHVertexTooltipTransformer(projectValues);
        vv.setVertexToolTipTransformer(vertexTooltip);
        ToolTipManager.sharedInstance().setDismissDelay(15000);
        //</editor-fold>

        // <editor-fold defaultstate="collapsed" desc="vertex fillPaint transformer">
        Transformer<Object, Paint> vertexPaint = new CHVertexPaintTransformer(projectValues);
        vv.getRenderContext().setVertexFillPaintTransformer(vertexPaint);
        //</editor-fold>

        // <editor-fold defaultstate="collapsed" desc="vertex label transformer">
        Transformer<Object, String> vertexLabel = new CHVertexLabelTransformer();
        vv.getRenderContext().setVertexLabelTransformer(vertexLabel);
        vv.getRenderer().getVertexLabelRenderer().setPosition(Renderer.VertexLabel.Position.CNTR);
        //</editor-fold>

        vv.getRenderContext().setEdgeShapeTransformer(new EdgeShape.Line());
        vv.getRenderContext().setVertexShapeTransformer(new ClusterVertexShapeTransformer());
        //vv.repaint();
    }
    //</editor-fold>

    // <editor-fold defaultstate="collapsed" desc="action handlers">
    private void collapseActionPerformed(ActionEvent evt) {
        Collection picked = new HashSet(vv.getPickedVertexState().getPicked());
        collapse(picked);
    }

    private void expandActionPerformed(ActionEvent e) {
        Collection picked = new HashSet(vv.getPickedVertexState().getPicked());
        expand(picked);
    }

    private void ResetActionPerformed(ActionEvent evt) {
        resetGraph();
    }

    private void edgeLineShapeSelectionActionPerformed(ActionEvent evt) {
        String mode = (String) this.edgeLineShapeCombo.getSelectedItem();
        if (mode.equalsIgnoreCase("QuadCurve")) {
            vv.getRenderContext().setEdgeShapeTransformer(new EdgeShape.QuadCurve());
        } else if (mode.equalsIgnoreCase("Line")) {
            vv.getRenderContext().setEdgeShapeTransformer(new EdgeShape.Line());
        } else if (mode.equalsIgnoreCase("CubicCurve")) {
            vv.getRenderContext().setEdgeShapeTransformer(new EdgeShape.CubicCurve());
        }
        this.vv.repaint();
    }
    // </editor-fold>

    private void collapse(Collection picked) {
//        AddFilters();
        if (picked.size() > 1) {
            Graph inGraph = layout.getGraph();
            Graph clusterGraph = collapser.getClusterGraph(inGraph, picked);

            collapsedGraph = ((DirectedOrderedSparseMultigraph) collapser.collapse(layout.getGraph(), clusterGraph));
            double sumx = 0;
            double sumy = 0;
            for (Object v : picked) {
                Point2D p = (Point2D) layout.transform(v);
                sumx += p.getX();
                sumy += p.getY();
            }
            Point2D cp = new Point2D.Double(sumx / picked.size(), sumy / picked.size());
            vv.getRenderContext().getParallelEdgeIndexFunction().reset();
            layout.setGraph(collapsedGraph);
            layout.setLocation(clusterGraph, cp);
            vv.getPickedVertexState().clear();
            vv.repaint();
        }
//    RemoveFilters();
    }

    private void expand(Collection picked) {
        for (Object v : picked) {
            if (v instanceof Graph) {
//                AddFilters();
                collapsedGraph = ((DirectedOrderedSparseMultigraph) collapser.expand(layout.getGraph(), (Graph) v));
                vv.getRenderContext().getParallelEdgeIndexFunction().reset();
                layout.setGraph(collapsedGraph);

            }
//            RemoveFilters();
//            Filter();

            vv.getPickedVertexState().clear();
            vv.repaint();
        }
    }

    private void resetGraph() {
        layout.setGraph(graph);
        collapsedGraph = graph;
//        RemoveFilters();
        vv.repaint();
    }

    /**
     * runs the graph with a demo repository
     */
    public static void main(String[] args) {
        //ProjectRevisions rep = new ProjectRevisions();
       // rep.setId("rep1363653250218");
//        rep.setId("rep1364318989748");
        //new CommitHistoryWindow(rep).setVisible(true);
    }
}


text:
from django.core import mail
from django.db import IntegrityError
from django.test.utils import override_settings
from django.utils import timezone
from mock import patch

from bluebottle.members.models import MemberPlatformSettings, Member
from bluebottle.test.factory_models.accounts import BlueBottleUserFactory
from bluebottle.test.factory_models.geo import LocationFactory, CountryFactory
from bluebottle.test.utils import BluebottleTestCase

class BlueBottleUserManagerTestCase(BluebottleTestCase):
    """
    Test case for the model manager of the abstract user model.
    """

    def test_create_user(self):
        """
        Tests the manager ``create_user`` method.
        """

        user = BlueBottleUserFactory.create(
            email='john_doe@onepercentclub.com')

        self.assertTrue(user.is_active)
        self.assertFalse(user.is_superuser)
        self.assertFalse(user.is_staff)

    def test_create_user_with_email(self):
        payload = {
            'email': 'john_doe@onepercentclub.com',
            'remote_id': 'john_doe@onepercentclub.com',
            'username': 'johny',
        }
        user = Member.objects.create_user(**payload)
        self.assertTrue(user.id)
        self.assertEqual(user.email, 'john_doe@onepercentclub.com')
        self.assertEqual(user.username, 'johny')

    def test_create_user_no_email_provided(self):
        """
        Tests exception raising when trying to create a new user without
        providing an email.
        """
        with self.assertRaises(IntegrityError):
            user = BlueBottleUserFactory.build()
            user.email = None
            user.save()

    def test_location_sets_country(self):
        country = CountryFactory.create()
        location = LocationFactory.create(country=country)
        BlueBottleUserFactory.create(email='john_doe@onepercentclub.com', location=location)

class BlueBottleUserTestCase(BluebottleTestCase):
    """
    Test case for the implementation of the abstract user model.
    """

    def setUp(self):
        self.init_projects()
        self.user = BlueBottleUserFactory.create()

    @patch('django.utils.timezone.now')
    def test_update_deleted_timestamp(self, mock):
        """
        Tests the ``update_deleted_timestamp`` method, checking that the
        timestamp is properly set up when the user is not active any more.
        """
        timestamp = timezone.now()
        mock.return_value = timestamp

        self.user.is_active = False
        self.user.update_deleted_timestamp()

        self.assertEqual(self.user.deleted, timestamp)

    def test_update_deleted_timestamp_active_user(self):
        """
        Tests that the ``update_deleted_timestamp`` method resets the timestamp
        to ``None`` if the user becomes active again.
        """
        self.user.is_active = False
        self.user.update_deleted_timestamp()

        # Now the user is inactive, so ``deleted`` attribute is set. Let's
        # reactivate it again and check that is reset.
        self.user.is_active = True
        self.user.update_deleted_timestamp()

        self.assertIsNone(self.user.deleted)

    def test_generate_username_from_email(self):
        """
        Tests the ``generate_username`` method when no username was provided.
        It should set the email as username.
        """
        user = BlueBottleUserFactory.create(email='piet@puk.nl', username='',
                                            first_name='', last_name='')
        user.generate_username()
        self.assertEqual(user.username, user.email)

    def test_get_full_name(self):
        """
        Tests the ``get_full_name`` method.
        """
        self.user.first_name = 'John'
        self.user.last_name = 'Doe'
        self.user.save()

        self.assertEqual(self.user.get_full_name(), 'John Doe')

    def test_get_short_name(self):
        """
        Tests the ``get_short_name`` method.
        """
        self.user.first_name = 'John'
        self.user.last_name = 'Doe'
        self.user.save()

        self.assertEqual(self.user.get_short_name(), 'John')

    @override_settings(SEND_WELCOME_MAIL=True,
                       CELERY_MAIL=False)
    def test_welcome_mail(self):
        """
        Test that a welcome mail is sent when a user is created when the
        setting are enabled
        """

        mail.outbox = []

        self.assertEqual(len(mail.outbox), 0)
        new_user = BlueBottleUserFactory.create(
            email='new_user@onepercentclub.com',
            primary_language='en')
        self.assertEqual(len(mail.outbox), 1)
        # We need a better way to verify the right mail is loaded
        self.assertTrue("Welcome" in mail.outbox[0].subject)
        self.assertEqual(mail.outbox[0].activated_language, 'en')
        self.assertEqual(mail.outbox[0].recipients()[0], new_user.email)
        self.assertTrue('[Set password](https://testserver/authentication/set-password' in mail.outbox[0].body)

    @override_settings(SEND_WELCOME_MAIL=True,
                       CELERY_MAIL=False)
    def test_welcome_mail_password(self):
        """
        Test that a welcome mail is sent when a user is created when the
        setting are enabled
        """

        mail.outbox = []

        self.assertEqual(len(mail.outbox), 0)
        new_user = BlueBottleUserFactory.create(
            email='new_user@onepercentclub.com',
            password='test',
            primary_language='en')
        self.assertEqual(len(mail.outbox), 1)
        # We need a better way to verify the right mail is loaded
        self.assertTrue("Welcome" in mail.outbox[0].subject)
        self.assertEqual(mail.outbox[0].activated_language, 'en')
        self.assertEqual(mail.outbox[0].recipients()[0], new_user.email)
        self.assertTrue('[Take me there](https://testserver)' in mail.outbox[0].body)

    @override_settings(SEND_WELCOME_MAIL=True,
                       CELERY_MAIL=False)
    def test_welcome_mail_closed(self):
        """
        Test that a welcome mail is sent when a user is created when the
        setting are enabled
        """

        mail.outbox = []
        MemberPlatformSettings.objects.update(closed=True)

        self.assertEqual(len(mail.outbox), 0)
        new_user = BlueBottleUserFactory.create(
            email='new_user@onepercentclub.com',
            password='test',
            remote_id=None,
            primary_language='en')
        self.assertEqual(len(mail.outbox), 1)
        self.assertEqual("Welcome to Test!", mail.outbox[0].subject)
        self.assertEqual(mail.outbox[0].activated_language, 'en')
        self.assertEqual(mail.outbox[0].recipients()[0], new_user.email)
        self.assertTrue('[Take me there](https://testserver/partner)' in mail.outbox[0].body)

    @override_settings(SEND_WELCOME_MAIL=True,
                       CELERY_MAIL=False)
    def test_welcome_mail_closed_remote_id(self):
        """
        Test that a welcome mail is sent when a user is created when the
        setting are enabled
        """
        MemberPlatformSettings.objects.update(closed=True)
        mail.outbox = []

        self.assertEqual(len(mail.outbox), 0)
        new_user = BlueBottleUserFactory.create(
            email='new_user@onepercentclub.com',
            password='test',
            remote_id='123',
            primary_language='en')
        self.assertEqual(len(mail.outbox), 1)
        self.assertTrue("Welcome" in mail.outbox[0].subject)
        self.assertEqual(mail.outbox[0].activated_language, 'en')
        self.assertEqual(mail.outbox[0].recipients()[0], new_user.email)
        self.assertTrue('[Take me there](https://testserver)' in mail.outbox[0].body)

    @override_settings(SEND_WELCOME_MAIL=True,
                       CELERY_MAIL=False)
    def test_welcome_mail_nl(self):
        """
        Test that a welcome mail is sent when a user is created when the
        setting are enabled (NL).
        """

        mail.outbox = []

        self.assertEqual(len(mail.outbox), 0)
        new_user = BlueBottleUserFactory.create(
            email='new_user@onepercentclub.com',
            primary_language='nl')
        self.assertEqual(len(mail.outbox), 1)
        self.assertEqual(mail.outbox[0].activated_language, 'nl')
        self.assertEqual(mail.outbox[0].recipients()[0], new_user.email)

    def test_no_welcome_mail(self):
        """
        Test that a welcome mail is sent when a user is created when the setting
        are disabled (= default)
        """
        mail.outbox = []

        # The setup function also creates a user and generates a mail
        self.assertEqual(len(mail.outbox), 0)
        BlueBottleUserFactory.create(email='new_user@onepercentclub.com')
        self.assertEqual(len(mail.outbox), 0)

    def test_base_user_fields(self):
        """ Test that a base user model has all the expected fields """
        from bluebottle.members.models import Member

        user_fields = set(
            ['email', 'username', 'is_staff', 'is_active', 'date_joined',
             'updated', 'deleted',
             'user_type', 'first_name', 'last_name', 'location', 'picture',
             'about_me',
             'primary_language', 'share_time_knowledge', 'share_money',
             'newsletter', 'phone_number',
             'gender', 'birthdate', 'disable_token', 'campaign_notifications'])

        self.assertEqual(
            set(f.name for f in Member._meta.fields) & user_fields, user_fields)

    def test_anonymize(self):
        self.user.anonymize()

        for prop in [
            'is_active',
            'user_name',
            'place',
            'picture',
            'avatar',
            'about_me',
            'gender',
            'location',
            'website',
            'facebook',
            'twitter',
            'skypename',
            'partner_organization',
        ]:
            self.assertFalse(getattr(self.user, prop))

        self.assertEqual(self.user.birthdate, '1000-01-01')
        self.assertTrue(self.user.email.endswith('anonymous@example.com'))
        self.assertEqual(self.user.first_name, 'Deactivated')
        self.assertEqual(self.user.last_name, 'Member')
        self.assertEqual(self.user.is_anonymized, True)
        self.assertFalse(self.user.has_usable_password())

    def test_anonymize_twice(self):
        self.user.anonymize()

        other_user = BlueBottleUserFactory.create()
        other_user.anonymize()
        self.assertFalse(other_user.is_active)


text:
#ifndef PCA10000_H
#define PCA10000_H

// Definitions for PCA10000 v2.0.0 or higher
#if 1

#define LEDS_NUMBER    3

// there is RGB LED on this board
#define LED_RGB_RED    21
#define LED_RGB_GREEN  22
#define LED_RGB_BLUE   23

#define LED_START  LED_RGB_RED
#define BSP_LED_0  LED_RGB_RED
#define BSP_LED_1  LED_RGB_GREEN
#define BSP_LED_2  LED_RGB_BLUE
#define LED_STOP   LED_RGB_BLUE

#define BUTTONS_LIST {}
#define LEDS_LIST { LED_RGB_RED, LED_RGB_GREEN, LED_RGB_BLUE }

#define BSP_LED_0_MASK    (1<<LED_RGB_RED)
#define BSP_LED_1_MASK    (1<<LED_RGB_GREEN)
#define BSP_LED_2_MASK    (1<<LED_RGB_BLUE)

#define LEDS_MASK      (BSP_LED_0_MASK | BSP_LED_1_MASK | BSP_LED_2_MASK)
#define LEDS_INV_MASK  LEDS_MASK

// there are no buttons on this board
#define BUTTONS_NUMBER 0
#define BUTTONS_MASK   0x00000000

// UART pins connected to J-Link
#define RX_PIN_NUMBER  11
#define TX_PIN_NUMBER  9
#define CTS_PIN_NUMBER 10
#define RTS_PIN_NUMBER 8
#define HWFC           true

// Definitions for PCA10000 v1.0
#else

#define RX_PIN_NUMBER  3
#define TX_PIN_NUMBER  1
#define CTS_PIN_NUMBER 2
#define RTS_PIN_NUMBER 0
#define HWFC           true

#endif

// Low frequency clock source to be used by the SoftDevice
#define NRF_CLOCK_LFCLKSRC      NRF_CLOCK_LFCLKSRC_XTAL_20_PPM

#endif


text:
package cn.easyproject.easyee.sm.base.configuration;

import java.io.IOException;

import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.annotation.WebFilter;
import javax.servlet.http.HttpServletResponse;
@WebFilter(filterName="CKFinderCORSFilter", value="/staticresources/ckfinder/core/connector/java/connector.java")
public class CKFinderCORSFilter implements Filter{

	@Override
	public void destroy() {
	}

	@Override
	public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain)
			throws IOException, ServletException {
		HttpServletResponse response = (HttpServletResponse) res;
        response.setHeader("Access-Control-Allow-Origin", "*");
        response.setHeader("Access-Control-Allow-Methods", "POST, GET, OPTIONS, DELETE, PUT");
        response.setHeader("Access-Control-Max-Age", "3600");
        response.setHeader("Access-Control-Allow-Headers", "*");
        chain.doFilter(req, res);
	}

	@Override
	public void init(FilterConfig arg0) throws ServletException {
	}

}


text:
define('getlibs/plugins/index', [], function(){

	function fetch(load, fallback){

		function retry(err){

			if (String(err.message).indexOf('No access to files') == 0){
				throw err;
			}

			var address = load.address,
				index = address.replace(/\.(ts|js)$/, '/index.$1'),
				ext = RegExp.$1,
				path = JSON.stringify(index),
				source = (ext == 'ts') ?
					'export * from ' + path :
					'module.exports = require(' + path + ')';

			if (address.match(/\.(ts|js)$/) && !address.match(/index\.(ts|js)$/)){
				return source;
			}

			throw err;
		}

		return Promise.resolve(fallback(load)).catch(retry);
	}

	return {
		fetch: fetch
	};
});


text:
<?

require('plurkAPI.php');

class PlurkAPITest extends PHPUnit_Framework_TestCase {

    protected $consumer_key;
    protected $consumer_secret;
    protected $oauth_token;
    protected $oauth_token_secret;
    protected $plurk;

    public function setUp(){
	$this->consumer_key = CONSUMER_KEY;
	$this->consumer_secret = CONSUMER_SECRET;
	$this->oauth_token = ACCESS_TOKEN;
	$this->oauth_token_secret = ACCESS_TOKEN_SECRET;
    }

    public function tearDown(){}

    /**
     * @expectedException InvalidArgumentException
     */
    public function testNoConsumerKey()
    {
	$plurk = new PlurkAPI();
    }

    public function testInvalidConsumerKey()
    {
	$plurk = new PlurkAPI("abc", "def");
	$json = $plurk->callAPI('/APP/Profile/getPublicProfile',
	    array('user_id' => 'clsung'), true);
	$this->assertNull($json);
	$this->assertContains('40101:unknown application key', $plurk->error());
    }

    public function testValidConsumerKey()
    {
	$plurk = new PlurkAPI($this->consumer_key, $this->consumer_secret);
	$json = $plurk->callAPI('/APP/Profile/getPublicProfile', array('user_id' => 'clsung'), true);
	$this->assertNotNull($json);
	$this->assertEquals(0, $plurk->errno());
    }

    /**
     * @depends testValidConsumerKey
     */
    public function testcurrUser()
    {
	$plurk = new PlurkAPI($this->consumer_key, $this->consumer_secret,
	    $this->oauth_token, $this->oauth_token_secret
	);
	$json = $plurk->callAPI('/APP/Users/currUser');
	$this->assertNotNull($json);
	$this->assertEquals(0, $plurk->errno());
    }

    /**
     * @depends testValidConsumerKey
     */
    public function testGetOwnProfile()
    {
	$plurk = new PlurkAPI($this->consumer_key, $this->consumer_secret,
	    $this->oauth_token, $this->oauth_token_secret
	);
	$json = $plurk->callAPI('/APP/Profile/getOwnProfile');
	$this->assertNotNull($json);
	$this->assertEquals(0, $plurk->errno());
    }

    /**
     * @depends testValidConsumerKey
     */
    public function testGetAccessToken()
    {
	$this->markTestIncomplete("Only when you need to get access token");
	$oauth = new PlurkOAuth($this->consumer_key, $this->consumer_secret);
	$this->assertTrue($oauth->authorize());
    }

    /**
     * @depends testValidConsumerKey
     */
    public function testAPIplurkAdd()
    {
	$plurk = new PlurkAPI($this->consumer_key, $this->consumer_secret,
	    $this->oauth_token, $this->oauth_token_secret
	);
	$json = $plurk->callAPI('/APP/Timeline/plurkAdd',
	    array ('content' => 'Post by plurkoauth which based on php', 'qualifier' => 'hates')
	);
	$this->assertNotNull($json);
	$this->assertEquals(0, $plurk->errno());
    }

    /**
     * @depends testValidConsumerKey
     */
    public function testAPIresponseAdd()
    {
	$plurk = new PlurkAPI($this->consumer_key, $this->consumer_secret,
	    $this->oauth_token, $this->oauth_token_secret
	);
	# reply to http://www.plurk.com/p/cs770l
	$plurk_id = base_convert("cs770l",36,10);
	$json = $plurk->callAPI('/APP/Responses/responseAdd',
	    array ('plurk_id' => $plurk_id,
	    'content' => 'Response test by plurkoauth', 'qualifier' => 'says')
	);
	$this->assertNotNull($json);
	$this->assertEquals(0, $plurk->errno());
	$json = $plurk->callAPI('/APP/Responses/responseAdd',
	    array ('plurk_id' => $plurk_id,
	    'content' => 'plurkoauth is https://github.com/clsung/plurkoauth (here)', 'qualifier' => 'shares')
	);
	$this->assertNotNull($json);
	$this->assertEquals(0, $plurk->errno());
    }
}


text:
from __future__ import print_function

import base64
import argparse
import xerox

def convert_image(args):
    paths = args['query']
    copy = args['copy']
    encoded = ''

    for path in paths:
        with open(path,'rb') as img:
            encoded = encoded + 'data:image/png;base64,' + base64.b64encode(img.read())
            encoded = encoded + "\n"

    if copy:
        xerox.copy(encoded)

    print(encoded)

def get_parser():
    parser = argparse.ArgumentParser(description='Command line b64 image converter.')
    parser.add_argument('query', metavar='QUERY', type=str, nargs='*',
            help='The path of the image to encode.')
    parser.add_argument('-c','--copy', help='copy result to the clipboard.', default=False, dest='copy', action='store_true')
    return parser

def command_line_runner():
    parser = get_parser()
    args = vars(parser.parse_args())
    if not args['query']:
        parser.print_help()
        return
    if args['query']:
        convert_image(args)

if __name__ == '__main__':
    command_line_runner()


text:
using System.Threading.Tasks;
using AllReady.Features.Organizations;
using MediatR;
using Microsoft.AspNetCore.Mvc;

namespace AllReady.Controllers
{
    public class OrganizationController : Controller
    {
        private readonly IMediator _mediator;

        public OrganizationController(IMediator mediator)
        {
            _mediator = mediator;
        }

        [Route("Organizations/")]
        public IActionResult Index()
        {
            return View(_mediator.Send(new OrganizationsQuery()));
        }

        [Route("Organization/{id}/")]
        public async Task<IActionResult> ShowOrganization(int id)
        {
            if (id <= 0)
            {
                return BadRequest();
            }

            var model = await _mediator.SendAsync(new OrganizationDetailsQuery { Id = id });

            if (model == null)
            {
                return NotFound();
            }

            return View("Organization", model);
        }

        [Route("Organization/{id}/PrivacyPolicy")]
        public async Task<IActionResult> OrganizationPrivacyPolicy(int id)
        {
            if (id <= 0)
            {
                return BadRequest();
            }

            var model = await _mediator.SendAsync(new OrganizationPrivacyPolicyQuery { OrganizationId = id });

            if (model == null || string.IsNullOrEmpty(model.Content))
            {
                return RedirectToAction(nameof(ShowOrganization));
            }

            return View("OrgPrivacyPolicy", model);
        }
    }
}


text:
layout: default
title: Browsers
---

# [Browser Hyperpolyglot](http://jeffcarp.github.io/frontend-hyperpolyglot/)

  {% for category in site.data.browsers %}
    {% if category.name %}

      {{ category.name }}

    {% endif %}

      {% for label in site.data.browserlabels %}
        {{ label }}
      {% endfor %}

    {% for comparison in category.comparisons %}

        {{ comparison.label }}
        {% for browser in comparison.browsers %}
          {% if browser[1].link %}
            {{ browser[1].linktext }}
          {% else %}
            {{ browser[1] }}
          {% endif %}
        {% endfor %}

    {% endfor %}
  {% endfor %}

{% for category in site.data.browsers %}

{{ category.name }}

  {% for comparison in category.comparisons %}
  {% if comparison.remarks %}

{{ comparison.label }}

  {{ comparison.remarks | markdownify }}
  {% endif %}
  {% endfor %}
{% endfor %}


text:
using LightBDD.Core.Formatting.ExceptionFormatting;
using LightBDD.Framework.Configuration;
using LightBDD.NUnit3.Implementation;

namespace LightBDD.NUnit3.Configuration
{
    /// <summary>
    /// Extensions allowing to apply test framework default configuration.
    /// </summary>
    public static class TestFrameworkConfigurationExtensions
    {
        /// <summary>
        /// Adds NUnit specific stack trace member exclusions.
        /// </summary>
        /// <param name="formatter">Formatter.</param>
        /// <returns>Formatter.</returns>
        public static DefaultExceptionFormatter WithTestFrameworkDefaults(this DefaultExceptionFormatter formatter)
        {
            return formatter
                .WithMembersExcludedFromStackTrace("NUnit\\..*");
        }

        /// <summary>
        /// Appends LightBDD.NUnit3 default scenario progress notifiers.
        /// </summary>
        public static ScenarioProgressNotifierConfiguration AppendFrameworkDefaultProgressNotifiers(this ScenarioProgressNotifierConfiguration configuration)
        {
            return configuration.AppendNotifierProviders(NUnit3ProgressNotifier.CreateScenarioProgressNotifier);
        }

        /// <summary>
        /// Appends LightBDD.NUnit3 default feature progress notifiers.
        /// </summary>
        public static FeatureProgressNotifierConfiguration AppendFrameworkDefaultProgressNotifiers(this FeatureProgressNotifierConfiguration configuration)
        {
            return configuration.AppendNotifiers(NUnit3ProgressNotifier.CreateFeatureProgressNotifier());
        }
    }
}


text:
using namespace DirectX::SimpleMath;

#pragma once
class Transform
{
	Vector3 position;
	Vector3 scale;
	Quaternion rotation;

	Matrix matrix;
	bool dirty;

public:
	Transform();
	~Transform();

	//Transform by values
	void Translate(float x, float y, float z);
	void Rotate(float x, float y, float z);
	void Scale(float x, float y, float z);

	//Transform by vectors
	void Translate(Vector3 translation);
	void Rotate(Vector3 rotation);
	void Rotate(Quaternion rotation);
	void Scale(Vector3 scale);

	void SetPosition(float x, float y, float z);
	void SetScale(float x, float y, float z);
	void SetScale(const float &scale);
	void SetRotation(float x, float y, float z);

	void SetPosition(Vector3 position);
	void SetScale(Vector3 scale);
	void SetRotation(Vector3 orientation);
	void SetRotation(Quaternion orientation);

	Vector3 GetPosition();
	Vector3 GetScale();
	Quaternion GetRotation();

	Matrix GetMatrix();
};


text:
package com.LilG.utils;

import java.util.LinkedList;

public class SizedArray<T> extends LinkedList<T> {
	private int maxSize;

	public SizedArray() {
		this(20);
	}

	public SizedArray(int size) {
		super();
		maxSize = size;
	}

	public void setMaxSize(int size) {
		maxSize = size;
		clean();
	}

	@Override
	public boolean add(T object) {
		clean();
		return super.add(object);
	}

	public T get() {
		if (size() == 0) {
			return null;
		}
		return super.get(size() - 1);
	}

	private void clean() {
		//If the array is too big, remove elements until it's the right size.
		while (size() >= maxSize) {
			remove(0);
		}
	}
}


text:
package org.apache.synapse.securevault.secret.handler;

import org.apache.synapse.securevault.CipherFactory;
import org.apache.synapse.securevault.CipherOperationMode;
import org.apache.synapse.securevault.DecryptionProvider;
import org.apache.synapse.securevault.EncodingType;
import org.apache.synapse.securevault.definition.CipherInformation;
import org.apache.synapse.securevault.secret.AbstractSecretCallbackHandler;
import org.apache.synapse.securevault.secret.SecretManager;
import org.apache.synapse.securevault.secret.SingleSecretCallback;

import javax.crypto.spec.SecretKeySpec;
import java.security.Key;

/**
 * SecretCallbackHandler implementation which is compatible to the default encryption used
 * within the JBoss Application Server to decrypt database passwords.
 */
public class JBossEncryptionSecretCallbackHandler extends AbstractSecretCallbackHandler {

    private static final String ALGORITHM = "Blowfish";
    private static Key key = new SecretKeySpec("jaas is the way".getBytes(), ALGORITHM);
        private final SecretManager secretManager = SecretManager.getInstance();
    /**
     * Decrypts the encrypted secret provided by the specified callback handler.
     *
     * @param singleSecretCallback The singleSecretCallback which secret has to be decrypted
     */
    @Override
    protected void handleSingleSecretCallback(SingleSecretCallback singleSecretCallback) {

        if (!secretManager.isInitialized()) {
            if (log.isWarnEnabled()) {
                log.warn("SecretManager has not been initialized.Cannot collect secrets.");
            }
            return;
        }

        String id = singleSecretCallback.getId();
        if (id != null && !"".equals(id)) {
            singleSecretCallback.setSecret(decrypt(secretManager.getEncryptedData(id)));
        }
    }

    /**
     * Decrypts the encrypted secret using the Blowfish algorithm and the same hard-coded
     * passphrase the JBoss application server uses to decrypt database passwords.
     *
     * @param encryptedSecret the encrypted secret
     * @return the decrypted secret.
     */
    private static String decrypt(String encryptedSecret) {
        CipherInformation cipherInformation = new CipherInformation();
        cipherInformation.setAlgorithm(ALGORITHM);
        cipherInformation.setCipherOperationMode(CipherOperationMode.DECRYPT);
        cipherInformation.setInType(EncodingType.BIGINTEGER16); //TODO
        DecryptionProvider decryptionProvider = CipherFactory.createCipher(cipherInformation, key);
        return new String(decryptionProvider.decrypt(encryptedSecret.getBytes()));
    }
}


text:
import { Component, OnInit } from '@angular/core';

@Component({
  selector: 'app-comp-3370',
  templateUrl: './comp-3370.component.html',
  styleUrls: ['./comp-3370.component.css']
})
export class Comp3370Component implements OnInit {

  constructor() { }

  ngOnInit() {
  }

}


text:
package com.skynav.ttv.verifier.smpte;

import com.skynav.ttv.model.Model;
import com.skynav.ttv.verifier.ttml.TTML1ParameterVerifier;

public class ST20522010TTML1ParameterVerifier extends TTML1ParameterVerifier {
    public ST20522010TTML1ParameterVerifier(Model model) {
        super(model);
    }
}


text:
package com.opengamma.integration.analyticservice;

import java.util.List;

import com.opengamma.engine.view.ViewResultEntry;

/**
 *
 */
public interface AnalyticResultReceiver {

  void analyticReceived(List<ViewResultEntry> allResults);

}


text:
ACCEPTED

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

#### Published in
Ric. auton. lich. crost. (Verona) 91 (1852)

#### Original name
Lecidea globifera Ach.

### Remarks
null


text:
package org.jasig.cas.authentication.principal;

import java.io.Serializable;
import java.util.Map;

/**
 * Defines operations to create principals.
 * @author Misagh Moayyed
 * @since 4.1.0
 */
public interface PrincipalFactory extends Serializable {
    /**
     * Create principal.
     *
     * @param id the id
     * @return the principal
     */
    Principal createPrincipal(String id);

    /**
     * Create principal along with its attributes.
     *
     * @param id the id
     * @param attributes the attributes
     * @return the principal
     */
    Principal createPrincipal(String id, Map<String, Object> attributes);

}


text:
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.securitydevops.generated;

import com.azure.resourcemanager.securitydevops.models.ActionableRemediation;
import com.azure.resourcemanager.securitydevops.models.ActionableRemediationState;
import com.azure.resourcemanager.securitydevops.models.AzureDevOpsRepoProperties;
import com.azure.resourcemanager.securitydevops.models.RuleCategory;
import com.azure.resourcemanager.securitydevops.models.TargetBranchConfiguration;
import java.util.Arrays;

/** Samples for AzureDevOpsRepo CreateOrUpdate. */
public final class AzureDevOpsRepoCreateOrUpdateSamples {
    /*
     * x-ms-original-file: specification/securitydevops/resource-manager/Microsoft.SecurityDevOps/preview/2022-09-01-preview/examples/AzureDevOpsRepoCreateOrUpdate.json
     */
    /**
     * Sample code: AzureDevOpsRepo_CreateOrUpdate.
     *
     * @param manager Entry point to SecurityDevOpsManager.
     */
    public static void azureDevOpsRepoCreateOrUpdate(
        com.azure.resourcemanager.securitydevops.SecurityDevOpsManager manager) {
        manager
            .azureDevOpsRepoes()
            .define("myRepo")
            .withExistingProject("westusrg", "testconnector", "myOrg", "myProject")
            .withProperties(
                new AzureDevOpsRepoProperties()
                    .withRepoId("00000000-0000-0000-0000-000000000000")
                    .withRepoUrl("https://dev.azure.com/myOrg/myProject/_git/myRepo")
                    .withActionableRemediation(
                        new ActionableRemediation()
                            .withState(ActionableRemediationState.ENABLED)
                            .withSeverityLevels(Arrays.asList("High"))
                            .withCategories(Arrays.asList(RuleCategory.SECRETS))
                            .withBranchConfiguration(new TargetBranchConfiguration().withNames(Arrays.asList("main")))))
            .create();
    }
}


text:
// #define QUICKTEST

#if QUICKTEST

public class DoorHint : FakeStepByStepTutorial { }

#else

public class DoorHint : StepByStepTutorial
{
    private const string _textKeyPrefix = _genericTextKeyPrefix + "DOOR.";
    protected override string textKeyPrefix
    {
        get
        {
            return _textKeyPrefix;
        }
    }
    private const int _stepCount = 1;
    protected override int stepCount
    {
        get
        {
            return _stepCount;
        }
    }
    private string[] _focusObjects = new string[_stepCount] {
        _bacterium
        };
    protected override string[] focusObjects
    {
        get
        {
            return _focusObjects;
        }
    }
}
#endif


text:
<!DOCTYPE html>

    <title>spa</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1">

    <link rel="stylesheet" href="bootstrap3/css/bootstrap.min.css">
    <link rel="stylesheet" href="bootstrap3/css/bootstrap-theme.min.css">

Golo powered


text:
(based off of ESP8266 I2S WS2812 Driver)

This project is based off of the I2S interface for the mp3 player found here:
https://github.com/espressif/esp8266_mp3_decoder/

If you want more information about the build environment, etc.  You should
check out the regular WS2812 driver, found here: https://github.com/cnlohr/ws2812esp8266

WARNING: This subproject is very jankey!  It's about stable, but I don't think it's quite there yet.

## Hardware Connection

Unfortunately the I2S Out (WS2812 in) pin is the same as RX1 (pin 25), which means if you are programming via the UART, it'll need to be unplugged any time you're testing.  The positive side of this is that it is a pin that is exposed on most ESP8266 breakout boards.

The audio data is taken from TOUT, but must be kept between 0 and 1V.


text:
package net.floodlightcontroller.core.internal;

import static org.easymock.EasyMock.anyObject;
import static org.easymock.EasyMock.eq;
import static org.easymock.EasyMock.expect;
import static org.easymock.EasyMock.expectLastCall;
import static org.easymock.EasyMock.replay;
import static org.easymock.EasyMock.reset;
import static org.easymock.EasyMock.verify;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.junit.Assert.assertThat;

import java.util.Collections;
import java.util.EnumSet;
import java.util.List;

import net.floodlightcontroller.core.IOFSwitch;
import net.floodlightcontroller.core.IOFSwitch.SwitchStatus;
import org.hamcrest.CoreMatchers;
import org.hamcrest.Matchers;
import org.junit.Test;

import net.floodlightcontroller.core.IOFSwitchBackend;
import net.floodlightcontroller.core.SwitchDescription;
import net.floodlightcontroller.core.internal.OFSwitchHandshakeHandler.WaitAppHandshakeState;
import net.floodlightcontroller.core.internal.OFSwitchHandshakeHandler.WaitTableFeaturesReplyState;

import org.projectfloodlight.openflow.protocol.OFCapabilities;
import org.projectfloodlight.openflow.protocol.OFControllerRole;
import org.projectfloodlight.openflow.protocol.OFDescStatsReply;
import org.projectfloodlight.openflow.protocol.OFFactories;
import org.projectfloodlight.openflow.protocol.OFFactory;
import org.projectfloodlight.openflow.protocol.OFFeaturesReply;
import org.projectfloodlight.openflow.protocol.OFMessage;
import org.projectfloodlight.openflow.protocol.OFPortDesc;
import org.projectfloodlight.openflow.protocol.OFPortDescStatsReply;
import org.projectfloodlight.openflow.protocol.OFPortDescStatsRequest;
import org.projectfloodlight.openflow.protocol.OFRoleReply;
import org.projectfloodlight.openflow.protocol.OFRoleRequest;
import org.projectfloodlight.openflow.protocol.OFTableFeaturesStatsReply;
import org.projectfloodlight.openflow.protocol.OFTableFeaturesStatsRequest;
import org.projectfloodlight.openflow.protocol.OFVersion;
import org.projectfloodlight.openflow.types.DatapathId;
import org.projectfloodlight.openflow.types.OFAuxId;
import org.projectfloodlight.openflow.types.OFPort;

import com.google.common.collect.ImmutableList;
import org.projectfloodlight.openflow.types.TableId;

public class OFSwitchHandshakeHandlerVer13Test extends OFSwitchHandlerTestBase {

    @Override
    public OFFactory getFactory() {
        return OFFactories.getFactory(OFVersion.OF_13);
    }

    @Override
    OFFeaturesReply getFeaturesReply() {
        return factory.buildFeaturesReply()
                .setDatapathId(dpid)
                .setNBuffers(1)
                .setNTables((short)1)
                .setCapabilities(EnumSet.<OFCapabilities>of(OFCapabilities.FLOW_STATS, OFCapabilities.TABLE_STATS))
                .setAuxiliaryId(OFAuxId.MAIN)
                .build();
    }

    OFPortDescStatsReply getPortDescStatsReply() {
        OFPortDesc portDesc = factory.buildPortDesc()
                .setName("Eth1")
                .setPortNo(OFPort.of(1))
                .build();
        return factory.buildPortDescStatsReply()
            .setEntries(ImmutableList.<OFPortDesc>of(portDesc))
            .build();
    }

    /** Move the channel from scratch to WAIT_CONFIG_REPLY state
     * Builds on moveToWaitFeaturesReply
     * adds testing for WAIT_FEATURES_REPLY state
     */
    @Test
    public void moveToWaitPortDescStatsReply() throws Exception {
        testInitState();

        switchHandler.beginHandshake();

        OFMessage msg = connection.retrieveMessage();
        assertThat(msg, CoreMatchers.instanceOf(OFPortDescStatsRequest.class));
        verifyUniqueXids(msg);

        assertThat(switchHandler.getStateForTesting(), CoreMatchers.instanceOf(OFSwitchHandshakeHandler.WaitPortDescStatsReplyState.class));
    }

    @Override
    void moveToPreConfigReply() throws Exception {
        moveToWaitPortDescStatsReply();
        switchHandler.processOFMessage(getPortDescStatsReply());
    }

    public void handleDescStatsAndCreateSwitch() throws Exception {
        // build the stats reply
        OFDescStatsReply sr = createDescriptionStatsReply();

        reset(sw);
        SwitchDescription switchDescription = new SwitchDescription(sr);
        setupSwitchForInstantiationWithReset();
        sw.setPortDescStats(anyObject(OFPortDescStatsReply.class));
        expectLastCall().once();

        expect(sw.getOFFactory()).andReturn(factory).anyTimes();
        replay(sw);

        reset(switchManager);
        expect(switchManager.getHandshakePlugins()).andReturn(plugins).anyTimes();
        expect(
               switchManager.getOFSwitchInstance(anyObject(OFConnection.class),
                                              eq(switchDescription),
                                              anyObject(OFFactory.class),
                                              anyObject(DatapathId.class))).andReturn(sw).once();
        expect(switchManager.getNumRequiredConnections()).andReturn(1).anyTimes();
        switchManager.switchAdded(sw);
        expectLastCall().once();
        replay(switchManager);

        // send the description stats reply
        switchHandler.processOFMessage(sr);

        OFMessage msg = connection.retrieveMessage();
        assertThat(msg, CoreMatchers.instanceOf(OFTableFeaturesStatsRequest.class));
        verifyUniqueXids(msg);

        verify(sw, switchManager);
    }

    @SuppressWarnings("unchecked")
	public void handleTableFeatures(boolean subHandShakeComplete) throws Exception {
    	// build the table features stats reply
    	OFTableFeaturesStatsReply tf = createTableFeaturesStatsReply();

    	reset(sw);
    	sw.startDriverHandshake();
        expectLastCall().once();
        expect(sw.isDriverHandshakeComplete()).andReturn(subHandShakeComplete).once();
    	sw.processOFTableFeatures(anyObject(List.class));
    	expectLastCall().once();
    	expect(sw.getOFFactory()).andReturn(factory).anyTimes();
    	replay(sw);

    	switchHandler.processOFMessage(tf);
    }

    @Test
    public void moveToWaitTableFeaturesReplyState() throws Exception {
    	moveToWaitDescriptionStatReply();
    	handleDescStatsAndCreateSwitch();

        assertThat(switchHandler.getStateForTesting(),
                   CoreMatchers.instanceOf(WaitTableFeaturesReplyState.class));
    }

    @Test
    @Override
    public void moveToWaitAppHandshakeState() throws Exception {
    	moveToWaitTableFeaturesReplyState();
    	handleTableFeatures(true);

        assertThat(switchHandler.getStateForTesting(),
                   CoreMatchers.instanceOf(WaitAppHandshakeState.class));
    }

    @Override
    Class<?> getRoleRequestClass() {
        return OFRoleRequest.class;
    }

    @Override
    public void verifyRoleRequest(OFMessage m, OFControllerRole expectedRole) {
        assertThat(m, CoreMatchers.instanceOf(OFRoleRequest.class));
        OFRoleRequest roleRequest = (OFRoleRequest) m;
        assertThat(roleRequest.getRole(), equalTo(expectedRole));
    }

    @Override
    protected OFMessage getRoleReply(long xid, OFControllerRole role) {
        OFRoleReply roleReply = factory.buildRoleReply()
                .setXid(xid)
                .setRole(role)
                .build();
        return roleReply;
    }

    @Override
    @Test
    public void moveToWaitInitialRole() throws Exception {
    	moveToWaitAppHandshakeState();
        assertThat(switchHandler.getStateForTesting(), CoreMatchers.instanceOf(WaitAppHandshakeState.class));

        reset(sw);
        expect(sw.getAttribute(IOFSwitchBackend.SWITCH_SUPPORTS_NX_ROLE)).andReturn(true).anyTimes();
        replay(sw);

        reset(roleManager);
        expect(roleManager.getOFControllerRole()).andReturn(OFControllerRole.ROLE_MASTER).anyTimes();
        roleManager.notifyControllerConnectionUpdate();
        expectLastCall().once();
        replay(roleManager);

        WaitAppHandshakeState state = (WaitAppHandshakeState) switchHandler.getStateForTesting();
        state.enterNextPlugin();

        // Expect wait initial role's enterState message to be written
        OFMessage msg = connection.retrieveMessage();
        assertThat(msg, CoreMatchers.instanceOf(OFRoleRequest.class));
        verifyUniqueXids(msg);

        assertThat(switchHandler.getStateForTesting(), CoreMatchers.instanceOf(OFSwitchHandshakeHandler.WaitInitialRoleState.class));
    }

    @Override
    @Test
    public void moveToWaitSwitchDriverSubHandshake() throws Exception {
        moveToWaitTableFeaturesReplyState();
        handleTableFeatures(false); //TODO

        assertThat(switchHandler.getStateForTesting(), CoreMatchers.instanceOf(OFSwitchHandshakeHandler.WaitSwitchDriverSubHandshakeState.class));
        assertThat("Unexpected message captured", connection.getMessages(), Matchers.empty());
        verify(sw);
    }

    @Test
    public void testSetupDefaultRules() throws Exception {
        OFMessage reply = switchToMasterStateTransition();
        expect(sw.getTables()).andReturn(Collections.EMPTY_LIST).once();
        expect(sw.getNumTables()).andReturn((short) 0).once();
        replay(sw);

        /* Go into the MasterState */
        boolean setupDefaultFlowOption = OFSwitchManager.setupTablesDefaultFlows;
        try {
            OFSwitchManager.setupTablesDefaultFlows = true;
            switchHandler.processOFMessage(reply);
        } finally {
            OFSwitchManager.setupTablesDefaultFlows = setupDefaultFlowOption;
        }

        assertThat(switchHandler.getStateForTesting(),
                CoreMatchers.instanceOf(OFSwitchHandshakeHandler.MasterState.class));
    }

    @Test
    public void testDoNotSetupDefaultRules() throws Exception {
        OFMessage reply = switchToMasterStateTransition();
        replay(sw);

        /* Go into the MasterState */
        boolean setupDefaultFlowOption = OFSwitchManager.setupTablesDefaultFlows;
        try {
            OFSwitchManager.setupTablesDefaultFlows = false;
            switchHandler.processOFMessage(reply);
        } finally {
            OFSwitchManager.setupTablesDefaultFlows = setupDefaultFlowOption;
        }

        assertThat(switchHandler.getStateForTesting(),
                CoreMatchers.instanceOf(OFSwitchHandshakeHandler.MasterState.class));
    }

    private OFMessage switchToMasterStateTransition() throws Exception {
        // first, move us to WAIT_INITIAL_ROLE_STATE
        moveToWaitInitialRole();

        // Set the role
        long xid = setupSwitchSendRoleRequestAndVerify(null, OFControllerRole.ROLE_MASTER);
        assertThat(switchHandler.getStateForTesting(),
                CoreMatchers.instanceOf(OFSwitchHandshakeHandler.WaitInitialRoleState.class));

        // prepare mocks and inject the role reply message
        reset(sw);
        expect(sw.getOFFactory()).andReturn(factory).anyTimes();
        expect(sw.write(anyObject(OFMessage.class))).andReturn(true).anyTimes();
        expect(sw.write(anyObject(Iterable.class))).andReturn(Collections.EMPTY_LIST).anyTimes();
        sw.setAttribute(IOFSwitch.SWITCH_SUPPORTS_NX_ROLE, true);
        expectLastCall().once();
        sw.setControllerRole(OFControllerRole.ROLE_MASTER);
        expectLastCall().once();
        expect(sw.getStatus()).andReturn(SwitchStatus.HANDSHAKE).once();
        sw.setStatus(SwitchStatus.MASTER);
        expectLastCall().once();

        if (factory.getVersion().compareTo(OFVersion.OF_13) >= 0) {
            //expect(sw.getMaxTableForTableMissFlow()).andReturn(TableId.ZERO).times(1);
            expect(sw.getTableFeatures(TableId.ZERO))
                    .andReturn(TableFeatures.of(createTableFeaturesStatsReply().getEntries().get(0))).anyTimes();
        }

        reset(switchManager);
        switchManager.switchStatusChanged(sw, SwitchStatus.HANDSHAKE, SwitchStatus.MASTER);
        expectLastCall().once();
        replay(switchManager);
        return getRoleReply(xid, OFControllerRole.ROLE_MASTER);
    }
}


text:
title: Intelligente Suche & Entdeckung (ehemals Delve)
inshort: Mitarbeiter-Profil & Inhalt-Entdeckung
translator: Microsoft Cognitive Services
---

Office Delve ist eine kombinierte Mitarbeiter Profil Seite und Inhalt-Entdeckung
Werkzeug.

Die Profil-Seite bietet Informationen über jeden Mitarbeiter in der
Systems, einschließlich ihren Namen, Telefonnummer, Bürostandort, e-Mail,
Manager, etc., die in der Regel durch die Office 365 aufgefüllt werden
Administrator. Eine rudimentäre Organigramm ist ebenfalls enthalten.

Die Profil-Seite bietet aber auch Raum für Sie mehr hinzufügen
persönliche Informationen über sich selbst, wie Ihre Alma Mater, die Fähigkeiten, die Vergangenheit
Projekte, Interessen und anderen persönlichen Informationen. Tauchen Sie ein eignet sich für
Suche nach Personen basierend auf ihre Fähigkeiten und Erfahrungen in einem Unternehmen
ohne zu wissen, diejenigen Personen vor, sie zu finden.

Der Content-Discovery Teil Delve zeigt Dateien in Office 365
(in der Regel aus SharePoint Online und OneDrive für Unternehmen) sind, die
für Sie relevant. Dateien bearbeitet oder von Ihren Kollegen geöffnet und
Sie arbeiten mit Einzelpersonen werden vorgeschlagen als möglicherweise relevante Grundlage
Ihre Verbindung zu den Menschen.

Tauchen kann nicht freigegeben werden, mit anderen Nutzern und jede Person, die Erfahrung
mit Delve ist einzigartig, ähnlich wie Ihre Erfahrungen auf Facebook und
LinkedIn. Sie werden nur angezeigt, haben Sie bereits Zugang zu Inhalten.
Tauchen bietet keine zusätzlichen Zugriff auf Inhalte, die Sie nicht sehen.

Tauchen ist eines jener Dinge, die man am besten dran Herumspielen mit zu
wirklich zu verstehen. Es ist ein Werkzeug, dass einige abschütteln, während andere Fragen sich
wie sie ohne sie gelebt. Unabhängig von Ihrem Interesse sollten Sie
immer aktualisieren Sie Ihr Profil mit relevanten Fähigkeiten und Erfahrungen so anderen
finden Sie Hilfe bei Bedarf.

Ressourcen
---------

-[Was ist Office
    Delve?](https://support.office.com/en-us/article/What-is-Office-Delve-1315665a-c6af-4409-a28d-49f8916878ca)
    \[Microsoft\]

-[Fünf gute Gründe für Büro Liebe
    Tauchen Sie ein](https://sharepointmaven.com/5-reasons-love-new-office-365-delve/)
    \[SharePoint Maven\]

Ähnliche Anwendungen
--------------------

-Facebook und LinkedIn

Feedback
---------

-[Vertiefen UserVoice](https://office365.uservoice.com/forums/273487-delve)
    \[UserVoice\]

-[Tauchen auf TechCommunity](https://techcommunity.microsoft.com/t5/Delve/ct-p/OfficeDelve)
    \[Microsoft\]

Autor
---------

-[Matt Wade](https://www.linkedin.com/in/thatmattwade/), Office Services MVP


text:
package com.yahoo.athenz.zts.store.impl;

import java.io.File;
import java.security.PrivateKey;

import com.yahoo.athenz.zts.store.ChangeLogStore;
import com.yahoo.athenz.zts.store.ChangeLogStoreFactory;
import com.yahoo.athenz.zts.store.CloudStore;

public class ZMSFileChangeLogStoreFactory implements ChangeLogStoreFactory {

    private static final String ZTS_DATA_STORE = "zts_store";

    public ChangeLogStore create(String ztsHomeDir, PrivateKey privateKey,
            String privateKeyId, CloudStore cloudStore) {

        return new ZMSFileChangeLogStore(ztsHomeDir + File.separator + ZTS_DATA_STORE, privateKey,
                privateKeyId);
    }
}


text:
const winston = require('winston')
var logger = new (winston.Logger)({
    transports: [
        new winston.transports.Console(),
        new winston.transports.File({ filename: './log.txt' })
    ]
})
const ipInfo = require("ipinfo");
exports.run = function (client, message, args, args2, cmd) {
    const config = require("../config.json");
    const Discord = require('discord.js');
    var guild = message.guild;
    if (message.author.id === config.owner) {

        let user = message.author;
        ipInfo((err, cLoc) => {
            const embed = new Discord.RichEmbed()
                .setTitle("PowerBot's Host's IP Information - PowerBot Does NOT Log IP Addresses")
                .setColor("36393E")
                .setTimestamp()
                .addField('IP', cLoc.ip)
                .addField('Host', cLoc.hostname)
                .addField('City', cLoc.city)
                .addField('Region', cLoc.region)
                .addField('Country', cLoc.country)
                .addField('Location Cords', cLoc.loc)
                .addField('Postal/Zip Code', cLoc.postal)
                .addField('ISP/Organization', cLoc.org)
            user.send({ embed: embed })

        })
        logger.log('info', `gethostip command used by ${message.author.tag} ID: ${message.author.id} Time: ${Date()} Guild: ${guild}`)
    }

}


text:
<?php

/**
 * Contactlab template model resource newsletter subscriber collection.
 */
class Contactlab_Template_Model_Resource_Customer_Collection extends Mage_Customer_Model_Resource_Customer_Collection {
    /**
     * Get the real size.
     * @return int
     */
    public function getRealSize() {
        $sql = $this->getSelectCountSql();
        return $this->getConnection()->fetchOne($sql, $this->_bindParams);
    }
}


text:
package jsonprocessorconflictstrategy

import "strings"

// https://github.com/elastic/elasticsearch-specification/blob/4ca0cc05d3ae3fa06c2cd7be91905b656a474334/specification/ingest/_types/Processors.ts#L279-L284
type JsonProcessorConflictStrategy struct {
	Name string
}

var (
	Replace = JsonProcessorConflictStrategy{"replace"}

	Merge = JsonProcessorConflictStrategy{"merge"}
)

func (j JsonProcessorConflictStrategy) MarshalText() (text []byte, err error) {
	return []byte(j.String()), nil
}

func (j *JsonProcessorConflictStrategy) UnmarshalText(text []byte) error {
	switch strings.ToLower(string(text)) {

	case "replace":
		*j = Replace
	case "merge":
		*j = Merge
	default:
		*j = JsonProcessorConflictStrategy{string(text)}
	}

	return nil
}

func (j JsonProcessorConflictStrategy) String() string {
	return j.Name
}


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

<title>com.centurylink.cloud.sdk.base.services.dsl.domain.queue.job.future (sdk 1.2.2 API)</title>
<meta name="date" content="2016-01-06">
<link rel="stylesheet" type="text/css" href="../../../../../../../../../../../stylesheet.css" title="Style">

com.centurylink.cloud.sdk.base.services.dsl.domain.queue.job.future

Interfaces

JobFuture

Classes

AbstractSingleJobFuture

NoWaitingJobFuture

ParallelJobsFuture

SequentialJobsFuture

SingleJobFuture


text:
<?php

namespace Herald\Client\Command;

use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Herald\Client\Message;

class MessageListCommand extends BaseCommand
{
    protected function configure()
    {
        $this
            ->setName('message:list')
            ->setDescription('List recently sent messages for this herald account')
        ;
        parent::configure();
    }

    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $c = $this->getClient($input);
        $messages = $c->getMessages();
        print_r($messages);
    }
}


text:
/*  Bluetooth Mesh */

/*
 * Copyright (c) 2017 Intel Corporation
 *
 * SPDX-License-Identifier: Apache-2.0
 */

/* Maximum advertising data payload for a single data type */
#define BT_MESH_ADV_DATA_SIZE 29

/* The user data is a pointer (4 bytes) to struct bt_mesh_adv */
#define BT_MESH_ADV_USER_DATA_SIZE 4

#define BT_MESH_ADV(buf) (*(struct bt_mesh_adv **)net_buf_user_data(buf))

#define BT_MESH_ADV_SCAN_UNIT(_ms) ((_ms) * 8 / 5)
#define BT_MESH_SCAN_INTERVAL_MS 30
#define BT_MESH_SCAN_WINDOW_MS   30

enum bt_mesh_adv_type {
	BT_MESH_ADV_PROV,
	BT_MESH_ADV_DATA,
	BT_MESH_ADV_BEACON,
	BT_MESH_ADV_URI,

	BT_MESH_ADV_TYPES,
};

typedef void (*bt_mesh_adv_func_t)(struct net_buf *buf, uint16_t duration,
				   int err, void *user_data);

struct bt_mesh_adv {
	const struct bt_mesh_send_cb *cb;
	void *cb_data;

	uint8_t      type:2,
		  busy:1;
	uint8_t      xmit;
};

typedef struct bt_mesh_adv *(*bt_mesh_adv_alloc_t)(int id);

extern struct k_fifo bt_mesh_adv_queue;

/* Lookup table for Advertising data types for bt_mesh_adv_type: */
extern const uint8_t bt_mesh_adv_type[BT_MESH_ADV_TYPES];

/* xmit_count: Number of retransmissions, i.e. 0 == 1 transmission */
struct net_buf *bt_mesh_adv_create(enum bt_mesh_adv_type type, uint8_t xmit,
				   k_timeout_t timeout);

struct net_buf *bt_mesh_adv_create_from_pool(struct net_buf_pool *pool,
					     bt_mesh_adv_alloc_t get_id,
					     enum bt_mesh_adv_type type,
					     uint8_t xmit, k_timeout_t timeout);

void bt_mesh_adv_send(struct net_buf *buf, const struct bt_mesh_send_cb *cb,
		      void *cb_data);

void bt_mesh_adv_update(void);

void bt_mesh_adv_init(void);

int bt_mesh_scan_enable(void);

int bt_mesh_scan_disable(void);

int bt_mesh_adv_enable(void);

void bt_mesh_adv_buf_ready(void);

int bt_mesh_adv_start(const struct bt_le_adv_param *param, int32_t duration,
		      const struct bt_data *ad, size_t ad_len,
		      const struct bt_data *sd, size_t sd_len);

static inline void bt_mesh_adv_send_start(uint16_t duration, int err,
					  const struct bt_mesh_send_cb *cb,
					  void *cb_data)
{
	if (cb && cb->start) {
		cb->start(duration, err, cb_data);
	}
}

static inline void bt_mesh_adv_send_end(
	int err, const struct bt_mesh_send_cb *cb, void *cb_data)
{
	if (cb && cb->end) {
		cb->end(err, cb_data);
	}
}


text:
require 'spec_helper'

module OpenStax
  module Accounts
    RSpec.describe CurrentUserManager do
      let(:account) do
        FactoryBot.create(
          :openstax_accounts_account,
          username: 'some_user',
          uuid: "f0cb40a7-d644-41ed-ba93-9fccfad72ffd",
          openstax_uid: 1
        )
      end
      let!(:user)    { User.create(account: account) }

      let(:request) { ::ActionController::TestRequest.create(host: 'localhost') }

      let(:session) { request.session }

      let(:cookies) { ActionDispatch::Cookies::CookieJar.new(request) }

      let(:current_user_manager) { CurrentUserManager.new(request, session, cookies) }

      context 'signing in' do

        it 'signs in an account' do
          expect(current_user_manager.signed_in?).to eq(false)
          expect(current_user_manager.current_account).to eq(AnonymousAccount.instance)
          expect(current_user_manager.current_user).to eq(AnonymousUser.instance)

          current_user_manager.sign_in!(account)

          expect(current_user_manager.signed_in?).to eq(true)
          expect(current_user_manager.current_account).to eq(account)
          expect(current_user_manager.current_user).to eq(user)
        end

        it 'signs in a user' do
          expect(current_user_manager.signed_in?).to eq(false)
          expect(current_user_manager.current_account).to eq(AnonymousAccount.instance)
          expect(current_user_manager.current_user).to eq(AnonymousUser.instance)

          current_user_manager.sign_in!(user)

          expect(current_user_manager.signed_in?).to eq(true)
          expect(current_user_manager.current_account).to eq(account)
          expect(current_user_manager.current_user).to eq(user)
        end

      end

      context 'from session' do

        before(:each) { current_user_manager.sign_in!(account) }

        it 'keeps a legitimate user signed in' do
          expect(current_user_manager.signed_in?).to eq(true)
          expect(current_user_manager.current_account).to eq(account)
          expect(current_user_manager.current_user).to eq(user)

          # Secure cookies are not sent with non-SSL requests
          current_user_manager = CurrentUserManager.new(request, session, cookies)

          expect(current_user_manager.signed_in?).to eq(true)
          expect(current_user_manager.current_account).to eq(account)
          expect(current_user_manager.current_user).to eq(user)

          # But they are sent with SSL requests
          expect(request).to receive(:ssl?).at_least(:once).and_return(true)
          current_user_manager = CurrentUserManager.new(request, session, cookies)

          expect(current_user_manager.signed_in?).to eq(true)
          expect(current_user_manager.current_account).to eq(account)
          expect(current_user_manager.current_user).to eq(user)
        end

        it 'signs out an attacker attempting to hijack the session' do
          expect(current_user_manager.signed_in?).to eq(true)
          expect(current_user_manager.current_account).to eq(account)
          expect(current_user_manager.current_user).to eq(user)

          # The protection relies on the attacker not being
          # able to get the secure cookies
          cookies.delete(:secure_account_id)

          # The attacker can still access non-SSL pages
          current_user_manager = CurrentUserManager.new(request, session, cookies)

          expect(current_user_manager.signed_in?).to eq(true)
          expect(current_user_manager.current_account).to eq(account)
          expect(current_user_manager.current_user).to eq(user)

          # But not SSL pages
          expect(request).to receive(:ssl?).at_least(:once).and_return(true)
          current_user_manager = CurrentUserManager.new(request, session, cookies)

          expect(current_user_manager.signed_in?).to eq(false)
          expect(current_user_manager.current_account).to eq(AnonymousAccount.instance)
          expect(current_user_manager.current_user).to eq(AnonymousUser.instance)

          # And after they logout, that's it
          current_user_manager = CurrentUserManager.new(request, session, cookies)

          expect(current_user_manager.signed_in?).to eq(false)
          expect(current_user_manager.current_account).to eq(AnonymousAccount.instance)
          expect(current_user_manager.current_user).to eq(AnonymousUser.instance)
        end

      end

      context 'using sso' do
        before do
          request.cookies['ox'] = "eEkxbm4zQ1kzaG9oWnFFVCs1amV0ajRxYlBXc0NScDFueTFPU1FqSDRtZ3ZlcWFQbVk2SEx6UGtQYVcvMld5aWhYL05TVDJOV3Zjb2x3ZHlkNUdCck5hdGw0bk0vSW0xTFQwdjRlTE1Vcnk0NmNqQWdEbUV5YmE2dkdWdk9UNk1tc3pEdWFMc3Bob0NvWk5QMXhGNUt6U3A1SmhhOGVsajlnN1l0a1dFZlhFQndvYk4wd0wyQTljZ3haMnk5S0EwaXA4SkNQRDRpUUhLK1crTXA0clNhcWp1bUhCajdjUExEdEVYSVVSTWsrN2t2ek9XcEVqVURQeXkxZndLNHFSUlNPRVQ5T3kzZ3MwRWNrbmRhOVY4a29DdXlEWkc4L3V5S0JmVi9jTWk1b1NjUmsvNXN1VG80b0UvNU90ZGUxcnJMV0xIay9MZ1FrWkJYZGw0U2UzM093PT0tLWRiNDU3Unc3MTJPZDQxSzlLQVM0aEE9PQ==--3684c383b8b6d2b073f8f31fe3a58a583fed74bf"
        end

        it 'signs in a user' do
          expect(current_user_manager.signed_in?).to eq(true)
          expect(current_user_manager.current_account.attributes).to include(
            {
              openstax_uid: 1,
              username: 'some_user',
              uuid: "f0cb40a7-d644-41ed-ba93-9fccfad72ffd",
            }.stringify_keys
          )
        end

        context 'with an invalid sso cookie' do
          before      do
            expect(OpenStax::Accounts.configuration).to(
              receive(:sso_secret_key).once.and_return 'a-bad-secret-key'
            )
            OpenStax::Accounts::Sso.send :reset_config
          end
          after(:all) { OpenStax::Accounts::Sso.send :reset_config }

          it 'is ignored' do
            expect(current_user_manager.signed_in?).to eq(false)
          end
        end

      end

      context 'signing out' do

        before(:each) { current_user_manager.sign_in!(account) }

        it 'signs out users' do
          expect(current_user_manager.signed_in?).to eq(true)
          expect(current_user_manager.current_account).to eq(account)
          expect(current_user_manager.current_user).to eq(user)

          current_user_manager.sign_out!

          expect(current_user_manager.signed_in?).to eq(false)
          expect(current_user_manager.current_account).to eq(AnonymousAccount.instance)
          expect(current_user_manager.current_user).to eq(AnonymousUser.instance)
        end

      end

    end
  end
end


text:
package com.hiwata.NativeDialog;

public class JavaNativeListener {
	private long mDelegate;
    public JavaNativeListener(long delegate){
        this.mDelegate = delegate;
    }
	public native void onNativeSuccess(long delegate);

	public void onSuccess(){
		onNativeSuccess(this.mDelegate);
    }

}