text:
require_relative 'ciscotest'
require_relative '../lib/cisco_node_utils/interface'
require_relative '../lib/cisco_node_utils/interface_portchannel'

# TestX__CLASS_NAME__X - Minitest for X__CLASS_NAME__X node utility class
class TestInterfacePortChannel < CiscoTestCase
  @skip_unless_supported = 'interface_portchannel'
  # TESTS

  DEFAULT_NAME = 'port-channel134'

  def setup
    super
    config "no interface #{DEFAULT_NAME}"
  end

  def teardown
    config "no interface #{DEFAULT_NAME}"
    super
  end

  def n6k_platform?
    /N(5|6)/ =~ node.product_id
  end

  def create_port_channel(ifname=DEFAULT_NAME)
    InterfacePortChannel.new(ifname)
  end

  def test_bfd_per_link
    interface = create_port_channel
    assert_equal(interface.default_bfd_per_link, interface.bfd_per_link)
    interface.bfd_per_link = true
    assert_equal(true, interface.bfd_per_link)
    interface.bfd_per_link = interface.default_bfd_per_link
    assert_equal(interface.default_bfd_per_link, interface.bfd_per_link)
  end

  def test_port_hash_distribution
    skip('Platform does not support this property') if n6k_platform?
    interface = create_port_channel
    interface.port_hash_distribution = 'adaptive'
    assert_equal('adaptive', interface.port_hash_distribution)
    interface.port_hash_distribution = 'fixed'
    assert_equal('fixed', interface.port_hash_distribution)
    interface.port_hash_distribution =
      interface.default_port_hash_distribution
    assert_equal(interface.default_port_hash_distribution,
                 interface.port_hash_distribution)
  end

  def test_lacp_graceful_convergence
    interface = create_port_channel
    interface.lacp_graceful_convergence = false
    assert_equal(false, interface.lacp_graceful_convergence)
    interface.lacp_graceful_convergence =
      interface.default_lacp_graceful_convergence
    assert_equal(interface.default_lacp_graceful_convergence,
                 interface.lacp_graceful_convergence)
  end

  def test_lacp_min_links
    interface = create_port_channel
    interface.lacp_min_links = 5
    assert_equal(5, interface.lacp_min_links)
    interface.lacp_min_links = interface.default_lacp_min_links
    assert_equal(interface.default_lacp_min_links,
                 interface.lacp_min_links)
  end

  def test_lacp_max_bundle
    interface = create_port_channel
    interface.lacp_max_bundle = 10
    assert_equal(10, interface.lacp_max_bundle)
    interface.lacp_max_bundle =
      interface.default_lacp_max_bundle
    assert_equal(interface.default_lacp_max_bundle,
                 interface.lacp_max_bundle)
  end

  def test_lacp_suspend_individual
    interface = create_port_channel

    # Run this test with the portchannel in both a 'shutdown'
    # and 'no shutdown' state.
    int_obj = Interface.new(interface.name)
    [true, false].each do |state|
      int_obj.shutdown = state

      # Test initial default case
      assert_equal(interface.default_lacp_suspend_individual,
                   interface.lacp_suspend_individual)

      # Test non-default value
      val = !interface.default_lacp_suspend_individual
      interface.lacp_suspend_individual = val
      assert_equal(val, interface.lacp_suspend_individual)

      # Set back to default
      interface.lacp_suspend_individual =
        interface.default_lacp_suspend_individual
      assert_equal(interface.default_lacp_suspend_individual,
                   interface.lacp_suspend_individual)

      # Make sure interface ends up in the same state.
      assert_equal(state, int_obj.shutdown,
                   "Interface #{int_obj.name} incorrect state after setting property")
    end
  end

  def test_port_load_defer
    skip('Platform does not support this property') if n6k_platform?
    interface = create_port_channel
    interface.port_load_defer = true
    assert_equal(true, interface.port_load_defer)
    interface.port_load_defer =
      interface.default_port_load_defer
    assert_equal(interface.default_port_load_defer,
                 interface.port_load_defer)
  end
end


text:
__author__ = "Kishori M Konwar"
__copyright__ = "Copyright 2013, MetaPathways"
__credits__ = ["r"]
__version__ = "1.0"
__maintainer__ = "Kishori M Konwar"
__status__ = "Release"

"""Contains general utility code for the metapaths project"""

