text:
package org.jenkinsci.plugins.awsbeanstalkpublisher;

import java.util.ArrayList;
import java.util.List;

import hudson.Extension;
import hudson.Launcher;
import hudson.Util;
import hudson.init.InitMilestone;
import hudson.init.Initializer;
import hudson.model.BuildListener;
import hudson.model.AbstractBuild;
import hudson.model.AbstractProject;
import hudson.model.Items;
import hudson.model.Saveable;
import hudson.tasks.BuildStepDescriptor;
import hudson.tasks.BuildStepMonitor;
import hudson.tasks.Builder;
import hudson.util.DescribableList;
import net.sf.json.JSONObject;

import org.jenkinsci.plugins.awsbeanstalkpublisher.extensions.AWSEBElasticBeanstalkSetup;
import org.jenkinsci.plugins.awsbeanstalkpublisher.extensions.AWSEBSetup;
import org.jenkinsci.plugins.awsbeanstalkpublisher.extensions.AWSEBSetupDescriptor;
import org.kohsuke.stapler.DataBoundConstructor;
import org.kohsuke.stapler.StaplerRequest;

/**
 * AWS Elastic Beanstalk Deployment
 */
public class AWSEBBuilder extends AWSEBBuilderBackwardsCompatibility {

    @Initializer(before=InitMilestone.PLUGINS_STARTED)
    public static void addAlias() {
        Items.XSTREAM2.addCompatibilityAlias("org.jenkinsci.plugins.awsbeanstalkpublisher.AWSEBDeploymentBuilder", AWSEBBuilder.class);
    }

    @DataBoundConstructor
    public AWSEBBuilder(
            List<AWSEBElasticBeanstalkSetup> extensions) {
        super();
        this.extensions = new DescribableList<>(
                Saveable.NOOP,Util.fixNull(extensions));
    }

    private DescribableList<AWSEBSetup, AWSEBSetupDescriptor> extensions;

    public DescribableList<AWSEBSetup, AWSEBSetupDescriptor> getExtensions() {
        if (extensions == null) {
            extensions = new DescribableList<>(Saveable.NOOP,Util.fixNull(extensions));
        }
        return extensions;
    }

    public Object readResolve() {
        readBackExtensionsFromLegacy();
        return this;
    }

    @Override
    public boolean perform(AbstractBuild<?, ?> build, Launcher launcher, BuildListener listener) {
        return AWSEBSetup.perform(build, launcher, listener, getExtensions());
    }

    public BuildStepMonitor getRequiredMonitorService() {
        return BuildStepMonitor.NONE;
    }

    // Overridden for better type safety.
    // If your plugin doesn't really define any property on Descriptor,
    // you don't have to do this.
    @Override
    public DescriptorImpl getDescriptor() {
        return (DescriptorImpl) super.getDescriptor();
    }

    @Extension
    public static final class DescriptorImpl extends BuildStepDescriptor<Builder> {

        @SuppressWarnings("rawtypes")
        public boolean isApplicable(Class<? extends AbstractProject> aClass) {
            // Indicates that this builder can be used with all kinds of project types
            return true;
        }

        /**
         * This human readable name is used in the configuration screen.
         */
        public String getDisplayName() {
            return "Deploy into AWS Elastic Beanstalk";
        }

        @Override
        public boolean configure(StaplerRequest req, JSONObject json) throws FormException {
            save();
            return super.configure(req, json);
        }

        public List<AWSEBSetupDescriptor> getExtensionDescriptors() {
            List<AWSEBSetupDescriptor> extensions = new ArrayList<>(1);
            extensions.add(AWSEBElasticBeanstalkSetup.getDesc());
            return extensions;
        }

    }

}


text:
package org.apache.cassandra.db;

import java.nio.ByteBuffer;
import java.util.concurrent.TimeUnit;

import com.google.common.annotations.VisibleForTesting;

import org.apache.cassandra.db.filter.DataLimits;
import org.apache.cassandra.index.Index;
import org.apache.cassandra.schema.TableMetadata;
import org.apache.cassandra.utils.MonotonicClock;
import org.apache.cassandra.utils.concurrent.OpOrder;

import static org.apache.cassandra.utils.MonotonicClock.preciseTime;

public class ReadExecutionController implements AutoCloseable
{
    private static final long NO_SAMPLING = Long.MIN_VALUE;

    // For every reads
    private final OpOrder.Group baseOp;
    private final TableMetadata baseMetadata; // kept to sanity check that we have take the op order on the right table

    // For index reads
    private final ReadExecutionController indexController;
    private final WriteContext writeContext;
    private final ReadCommand command;
    static MonotonicClock clock = preciseTime;

    private final long createdAtNanos; // Only used while sampling

    private final RepairedDataInfo repairedDataInfo;
    private int oldestUnrepairedTombstone = Integer.MAX_VALUE;

    ReadExecutionController(ReadCommand command,
                            OpOrder.Group baseOp,
                            TableMetadata baseMetadata,
                            ReadExecutionController indexController,
                            WriteContext writeContext,
                            long createdAtNanos,
                            boolean trackRepairedStatus)
    {
        // We can have baseOp == null, but only when empty() is called, in which case the controller will never really be used
        // (which validForReadOn should ensure). But if it's not null, we should have the proper metadata too.
        assert (baseOp == null) == (baseMetadata == null);
        this.baseOp = baseOp;
        this.baseMetadata = baseMetadata;
        this.indexController = indexController;
        this.writeContext = writeContext;
        this.command = command;
        this.createdAtNanos = createdAtNanos;

        if (trackRepairedStatus)
        {
            DataLimits.Counter repairedReadCount = command.limits().newCounter(command.nowInSec(),
                                                                               false,
                                                                               command.selectsFullPartition(),
                                                                               metadata().enforceStrictLiveness()).onlyCount();
            repairedDataInfo = new RepairedDataInfo(repairedReadCount);
        }
        else
        {
            repairedDataInfo = RepairedDataInfo.NO_OP_REPAIRED_DATA_INFO;
        }
    }

    public ReadExecutionController indexReadController()
    {
        return indexController;
    }

    public WriteContext getWriteContext()
    {
        return writeContext;
    }

    int oldestUnrepairedTombstone()
    {
        return oldestUnrepairedTombstone;
    }

    void updateMinOldestUnrepairedTombstone(int candidate)
    {
        oldestUnrepairedTombstone = Math.min(oldestUnrepairedTombstone, candidate);
    }

    boolean validForReadOn(ColumnFamilyStore cfs)
    {
        return baseOp != null && cfs.metadata.id.equals(baseMetadata.id);
    }

    public static ReadExecutionController empty()
    {
        return new ReadExecutionController(null, null, null, null, null, NO_SAMPLING, false);
    }

    /**
     * Creates an execution controller for the provided command.
     * <p>
     * Note: no code should use this method outside of {@link ReadCommand#executionController} (for
     * consistency sake) and you should use that latter method if you need an execution controller.
     *
     * @param command the command for which to create a controller.
     * @return the created execution controller, which must always be closed.
     */
    @SuppressWarnings("resource") // ops closed during controller close
    static ReadExecutionController forCommand(ReadCommand command, boolean trackRepairedStatus)
    {
        ColumnFamilyStore baseCfs = Keyspace.openAndGetStore(command.metadata());
        ColumnFamilyStore indexCfs = maybeGetIndexCfs(baseCfs, command);

        long createdAtNanos = baseCfs.metric.topLocalReadQueryTime.isEnabled() ? clock.now() : NO_SAMPLING;

        if (indexCfs == null)
            return new ReadExecutionController(command, baseCfs.readOrdering.start(), baseCfs.metadata(), null, null, createdAtNanos, trackRepairedStatus);

        OpOrder.Group baseOp = null;
        WriteContext writeContext = null;
        ReadExecutionController indexController = null;
        // OpOrder.start() shouldn't fail, but better safe than sorry.
        try
        {
            baseOp = baseCfs.readOrdering.start();
            indexController = new ReadExecutionController(command, indexCfs.readOrdering.start(), indexCfs.metadata(), null, null, NO_SAMPLING, false);
            /*
             * TODO: this should perhaps not open and maintain a writeOp for the full duration, but instead only *try*
             * to delete stale entries, without blocking if there's no room
             * as it stands, we open a writeOp and keep it open for the duration to ensure that should this CF get flushed to make room we don't block the reclamation of any room being made
             */
            writeContext = baseCfs.keyspace.getWriteHandler().createContextForRead();
            return new ReadExecutionController(command, baseOp, baseCfs.metadata(), indexController, writeContext, createdAtNanos, trackRepairedStatus);
        }
        catch (RuntimeException e)
        {
            // Note that must have writeContext == null since ReadOrderGroup ctor can't fail
            assert writeContext == null;
            try
            {
                if (baseOp != null)
                    baseOp.close();
            }
            finally
            {
                if (indexController != null)
                    indexController.close();
            }
            throw e;
        }
    }

    private static ColumnFamilyStore maybeGetIndexCfs(ColumnFamilyStore baseCfs, ReadCommand command)
    {
        Index index = command.getIndex(baseCfs);
        return index == null ? null : index.getBackingTable().orElse(null);
    }