try:
    import re, sys, os, traceback
    from shutil import rmtree
    from os import getenv, makedirs, path, remove
    from operator import itemgetter
    from os.path import abspath, exists, dirname, join, isdir
    from collections import defaultdict
    from optparse import make_option
except:
    print("Cannot load some modules")
    sys.exit(0)

class Command():

    inputs = []
    outputs = []
    commands = []
    flags = []

    def __init__(self):
        pass

class Commands():
    """Contains the list of commands for different steps of the pipeline """

    commands = {}

    def __init__(self):
        pass

    def addCommand(self, stepName, command):
        self.commands[stepName] = command
        return True

if __name__=="__main__":
    pass

redpajama_set_name: RedPajamaGithub


text:
layout: post
title: Four Quadrants – Dividing and Conquering the Crypto Universe
cover: https://media.coindesk.com/uploads/2017/08/ties-clothing-e1501855122816.jpg
date: 2017-08-07 00:00:00 +00:00
author: Hu Liang
link: "/four-quadrants-dividing-conquering-crypto-universe"
---

Just a quick introduction into AWS.

Please come along if your interested. Pizza will be provided.


text:
function _this() { //Error
    return 10;
}
var f = () => this;

//// [collisionThisExpressionAndFunctionInGlobal.js]
var _this = this;
function _this() {
    return 10;
}
var f = function () { return _this; };


text:
from midonetclient import condition
from midonetclient import resource_base
from midonetclient import vendor_media_type

class Mirror(resource_base.ResourceBase):

    media_type = vendor_media_type.APPLICATION_MIRROR_JSON

    def __init__(self, uri, dto, auth):
        super(Mirror, self).__init__(uri, dto, auth)

    def get_id(self):
        return self.dto['id']

    def get_to_port(self):
        return self.dto['toPortId']

    def to_port(self, to_port_id):
        self.dto['toPortId'] = to_port_id
        return self

    def get_conditions(self):
        return self.dto['conditions']

    def set_conditions(self, conditions):
        self.dto['conditions'] = conditions
        return self

    def add_condition(self):
        return condition.Condition('fake-URI', {}, 'fake-AUTH')


text:
namespace IronFoundry.Warden.Handlers
{
    using System.Collections.Generic;
    using System.IO;
    using System.Security.AccessControl;
    using System.Threading.Tasks;
    using Containers;
    using NLog;
    using Protocol;

    public class CreateRequestHandler : ContainerRequestHandler
    {
        private readonly Logger log = LogManager.GetCurrentClassLogger();
        private readonly CreateRequest request;

        public CreateRequestHandler(IContainerManager containerManager, Request request)
            : base(containerManager, request)
        {
            this.request = (CreateRequest)request;
        }

        public override Task<Response> HandleAsync()
        {
            return Task.Run<Response>(() =>
                {
                    // before

                    // do
                    var container = new Container();
                    containerManager.AddContainer(container);

                    // after
                    container.AfterCreate();

                    ProcessBindMounds(request.BindMounts, container.User);

                    return new CreateResponse { Handle = container.Handle };
                });
        }

        /// <summary>
        /// Give read access to bind mount directories.
        /// TODO: move to centralized permission manager.
        /// </summary>
        /// <param name="bindMounts"></param>
        /// <param name="containerUser"></param>
        private void ProcessBindMounds(IEnumerable<CreateRequest.BindMount> bindMounts, ContainerUser containerUser)
        {
            var inheritanceFlags = InheritanceFlags.ContainerInherit | InheritanceFlags.ObjectInherit;

            if (!bindMounts.IsNullOrEmpty())
            {
                foreach (var bindMount in bindMounts)
                {
                    FileSystemRights rights = FileSystemRights.Read;
                    switch (bindMount.BindMountMode)
                    {
                        case CreateRequest.BindMount.Mode.RO:
                            // TODO: these rights aren't quite enough - rights = FileSystemRights.Read;
                            rights = FileSystemRights.FullControl;
                            break;
                        case CreateRequest.BindMount.Mode.RW:
                            // TODO: these rights aren't quite enough - rights = FileSystemRights.Read | FileSystemRights.Write;
                            rights = FileSystemRights.FullControl;
                            break;
                    }
                    var accessRule = new FileSystemAccessRule(containerUser, rights, inheritanceFlags, PropagationFlags.InheritOnly, AccessControlType.Allow);
                    log.Trace("Adding access rule to SrcPath '{0}', DstPath '{1}'", bindMount.SrcPath, bindMount.DstPath);
                    AddAccessRuleTo(accessRule, bindMount.SrcPath);
                    AddAccessRuleTo(accessRule, bindMount.DstPath);
                }
            }
        }

        private void AddAccessRuleTo(FileSystemAccessRule accessRule, string path)
        {
            var pathInfo = new DirectoryInfo(path);
            if (pathInfo.Exists)
            {
                log.Trace("Adding access rule to path '{0}'", pathInfo.FullName);
                DirectorySecurity pathSecurity = pathInfo.GetAccessControl();
                pathSecurity.AddAccessRule(accessRule);

                ReplaceAllChildPermissions(pathInfo, pathSecurity);
            }
            else
            {
                DirectoryInfo parentInfo = pathInfo.Parent;
                if (parentInfo.Exists)
                {
                    log.Trace("Adding access rule to path '{0}' via parent '{1}'", pathInfo.FullName, parentInfo.FullName);
                    DirectorySecurity pathSecurity = parentInfo.GetAccessControl();
                    pathSecurity.AddAccessRule(accessRule);

                    Directory.CreateDirectory(pathInfo.FullName, pathSecurity);

                    ReplaceAllChildPermissions(pathInfo, pathSecurity);
                }
            }
        }

        private static void ReplaceAllChildPermissions(DirectoryInfo dirInfo, DirectorySecurity security)
        {
            dirInfo.SetAccessControl(security);

            foreach (var fi in dirInfo.GetFiles())
            {
                var fileSecurity = fi.GetAccessControl();
                fileSecurity.SetAccessRuleProtection(false, false);
                fi.SetAccessControl(fileSecurity);
            }

            foreach (var di in dirInfo.GetDirectories())
            {
                ReplaceAllChildPermissions(di, security);
            }
        }
    }
}


text:
package jp.co.yahoo.dataplatform.mds.hadoop.hive.pushdown;

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

import jp.co.yahoo.dataplatform.mds.spread.expression.AndExpressionNode;
import jp.co.yahoo.dataplatform.mds.spread.expression.IExpressionNode;
import org.apache.hadoop.hive.ql.plan.ExprNodeDesc;
import org.apache.hadoop.hive.ql.plan.ExprNodeColumnDesc;
import org.apache.hadoop.hive.ql.plan.ExprNodeFieldDesc;
import org.apache.hadoop.hive.ql.plan.ExprNodeGenericFuncDesc;
import org.apache.hadoop.hive.ql.udf.generic.GenericUDF;
import org.apache.hadoop.hive.ql.udf.generic.GenericUDFOPAnd;
import org.apache.hadoop.hive.ql.udf.generic.GenericUDFOPOr;
import org.apache.hadoop.hive.ql.udf.generic.GenericUDFOPNot;

public class HiveExprAndNode implements IHiveExprNode{

  private final List<IHiveExprNode> childNodeList = new ArrayList<IHiveExprNode>();

  public HiveExprAndNode(){}

  public HiveExprAndNode( final List<ExprNodeDesc> childExprNodeDesc ){
    for( ExprNodeDesc nodeChild : childExprNodeDesc  ){
      if( nodeChild instanceof ExprNodeGenericFuncDesc ){
        addChildNode( (ExprNodeGenericFuncDesc)nodeChild );
      }
      else if( ( nodeChild instanceof ExprNodeColumnDesc ) || ( nodeChild instanceof ExprNodeFieldDesc ) ){
        childNodeList.add( new BooleanHiveExpr( nodeChild ) );
      }
      else{
        childNodeList.add( new UnsupportHiveExpr() );
      }
    }
  }

  @Override
  public void addChildNode( final ExprNodeGenericFuncDesc exprNodeDesc ){
    GenericUDF udf = exprNodeDesc.getGenericUDF();
    if( udf instanceof GenericUDFOPAnd ){
      childNodeList.add( new HiveExprAndNode( exprNodeDesc.getChildren() ) );
    }
    else if( udf instanceof GenericUDFOPOr ){
      childNodeList.add( new HiveExprOrNode( exprNodeDesc.getChildren() ) );
    }
    else if( udf instanceof GenericUDFOPNot ){
      childNodeList.add( new HiveExprNotNode( exprNodeDesc.getChildren() ) );
    }
    else{
      childNodeList.add( HiveExprFactory.get( exprNodeDesc , udf , exprNodeDesc.getChildren() ) );
    }
  }