    public TableMetadata metadata()
    {
        return baseMetadata;
    }

    public void close()
    {
        try
        {
            if (baseOp != null)
                baseOp.close();
        }
        finally
        {
            if (indexController != null)
            {
                try
                {
                    indexController.close();
                }
                finally
                {
                    writeContext.close();
                }
            }
        }

        if (createdAtNanos != NO_SAMPLING)
            addSample();
    }

    public boolean isTrackingRepairedStatus()
    {
        return repairedDataInfo != RepairedDataInfo.NO_OP_REPAIRED_DATA_INFO;
    }

    @VisibleForTesting
    public ByteBuffer getRepairedDataDigest()
    {
        return repairedDataInfo.getDigest();
    }

    @VisibleForTesting
    public boolean isRepairedDataDigestConclusive()
    {
        return repairedDataInfo.isConclusive();
    }

    public RepairedDataInfo getRepairedDataInfo()
    {
        return repairedDataInfo;
    }

    private void addSample()
    {
        String cql = command.toCQLString();
        int timeMicros = (int) Math.min(TimeUnit.NANOSECONDS.toMicros(clock.now() - createdAtNanos), Integer.MAX_VALUE);
        ColumnFamilyStore cfs = ColumnFamilyStore.getIfExists(baseMetadata.id);
        if (cfs != null)
            cfs.metric.topLocalReadQueryTime.addSample(cql, timeMicros);
    }
}

redpajama_set_name: RedPajamaGithub


text:
var jsdom = require('../../lib/jsdom');
var assert = require('assert');
var http = require('http');
var fs = require('fs');
var path = require('path');
exports.tests = {

  HTMLStyleElement01 : function (test) {
    jsdom.env(
        '',
        jsdom.defaultLevel, function(err, win) {
      var style = win.document.head.lastChild;
      test.equal(1, style.sheet.cssRules.length);
      test.equal('p', style.sheet.cssRules[0].selectorText);
      test.equal('red', style.sheet.cssRules[0].style.color);
      test.done();
    });
  },

  HTMLStyleAttribute01 : function (test) {
    jsdom.env(
        '
',
        jsdom.defaultLevel, function(err, win) {
      var p = win.document.body.lastChild;
      test.equal(2, p.style.length);
      test.equal('color', p.style[0]);
      test.equal('red', p.style.color);
      test.equal('background-color', p.style[1]);
      test.equal('blue', p.style.backgroundColor);
      test.done();
    });
  },

  StylePropertyReflectsStyleAttribute : function (test) {
    jsdom.env(
        '',
        jsdom.defaultLevel, function(err, win) {
      var p = win.document.createElement('p');
      p.setAttribute('style', 'color:red');
      test.equal(1, p.style.length);
      test.equal('color', p.style[0]);
      test.equal('red', p.style.color);
      p.setAttribute('style', '');
      test.equal(0, p.style.length);
      test.equal('', p.style.color);
      p.setAttribute('style', 'color:blue');
      test.equal('color', p.style[0]);
      test.equal('blue', p.style.color);
      test.done();
    });
  },

  StyleAttributeReflectsStyleProperty : function (test) {
    jsdom.env(
        '',
        jsdom.defaultLevel, function(err, win) {
      var p = win.document.createElement('p');
      p.style.setProperty('color', 'red');
      test.equal(p.getAttribute('style'), 'color: red;');
      p.style.setProperty('width', '20px');
      test.equal(p.getAttribute('style'), 'color: red; width: 20px;');
      p.style.removeProperty('color');
      test.equal(p.getAttribute('style'), 'width: 20px;');
      p.style.removeProperty('width');
      test.equal(p.getAttribute('style'), '');
      p.style.cssText = 'background-color: blue; z-index: 12;';
      test.equal(2, p.style.length);
      test.equal('blue', p.style.backgroundColor);
      test.equal('12', p.style.zIndex);
      p.style.removeProperty('z-index');
      test.equal(1, p.style.length);
      p.style.backgroundColor = 'green';
      test.equal('background-color: green;', p.style.cssText);
      test.equal('background-color', p.style.item(0));
      test.done();
    });
  },

  getComputedStyleInline: function(test) {
    jsdom.env(
        '',
        jsdom.defaultLevel, function(err, win) {
          var doc = win.document;
          var html = doc.createElement("html");
          doc.appendChild(html);
          var head = doc.createElement("head");
          html.appendChild(head);
          var style = doc.createElement("style");
          style.innerHTML = "p { display: none; }";
          head.appendChild(style);
          var body = doc.createElement("body");
          html.appendChild(body);
          var p = doc.createElement("p");
          body.appendChild(p);
          p = doc.getElementsByTagName("p")[0];
          var cs = win.getComputedStyle(p);
          test.equal(cs.display, "none", "computed display of p is none");
          test.done();
    });
  },

  ensureExternalStylesheetsAreLoadable : function(test) {
    var css = "body { border: 1px solid #f0f; }";
    var server = http.createServer(function(req, res) {
      res.writeHead(200, {
        'Content-type' : 'text/css',
        'Content-length' : css.length
      });
      res.end(css);
    });

    server.listen(10099);

    jsdom.env(path.resolve(__dirname, 'style/external_css.html'), function(errors, win) {
      test.equal(win.document.errors, null);
      server.close();
      test.done();
    });
  },

  getComputedStyleExternal: function(test) {
    var css = "div { color: red; }";
    var server = http.createServer(function(req, res) {
      res.writeHead(200, {
        'Content-type' : 'text/css',
        'Content-length' : css.length
      });
      res.end(css);
    });

    server.listen(10099);

    var html = fs.readFileSync(path.resolve(__dirname, 'style/getComputedStyleExternal.html'), 'utf8');
    var doc = jsdom.jsdom(html);
    var win = doc.createWindow();
    doc.onload = function () {
      var div = doc.getElementsByTagName("div")[0];
      var style = win.getComputedStyle(div);
      test.equal(style.color, "red", "computed color of div is red");
      server.close();
      test.done();
    };
  },

  getComputedStyleWithBadSelectors: function(test) {
    jsdom.env(
        '',
        jsdom.defaultLevel, function(err, win) {
          var doc = win.document;
          var html = doc.createElement("html");
          doc.appendChild(html);
          var head = doc.createElement("head");
          html.appendChild(head);
          var style = doc.createElement("style");
          style.innerHTML = ";p { display: none; }";
          head.appendChild(style);
          var body = doc.createElement("body");
          html.appendChild(body);
          var p = doc.createElement("p");
          body.appendChild(p);
          p = doc.getElementsByTagName("p")[0];
          test.doesNotThrow(function () {
            win.getComputedStyle(p);
          });
          test.done();
    });
  }
};


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:weightSum="1" android:background="#028ec9" android:padding="12dip">
    <TextView android:id="@+id/textView1" android:layout_height="wrap_content" android:textColor="#ffffff" android:textStyle="bold" android:gravity="center" android:text="Autobahn Broadcast Client" android:layout_width="match_parent" android:paddingBottom="16dip" android:textSize="22dip"></TextView>
    <TextView android:id="@+id/textView2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textAppearance="?android:attr/textAppearanceSmall" android:textColor="@color/lightgrey" android:text="Autobahn Server Hostname / Port"></TextView>
    <LinearLayout android:layout_width="match_parent" android:id="@+id/linearLayout1" android:layout_height="wrap_content">
        <EditText android:id="@+id/hostname" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_weight="1" android:textColor="@color/darkgrey"></EditText>
        <EditText android:id="@+id/port" android:layout_width="match_parent" android:inputType="number" android:layout_height="wrap_content" android:layout_weight="3" android:textColor="@color/darkgrey"></EditText>
    </LinearLayout>
    <Button android:layout_gravity="center" android:layout_margin="16dip" android:id="@+id/start" android:bufferType="editable" android:text="Button" android:layout_width="100dip" android:layout_height="50dip"></Button>
    <TextView
	    android:layout_width="fill_parent"
	    android:layout_height="wrap_content"
	    android:textColor="@color/lightgrey" android:id="@+id/statusline" android:text="Ready." android:textSize="14dip" android:layout_marginBottom="12dip"/>
    <TextView android:id="@+id/textView3" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textAppearance="?android:attr/textAppearanceSmall" android:textColor="@color/lightgrey" android:text="Message to broadcast"></TextView>
    <EditText android:id="@+id/msg" android:layout_width="match_parent" android:textColor="@color/darkgrey" android:text="Hello, world!" android:maxLines="1" android:layout_height="wrap_content"></EditText>
    <Button android:layout_gravity="center" android:layout_margin="16dip" android:id="@+id/sendMsg" android:bufferType="editable" android:text="Send" android:layout_height="50dip" android:layout_width="100dip"></Button>

    <ScrollView
    android:id="@+id/logscroller"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:scrollbars="vertical"
    android:fillViewport="true">

        <TextView
        android:id="@+id/log"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:layout_weight="1.0"/>

    </ScrollView>