  @Override
  public IExpressionNode getPushDownFilterNode(){
    IExpressionNode result = new AndExpressionNode();
    for( IHiveExprNode childHiveExprNode : childNodeList ){
      IExpressionNode childNode = childHiveExprNode.getPushDownFilterNode();
      if( childNode != null ){
        result.addChildNode( childNode );
      }
    }
    return result;
  }

}


text:
"use strict";

var path = require('path');
var mkdirp = require('mkdirp');
var async = require('async');
var chalk = require('chalk');
var filesize = require('filesize');

var Optimizer = require('./optimizer');

module.exports = function (grunt) {
  grunt.registerMultiTask('image', 'Optimize PNG, JPEG, GIF, SVG images.', function() {

    var done = this.async();
    var options = this.options({
      pngquant: true,
      optipng: true,
      advpng: true,
      zopflipng: false,
      pngcrush: false,
      pngout: false,
      jpegRecompress: true,
      mozjpeg: true,
      jpegoptim: true,
      gifsicle: true,
      svgo: true
    });

    async.eachLimit(this.files, 10, function (file, next) {

      var src = file.src[0];
      var dest = file.dest;

      // make directory if does not exist
      mkdirp.sync(path.dirname(dest));

      var optimizer = new Optimizer({
        src: src,
        dest: dest,
        options: options
      });

      optimizer.optimize(function (error, data) {

        if (error) {
          grunt.warn(error);
          return next(error);
        }

        if (data.isOptimized) {
          grunt.log.writeln(
            chalk.green('✔ ') + src + chalk.gray(' ->') +
            chalk.gray(' before=') + chalk.yellow(filesize(data.originalSize)) +
            chalk.gray(' after=') + chalk.cyan(filesize(data.optimizedSize)) +
            chalk.gray(' reduced=') + chalk.green.underline(filesize(data.diffSize) + '(' + data.diffPercent + '%)')
          );
        } else {
          grunt.log.writeln(
            chalk.cyan('✗ ') + src + chalk.gray(' is not optimized') +
            chalk.gray(' before=after=') + chalk.cyan(filesize(data.originalSize)) +
            chalk.gray(' reduced=') + chalk.green.underline(filesize(0) + '(0%)')
          );
        }

        next();
      });
    }, function (error) {
      if (error) {
        grunt.warn(error);
        return done(error);
      }
      done();
    });
  });
};


text:
@extends('cscms::backend.layouts.app')

@section('page_title')
Capability
@endsection

@section('content')

            @if ($vars['form_type'] == 'create')

New capability

            @endif
            @if ($vars['form_type'] == 'edit')

Edit capability

            @endif

            @include('cscms::backend.partials.errors')

            <form method="post" action="{{ $vars['action'] }}">
                {!! csrf_field() !!}
                <input type="hidden" name="id" value="{{ $vars['id'] }}" />

                    Name

                        <input class="form-control" type="text" value="{{ old('name',$vars['capability']->name) }}" id="name" name="name">

                    Sort order

                        <input class="form-control" type="text" value="{{ old('sort_order',$vars['capability']->sort_order) }}" id="sort_order" name="sort_order">

                    Enabled

                                <input type="checkbox" class="form-check-input" name="enabled" value="1" {{ old('enabled',$vars['capability']->enabled) === 1 ? 'checked' : '' }}> Yes

                        <button type="submit" class="btn btn-primary">Save</button>

            </form>

@endsection


text:
<?xml version="1.0"?>
<!--
  ~ Copyright (c) 2010-2013 Evolveum
  ~
  ~ 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.
  -->

<systemConfiguration xmlns="http://midpoint.evolveum.com/xml/ns/public/common/common-3">

    <name>dummy</name>

        <!-- insert the following element into system configuration object (via debug pages)
             before logging and cleanup policy items -->

    <notificationConfiguration>
		<handler>
        <simpleResourceObjectNotifier>
            <recipientExpression>
                <value>somebody@acme.org</value>
            </recipientExpression>
            <transport>mail</transport>
        </simpleResourceObjectNotifier>
	</handler>

	<handler>
        <simpleUserNotifier>
            <recipientExpression>
                <value>somebody@acme.org</value>
            </recipientExpression>
            <transport>mail</transport>
        </simpleUserNotifier>
	</handler>
        <mail>
            <redirectToFile>c:\midpoint\mail-notifications.log</redirectToFile>
        </mail>
    </notificationConfiguration>

</systemConfiguration>


text:
/**
 * OptionAnimationSpeedView pushes in the option panel the animation speed control
 * @class OptionAnimationSpeedView
 * @module modules
 */

define(
    [
        //Template
        BGPLAY_TEMPLATES_NOCORS_URL + "optionRestoreGraph.html.js"

    ],  function(){

        var OptionRestoreGraph = Backbone.View.extend({

            /*
             * The initialization method of this object.
             * @method initialize
             * @param {Map} A map of parameters
             */
            initialize: function(){
                this.environment = this.options.environment;
                this.bgplay = this.environment.bgplay;
                this.fileRoot = this.environment.fileRoot;
                this.eventAggregator = this.environment.eventAggregator;

                this.eventAggregator.on("destroyAll", function(){
                    this.destroyMe();
                },this);

                this.dom = this.environment.optionPopupDom;
                this.render();
                this.eventManager();
                this.getNodesPositions();

                this.eventAggregator.trigger("moduleLoaded", this);
            },

            /**
             * This method draws this module (eg. inject the DOM and elements).
             * @method render
             */
            render: function(){
                parseTemplate(this.environment,'optionRestoreGraph.html',this,this.dom,"prepend");
                this.button = this.dom.find('.restorePositionButton');
                return this;
            },

            /**
             * This method manages the events of the built DOM.
             * @method eventManager
             */
            eventManager: function(){
                var $this = this;
                this.button.click(function(){
                    $this.apply();
                });
            },

            /**
             * This methods builds a string describing the graph.
             * @method getNodesPositions
             */
            getNodesPositions: function(){
                var positions = {};
                this.bgplay.get("nodes").forEach(function(node){
                    positions[node.id] = {x:node.view.x, y:node.view.y};
                });

                this.nodesPosition = JSON.stringify(positions);
            },

            /**
             * This methods applies to each node the coordinates obtained with the getNodesPositions method.
             * @method apply
             */
            apply: function(){
                var newPositions, position, $this;
                $this=this;
                newPositions = JSON.parse(this.nodesPosition);
                this.bgplay.get("nodes").forEach(function(node){
                    position = newPositions[node.id];
                    if (position != null){
                        var x = (position.x - node.view.x);
                        var y = (position.y - node.view.y);
                        node.view.view.translate(x, y);
                        node.oldX = node.view.x;
                        node.oldY = node.view.y;
                        node.view.x += x;
                        node.view.y += y;
                        $this.eventAggregator.trigger("nodeMoved", node);
                    }
                });
            }
        });

        return OptionRestoreGraph;
    });


text:
//Problem 8. Maximal sum

//    Write a program that finds the sequence of maximal sum in given array.

using System;
using System.Text;

class MaximalSum
{
    static void Main()
    {

        int[] arr = { 2, 3, -6, -1, 2, -1, 6, 4, -8, 8 };
        int maxSum = int.MinValue;
        StringBuilder sequence = new StringBuilder();
        int sum = 0;
        string resultSequence = "";

        for (int i = 1; i < arr.Length; i++)
        {
            sum += arr[i];
            sequence.AppendFormat("{0}, ", arr[i]);
            if (sum > maxSum)
            {
                resultSequence = sequence.ToString();
                maxSum = sum;
            }
            if (sum < 0)
            {
                sequence.Clear();
                sum = 0;
            }
        }

        Console.WriteLine("Sequence is: " + resultSequence);
        Console.WriteLine("Maximal sum is: " + sum);
    }
}


text:
#ifndef STREAM_CLOSE_H__
#define STREAM_CLOSE_H__

/* This is a Object File I/O API call */

#include "rcConnect.h"
#include "fileClose.h"

#if defined(RODS_SERVER)
#define RS_STREAM_CLOSE rsStreamClose
/* prototype for the server handler */
int
rsStreamClose( rsComm_t *rsComm, fileCloseInp_t *fileCloseInp );
#else
#define RS_STREAM_CLOSE NULL
#endif

/* prototype for the client call */
#ifdef __cplusplus
extern "C" {
#endif
int
rcStreamClose( rcComm_t *conn, fileCloseInp_t *fileCloseInp );
#ifdef __cplusplus
}
#endif

#endif	// STREAM_CLOSE_H__