<!--
    <TextView android:id="@+id/log" android:textAppearance="?android:attr/textAppearanceSmall" android:textColor="@color/lightgrey" android:text="" android:layout_height="match_parent" android:layout_width="fill_parent" android:scrollbars="vertical" android:maxLines="1000"></TextView>
 -->
</LinearLayout>


text:
package victor.training.eepatterns.singleton;

import javax.annotation.PostConstruct;
import javax.ejb.Singleton;
import javax.ejb.Startup;

@Singleton
@Startup
public class ServiceStarter {

	@PostConstruct
	public void initResources() {
		System.out.println("Execute custom on-deploy initializations");
	}
}


text:
package com.sqlibri;

import com.sqlibri.presenter.AppPresenter;
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.image.Image;
import javafx.stage.Stage;

import java.net.URL;

/** Main class - launches the application */
public class App extends Application {

  // Application Icon
  private final Image ROOT_ICON = new Image(
      getClass().getResource("resources/image/SQLibri-icon.png").toExternalForm());

  // Application title
  private final String TITLE = "SQLibri";

  // Main Layout
  private final URL MAIN_LAYOUT = getClass()
      .getResource("resources/layout/main-layout.fxml");

  @Override
  public void start(Stage primaryStage) {
    try {
      FXMLLoader loader = new FXMLLoader(MAIN_LAYOUT);
      Parent root = loader.load();

      Scene scene = new Scene(root);
      primaryStage.setScene(scene);

      AppPresenter controller = loader.getController();
      controller.init(primaryStage);

      primaryStage.setTitle(TITLE);
      primaryStage.getIcons().add(ROOT_ICON);
      primaryStage.setMaximized(true);
      primaryStage.show();
    } catch (Exception e) {
      e.printStackTrace();
    }
  }

  public static void main(String[] args) {
    launch(args);
  }
}


text:
package main

import (
	"fmt"
	"os"

	"github.com/docker/docker/cli"
	"github.com/docker/docker/daemon/config"
	"github.com/docker/docker/dockerversion"
	"github.com/docker/docker/pkg/jsonmessage"
	"github.com/docker/docker/pkg/reexec"
	"github.com/docker/docker/pkg/term"
	"github.com/moby/buildkit/util/apicaps"
	"github.com/sirupsen/logrus"
	"github.com/spf13/cobra"
)

func newDaemonCommand() (*cobra.Command, error) {
	opts := newDaemonOptions(config.New())

	cmd := &cobra.Command{
		Use:           "dockerd [OPTIONS]",
		Short:         "A self-sufficient runtime for containers.",
		SilenceUsage:  true,
		SilenceErrors: true,
		Args:          cli.NoArgs,
		RunE: func(cmd *cobra.Command, args []string) error {
			opts.flags = cmd.Flags()
			return runDaemon(opts)
		},
		DisableFlagsInUseLine: true,
		Version:               fmt.Sprintf("%s, build %s", dockerversion.Version, dockerversion.GitCommit),
	}
	cli.SetupRootCommand(cmd)

	flags := cmd.Flags()
	flags.BoolP("version", "v", false, "Print version information and quit")
	defaultDaemonConfigFile, err := getDefaultDaemonConfigFile()
	if err != nil {
		return nil, err
	}
	flags.StringVar(&opts.configFile, "config-file", defaultDaemonConfigFile, "Daemon configuration file")
	opts.InstallFlags(flags)
	if err := installConfigFlags(opts.daemonConfig, flags); err != nil {
		return nil, err
	}
	installServiceFlags(flags)

	return cmd, nil
}

func init() {
	if dockerversion.ProductName != "" {
		apicaps.ExportedProduct = dockerversion.ProductName
	}
}

func main() {
	if reexec.Init() {
		return
	}

	// initial log formatting; this setting is updated after the daemon configuration is loaded.
	logrus.SetFormatter(&logrus.TextFormatter{
		TimestampFormat: jsonmessage.RFC3339NanoFixed,
		FullTimestamp:   true,
	})

	// Set terminal emulation based on platform as required.
	_, stdout, stderr := term.StdStreams()

	initLogging(stdout, stderr)

	onError := func(err error) {
		fmt.Fprintf(stderr, "%s\n", err)
		os.Exit(1)
	}

	cmd, err := newDaemonCommand()
	if err != nil {
		onError(err)
	}
	cmd.SetOutput(stdout)
	if err := cmd.Execute(); err != nil {
		onError(err)
	}
}


text:
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) > [sip.js](./sip.js.md) > [Transport](./sip.js.transport.md) > [(constructor)](./sip.js.transport._constructor_.md)

## Transport.(constructor)

Constructs a new instance of the `Transport` class

<b>Signature:</b>