text:
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**createdDate** | **Long** | The date the permission was added. Unix timestamp in seconds |  [optional]
**description** | **String** | The description of the permission |  [optional]
**locked** | **Boolean** | Whether a permission is locked from being deleted |  [optional]
**name** | **String** | The name of the permission used for display purposes |
**parent** | **String** | The name of the parent of the permission |  [optional]
**permission** | **String** | The keyword that defines the permission |
**updatedDate** | **Long** | The date the permission was updated. Unix timestamp in seconds |  [optional]


text:
<?xml version="1.0" encoding="utf-8"?>
<!--
  ~ Copyright 2020 Google LLC
  ~
  ~ 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
  ~
  ~     https://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.
  -->

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".GameSuccessFragment">

    <androidx.constraintlayout.widget.ConstraintLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <ImageButton
            android:id="@+id/menu_button"
            style="@style/BackButton"
            android:contentDescription="@string/menu_button"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintTop_toTopOf="parent" />

        <LinearLayout
            android:id="@+id/droid_draw_view"
            style="@style/DroidDrawFrame"
            android:layout_width="71dp"
            android:layout_height="80dp"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintStart_toStartOf="parent" />

        <TextView
            android:id="@+id/success_text"
            style="@style/CenterHeader"
            android:layout_marginBottom="@dimen/header_margin"
            android:text="@string/success_text"
            app:layout_constraintBottom_toTopOf="@+id/next_button"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent" />

        <TextView
            android:id="@+id/how_to_play"
            style="@style/RegularText"
            android:layout_marginEnd="@dimen/fab_margin"
            android:layout_marginRight="@dimen/fab_margin"
            android:layout_marginBottom="@dimen/fab_margin"
            android:text="@string/how_to_play"
            app:layout_constraintBottom_toTopOf="@+id/how_to_play_button"
            app:layout_constraintEnd_toEndOf="parent" />

        <com.google.android.material.floatingactionbutton.FloatingActionButton
            android:id="@+id/how_to_play_button"
            style="@style/HowToPlayButton"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent" />

        <com.google.android.material.floatingactionbutton.FloatingActionButton
            android:id="@+id/next_button"
            style="@style/RoundButton"
            android:src="@drawable/ic_play"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent" />

        <TextView
            android:id="@+id/score_text_view"
            style="@style/RegularText"
            android:layout_marginTop="40dp"
            app:layout_constraintTop_toBottomOf="@+id/next_button"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"/>
    </androidx.constraintlayout.widget.ConstraintLayout>
</FrameLayout>


text:
struct Person {
    name: String,
}

#[derive(Debug)]
struct Table {
    people: Vec<Person>,
}

#[derive(Debug)]
struct Config {
    people: Vec<Person>,
}

fn process_table(table: Table) {
    for p in table.people {
        println!("TRACER p: {:?}", p);
    }
}

fn main() {
    let p1 = Person{name: String::from("bach")};
    let p2 = Person{name: String::from("chopin")};
    let p3 = Person{name: String::from("mozart")};
    let list = vec![p1, p2, p3];
    let table = Table{people: list};

    process_table(table);

    println!("Ready.");
}


text:
<?php

namespace Tidal\WampWatch\Model\Contract;

interface SessionInterface
{
    /**
     * @return int
     */
    public function getId();
}


text:
package com.evolveum.midpoint.web.component.data;

import com.evolveum.midpoint.web.component.menu.cog.InlineMenu;
import com.evolveum.midpoint.web.component.menu.cog.InlineMenuItem;
import com.evolveum.midpoint.web.component.menu.cog.MenuDividerPanel;
import com.evolveum.midpoint.web.component.menu.cog.MenuLinkPanel;
import com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour;
import org.apache.wicket.AttributeModifier;
import org.apache.wicket.markup.html.WebMarkupContainer;
import org.apache.wicket.markup.html.list.ListItem;
import org.apache.wicket.markup.html.list.ListView;
import org.apache.wicket.model.AbstractReadOnlyModel;
import org.apache.wicket.model.IModel;
import org.apache.wicket.model.Model;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by honchar
 */
public class MenuMultiButtonPanel<T extends Serializable> extends MultiButtonPanel<T> {
    private static final String ID_INLINE_MENU_PANEL = "inlineMenuPanel";
    private static final String ID_MENU_ITEM_BODY = "menuItemBody";
    private static final String ID_MENU_BUTTON_CONTAINER = "menuButtonContainer";