```typescript
constructor(logger: Logger, options?: TransportOptions);
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  logger | Logger |  |
|  options | [TransportOptions](./sip.js.transportoptions.md) |  |


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Boost.Geometry (aka GGL, Generic Geometry Library)</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">

Main Page

Related Pages

Modules

Namespaces

Classes

Files

Examples

File List

File Members

Classes |
Namespaces

/home/travis/build/boostorg/boost/boost/geometry/geometries/helper_geometry.hpp File Reference

Classes

struct  	boost::geometry::detail::helper_geometries::cs_tag_to_coordinate_system< Units, CS_Tag >

struct  	boost::geometry::detail::helper_geometries::cs_tag_to_coordinate_system< Units, geographic_tag >

struct  	boost::geometry::detail::helper_geometries::cs_tag_to_coordinate_system< Units, spherical_equatorial_tag >

struct  	boost::geometry::detail::helper_geometries::cs_tag_to_coordinate_system< Units, spherical_tag >

struct  	boost::geometry::detail::helper_geometries::default_units< Geometry, CS_Tag >

struct  	boost::geometry::detail::helper_geometries::default_units< Geometry, cartesian_tag >

struct  	boost::geometry::detail::helper_geometries::helper_point< Point, NewCoordinateType, NewUnits, CS_Tag >

struct  	boost::geometry::detail_dispatch::helper_geometry< Geometry, NewCoordinateType, NewUnits, Tag >

struct  	boost::geometry::detail_dispatch::helper_geometry< Box, NewCoordinateType, NewUnits, box_tag >

struct  	boost::geometry::detail_dispatch::helper_geometry< Point, NewCoordinateType, NewUnits, point_tag >

struct  	boost::geometry::helper_geometry< Geometry, NewCoordinateType, NewUnits >

Namespaces

namespace  	boost

namespace  	boost::geometry

namespace  	boost::geometry::detail

namespace  	boost::geometry::detail::helper_geometries

namespace  	boost::geometry::detail_dispatch

April 2, 2011

Copyright © 2007-2011 Barend Gehrels, Amsterdam, the Netherlands

Copyright © 2008-2011 Bruno Lalande, Paris, France

Copyright © 2009-2010 Mateusz Loskot, London, UK

<address style="text-align: right;">
Documentation is generated by Doxygen
</address>


text:
package io.fixprotocol.silverflash.transport;

import java.io.IOException;
import java.net.SocketAddress;
import java.nio.channels.SelectionKey;
import java.nio.channels.Selector;
import java.nio.channels.SocketChannel;
import java.util.Objects;
import java.util.concurrent.CompletableFuture;

import io.fixprotocol.silverflash.buffer.BufferSupplier;

/**
 * A client TCP transport
 *
 * @author Don Mendelson
 *
 */
public class TcpConnectorTransport extends AbstractTcpChannel implements Connector {

  private final SocketAddress remoteAddress;
  private CompletableFuture<TcpConnectorTransport> future;

  /**
   * Constructs a TCP client Transport
   *
   * @param selector event demultiplexor
   * @param remoteAddress address to connect to
   */
  public TcpConnectorTransport(Selector selector, SocketAddress remoteAddress) {
    super(selector);
    Objects.requireNonNull(remoteAddress);
    this.remoteAddress = remoteAddress;
  }

  /**
   * Constructs a TCP client Transport
   *
   * @param dispatcher a dedicated dispatcher thread
   * @param remoteAddress address to connect to
   */
  public TcpConnectorTransport(Dispatcher dispatcher, SocketAddress remoteAddress) {
    super(dispatcher);
    Objects.requireNonNull(remoteAddress);
    this.remoteAddress = remoteAddress;
  }

  public CompletableFuture<? extends Transport> open(BufferSupplier buffers,
      TransportConsumer consumer) {
    Objects.requireNonNull(buffers);
    Objects.requireNonNull(consumer);
    this.buffers = buffers;
    this.consumer = consumer;

    future = new CompletableFuture<TcpConnectorTransport>();

    try {
      this.socketChannel = SocketChannel.open();
      configureChannel();
      socketChannel.configureBlocking(true);
      if (selector != null) {
        register(SelectionKey.OP_CONNECT);
      }

      this.socketChannel.connect(remoteAddress);

      if (this.socketChannel.isConnected()) {
        future.complete(this);
        consumer.connected();
      }

      if (dispatcher != null) {
        dispatcher.addTransport(this);
      }

    } catch (IOException ex) {
      future.completeExceptionally(ex);
    }

    return future;
  }

  public void readyToConnect() {
    try {
      socketChannel.finishConnect();
      socketChannel.keyFor(selector).interestOps(SelectionKey.OP_READ);
      future.complete(this);
      consumer.connected();
    } catch (IOException ex) {
      future.completeExceptionally(ex);
    }
  }

}


text:
<?php

use Symfony\Component\HttpKernel\Kernel;
use Symfony\Component\Config\Loader\LoaderInterface;

class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = array(
            new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
            new Symfony\Bundle\SecurityBundle\SecurityBundle(),
            new Symfony\Bundle\TwigBundle\TwigBundle(),
            new Symfony\Bundle\MonologBundle\MonologBundle(),
            new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(),
            new Symfony\Bundle\AsseticBundle\AsseticBundle(),
            new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
            new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
            new Dudek\FormBundle\DudekFormBundle(),
            new Dudek\UserBundle\DudekUserBundle(),
            new FOS\UserBundle\FOSUserBundle(),
            new Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle(),
        );

        if (in_array($this->getEnvironment(), array('dev', 'test'))) {
            $bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle();
            $bundles[] = new Sensio\Bundle\DistributionBundle\SensioDistributionBundle();
            $bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle();
            $bundles[] = new Symfony\Bundle\DebugBundle\DebugBundle();
        }

        return $bundles;
    }

    public function registerContainerConfiguration(LoaderInterface $loader)
    {
        $loader->load(__DIR__.'/config/config_'.$this->getEnvironment().'.yml');
    }
}


text:
import chrome
import Coreftp
import cyberduck
import dotnet
import Filezilla
import ftpnavigator
import Mozilla
import network
import outlook
import putty
import skype
import winscp

class Result():
    def __init__(self):
        pass

    def run(self):
        print '[*] Running password finder'
        ret_list = []

        try:
            print '[*] Finding credentials in Chrome'
            chrome_win = chrome.Chrome()
            ret_list.append("Chrome")
            ret_list.append(chrome_win.run())
        except:
            pass

        try:
            print '[*] Finding credentials in Mozilla'
            moz_illa = Mozilla.Mozilla()
            ret_list.append("Mozilla")
            ret_list.append(moz_illa.run())
        except:
            pass

        try:
            print '[*] Finding Filezilla credentials'
            file_zilla = Filezilla.Filezilla()
            ret_list.append("Filezilla")
            ret_list.append(file_zilla.run())
        except:
            pass

        try:
            print '[*] Finding CoreFTP credentials'
            core_ftp = Coreftp.CoreFTP()
            ret_list.append("CoreFTP")
            ret_list.append(core_ftp.run())
        except:
            pass

        try:
            print '[*] Finding Cyberduck credentials'
            cyber_duck = cyberduck.Cyberduck()
            ret_list.append("Cyberduck")
            ret_list.append(cyber_duck.run())
        except:
            pass

        try:
            print '[*] Finding FtpNavigator credentials'
            ftp_navigator = ftpnavigator.FtpNavigator()
            ret_list.append("FtpNavigator")
            ret_list.append(ftp_navigator.run())
        except:
            pass

        try:
            print '[*] Finding Outlook credentials'
            out_look = outlook.Outlook()
            ret_list.append("Outlook")
            ret_list.append(out_look.run())
        except:
            pass

        try:
            print '[*] Finding Skype credentials'
            skype_ms = skype.Skype()
            ret_list.append("Skype")
            ret_list.append(skype_ms.run())
        except:
            pass

        try:
            print '[*] Finding DotNet credentials'
            d_net = dotnet.Dot_net()
            ret_list.append("DotNet")
            ret_list.append(d_net.run())
        except:
            pass

        try:
            print '[*] Finding Network credentials'
            net_work = network.Network()
            ret_list.append("Network")
            ret_list.append(net_work.run())
        except:
            pass

        try:
            print '[*] Finding Putty credentials'
            putty_cm = putty.Putty()
            ret_list.append("Putty")
            ret_list.append(putty_cm.run())
        except:
            pass

        try:
            print '[*] Finding WinSCP credentials'
            win_scp = winscp.WinSCP()
            ret_list.append("WinSCP")
            ret_list.append(win_scp.run())
        except:
            pass

        print '[*] Returning found passwords'
        return ret_list

# tem = Result()
# slave_info = 'info.txt' #C:\Users\Public\Intel\Logs\
# open_slave_info = open(slave_info, "w")
# open_slave_info.write(str(tem.run()) + "\n")
# open_slave_info.close()


text:
<?php
$smarty = new Smarty();

$smarty->setTemplateDir($basedir.'/templates');
$smarty->setCompileDir($basedir.'/templates_c');
$smarty->setCacheDir($basedir.'/cache');
$smarty->setConfigDir($basedir.'/configs');

$smarty->setCaching(Smarty::CACHING_LIFETIME_SAVED);
$smarty->assign('baseurl', $baseurl);


text:
/*
 * Initial development of the original code was made for the
 * g-Eclipse project founded by European Union
 * project number: FP6-IST-034327  http://www.geclipse.eu/
 *
 * Contributors:
 *    Mateusz Pabis (PSNC) - initial API and implementation
 *    Piter T. de boer - Refactoring to standalone API and bugfixing.
 *    Spiros Koulouzis - Refactoring to standalone API and bugfixing.
 */
package nl.uva.vlet.glite.lfc.internal;

import java.io.DataInputStream;
import java.io.IOException;

import nl.uva.vlet.glite.lfc.LFCError;
import nl.uva.vlet.glite.lfc.LFCServer;

/**
 * Standard LFC Response for methods with return no value (void methods).
 * Uses new CnsMessage class
 * @author Piter T. de Boer
 */
public class CnsVoidResponse
{
	int errorCode=0;

    private CnsMessage voidMessage;

	/**
	 * @return received error code if an error occurred.
	 */
	public int getErrorCode()
	{
		return this.errorCode;
	}

	public void readFrom( final DataInputStream input ) throws IOException
	{
		//int result=0;
		LFCServer.staticLogIOMessage( "Receiving VOID response..." );
		voidMessage=new CnsMessage();

		voidMessage.readHeader(input);
		if (voidMessage.size()!=0)
		{
		    LFCServer.staticLogIOMessage( "Warning VOID message is not EMPTY:size="+voidMessage.size());
		    voidMessage.readBody(input); // should be NULL;
		}

		// check for response type
		if ( voidMessage.isResetSecurityContext() )
		{
			// received RESET CONTEXT request we have an error
			LFCServer.staticLogIOMessage( "ERROR in receiving VOID Response: " + LFCError.getMessage( voidMessage.error()));
			// get error code from size field
			errorCode=voidMessage.error();
		}

		//return result;
	}

    public CnsMessage getMessage()
    {
           return voidMessage;
    }
}


text:
import csv
import os
import tempfile
from datetime import timedelta, date as ddate
from io import BytesIO

from flask import send_file
from flask_restful import Resource, reqparse
from sqlalchemy.util import OrderedDict

from moulinette import clientserializer, testserializer
from moulinette.stats_and_logs.models import *

class LogResource(Resource):
    def __init__(self):
        self.parser = reqparse.RequestParser()
        self.parser.add_argument('summary', type=bool, default=False,
                                 required=False)
        self.parser.add_argument('csv', type=bool, default=False,
                                 required=False)

    def get(self):
        args = self.parser.parse_args()
        if args.get('summary'):
            logs = RequestLog.query.order_by(RequestLog.created).all()

            if len(logs) < 1:
                return {}

            first_d = logs[0].created.date()
            last_d = logs[-1].created.date()

            result = OrderedDict()

            t_date = ddate(first_d.year, first_d.month, first_d.day)
            while t_date != last_d:
                result[str(t_date)] = 0
                t_date += timedelta(days=1)

            for log in logs:
                date = log.created.date()
                sdate = str(date)
                if result.get(sdate):
                    result[sdate] += 1
                else:
                    result[sdate] = 1

            if args.get('csv'):
                csv_tmp = tempfile.NamedTemporaryFile(mode='w+',
                                                      prefix='logs_csv_',
                                                      delete=False)
                csv_writer = csv.writer(csv_tmp)
                csv_writer.writerow(['DATE', 'N_REQUESTS'])

                for k, v in result.items():
                    csv_writer.writerow([k, v])

                csv_tmp.close()

                tmp_send = BytesIO()
                with open(csv_tmp.name, mode='rb') as f:
                    tmp_send.write(f.read())

                tmp_send.seek(0)
                response = send_file(tmp_send, mimetype='text/csv',
                                     as_attachment=True,
                                     attachment_filename='logs.csv')

                os.remove(csv_tmp.name)
                return response

            else:
                return result

        else:
            startdate = datetime.today().date() - timedelta(days=7)
            logs = RequestLog.query.filter(
                RequestLog.created > startdate
            ).all()
            result = []

            for log in logs:
                result.append(
                    {
                        "client_id": clientserializer.dumps(log.client_id),
                        "test_id": testserializer.dumps(log.test_id),
                        "result": log.result,
                        "error": log.error,
                        "timestamp": log.created.isoformat()
                    }
                )

            return {"results": result, "startdate": startdate.isoformat()}


text:
<lifecycleMappingMetadata>
	<pluginExecutions>
		<pluginExecution>
			<pluginExecutionFilter>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-remote-resources-plugin</artifactId>
				<versionRange>[1.6,)</versionRange>
				<goals>
					<goal>bundle</goal>
					<goal>process</goal>
				</goals>
			</pluginExecutionFilter>
			<action>
				<configurator>
					<id>com.eidosmedia.eclipse.maven.resources.remote.Configurator</id>
				</configurator>
			</action>
		</pluginExecution>
	</pluginExecutions>
</lifecycleMappingMetadata>


text:
package com.intellij.openapi.vcs.changes;

import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.Pair;
import com.intellij.openapi.vcs.*;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.util.containers.MultiMap;
import org.jetbrains.annotations.Nullable;

import java.io.File;
import java.util.*;

public class RemoteRevisionsStateCache implements ChangesOnServerTracker {
  private final static long DISCRETE = 3600000;
  // true -> changed
  private final Map<String, Pair<Boolean, VcsRoot>> myChanged;

  private final MultiMap<VcsRoot, String> myQueries;
  private final Map<VcsRoot, Long> myTs;
  private final Object myLock;
  private final ProjectLevelVcsManager myVcsManager;
  private final VcsConfiguration myVcsConfiguration;

  RemoteRevisionsStateCache(final Project project) {
    myVcsManager = ProjectLevelVcsManager.getInstance(project);
    myChanged = new HashMap<String, Pair<Boolean, VcsRoot>>();
    myQueries = new MultiMap<VcsRoot, String>();
    myTs = new HashMap<VcsRoot, Long>();
    myLock = new Object();
    myVcsConfiguration = VcsConfiguration.getInstance(project);
  }

  public void invalidate(final Collection<String> paths) {
    synchronized (myLock) {
      for (String path : paths) {
        myChanged.remove(path);
      }
    }
  }

  @Nullable
  private VirtualFile getRootForPath(final String s) {
    return myVcsManager.getVcsRootFor(new FilePathImpl(new File(s), false));
  }

  public boolean isUpToDate(final Change change) {
    final List<File> files = ChangesUtil.getIoFilesFromChanges(Collections.singletonList(change));
    synchronized (myLock) {
      for (File file : files) {
        final String path = file.getAbsolutePath();
        final Pair<Boolean, VcsRoot> data = myChanged.get(path);
        if (data != null && Boolean.TRUE.equals(data.getFirst())) return false;
      }
    }
    return true;
  }

  public void plus(final Pair<String, AbstractVcs> pair) {
    final VirtualFile root = getRootForPath(pair.getFirst());
    if (root == null) return;
    synchronized (myLock) {
      myQueries.putValue(new VcsRoot(pair.getSecond(), root), pair.getFirst());
    }
  }

  public void minus(Pair<String, AbstractVcs> pair) {
    final VirtualFile root = getRootForPath(pair.getFirst());
    if (root == null) return;
    synchronized (myLock) {
      final VcsRoot key = new VcsRoot(pair.getSecond(), root);
      if (myQueries.containsKey(key)) {
        myQueries.removeValue(key, pair.getFirst());
      }
      myChanged.remove(pair.getFirst());
    }
  }

  public void directoryMappingChanged() {
    // todo will work?
    synchronized (myLock) {
      myChanged.clear();
      myTs.clear();
    }
  }

  public boolean updateStep() {
    final MultiMap<VcsRoot, String> dirty = new MultiMap<VcsRoot, String>();
    final long oldPoint = System.currentTimeMillis() - (myVcsConfiguration.CHANGED_ON_SERVER_INTERVAL > 0 ?
                                                        myVcsConfiguration.CHANGED_ON_SERVER_INTERVAL * 60000 : DISCRETE);

    synchronized (myLock) {
      for (VcsRoot root : myQueries.keySet()) {
        final Collection<String> collection = myQueries.get(root);
        for (String s : collection) {
          dirty.putValue(root, s);
        }
      }
      myQueries.clear();

      final Set<VcsRoot> roots = new HashSet<VcsRoot>();
      for (Map.Entry<VcsRoot, Long> entry : myTs.entrySet()) {
        if (! dirty.get(entry.getKey()).isEmpty()) continue;

        final Long ts = entry.getValue();
        if ((ts == null) || (oldPoint > ts)) {
          roots.add(entry.getKey());
        }
      }
      for (Map.Entry<String, Pair<Boolean, VcsRoot>> entry : myChanged.entrySet()) {
        final VcsRoot vcsRoot = entry.getValue().getSecond();
        if ((! dirty.get(vcsRoot).isEmpty()) || roots.contains(vcsRoot)) {
          dirty.putValue(vcsRoot, entry.getKey());
        }
      }
    }

    if (dirty.isEmpty()) return false;

    final Map<String, Pair<Boolean, VcsRoot>> results = new HashMap<String, Pair<Boolean, VcsRoot>>();
    for (VcsRoot vcsRoot : dirty.keySet()) {
      // todo - actually it means nothing since the only known VCS to use this scheme is Git and now it always allow
      // todo - background operations. when it changes, develop more flexible behavior here
      if (! vcsRoot.getVcs().isVcsBackgroundOperationsAllowed(vcsRoot.getPath())) continue;
      final TreeDiffProvider provider = vcsRoot.getVcs().getTreeDiffProvider();
      if (provider == null) continue;

      final Collection<String> paths = dirty.get(vcsRoot);
      final Collection<String> remotelyChanged = provider.getRemotelyChanged(vcsRoot.getPath(), paths);
      for (String path : paths) {
        results.put(path, new Pair<Boolean, VcsRoot>(remotelyChanged.contains(path), vcsRoot));
      }
    }

    final long curTime = System.currentTimeMillis();
    synchronized (myLock) {
      myChanged.putAll(results);
      for (VcsRoot vcsRoot : dirty.keySet()) {
        myTs.put(vcsRoot, curTime);
      }
    }

    return true;
  }
}


text:
layout: post
title: Commencement speech from Ellen
categories:
- Learning
---

Funny!! and it knocks some sense into you!

<iframe width="560" height="315" src="//www.youtube.com/embed/0JccudODwwY" frameborder="0" allowfullscreen></iframe>


text:
var myLog,
    path          = require('path'),
    configuration = require('./configuration'),
    logsDir       = path.resolve(__dirname + '/../log/') + '/',
    logFileCommon = 'common.log',
    log4js        = require('log4js');

myLog = function myLog(myLogsDir, myLogFileCommon, myLogInstance, l4js) {

    this.logsDir       = myLogsDir;
    this.logFileCommon = myLogFileCommon;
    this.instance      = myLogInstance;

    this.log4js = l4js;
    this.logger = 1;

    this.log = function () {
        if ((typeof this.logger) === 'number') {
            this.log4js.loadAppender('file');
            this.log4js.addAppender(this.log4js.appenders.file(path.resolve(this.logsDir + '/' + this.logFileCommon)), this.instance);
            this.logger = this.log4js.getLogger(this.instance);
            this.logger.setLevel('INFO');
        }
        return this.logger;
    };
};

module.exports = new myLog(logsDir, logFileCommon, configuration.instanceId, log4js);


text:
import news
import auth_flow
from apscheduler.schedulers.blocking import BlockingScheduler

schedule = BlockingScheduler()

#schedule.add_job(auth_flow.update_token, trigger='cron', day_of_week='tue', hour=18)
#schedule.add_job(auth_flow.update_token, trigger='cron', day_of_week='thu', hour=18)
#schedule.add_job(auth_flow.update_token, trigger='cron', day_of_week='sat', hour=18)
schedule.add_job(news.main, trigger='cron', day_of_week='wed', hour=12)

schedule.start()


text:
package com.siyeh.ipp.exceptions;

import com.intellij.codeInsight.FileModificationService;
import com.intellij.openapi.application.WriteAction;
import com.intellij.openapi.project.Project;
import com.intellij.psi.*;
import com.intellij.psi.codeStyle.CodeStyleManager;
import com.intellij.psi.util.PsiTreeUtil;
import com.intellij.util.IncorrectOperationException;
import com.siyeh.ig.psiutils.DeclarationSearchUtils;
import com.siyeh.ipp.base.Intention;
import com.siyeh.ipp.base.PsiElementPredicate;
import org.jetbrains.annotations.NotNull;

import java.util.List;

public class ConvertCatchToThrowsIntention extends Intention {

  @Override
  @NotNull
  protected PsiElementPredicate getElementPredicate() {
    return new ConvertCatchToThrowsPredicate();
  }

  @Override
  public boolean startInWriteAction() {
    return false;
  }

  @Override
  protected void processIntention(@NotNull PsiElement element) throws IncorrectOperationException {
    final PsiCatchSection catchSection = (PsiCatchSection)element.getParent();
    final NavigatablePsiElement owner = PsiTreeUtil.getParentOfType(catchSection, PsiMethod.class, PsiLambdaExpression.class);
    final PsiMethod method;
    if (owner instanceof PsiMethod) {
      method = (PsiMethod)owner;
    }
    else if (owner instanceof PsiLambdaExpression) {
      method = LambdaUtil.getFunctionalInterfaceMethod(owner);
    }
    else {
      return;
    }
    if (method == null || !FileModificationService.getInstance().preparePsiElementsForWrite(method)) {
      return;
    }
    // todo warn if method implements or overrides some base method
    //             Warning
    // "Method xx() of class XX implements/overrides method of class
    // YY. Do you want to modify the base method?"
    //                                             [Yes][No][Cancel]
    WriteAction.run(() -> {
      final PsiReferenceList throwsList = method.getThrowsList();
      final PsiType catchType = catchSection.getCatchType();
      addToThrowsList(throwsList, catchType);
      final PsiTryStatement tryStatement = catchSection.getTryStatement();
      final PsiCatchSection[] catchSections = tryStatement.getCatchSections();
      if (catchSections.length > 1 || tryStatement.getResourceList() != null || tryStatement.getFinallyBlock() != null) {
        catchSection.delete();
      }
      else {
        final PsiCodeBlock tryBlock = tryStatement.getTryBlock();
        if (tryBlock == null) {
          return;
        }
        final PsiCodeBlock parentCodeBlock = PsiTreeUtil.getParentOfType(tryStatement, PsiCodeBlock.class, true, PsiStatement.class);
        if (parentCodeBlock != null && !DeclarationSearchUtils.containsConflictingDeclarations(tryBlock, parentCodeBlock)) {
          final PsiElement first = tryBlock.getFirstBodyElement();
          final PsiElement last = tryBlock.getLastBodyElement();
          if (first != null && last != null) {
            tryStatement.getParent().addRangeAfter(first, last, tryStatement);
          }
          tryStatement.delete();
        }
        else {
          CodeStyleManager.getInstance(tryStatement.getProject()).reformat(tryStatement.replace(tryBlock));
        }
      }
    });
  }

  private static void addToThrowsList(PsiReferenceList throwsList, PsiType catchType) {
    if (catchType instanceof PsiClassType) {
      final PsiClassType classType = (PsiClassType)catchType;
      final PsiClassType[] types = throwsList.getReferencedTypes();
      for (PsiClassType type : types) {
        if (catchType.equals(type)) {
          return;
        }
      }
      final Project project = throwsList.getProject();
      final PsiElementFactory factory = JavaPsiFacade.getElementFactory(project);
      final PsiJavaCodeReferenceElement referenceElement = factory.createReferenceElementByType(classType);
      throwsList.add(referenceElement);
    }
    else if (catchType instanceof PsiDisjunctionType) {
      final PsiDisjunctionType disjunctionType = (PsiDisjunctionType)catchType;
      final List<PsiType> disjunctions = disjunctionType.getDisjunctions();
      for (PsiType disjunction : disjunctions) {
        addToThrowsList(throwsList, disjunction);
      }
    }
  }
}


text:
#include <config.h>

#include "../container.c"

#include <assert.h>

int main(void)
{
	ROM_container_raw *c = malloc(SECURE_BOOT_HEADERS_SIZE);
	assert(stb_is_container(NULL, 0) == false);
	assert(stb_is_container(NULL, SECURE_BOOT_HEADERS_SIZE) == false);
	c->magic_number = cpu_to_be32(ROM_MAGIC_NUMBER + 1);
	assert(stb_is_container(c, SECURE_BOOT_HEADERS_SIZE) == false);
	c->magic_number = cpu_to_be32(ROM_MAGIC_NUMBER);
	assert(stb_is_container(c, SECURE_BOOT_HEADERS_SIZE) == true);

	return 0;
}


text:
package done.inpro.system.calendar;

import java.io.InputStream;

import edu.cmu.sphinx.util.props.ConfigurationManager;
import inpro.apps.SimpleMonitor;
import inpro.apps.util.CommonCommandLineParser;
import inpro.apps.util.MonitorCommandLineParser;
import inpro.audio.DispatchStream;
import inpro.incremental.processor.SynthesisModule;
import inpro.incremental.unit.SysInstallmentIU;

public class NoisySynthesisModule extends SynthesisModule {

	protected DispatchStream noiseDispatcher;

	public NoisySynthesisModule(DispatchStream speechDispatcher) {
		super(speechDispatcher);
		noiseDispatcher = setupDispatcher2();
		// preheat mary symbolic processing, HMM optimization and vocoding
		speechDispatcher.playStream(new SysInstallmentIU("Neuer Stimulus:").getAudio());
		speechDispatcher.waitUntilDone();
	}

	protected synchronized boolean noisy() {
		return noiseDispatcher.isSpeaking();
	}

	/** any ongoing noise is replaced with this one */
	protected synchronized void playNoiseSmart(InputStream noiseFile) {
		noiseDispatcher.playStream(noiseFile, true);
		sleepy(300);
		// stop after ongoing word,
		currentInstallment.stopAfterOngoingWord();
		// (no need to keep reference to the ongoing utterance as we'll start a new one anyway)
		currentInstallment = null;
	}

	/** any ongoing noise is replaced with this one */
	protected synchronized void playNoiseDumb(InputStream noiseFile) {
		noiseDispatcher.playStream(noiseFile, true);
		sleepy(300);
		speechDispatcher.interruptPlayback();
		// wait until noiseDispatcher is done
		noiseDispatcher.waitUntilDone();
		sleepy(100);
		speechDispatcher.continuePlayback();
	}

	public synchronized void playNoiseDeaf(InputStream noiseFile) {
		noiseDispatcher.playStream(noiseFile, true);
	}

	void sleepy(int ms) {
		try {
			Thread.sleep(ms);
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
	}

	/* wow, this is ugly. but oh well ... as long as it works */
	@SuppressWarnings("unused")
	public static DispatchStream setupDispatcher2() {
		ConfigurationManager cm = new ConfigurationManager(SimpleMonitor.class.getResource("config.xml"));
		MonitorCommandLineParser clp = new MonitorCommandLineParser(new String[] {
				"-S", "-M" // -M is just a placeholder here, it's immediately overridden in the next line:
			});
		clp.setInputMode(CommonCommandLineParser.DISPATCHER_OBJECT_2_INPUT);
		try {
			new SimpleMonitor(clp, cm);
		} catch (Exception e) {
			e.printStackTrace();
			throw new RuntimeException(e);
		}
		return (DispatchStream) cm.lookup("dispatchStream2");
	}

}


text:
define(['backbone'], function(Backbone) {

    return Backbone.Collection.extend({
        url: function() { return '/proposal/bls/'+this.ty },

        initialize: function(models, options) {
            this.ty = options.ty
        },

        parse: function(r) {
            var d = []
            _.each(r, function(bl,i) {
                d.push({ BEAMLINE: bl })
            })

            return d
        },
    })
})


text:
using System.Collections.ObjectModel;
using System.Windows;
using System.Windows.Controls;

namespace LiveCharts
{
    /// <summary>
    /// Interaction logic for PieSeriesViewer.xaml
    /// </summary>
    public partial class PieSeriesViewer
    {
        public PieSeriesViewer()
        {
            InitializeComponent();
            DataContext = this;
        }

        public static readonly DependencyProperty SeriesProperty = DependencyProperty.Register(
            "Series", typeof(ObservableCollection<Series>), typeof(PieSeriesViewer), new PropertyMetadata(null));

        public ObservableCollection<Series> Series
        {
            get { return (ObservableCollection<Series>)GetValue(SeriesProperty); }
            set { SetValue(SeriesProperty, value); }
        }

        public static readonly DependencyProperty OrientationProperty = DependencyProperty.Register(
            "Orientation", typeof(Orientation), typeof(PieSeriesViewer), new PropertyMetadata(Orientation.Vertical));

        public Orientation Orientation
        {
            get { return (Orientation)GetValue(OrientationProperty); }
            set { SetValue(OrientationProperty, value); }
        }
    }
}


text:
package com.google.code.apis.rest.client.GUI;

import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.ClickListener;
import com.google.gwt.user.client.ui.DialogBox;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.HasHorizontalAlignment;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.TextArea;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.ui.Widget;

/**
 * This class creates the accept wadl dialog
 *
 */
public class WadlSaveDialog {

  /**
   * Creates the accept wadl dialog
   * @param html The xhtml string containig the syntax-highlighted wadl
   */
  public static void show(final String wadlString) {
    final DialogBox dialog = new DialogBox();
    dialog.setText(GuiFactory.strings.wadlAcceptDialog());

    VerticalPanel acceptPanel = new VerticalPanel();
    final TextArea wadlTextArea = new TextArea();
    wadlTextArea.setStyleName("restDescribe-wadlArea");
    wadlTextArea.setHeight(Math.floor(Window.getClientHeight() * 0.75) + "px");
    wadlTextArea.setWidth(Math.floor(Window.getClientWidth() * 0.9) + "px");
    wadlTextArea.setText(wadlString);
    acceptPanel.add(wadlTextArea);

    Button closeButton = new Button(GuiFactory.strings.close());
    closeButton.addClickListener(new ClickListener() {
      public void onClick(Widget sender) {
        dialog.hide();
        GuiFactory.blockScreen(false);
      }
    });

    Button selectAllButton = new Button(GuiFactory.strings.selectAll());
    selectAllButton.addClickListener(new ClickListener() {
      public void onClick(Widget sender) {
        selectAll(wadlTextArea);
      }
    });

    Button toJsonButton = new Button(GuiFactory.strings.wadl2Json());
    toJsonButton.addClickListener(new ClickListener() {
      public void onClick(Widget sender) {
        new XmlHttpRequest(wadlString, SettingsDialog.pathToJsonConverter);
      }
    });

    acceptPanel.add(new HTML("<br />"));
    HorizontalPanel buttonPanel = new HorizontalPanel();
    buttonPanel.add(closeButton);
    buttonPanel.add(selectAllButton);
    if (wadlString.startsWith("<?xml")) {
      buttonPanel.add(new HTML("  " + GuiFactory.strings.newFeature()));
      buttonPanel.add(toJsonButton);
    }
    acceptPanel.add(buttonPanel);
    acceptPanel.setCellHorizontalAlignment(buttonPanel, HasHorizontalAlignment.ALIGN_CENTER);

    dialog.setWidget(acceptPanel);
    dialog.setPopupPosition((int) Math.floor(Window.getClientWidth() * 0.05), (int) Math.floor(Window.getClientHeight() * 0.05));
    GuiFactory.blockScreen(true);
    dialog.show();
  }

  /**
   * Selects the complete text area contents
   *
   * @param wadlTextArea The text area
   */
  private static void selectAll(TextArea wadlTextArea) {
    wadlTextArea.setSelectionRange(0, wadlTextArea.getText().length());
  }
}


text:
using System;
using MbUnit.Framework;

[assembly: MbUnit.Framework.AssemblyDependsOn("ParentAssembly")]
[assembly: MbUnit.Framework.AssemblyDependsOn("SickParentAssembly")]

namespace MbUnit.Framework.Tests.Core.Graph
{
    [TestFixture]
    public class ChildAssembly
    {
        [Test]
        public void Test()
        { }
    }
}


text:
var player = document.getElementById('player');
var speaker = document.getElementById('speaker');
if (player) {
  speaker.addEventListener('click', function() {
    if (speaker.classList.contains('playing')) {
      player.muted = true;
      speaker.classList.remove('playing');
      speaker.classList.add('mute');
    } else {
      player.muted = false;
      speaker.classList.remove('mute');
      speaker.classList.add('playing');
    }
  });
} else {
  speaker.classList.add('hid');
}

// Show/hide the info box when the icon is clicked.
var info_icon = document.getElementById('info-icon');
var toggleInfo = function() {
  var info = document.getElementById('info');
  info.classList.toggle('hid');
}
info_icon.addEventListener('click', toggleInfo);


text:
RubotoTest
==========

A sample Ruboto project using and testing SQLDroid

To run the tests, install Ruby and run

```
rake test
```


text:
using System;
using Google.GData.Extensions;

namespace Google.GData.ContentForShopping.Elements
{
    public class Status : SimpleElement
    {
        /// <summary>
        /// default constructor for sc:status
        /// </summary>
        public Status()
            : base(ContentForShoppingNameTable.Status,
                ContentForShoppingNameTable.scDataPrefix,
                ContentForShoppingNameTable.BaseNamespace)
        {
        }

        /// <summary>
        /// Constructs a new Status instance with the specified values.
        /// </summary>
        /// <param name="destination">destination</param>
        /// <param name="status">status</param>
        public Status(string destination, string status)
            : base(ContentForShoppingNameTable.Status,
                ContentForShoppingNameTable.scDataPrefix,
                ContentForShoppingNameTable.BaseNamespace)
        {
            Destination = destination;
            Value = status;
        }

        /// <summary>
        /// Destination property accessor
        /// </summary>
        public string Destination
        {
            get { return Convert.ToString(Attributes[ContentForShoppingNameTable.Destination]); }
            set { Attributes[ContentForShoppingNameTable.Destination] = value; }
        }

        /// <summary>
        /// Status property accessor
        /// </summary>
        public override string Value
        {
            get { return Convert.ToString(Attributes[ContentForShoppingNameTable.Status]); }
            set { Attributes[ContentForShoppingNameTable.Status] = value; }
        }
    }
}


text:
namespace Poco {
namespace RemotingNG {
namespace TCP {

class RemotingNGTCP_API ConnectionManager
	/// The ConnectionManager manages a collection of Connection objects.
	///
	/// Connection objects are either created by a ServerConnection as a result of
	/// an accepted connection request by the server, or by the ConnectionManager,
	/// in the case of client-side Connection objects.
	///
	/// For creation of Connection objects the ConnectionManager uses
	/// a SocketFactory.
	///
	/// A Poco::ThreadPool is used to obtain threads for driving the protocol
	/// on the client side, as well as for scheduling requests on the server
	/// and events on the client.
{
public:
	ConnectionManager(Poco::ThreadPool& threadPool = Poco::ThreadPool::defaultPool());
		/// Creates a ConnectionManager using the default
		/// SocketFactory.
		///
		/// Optionally, a Poco::ThreadPool can be specified
		/// if the default pool should not be used.

	ConnectionManager(SocketFactory::Ptr pSocketFactory, Poco::ThreadPool& threadPool = Poco::ThreadPool::defaultPool());
		/// Creates a ConnectionManager using the
		/// given SocketFactory.
		///
		/// Optionally, a Poco::ThreadPool can be specified
		/// if the default pool should not be used.

	~ConnectionManager();
		/// Destroys the ConnectionManager.

	void setIdleTimeout(Poco::Timespan timeout);
		/// Sets the timeout after an idle connection is closed.

	Poco::Timespan getIdleTimeout() const;
		/// Returns the idle connection timeout.

	void registerConnection(Connection::Ptr pConnection);
		/// Registers an existing connection.

	void unregisterConnection(Connection::Ptr pConnection);
		/// Unregisters an existing connection.

	Connection::Ptr findConnection(const Poco::Net::SocketAddress& peerAddress);
		/// Searches for a connection to the given peer address.
		///
		/// If a connection exists, and the connection is in established state,
		/// it is returned. Otherwise, a null pointer is returned.

	Connection::Ptr getConnection(const Poco::URI& endpointURI);
		/// Searches for a connection to the given endpoint.
		///
		/// If a connection exists, and the connection is in established state,
		/// it is returned. Otherwise, a new connection to that endpoint
		/// is created.

	void shutdown();
		/// Closes all connections.

	ThreadPool& threadPool();
		/// Returns a reference to the ConnectionManager's thread pool.

	static ConnectionManager& defaultManager();
		/// Returns the default ConnectionManager instance.

protected:
	Connection::Ptr createConnection(const Poco::URI& endpointURI);

private:
	enum
	{
		DEFAULT_IDLE_TIMEOUT = 60
	};

	ConnectionManager(const ConnectionManager&);
	ConnectionManager& operator = (const ConnectionManager&);

	typedef std::map<Poco::Net::SocketAddress, Connection::Ptr> ConnectionMap;
	typedef std::set<Poco::Net::SocketAddress> SocketAddressSet;

	SocketFactory::Ptr _pSocketFactory;
	Poco::Timespan _idleTimeout;
	Poco::ThreadPool& _threadPool;
	ConnectionMap _connections;
	SocketAddressSet _pendingConnections;
	Poco::FastMutex _mutex;
};

//
// inlines
//
inline Poco::Timespan ConnectionManager::getIdleTimeout() const
{
	return _idleTimeout;
}

inline Poco::ThreadPool& ConnectionManager::threadPool()
{
	return _threadPool;
}

} } } // namespace Poco::RemotingNG::TCP

#endif // RemotingNG_TCP_ConnectionManager_INCLUDED


text:
<?php
namespace Veta\HomeworkBundle\Controller;

use Knp\Component\Pager\Pagination\PaginationInterface;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\Session\Session;
use Symfony\Component\Routing\Annotation\Route;
use Veta\HomeworkBundle\Entity\Comment;
use Veta\HomeworkBundle\Entity\Post;
use Veta\HomeworkBundle\Form\Type\CommentType;

class PostController extends Controller
{
    /**
     * @Route("/{_locale}/post", name="index")
     * @Method("GET")
     *
     * @param Request $request
     * @return Response
     */
    public function indexAction(Request $request)
    {
        $breadcrumbs = $this->get("white_october_breadcrumbs");
        $breadcrumbs->addRouteItem("Home", "veta_homework_homepage");
        $breadcrumbs->addRouteItem("Post", "veta_homework_post_index");

        if ((($request->query->get('sort_date') == null) && ($request->query->get('sort_title') == null)) || ($request->query->get('sort_date') == 'new')) {
            $query = $this->getDoctrine()->getRepository('VetaHomeworkBundle:Post')->findMostRecentQuery();
        } else {
            if ($request->query->get('sort_date') == 'old') {
                $query = $this->getDoctrine()->getRepository('VetaHomeworkBundle:Post')->findMostOldQuery();
            } else {
                if ($request->query->get('sort_title') == 'up') {
                    $query = $this->getDoctrine()->getRepository('VetaHomeworkBundle:Post')->findOrderByTitleUp();
                } else {
                    $query = $this->getDoctrine()->getRepository('VetaHomeworkBundle:Post')->findOrderByTitleDown();
                }
            }
        }

        $posts = $this->sortPost($request, $query);
        return $this->render('VetaHomeworkBundle:Post:index.html.twig', [
            'posts' => $posts,

        ]);
    }

    /**
     * @Route("/post/like", name="likes")
     * @Method("POST")
     *
     * @param Request $request
     * @return Response
     */
    public function likesAction(Request $request)
    {
        $em = $this->getDoctrine()->getManager();
        $post = $em->getRepository('VetaHomeworkBundle:Post')->find($request->request->get('id'));

        if ($request->getSession()->get($post->getSlug())) {
            $likes = $post->getLikes() - 1;
            $post->setLikes($likes);
            $em->flush();
            $request->getSession()->remove($post->getSlug());
        } else {
            $session = new Session();
            $likes = $post->getLikes() + 1;
            $post->setLikes($likes);
            $em->flush();
            $session->set($post->getSlug(), $post->getLikes());
        }

        return new Response();
    }

    /**
     * @param $request
     * @return PaginationInterface
     */
    private function sortPost($request, $query)
    {
        $paginator  = $this->get('knp_paginator');
        if ($request->query->get('count') != null) {
            $count = $request->query->get('count');
        } else {
            $count = 5;
        }
        return $paginator->paginate($query, $request->query->getInt('page', 1), $count);
    }

    /**
     * @Route("/{_locale}/post/{slug}", name="views", requirements={"slug": "[\w\-]+"})
     * @Method("GET")
     *
     * @param Post $post
     * @return Response
     */
    public function viewAction(Post $post)
    {
        $breadcrumbs = $this->get("white_october_breadcrumbs");
        $breadcrumbs->addRouteItem("Home", "veta_homework_homepage");

        $breadcrumbs->addRouteItem($post->getCategory()->getTitle(), "veta_homework_category_index", ['slug' => $post->getCategory()->getSlug()]);
        $breadcrumbs->addRouteItem("Post", "veta_homework_post_index");
        $breadcrumbs->addRouteItem($post->getTitle(), "veta_homework_post_view", ['slug' => $post->getSlug()]);

        $comment = new Comment();
        $comment->setPost($post);

        $form = $this->createForm(CommentType::class, $comment, [
            'action' => $this->generateUrl('veta_homework_comment_create'),
            'method' => 'POST',
        ]);

        return $this->render('VetaHomeworkBundle:Post:view.html.twig', [
            'form' => $form->createView(),
            'post' => $post,
        ]);
    }

    /**
     * @Route("/{_locale}/post/search", name="search")
     * @Method("GET")
     *
     * @param Request $request
     * @return Response
     */
    public function searchAction(Request $request)
    {
        $q = $request->query->get('q');

        $finder = $this->container->get('fos_elastica.finder.blog.post');
        $query = $finder->createPaginatorAdapter($q);

        if (!$query) {
            $this->addFlash('search', "Search for text: \"$q\" no posts ... ");
        }

        $posts = $this->sortPost($request, $query);
        return $this->render('VetaHomeworkBundle:Post:search.html.twig', [
            'posts' => $posts,
        ]);
    }
}


text:
<link rel="import" href="/bower_components/polymer/polymer.html">

<polymer-element name="page-error404">
    <template>

404 !

    </template>

</polymer-element>


text:
title: "minikube start"
linkTitle: "Get Started!"
weight: 1
aliases:
  - /docs/start
---

minikube is local Kubernetes, focusing on making it easy to learn and develop for Kubernetes.

All you need is Docker (or similarly compatible) container or a Virtual Machine environment, and Kubernetes is a single command away: `minikube start`

## What you'll need

* 2 CPUs or more
* 2GB of free memory
* 20GB of free disk space
* Internet connection
* Container or virtual machine manager, such as: [Docker]({{<ref "/docs/drivers/docker">}}), [Hyperkit]({{<ref "/docs/drivers/hyperkit">}}), [Hyper-V]({{<ref "/docs/drivers/hyperv">}}), [KVM]({{<ref "/docs/drivers/kvm2">}}), [Parallels]({{<ref "/docs/drivers/parallels">}}), [Podman]({{<ref "/docs/drivers/podman">}}), [VirtualBox]({{<ref "/docs/drivers/virtualbox">}}), or [VMWare]({{<ref "/docs/drivers/vmware">}})

1Installation

{{% tabs %}}
{{% tab "Linux" %}}

For Linux users, we provide 3 easy download options:

### Binary download

```shell
 curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
 sudo install minikube-linux-amd64 /usr/local/bin/minikube
```

### Debian package

```shell
curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube_latest_amd64.deb
sudo dpkg -i minikube_latest_amd64.deb
```

### RPM package

```shell
curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-latest.x86_64.rpm
sudo rpm -ivh minikube-latest.x86_64.rpm
```

{{% /tab %}}
{{% tab "macOS" %}}

If the [Brew Package Manager](https://brew.sh/) installed:

```shell
brew install minikube
```

If `which minikube` fails after installation via brew, you may have to remove the minikube cask and link the binary:

```
brew cask remove minikube
brew link minikube
```

Otherwise, download minikube directly:

```shell
curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-darwin-amd64
sudo install minikube-darwin-amd64 /usr/local/bin/minikube
```

{{% /tab %}}
{{% tab "Windows" %}}

If the [Chocolatey Package Manager](https://chocolatey.org/) is installed, use it to install minikube:

```shell
choco install minikube
```

Otherwise, download and run the [Windows installer](https://storage.googleapis.com/minikube/releases/latest/minikube-installer.exe)

{{% /tab %}}
{{% /tabs %}}

2Start your cluster

From a terminal with administrator access (but not logged in as root), run:

```shell
minikube start
```

If minikube fails to start, see the [drivers page]({{<ref "/docs/drivers">}}) for help setting up a compatible container or virtual-machine manager.

3Interact with your cluster

If you already have kubectl installed, you can now use it to access your shiny new cluster:

```shell
kubectl get po -A
```

Alternatively, minikube can download the appropriate version of kubectl, if you don't mind the double-dashes in the command-line:

```shell
minikube kubectl -- get po -A
```

Initially, some services such as the storage-provisioner, may not yet be in a Running state. This is a normal condition during cluster bring-up, and will resolve itself momentarily. For additional insight into your cluster state, minikube bundles the Kubernetes Dashboard, allowing you to get easily acclimated to your new environment:

```shell
minikube dashboard
```

4Deploy applications

Create a sample deployment and expose it on port 8080:

```shell
kubectl create deployment hello-minikube --image=k8s.gcr.io/echoserver:1.4
kubectl expose deployment hello-minikube --type=NodePort --port=8080
```

It may take a moment, but your deployment will soon show up when you run:

```shell
kubectl get services hello-minikube
```

The easiest way to access this service is to let minikube launch a web browser for you:

```shell
minikube service hello-minikube
```

Alternatively, use kubectl to forward the port:

```shell
kubectl port-forward service/hello-minikube 7080:8080
```

Tada! Your application is now available at [http://localhost:7080/](http://localhost:7080/)

### LoadBalancer deployments

To access a LoadBalancer deployment, use the "minikube tunnel" command. Here is an example deployment:

```shell
kubectl create deployment balanced --image=k8s.gcr.io/echoserver:1.4
kubectl expose deployment balanced --type=LoadBalancer --port=8000
```

In another window, start the tunnel to create a routable IP for the 'balanced' deployment:

```shell
minikube tunnel
```

To find the routable IP, run this command and examine the `EXTERNAL-IP` column:

`kubectl get services balanced`

Your deployment is now available at <EXTERNAL-IP>:8000

5Manage your cluster

Pause Kubernetes without impacting deployed applications:

```shell
minikube pause
```

Halt the cluster:

```shell
minikube stop
```

Increase the default memory limit (requires a restart):

```shell
minikube config set memory 16384
```

Browse the catalog of easily installed Kubernetes services:

```shell
minikube addons list
```

Create a second cluster running an older Kubernetes release:

```shell
minikube start -p aged --kubernetes-version=v1.16.1
```

Delete all of the minikube clusters:

```shell
minikube delete --all
```

## Take the next step

* [The minikube handbook]({{<ref "/docs/handbook">}})
* [Community-contributed tutorials]({{<ref "/docs/tutorials">}})
* [minikube command reference]({{<ref "/docs/commands">}})
* [Contributors guide]({{<ref "/docs/contrib">}})
* Take our [fast 5-question survey](https://forms.gle/Gg3hG5ZySw8c1C24A) to share your thoughts 🙏


text:
require_relative './interface'

@interface.command(:listPeople)["people"]["person"].each do |person|
  puts "##{person["ixPerson"]} #{person["sFullName"]}"
end