    public MenuMultiButtonPanel(String id, int buttonsNumber, IModel<T> model, IModel<List<InlineMenuItem>> menuItemsModel) {
        super(id, buttonsNumber, model, menuItemsModel);
    }

    @Override
    protected void initLayout() {
        super.initLayout();

        InlineMenu inlineMenu = new InlineMenu(ID_INLINE_MENU_PANEL, menuItemsModel){
            @Override
            protected String getIconClass(){
                return "fa fa-ellipsis-h";
            }
           @Override
            protected String getAdditionalButtonClass(){
                return "btn btn-default btn-xs";
            }

           @Override
           protected String getMenuItemContainerClass(){
               return "none";
            }

           @Override
           protected String getMenuItemButtonStyle(){
               return "";
            }

           @Override
           protected String getMenuItemContainerStyle(){
               return "margin-left: -37px; margin-bottom: -3px; list-style: none;";
            }

        };
        inlineMenu.add(new VisibleEnableBehaviour(){
           @Override
            public boolean isVisible(){
               return !(numberOfButtons < 2);
           }
        });
        add(inlineMenu);

    }
}


text:
// Type definitions for pouchdb 6.1
// Project: https://pouchdb.com/
// Definitions by: Andy Brown <https://github.com/AGBrown>, Brian Geppert <https://github.com/geppy>, Frederico Galvão <https://github.com/fredgalvao>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3

/// <reference types='pouchdb-adapter-fruitdown' />
/// <reference types='pouchdb-adapter-http' />
/// <reference types='pouchdb-adapter-idb' />
/// <reference types='pouchdb-adapter-leveldb' />
/// <reference types='pouchdb-adapter-localstorage' />
/// <reference types='pouchdb-adapter-memory' />
/// <reference types='pouchdb-adapter-node-websql' />
/// <reference types='pouchdb-adapter-websql' />
/// <reference types='pouchdb-browser' />
/// <reference types='pouchdb-core' />
/// <reference types='pouchdb-http' />
/// <reference types='pouchdb-mapreduce' />
/// <reference types='pouchdb-node' />
/// <reference types='pouchdb-replication' />

// TODO: Fixing this lint error will require a large refactor
/* tslint:disable:no-single-declare-module */

declare module 'pouchdb' {
    const plugin: PouchDB.Static;
    export = plugin;
}


text:
package org.apache.tika.utils;

import java.io.IOException;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.io.Writer;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import org.apache.tika.exception.TikaException;

public class ExceptionUtils {

    private final static Pattern MSG_PATTERN = Pattern.compile(":[^\r\n]+");

    /**
     * Simple util to get stack trace.
     *

     * This will unwrap a TikaException and return the cause if not null
     *

     * NOTE: If your stacktraces are truncated, make sure to start your jvm
     * with: -XX:-OmitStackTraceInFastThrow
     *
     * @param t throwable
     * @return
     * @throws IOException
     */
    public static String getFilteredStackTrace(Throwable t) {
        Throwable cause = t;
        if ((t instanceof TikaException) &&
                t.getCause() != null) {
            cause = t.getCause();
        }
        return getStackTrace(cause);
    }

    /**
     * Get the full stacktrace as a string
     * @param t
     * @return
     */
    public static String getStackTrace(Throwable t) {
        Writer result = new StringWriter();
        PrintWriter writer = new PrintWriter(result);
        t.printStackTrace(writer);
        try {
            writer.flush();
            result.flush();
            writer.close();
            result.close();
        } catch (IOException e) {
            //swallow
        }
        return result.toString();
    }

    /**
     * Utility method to trim the message from a stack trace
     * string.
     *

     * E.g. java.lang.IllegalStateException: Potential loop detected
     * will be trimmed to java.lang.IllegalStateException
     * @param trace string view of stack trace
     * @return trimmed stack trace
     */
    public static String trimMessage(String trace) {
        Matcher msgMatcher = MSG_PATTERN.matcher(trace);
        if (msgMatcher.find()) {
            return msgMatcher.replaceFirst("");
        }
        return trace;
    }
}


text:
#ifndef BOOST_FLYWEIGHT_REFCOUNTED_FWD_HPP
#define BOOST_FLYWEIGHT_REFCOUNTED_FWD_HPP

#if defined(_MSC_VER)
#pragma once
#endif

namespace boost{

namespace flyweights{

struct refcounted;

} /* namespace flyweights */

} /* namespace boost */

#endif