text:
# Default target executed when no arguments are given to make.
default_target: all
.PHONY : default_target

#=============================================================================
# Special targets provided by cmake.

# Disable implicit rules so canoncical targets will work.
.SUFFIXES:

# Remove some rules from gmake that .SUFFIXES does not remove.
SUFFIXES =

.SUFFIXES: .hpux_make_needs_suffix_list

# Suppress display of executed commands.
$(VERBOSE).SILENT:

# A target that is always out of date.
cmake_force:
.PHONY : cmake_force

#=============================================================================
# Set environment variables for the build.

# The shell in which to execute make rules.
SHELL = /bin/sh

# The CMake executable.
CMAKE_COMMAND = /usr/local/bin/cmake

# The command to remove a file.
RM = /usr/local/bin/cmake -E remove -f

# The program to use to edit the cache.
CMAKE_EDIT_COMMAND = /usr/local/bin/ccmake

# The top-level source directory on which CMake was run.
CMAKE_SOURCE_DIR = /home/fjtenar/mycode/ejemplos_C/boost

# The top-level build directory on which CMake was run.
CMAKE_BINARY_DIR = /home/fjtenar/mycode/ejemplos_C/boost

#=============================================================================
# Targets provided globally by CMake.

# Special rule for the target edit_cache
edit_cache:
	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake cache editor..."
	/usr/local/bin/ccmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)
.PHONY : edit_cache

# Special rule for the target edit_cache
edit_cache/fast: edit_cache
.PHONY : edit_cache/fast

# Special rule for the target rebuild_cache
rebuild_cache:
	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..."
	/usr/local/bin/cmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)
.PHONY : rebuild_cache

# Special rule for the target rebuild_cache
rebuild_cache/fast: rebuild_cache
.PHONY : rebuild_cache/fast

# The main all target
all: cmake_check_build_system
	$(CMAKE_COMMAND) -E cmake_progress_start /home/fjtenar/mycode/ejemplos_C/boost/CMakeFiles /home/fjtenar/mycode/ejemplos_C/boost/CMakeFiles/progress.marks
	$(MAKE) -f CMakeFiles/Makefile2 all
	$(CMAKE_COMMAND) -E cmake_progress_start /home/fjtenar/mycode/ejemplos_C/boost/CMakeFiles 0
.PHONY : all

# The main clean target
clean:
	$(MAKE) -f CMakeFiles/Makefile2 clean
.PHONY : clean

# The main clean target
clean/fast: clean
.PHONY : clean/fast

# Prepare targets for installation.
preinstall: all
	$(MAKE) -f CMakeFiles/Makefile2 preinstall
.PHONY : preinstall

# Prepare targets for installation.
preinstall/fast:
	$(MAKE) -f CMakeFiles/Makefile2 preinstall
.PHONY : preinstall/fast

# clear depends
depend:
	$(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1
.PHONY : depend

#=============================================================================
# Target rules for targets named multi_index

# Build rule for target.
multi_index: cmake_check_build_system
	$(MAKE) -f CMakeFiles/Makefile2 multi_index
.PHONY : multi_index

# fast build rule for target.
multi_index/fast:
	$(MAKE) -f CMakeFiles/multi_index.dir/build.make CMakeFiles/multi_index.dir/build
.PHONY : multi_index/fast

multi_index.o: multi_index.cpp.o
.PHONY : multi_index.o

# target to build an object file
multi_index.cpp.o:
	$(MAKE) -f CMakeFiles/multi_index.dir/build.make CMakeFiles/multi_index.dir/multi_index.cpp.o
.PHONY : multi_index.cpp.o

multi_index.i: multi_index.cpp.i
.PHONY : multi_index.i

# target to preprocess a source file
multi_index.cpp.i:
	$(MAKE) -f CMakeFiles/multi_index.dir/build.make CMakeFiles/multi_index.dir/multi_index.cpp.i
.PHONY : multi_index.cpp.i

multi_index.s: multi_index.cpp.s
.PHONY : multi_index.s

# target to generate assembly for a file
multi_index.cpp.s:
	$(MAKE) -f CMakeFiles/multi_index.dir/build.make CMakeFiles/multi_index.dir/multi_index.cpp.s
.PHONY : multi_index.cpp.s

# Help Target
help:
	@echo "The following are some of the valid targets for this Makefile:"
	@echo "... all (the default if no target is provided)"
	@echo "... clean"
	@echo "... depend"
	@echo "... edit_cache"
	@echo "... multi_index"
	@echo "... rebuild_cache"
	@echo "... multi_index.o"
	@echo "... multi_index.i"
	@echo "... multi_index.s"
.PHONY : help

#=============================================================================
# Special targets to cleanup operation of make.

# Special rule to run CMake to check the build system integrity.
# No rule that depends on this can have commands that come from listfiles
# because they might be regenerated.
cmake_check_build_system:
	$(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0
.PHONY : cmake_check_build_system


text:
package jp.ats.liverwort.sql.binder;

import java.sql.Blob;

import jp.ats.liverwort.jdbc.LiPreparedStatement;
import jp.ats.liverwort.sql.Binder;

/**
 * {@link LiPreparedStatement} に {@link Blob} の値を設定するための {@link Binder} です。
 *
 * @author 千葉 哲嗣
 */
public final class BlobBinder extends Binder {

	private final Blob value;

	/**
	 * パラメータの値を持つインスタンスを生成します。
	 *
	 * @param value このインスタンスの値
	 */
	public BlobBinder(Blob value) {
		this.value = value;
	}

	@Override
	public void bind(int index, LiPreparedStatement statement) {
		statement.setBlob(index, value);
	}

	@Override
	public String toString() {
		return String.valueOf(value);
	}

	@Override
	public Binder replicate() {
		throw new UnsupportedOperationException();
	}

	@Override
	public boolean canEvalValue() {
		return true;
	}

	@Override
	public Object getValue() {
		return value;
	}

	/**
	 * このインスタンスの持つ値を返します。
	 *
	 * @return 値
	 */
	public Blob getBlobValue() {
		return value;
	}

	@Override
	protected Object getSpecificallyValue() {
		return value;
	}
}

redpajama_set_name: RedPajamaGithub


text:
<?php

	use \UserApp\Widget\User;
	require("app_init.php");

	$email = null;
	$valid_credentials = null;

	if($_SERVER['REQUEST_METHOD'] === 'POST'){
		if(!User::authenticated()){
			$email = $_POST["email"];
			$password = $_POST["password"];

			try{
				$valid_credentials = User::login($email, $password);
			}catch(\UserApp\Exceptions\ServiceException $exception){
				$valid_credentials = true;
			}
		}
	}

	if(User::authenticated()){
		$user = User::current();
		if($user->hasPermission("admin")){
			header('Location: admin/home.php');
		}else{
			header('Location: user/home.php');
		}
		die;
	}

?>

<?php require("app/header.php"); ?>

<form class="form" method="post">

Log in to MyApp

		<input name="email" type="text" class="form-control" placeholder="Email" value="<?php echo(htmlentities($email)) ?>" required autofocus>
		<input name="password" type="password" class="form-control" placeholder="Password" required>

	<?php if($valid_credentials !== null){ ?>

			Invalid email or password. Please try again.

	<?php } ?>

	<button class="btn btn-lg btn-primary btn-block" type="submit">Log in</button>

		or Sign up

</form>

<?php require("app/footer.php"); ?>


text:
module Fastlane
  module Actions
    module SharedValues
    end

    # To share this integration with the other fastlane users:
    # - Fork https://github.com/KrauseFx/fastlane
    # - Clone the forked repository
    # - Move this integration into lib/fastlane/actions
    # - Commit, push and submit the pull request

    class AfUpdateGithubMilestoneAction < Action
      def self.run(params)

        require 'net/http'
        require 'net/https'
        require 'json'
        require 'base64'

        begin
          uri = URI("https://api.github.com/repos/#{params[:owner]}/#{params[:repository]}/milestones/#{params[:number]}")

          # Create client
          http = Net::HTTP.new(uri.host, uri.port)
          http.use_ssl = true
          http.verify_mode = OpenSSL::SSL::VERIFY_PEER

          dict = Hash.new
          dict["title"] = params[:title] if params[:title]
          dict["state"] = params[:state] if params[:state]
          dict["description"] = params[:description] if params[:description]
          dict["due_on"] = params[:due_on] if params[:due_on]
          body = JSON.dump(dict)

          # Create Request
          req =  Net::HTTP::Patch.new(uri)
          req.add_field "Content-Type", "application/json"
          api_token = params[:api_token]
          req.add_field "Authorization", "Basic #{Base64.strict_encode64(api_token)}"
          req.add_field "Accept", "application/vnd.github.v3+json"
          req.add_field "Content-Type", "application/json"
          req.body = body

          # Fetch Request
          res = http.request(req)
        rescue StandardError => e
          UI.error("HTTP Request failed (#{e.message})")
        end

        case res.code.to_i
          when 200
          json = JSON.parse(res.body)
          UI.success("Github Release updated")

          Actions.lane_context[SharedValues::GITHUB_RELEASE_ID] = json["id"]
          Actions.lane_context[SharedValues::GITHUB_RELEASE_HTML_URL] = json["html_url"]
          Actions.lane_context[SharedValues::GITHUB_RELEASE_UPLOAD_URL_TEMPLATE] = json["upload_url"]
          return json
          when 400..499
          json = JSON.parse(res.body)
          raise "Error Creating Github Release (#{res.code}): #{json["message"]}".red
          else
          UI.message("Status Code: #{res.code} Body: #{res.body}")
          raise "Error Creating Github Release".red
        end
      end

      #####################################################
      # @!group Documentation
      #####################################################

      def self.description
        "Edit a Github Milestone"
      end

      def self.available_options
        [
          FastlaneCore::ConfigItem.new(key: :owner,
                                       env_name: "GITHUB_OWNER",
                                       description: "The Github Owner",
                                       is_string:true,
                                       optional:false),
           FastlaneCore::ConfigItem.new(key: :repository,
                                        env_name: "GITHUB_REPOSITORY",
                                        description: "The Github Repository",
                                        is_string:true,
                                        optional:false),
          FastlaneCore::ConfigItem.new(key: :number,
                                       env_name: "GITHUB_MILESTONE_NUMBER",
                                       description: "The Github Release ID",
                                       is_string:true,
                                       default_value:Actions.lane_context[SharedValues::GITHUB_MILESTONE_NUMBER]),
          FastlaneCore::ConfigItem.new(key: :api_token,
                                       env_name: "GITHUB_API_TOKEN",
                                       description: "Personal API Token for GitHub - generate one at https://github.com/settings/tokens",
                                       is_string: true,
                                       optional: false),
          FastlaneCore::ConfigItem.new(key: :title,
                                       env_name: "GITHUB_MILESTONE_TITLE",
                                       description: "The title to update",
                                       is_string: true,
                                       optional: true),
          FastlaneCore::ConfigItem.new(key: :state,
                                       env_name: "GITHUB_MILESTONE_STATE",
                                       description: "The state to update. Can be `open` or `closed`",
                                       is_string: true,
                                       optional: true,
                                       verify_block: proc do |value|
                                         raise "`state` can only be `open` or `closed".red unless value == "open" || value == "closed"
                                       end),
          FastlaneCore::ConfigItem.new(key: :description,
                                       env_name: "GITHUB_MILESTONE_DESCRIPTION",
                                       description: "The description of the milestone",
                                       is_string: true,
                                       optional: true),
          FastlaneCore::ConfigItem.new(key: :due_on,
                                       env_name: "GITHUB_MIELSTONE_DUE_DATE",
                                       description: "The milestone due date. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ",
                                       is_string: true,
                                       optional: true),

        ]
      end

      def self.return_value
        "The Hash representing the API response"
      end

      def self.authors
        ["kcharwood"]
      end

      def self.is_supported?(platform)
        return true
      end
    end
  end
end


text:
/**
 * Created by HuangKai on 2016/12/16.
 */
import {combineReducers} from 'redux';
import userReducer from './user';

export default combineReducers({
    userStore: userReducer
})


text:
using System;
using cAlgo.API;
using cAlgo.API.Indicators;

namespace cAlgo.Indicators
{
    [Indicator(IsOverlay = true, AccessRights = AccessRights.None)]
    public class Supertrend : Indicator
    {
        [Parameter(DefaultValue = 10)]
        public int Period { get; set; }

        [Parameter(DefaultValue = 3.0)]
        public double Multiplier { get; set; }

        [Output("UpTrend", Color = Colors.Green, PlotType = PlotType.Points, Thickness = 3)]
        public IndicatorDataSeries UpTrend { get; set; }

        [Output("DownTrend", Color = Colors.Red, PlotType = PlotType.Points, Thickness = 3)]
        public IndicatorDataSeries DownTrend { get; set; }

        private IndicatorDataSeries _upBuffer;
        private IndicatorDataSeries _downBuffer;
        private AverageTrueRange _averageTrueRange;
        private int[] _trend;
        private bool _changeofTrend;

        protected override void Initialize()
        {
            _trend = new int[1];
            _upBuffer = CreateDataSeries();
            _downBuffer = CreateDataSeries();
            _averageTrueRange = Indicators.AverageTrueRange(Period, MovingAverageType.WilderSmoothing);
        }

        public override void Calculate(int index)
        {
            // Init
            UpTrend[index] = double.NaN;
            DownTrend[index] = double.NaN;

            double median = (MarketSeries.High[index] + MarketSeries.Low[index]) / 2;
            double atr = _averageTrueRange.Result[index];

            _upBuffer[index] = median + Multiplier * atr;
            _downBuffer[index] = median - Multiplier * atr;

            if (index < 1)
            {
                _trend[index] = 1;
                return;
            }

            Array.Resize(ref _trend, _trend.Length + 1);

            // Main Logic
            if (MarketSeries.Close[index] > _upBuffer[index - 1])
            {
                _trend[index] = 1;
                if (_trend[index - 1] == -1)
                    _changeofTrend = true;
            }
            else if (MarketSeries.Close[index] < _downBuffer[index - 1])
            {
                _trend[index] = -1;
                if (_trend[index - 1] == -1)
                    _changeofTrend = true;
            }
            else if (_trend[index - 1] == 1)
            {
                _trend[index] = 1;
                _changeofTrend = false;
            }
            else if (_trend[index - 1] == -1)
            {
                _trend[index] = -1;
                _changeofTrend = false;
            }

            if (_trend[index] < 0 && _trend[index - 1] > 0)
                _upBuffer[index] = median + (Multiplier * atr);
            else if (_trend[index] < 0 && _upBuffer[index] > _upBuffer[index - 1])
                _upBuffer[index] = _upBuffer[index - 1];

            if (_trend[index] > 0 && _trend[index - 1] < 0)
                _downBuffer[index] = median - (Multiplier * atr);
            else if (_trend[index] > 0 && _downBuffer[index] < _downBuffer[index - 1])
                _downBuffer[index] = _downBuffer[index - 1];

            // Draw Indicator
            if (_trend[index] == 1)
            {
                UpTrend[index] = _downBuffer[index];
                if (_changeofTrend)
                {
                    UpTrend[index - 1] = DownTrend[index - 1];
                    _changeofTrend = false;
                }
            }
            else if (_trend[index] == -1)
            {
                DownTrend[index] = _upBuffer[index];
                if (_changeofTrend)
                {
                    DownTrend[index - 1] = UpTrend[index - 1];
                    _changeofTrend = false;
                }
            }
        }
    }
}


text:
package ca.uhn.fhir.rest.server;

/**
 * @see Extended Elements Support
 */
public enum ElementsSupportEnum {

	/**
	 * The server will support only the FHIR standard features for the _elements
	 * parameter.
	 *
	 * @see http://hl7.org/fhir/search.html#elements
	 */
	STANDARD,

	/**
	 * The server will support both the standard features as well as support for elements
	 * exclusion.
	 */
	EXTENDED

}


text:
module QA
  module Page
    module Project
      module Settings
        module Common
          include QA::Page::Settings::Common

          def self.included(base)
            base.class_eval do
              view 'app/views/projects/edit.html.haml' do
                element :advanced_settings_expand, "= expanded ? 'Collapse' : 'Expand'" # rubocop:disable QA/ElementWithPattern
              end
            end
          end
        end
      end
    end
  end
end


text:
<?php

namespace Omnipay\Sisow\Message;

class RefundResponse extends AbstractResponse
{
    /**
     * @inheritDoc
     */
    public function isSuccessful()
    {
        return isset($this->data->refund->refundid);
    }

    /**
     * @return string|null
     */
    public function getRefundId()
    {
        return isset($this->data->refund->refundid) ?
            (string) $this->data->refund->refundid :
            null;
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="pl.czak.retronix.android">

    <uses-feature android:name="android.software.leanback"
                  android:required="false" />

    <uses-feature android:name="android.hardware.touchscreen"
                  android:required="false" />

    <application android:label="Retronix"
                 android:banner="@drawable/banner"
                 android:icon="@drawable/icon"
                 android:isGame="true">
        <activity android:name="MainActivity"
                  android:screenOrientation="landscape"
                  android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
                <category android:name="android.intent.category.LEANBACK_LAUNCHER" />
            </intent-filter>
        </activity>
    </application>
</manifest>


text:
using Aspose.Email.Mapi;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;

/*
This project uses Automatic Package Restore feature of NuGet to resolve Aspose.Email for .NET API reference
when the project is build. Please check https://Docs.nuget.org/consume/nuget-faq for more information.
If you do not wish to use NuGet, you can manually download Aspose.Email for .NET API from https://www.nuget.org/packages/Aspose.Email/,
install it and then add its reference to this project. For any issues, questions or suggestions
please feel free to contact us using https://forum.aspose.com/c/email
*/

namespace Aspose.Email.Examples.CSharp.Email.Outlook
{
    class SetAdditionalMAPIProperties
    {
        public static void Run()
        {
            string dataDir = RunExamples.GetDataDir_Outlook();

            MapiMessage msg = MapiMessage.FromFile(dataDir + "message.msg");

            // ExStart:SetAdditionalMAPIProperties
            // PT_MV_FLOAT, PT_MV_R4, mv.float
            IList<object> values = new List<object>();
            values.Add((float)1);
            values.Add((float)2);
            msg.SetProperty(new MapiProperty(0x23901004, values));

            // PT_MV_DOUBLE, PT_MV_R8
            values = new List<object>();
            values.Add((double)1);
            values.Add((double)2);
            msg.SetProperty(new MapiProperty(0x23901005, values));

            // PT_MV_CURRENCY, mv.fixed.14.4
            values = new List<object>();
            values.Add((decimal)123.34);
            values.Add((decimal)289.45);
            msg.SetProperty(new MapiProperty(0x23901006, values));

            // PT_MV_APPTIME
            values = new List<object>();
            values.Add(30456.34);
            values.Add(40655.45);
            msg.SetProperty(new MapiProperty(0x23901007, values));

            // PT_MV_I8, PT_MV_LONGLONG
            values = new List<object>();
            values.Add((long)30456);
            values.Add((long)40655);
            msg.SetProperty(new MapiProperty(0x23901014, values));

            // PT_MV_CLSID, mv.uuid
            values = new List<object>();
            values.Add(Guid.NewGuid());
            values.Add(Guid.NewGuid());
            msg.SetProperty(new MapiProperty(0x23901048, values));

            // PT_MV_SHORT, PT_MV_I2, mv.i2
            values = new List<object>();
            values.Add((short)1);
            values.Add((short)2);
            msg.SetProperty(new MapiProperty(0x23901002, values));

            // PT_MV_SYSTIME
            values = new List<object>();
            values.Add(DateTime.Now);
            values.Add(DateTime.Now);
            msg.SetProperty(new MapiProperty(0x23901040, values));

            // PT_MV_BOOLEAN
            values = new List<object>();
            values.Add(true);
            values.Add(false);
            msg.SetProperty(new MapiProperty(0x2390100b, values));

            // PT_MV_BINARY
            values = new List<object>();
            values.Add(Guid.NewGuid().ToByteArray());
            values.Add(new byte[]{1,2,4,5,6,7,5,4,3,5,6,7,8,6,4,3,4,5,6,7,8,6,5,4,3,7,8,9,0,2,3,4,});
            msg.SetProperty(new MapiProperty(0x23901102, values));

            // PT_NULL
            msg.SetProperty(new MapiProperty(0x67400001, new byte[1]));
            MapiMessage message = new MapiMessage("sender@test.com", "recipient@test.com", "subj", "Body of test msg");

            // PT_MV_LONG
            values = new List<object>();
            values.Add((int)4);
            MapiProperty property = new MapiProperty(message.NamedPropertyMapping.GetNextAvailablePropertyId(MapiPropertyType.PT_MV_LONG), values);
            message.NamedPropertyMapping.AddNamedPropertyMapping(property, 0x00008028, new Guid("00062004-0000-0000-C000-000000000046"));
            message.SetProperty(property);

            // OR you can set the custom property (with the custom name)
            message = new MapiMessage("sender@test.com", "recipient@test.com", "subj", "Body of test msg");
            values = new List<object>();
            values.Add((int)4);
            property = new MapiProperty(message.NamedPropertyMapping.GetNextAvailablePropertyId(MapiPropertyType.PT_MV_LONG), values);
            message.AddCustomProperty(property, "customProperty");

            //PT_FLOAT
            //Please note that you need explicit cast to float value for this to work
            float floatValue = (float)123.456;
            MapiMessage newMsg = new MapiMessage();
            long floatTag = newMsg.NamedPropertyMapping.GetNextAvailablePropertyId(MapiPropertyType.PT_FLOAT);
            Guid guid = Guid.NewGuid();
            MapiProperty newMapiProperty = new MapiProperty(floatTag, BitConverter.GetBytes(floatValue));
            newMsg.NamedPropertyMapping.AddNamedPropertyMapping(newMapiProperty, 12, guid);
            newMsg.SetProperty(newMapiProperty);

            // ExEnd:SetAdditionalMAPIProperties
        }
    }
}


text:
package com.mopub.nativeads;

import android.content.Context;
import android.support.annotation.NonNull;

import com.mopub.common.UrlHandler;
import com.mopub.common.UrlAction;
import com.mopub.common.logging.MoPubLog;

import java.lang.ref.WeakReference;
import java.util.Iterator;

class ClickDestinationResolutionListener implements UrlResolutionTask.UrlResolutionListener {
    private final Context mContext;
    private final Iterator<String> mUrlIterator;
    private final WeakReference<SpinningProgressView> mSpinningProgressView;

    public ClickDestinationResolutionListener(@NonNull final Context context,
            @NonNull final Iterator<String> urlIterator,
            @NonNull final SpinningProgressView spinningProgressView) {
        mContext = context.getApplicationContext();
        mUrlIterator = urlIterator;
        mSpinningProgressView = new WeakReference<SpinningProgressView>(spinningProgressView);
    }

    /**
     * Called upon user click, after the corresponding UrlResolutionTask has followed all redirects
     * successfully. Attempts to open mopubnativebrowser links in the device browser, deep-links in
     * the corresponding application, and all other links in the MoPub in-app browser. In the first
     * two cases, malformed URLs will try to fallback to the next entry in mUrlIterator, and failing
     * that, will no-op.
     */
    @Override
    public void onSuccess(@NonNull final String resolvedUrl) {
        new UrlHandler.Builder()
                .withSupportedUrlActions(
                        UrlAction.IGNORE_ABOUT_SCHEME,
                        UrlAction.OPEN_NATIVE_BROWSER,
                        UrlAction.OPEN_APP_MARKET,
                        UrlAction.OPEN_IN_APP_BROWSER,
                        UrlAction.HANDLE_SHARE_TWEET,
                        UrlAction.FOLLOW_DEEP_LINK_WITH_FALLBACK,
                        UrlAction.FOLLOW_DEEP_LINK)
                .withResultActions(new UrlHandler.ResultActions() {
                    @Override
                    public void urlHandlingSucceeded(@NonNull String url,
                            @NonNull UrlAction urlAction) {
                    }

                    @Override
                    public void urlHandlingFailed(@NonNull String url,
                            @NonNull UrlAction lastFailedUrlAction) {
                        if (mUrlIterator.hasNext()) {
                            UrlResolutionTask.getResolvedUrl(mUrlIterator.next(),
                                    ClickDestinationResolutionListener.this);
                        }
                    }
                })
                .build().handleUrl(mContext, resolvedUrl);
        removeSpinningProgressView();
    }

    @Override
    public void onFailure() {
        MoPubLog.d("Failed to resolve URL for click.");
        removeSpinningProgressView();
    }

    private void removeSpinningProgressView() {
        final SpinningProgressView spinningProgressView = mSpinningProgressView.get();
        if (spinningProgressView != null) {
            spinningProgressView.removeFromRoot();
        }
    }
}


text:
ALTER TABLE `zstack`.`VipVO` add column `system` tinyint unsigned NOT NULL DEFAULT 0;

UPDATE ResourceVO SET resourceType = "PrimaryStorageVO", concreteResourceType = "org.zstack.storage.primary.sharedblock.SharedBlockGroupVO"  WHERE resourceType = "SharedBlockGroupVO";


text:
namespace media {

class CdmFactory;

// A mojom::ContentDecryptionModule implementation backed by a
// media::ContentDecryptionModule.
class MEDIA_MOJO_EXPORT MojoCdmService final
    : public mojom::ContentDecryptionModule {
 public:
  // Callback for Initialize(). Non-null `cdm_context` indicates success. Null
  // `cdm_context` indicates failure and the `error_message` provides a reason.
  using InitializeCB =
      base::OnceCallback<void(mojom::CdmContextPtr cdm_context,
                              const std::string& error_message)>;

  explicit MojoCdmService(MojoCdmServiceContext* context);

  MojoCdmService(const MojoCdmService&) = delete;
  MojoCdmService& operator=(const MojoCdmService&) = delete;

  ~MojoCdmService() final;

  // Initialize the MojoCdmService, including creating the real CDM using the
  // `cdm_factory`, which must not be null. The MojoCdmService should NOT be
  // used before the `init_cb` is returned.
  void Initialize(CdmFactory* cdm_factory,
                  const CdmConfig& cdm_config,
                  InitializeCB init_cb);

  // mojom::ContentDecryptionModule implementation.
  void SetClient(
      mojo::PendingAssociatedRemote<mojom::ContentDecryptionModuleClient>
          client) final;
  void SetServerCertificate(const std::vector<uint8_t>& certificate_data,
                            SetServerCertificateCallback callback) final;
  void GetStatusForPolicy(HdcpVersion min_hdcp_version,
                          GetStatusForPolicyCallback callback) final;
  void CreateSessionAndGenerateRequest(
      CdmSessionType session_type,
      EmeInitDataType init_data_type,
      const std::vector<uint8_t>& init_data,
      CreateSessionAndGenerateRequestCallback callback) final;
  void LoadSession(CdmSessionType session_type,
                   const std::string& session_id,
                   LoadSessionCallback callback) final;
  void UpdateSession(const std::string& session_id,
                     const std::vector<uint8_t>& response,
                     UpdateSessionCallback callback) final;
  void CloseSession(const std::string& session_id,
                    CloseSessionCallback callback) final;
  void RemoveSession(const std::string& session_id,
                     RemoveSessionCallback callback) final;

  // Get CDM to be used by the media pipeline.
  scoped_refptr<::media::ContentDecryptionModule> GetCdm();

  // Gets the remote ID of the CDM this is holding.
  base::UnguessableToken cdm_id() const { return cdm_id_.value(); }

 private:
  // Callback for CdmFactory::Create().
  void OnCdmCreated(InitializeCB callback,
                    const scoped_refptr<::media::ContentDecryptionModule>& cdm,
                    const std::string& error_message);

  // Callbacks for firing session events.
  void OnSessionMessage(const std::string& session_id,
                        ::media::CdmMessageType message_type,
                        const std::vector<uint8_t>& message);
  void OnSessionKeysChange(const std::string& session_id,
                           bool has_additional_usable_key,
                           CdmKeysInfo keys_info);
  void OnSessionExpirationUpdate(const std::string& session_id,
                                 base::Time new_expiry_time);
  void OnSessionClosed(const std::string& session_id,
                       CdmSessionClosedReason reason);

  // Callback for when |decryptor_| loses connectivity.
  void OnDecryptorConnectionError();

  const raw_ptr<MojoCdmServiceContext> context_;
  scoped_refptr<::media::ContentDecryptionModule> cdm_;

  // MojoDecryptorService is passed the Decryptor from |cdm_|, so
  // |decryptor_| must not outlive |cdm_|.
  std::unique_ptr<MojoDecryptorService> decryptor_;
  mojo::PendingRemote<mojom::Decryptor> decryptor_remote_;
  std::unique_ptr<mojo::Receiver<mojom::Decryptor>> decryptor_receiver_;

  // Set to a valid CDM ID if the |cdm_| is successfully created.
  absl::optional<base::UnguessableToken> cdm_id_;

  mojo::AssociatedRemote<mojom::ContentDecryptionModuleClient> client_;

  base::WeakPtrFactory<MojoCdmService> weak_factory_{this};
};

}  // namespace media

#endif  // MEDIA_MOJO_SERVICES_MOJO_CDM_SERVICE_H_


text:
package com.github.dmn1k.supercsv.io.declarative.provider;

import com.github.dmn1k.supercsv.model.CellProcessorFactory;
import com.github.dmn1k.supercsv.model.DeclarativeCellProcessorProvider;
import com.github.dmn1k.supercsv.model.ProcessingMetadata;
import com.github.dmn1k.supercsv.io.declarative.annotation.ParseLocalTime;
import java.time.format.DateTimeFormatter;
import org.supercsv.cellprocessor.ift.CellProcessor;

/**
 * CellProcessorProvider for {@link ParseLocalTime}
 *
 * @since 3.0.0
 * @author Dominik Schlosser
 */
public class ParseLocalTimeCellProcessorProvider implements DeclarativeCellProcessorProvider<ParseLocalTime> {

    /**
     * {@inheritDoc}
     */
    @Override
    public CellProcessorFactory create(ProcessingMetadata<ParseLocalTime> metadata) {
        return new CellProcessorFactory() {

            @Override
            public int getOrder() {
                return metadata.getAnnotation().order();
            }

            @Override
            public CellProcessor create(CellProcessor next) {
                ParseLocalTime annotation = metadata.getAnnotation();
                return new org.supercsv.cellprocessor.time.ParseLocalTime(DateTimeFormatter.ofPattern(annotation.format()), next);
            }
        };
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public Class<ParseLocalTime> getType() {
        return ParseLocalTime.class;
    }

}


text:
goog.provide('ol.test.rendering.reproj.Image');

describe('ol.rendering.reproj.Image', function() {

  function testSingleImage(source, targetProj,
      targetExtent, targetResolution, pixelRatio, expectedUrl, done) {
    var sourceProj = source.getProjection();

    var imagesRequested = 0;

    var image = new ol.reproj.Image(sourceProj, ol.proj.get(targetProj),
        targetExtent, targetResolution, pixelRatio,
        function(extent, resolution, pixelRatio) {
          imagesRequested++;
          return source.getImage(extent, resolution, pixelRatio, sourceProj);
        });
    if (image.getState() == 0) { // IDLE
      ol.events.listen(image, 'change', function(e) {
        if (image.getState() == 2) { // LOADED
          expect(imagesRequested).to.be(1);
          resembleCanvas(image.getImage(), expectedUrl, IMAGE_TOLERANCE, done);
        }
      });
      image.load();
    }
  }

  var source;

  describe('image reprojections from EPSG:3857', function() {
    beforeEach(function() {
      source = new ol.source.ImageStatic({
        url: 'spec/ol/data/tiles/osm/5/5/12.png',
        imageExtent: ol.tilegrid.createXYZ().getTileCoordExtent([5, 5, -13]),
        projection: ol.proj.get('EPSG:3857')
      });
    });

    it('works for identity reprojection', function(done) {
      testSingleImage(source, 'EPSG:3857',
          ol.tilegrid.createXYZ().getTileCoordExtent([5, 5, -13]),
          2 * ol.proj.EPSG3857.HALF_SIZE / (256 * (1 << 5)), 1,
          'spec/ol/data/tiles/osm/5/5/12.png', done);
    });

    it('to EPSG:4326', function(done) {
      testSingleImage(source, 'EPSG:4326',
          ol.tilegrid.createForProjection('EPSG:4326').
              getTileCoordExtent([6, 10, -10]),
          360 / (256 * (1 << 4)), 1,
          'spec/ol/reproj/expected/image-3857-to-4326.png', done);
    });
  });
});

goog.require('ol.events');
goog.require('ol.proj');
goog.require('ol.proj.EPSG3857');
goog.require('ol.reproj.Image');
goog.require('ol.source.ImageStatic');


text:
Stratio Druid Sink
====================

The Druid Sink component allows to save Flume-flow events to Druid.

Configuration
=============

The available config parameters are:

- `indexService` *(String, required)*: Overlord's service name

- `discoveryPath` *(String, required)*: Your overlord's druid.discovery.curator.path

- `dimensions` *(String, required)*: Comma separated list with event headers you want to stored. Similar to columns in
relational databases.

- `firehosePattern` *(String)*:  Firehoses describe the data stream source. Make up a service pattern, include %s
somewhere in it. This will be used for internal service-discovery purposes, to help druid sink find Druid indexing
tasks. By default, *druid:firehose:%s*.

- `dataSource` *(String)*: Source name where events will be stored. Very similar to a table in relational databases.
 By default, *sampleSource*.

- `aggregators` *(String)*: Different specifications of processing over available metrics. By default, *count*
aggregator.

- `zookeeperLocation` *(String)*: Zookeeper location (hostname:port).By default, *127.0.0.1:2181*.

- `timestampField` *(String)*: The field name where event timestamp info is extracted from. By default, *timestamp*.

- `segmentGranularity` *(Granularity)*: Time granularity (minute, hour, day, week, month) for loading data at query
time. Recommended, more than queryGranularity.  By default, *HOUR*.

- `queryGranularity` *(Granularity)*: Time granularity (minute, hour, day, week, month) for rollup. At least, less
than segmentGranularity. Recommended: minute, hour, day, week, month.  By default, *NONE*.

- `period` *(Period)*: While reading, events with timestamp older than now minus this value, will be discarded.  By
default, *PT10M*.

- `partitions` *(Integer)*: This is used to scale ingestion up to handle larger streams.  By default, *1*.

- `replicants` *(Integer)*: This is used to provide higher availability and parallelism for queries.  By default, *1*.

- `baseSleepTime` *(Integer)*: Initial amount of time to wait between retries.  By default, *1000*.

- `maxRetries` *(Integer)*: Max number of times to retry.  By default, *3*.

- `maxSleep` *(Integer)*: Max time in ms to sleep on each retry.  By default, *30000*.

- `batchSize` *(Integer)*: Number of events to batch together to be send to our data source.  By default, *1000*.

As a recommendation: The normal, expected use cases have the following overall constraints: queryGranularity <
windowPeriod < segmentGranularity.

Sample Complete-flow Flume config
=================================

The following file describes an example configuration of an Flume agent that uses a [Syslog source]
(http://flume.apache.org/FlumeUserGuide.html#syslog-tcp-source), a [File channel](http://flume.apache
.org/FlumeUserGuide.html#file-channel) and our Druid Sink

    # Name the components on this agent
    agent.sources = logs
    agent.sinks = druidSink
    agent.channels = c1

    # Describe the source - Syslog
    agent.sources.logs.type = syslogtcp
    agent.sources.logs.port = 5140
    agent.sources.logs.host = 127.0.0.1

    #Interceptor morphline
    agent.sources.logs.interceptors = morphline
    agent.sources.logs.interceptors.morphline.type = org.apache.flume.sink.solr.morphline.MorphlineInterceptor$Builder
    agent.sources.logs.interceptors.morphline.morphlineFile = morphline.conf
    agent.sources.logs.interceptors.morphline.morphlineId = morphline1

    # Describe the Druid sink
    agent.sinks.druidSink.type = com.stratio.ingestion.sink.druid.DruidSink
    agent.sinks.druidSink.indexService = druid/prod/overlord
    agent.sinks.druidSink.discoveryPath = /prod/discovery
    agent.sinks.druidSink.dimensions = timestamp,IPAddr,LogLevel,Domain,MessageID

    # Use a channel which buffers events in file
    agent.channels.c1.type = file
    agent.channels.c1.checkpointDir = data/channel/check/
    agent.channels.c1.dataDirs = data/channel/data/
    agent.channels.c1.capacity = 1000000
    agent.channels.c1.transactionCapacity = 10000
    agent.channels.c1.checkpointInterval = 300000

    # Bind the source and sink to the channel
    agent.sources.logs.channels = c1
    agent.sinks.druidSink.channel = c1


text:
package java2.util2;

/**
 * A tagging interface that all event listener interfaces must extend.
 * @since JDK1.1
 */
public interface EventListener {}


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

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>GFileOutputStream: GIO Reference Manual</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
<link rel="home" href="index.html" title="GIO Reference Manual">
<link rel="up" href="streaming.html" title="Streaming I/O">
<link rel="prev" href="GFileInputStream.html" title="GFileInputStream">
<link rel="next" href="GFileIOStream.html" title="GFileIOStream">
<meta name="generator" content="GTK-Doc V1.24 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">

Top  |
                  Description  |
                  Object Hierarchy  |
                  Implemented Interfaces

GFileOutputStream

GFileOutputStream — File output streaming operations

Functions

<colgroup>
<col width="150px" class="functions_return">
<col class="functions_name">
</colgroup>

GFileInfo *

g_file_output_stream_query_info ()

void

g_file_output_stream_query_info_async ()

GFileInfo *

g_file_output_stream_query_info_finish ()

char *

g_file_output_stream_get_etag ()

Types and Values

<colgroup>
<col width="150px" class="name">
<col class="description">
</colgroup>

GFileOutputStream

Object Hierarchy

    GObject
    ╰── GOutputStream
        ╰── GFileOutputStream

Implemented Interfaces

GFileOutputStream implements
 GSeekable.

Includes

#include <gio/gio.h>

Description

GFileOutputStream provides output streams that write their
content to a file.

GFileOutputStream implements GSeekable, which allows the output
stream to jump to arbitrary positions in the file and to truncate
the file, provided the filesystem of the file supports these
operations.

To find the position of a file output stream, use g_seekable_tell().
To find out if a file output stream supports seeking, use
g_seekable_can_seek().To position a file output stream, use
g_seekable_seek(). To find out if a file output stream supports
truncating, use g_seekable_can_truncate(). To truncate a file output
stream, use g_seekable_truncate().

Functions

g_file_output_stream_query_info ()

GFileInfo *
g_file_output_stream_query_info (GFileOutputStream *stream,
                                 const char *attributes,
                                 GCancellable *cancellable,
                                 GError **error);

Queries a file output stream for the given attributes
.
This function blocks while querying the stream. For the asynchronous
version of this function, see g_file_output_stream_query_info_async().
While the stream is blocked, the stream will set the pending flag
internally, and any other operations on the stream will fail with
G_IO_ERROR_PENDING.

Can fail if the stream was already closed (with error
 being set to
G_IO_ERROR_CLOSED), the stream has pending operations (with error
 being
set to G_IO_ERROR_PENDING), or if querying info is not supported for
the stream's interface (with error
 being set to G_IO_ERROR_NOT_SUPPORTED). In
all cases of failure, NULL will be returned.

If cancellable
 is not NULL, then the operation can be cancelled by
triggering the cancellable object from another thread. If the operation
was cancelled, the error G_IO_ERROR_CANCELLED will be set, and NULL will
be returned.

Parameters

<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>

stream

a GFileOutputStream.

attributes

a file attribute query string.

cancellable

optional GCancellable object, NULL to ignore.

error

a GError, NULL to ignore.

Returns

 a GFileInfo for the stream
, or NULL on error.

[<acronym title="Free data after the code is done.">transfer full</acronym>]

g_file_output_stream_query_info_async ()

void
g_file_output_stream_query_info_async (GFileOutputStream *stream,
                                       const char *attributes,
                                       int io_priority,
                                       GCancellable *cancellable,
                                       GAsyncReadyCallback callback,
                                       gpointer user_data);

Asynchronously queries the stream
 for a GFileInfo. When completed,
callback
 will be called with a GAsyncResult which can be used to
finish the operation with g_file_output_stream_query_info_finish().

For the synchronous version of this function, see
g_file_output_stream_query_info().

Parameters

<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>

stream

a GFileOutputStream.

attributes

a file attribute query string.

io_priority

the I/O priority of the request

cancellable

optional GCancellable object, NULL to ignore.

callback

callback to call when the request is satisfied

user_data

the data to pass to callback function

g_file_output_stream_query_info_finish ()

GFileInfo *
g_file_output_stream_query_info_finish
                               (GFileOutputStream *stream,
                                GAsyncResult *result,
                                GError **error);

Finalizes the asynchronous query started
by g_file_output_stream_query_info_async().

Parameters

<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>

stream

a GFileOutputStream.

result

a GAsyncResult.

error

a GError, NULL to ignore.

Returns

 A GFileInfo for the finished query.

[<acronym title="Free data after the code is done.">transfer full</acronym>]

g_file_output_stream_get_etag ()

char *
g_file_output_stream_get_etag (GFileOutputStream *stream);

Gets the entity tag for the file when it has been written.
This must be called after the stream has been written
and closed, as the etag can change while writing.

Parameters

<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>

stream

a GFileOutputStream.

Returns

 the entity tag for the stream.

Types and Values

GFileOutputStream

typedef struct _GFileOutputStream GFileOutputStream;

A subclass of GOutputStream for opened files. This adds
a few file-specific operations and seeking and truncating.

GFileOutputStream implements GSeekable.

See Also

GOutputStream, GDataOutputStream, GSeekable

Generated by GTK-Doc V1.24


text:
// Copyright © John Gietzen. All Rights Reserved. This source is subject to the MIT license. Please see license.md for more information.

namespace Pegasus.Expressions
{
    using System;

    /// <summary>
    /// Describes the semantics of a code expression.
    /// </summary>
    public enum CodeType
    {
        /// <summary>
        /// Indicates that the code should be used as a successful result.
        /// </summary>
        Result,

        /// <summary>
        /// Indicates that the code should be used to throw an error.
        /// </summary>
        Error,

        /// <summary>
        /// Indicates that the code should be used to modify the current parser state.
        /// </summary>
        State,

        /// <summary>
        /// Indicates that the code should be used as the body of a parse method.
        /// </summary>
        Parse,
    }

    /// <summary>
    /// Represents a code expression to be emitted in the source code of the generated parser.
    /// </summary>
    public class CodeExpression : Expression
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="CodeExpression"/> class.
        /// </summary>
        /// <param name="codeSpan">The literal code to be contained by this expression.</param>
        /// <param name="codeType">The semantic usage of this expression.</param>
        public CodeExpression(CodeSpan codeSpan, CodeType codeType)
        {
            this.CodeSpan = codeSpan ?? throw new ArgumentNullException(nameof(codeSpan));
            this.CodeType = codeType;
        }

        /// <summary>
        /// Gets the code that this expression contains.
        /// </summary>
        public CodeSpan CodeSpan { get; }

        /// <summary>
        /// Gets the semantic usage of this expression.
        /// </summary>
        public CodeType CodeType { get; }
    }
}


text:
package grondag.adversity.item;

import java.util.List;
import java.util.stream.Collectors;

import it.unimi.dsi.fastutil.HashCommon;

import net.minecraft.entity.effect.StatusEffectInstance;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;

import grondag.adversity.registry.AdversityEffects;

public class MilkPotion extends AbstractPotion {
	public MilkPotion(final Settings settings) {
		super(settings);
	}

	@Override
	public void applyEffects(final ItemStack stack, final World world, final PlayerEntity player) {
		final List<StatusEffectInstance> candidates = player.getStatusEffects()
				.stream()
				.filter(e -> !AdversityEffects.isImmuneToMilk(e.getEffectType()))
				.collect(Collectors.toList());

		if (candidates.isEmpty()) {
			return;
		}

		final int size = candidates.size();

		player.removeStatusEffect(candidates.get(HashCommon.mix(size) % size).getEffectType());
	}
}


text:
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.Versioning;
using System.Threading.Tasks;
using Microsoft.Build.Framework;
using NuGet;
using NuProj.Tests.Infrastructure;
using Xunit;

namespace NuProj.Tests
{
    public class DependencyTests
    {
        [Fact]
        public async Task Dependency_NoDependencies_Fails()
        {
            var solutionPath = Assets.GetScenarioSolutionPath("Dependency_NoDependencies_Fails");
            var result = await MSBuild.RebuildAsync(solutionPath);
            var error = result.ErrorEvents.Single();

            var expectedMessage = "Cannot create a package that has no dependencies nor content.";
            var actualMessage = error.Message;

            Assert.Equal(expectedMessage, actualMessage);
        }

        [Fact]
        public async Task Dependency_Content_IsNotFiltered()
        {
            var package = await Scenario.RestoreAndBuildSinglePackage("Dependency_Content_IsNotFiltered");
            var expectedFileNames = new[]
            {
                @"content\jquery-2.1.1.js",
                @"lib\net45\ClassLibrary1.dll"
            };
            var files = package.GetFiles().Select(f => f.Path);
            Assert.Equal(expectedFileNames, files);
        }

        [Fact]
        public async Task Dependency_Tools_IsNotFiltered()
        {
            var package = await Scenario.RestoreAndBuildSinglePackage("Dependency_Tools_IsNotFiltered");
            var expectedFileNames = new[]
            {
                @"lib\net45\ClassLibrary1.dll",
                @"tools\Microsoft.CodeAnalysis.CSharp.Desktop.dll",
                @"tools\Microsoft.CodeAnalysis.CSharp.dll",
                @"tools\Microsoft.CodeAnalysis.Desktop.dll",
                @"tools\Microsoft.CodeAnalysis.dll",
            };
            var files = package.GetFiles().Select(f => f.Path);
            Assert.Equal(expectedFileNames, files);
        }

        [Fact]
        public async Task Dependency_IndirectDependencies_AreNotPackaged()
        {
            var package = await Scenario.RestoreAndBuildSinglePackage("Dependency_IndirectDependencies_AreNotPackaged", "A");
            var files = package.GetFiles();

            Assert.None(files, x => x.Path.Contains("Newtonsoft.Json.dll"));
            Assert.None(files, x => x.Path.Contains("ServiceModel.Composition.dll"));
            Assert.None(files, x => x.Path.Contains("B3.dll"));
        }

        [Fact]
        public async Task Dependency_DirectDependencies_AreNotPackaged()
        {
            var package = await Scenario.RestoreAndBuildSinglePackage("Dependency_DirectDependencies_AreNotPackaged", "A");
            var files = package.GetFiles();

            Assert.None(files, x => x.Path.Contains("Newtonsoft.Json.dll"));
            Assert.None(files, x => x.Path.Contains("ServiceModel.Composition.dll"));
            Assert.None(files, x => x.Path.Contains("B3.dll"));
        }

        [Fact]
        public async Task Dependency_Versions_AreAggregated()
        {
            var package = await Scenario.RestoreAndBuildSinglePackage("Dependency_Versions_AreAggregated");
            var expectedVersions = new[]
            {
                    "1.1.20-beta",
                    "1.0.12-alpha",
                    "[0.2, 1.0]",
                    "[0.2, 1.0]",
            };
            var versionSpecs = package.DependencySets
                .SelectMany(x => x.Dependencies)
                .Select(x => x.VersionSpec.ToString());
            Assert.Equal(expectedVersions, versionSpecs);
        }

        [Fact]
        public async Task Dependency_MultipleFrameworks_AreResolved()
        {
            var package = await Scenario.RestoreAndBuildSinglePackage(
                "Dependency_MultipleFrameworks_AreResolved",
                "Dependent");
            var dependencySet = new []{
                new PackageDependencySet(VersionUtility.ParseFrameworkName("net40"), new List<PackageDependency>
                    {
                        new PackageDependency("Dependency", new VersionSpec
                            {
                                IsMinInclusive = true,
                                MinVersion = new SemanticVersion("1.0.0")
                            })
                    }),
                new PackageDependencySet(VersionUtility.ParseFrameworkName("net45"), new List<PackageDependency>
                    {
                        new PackageDependency("Dependency", new VersionSpec
                            {
                                IsMinInclusive = true,
                                MinVersion = new SemanticVersion("1.0.0")
                            })
                    }),
            };

            Assert.Equal(dependencySet, package.DependencySets, PackageDependencySetComparer.Instance);
        }

        [Theory]
        [InlineData("Build")]
        [InlineData("Clean")]
        [InlineData("Rebuild")]
        public async Task Dependency_IsBuilt_WhenNotBuildingInsideVisualStudio(string target)
        {
            var projectPath = Assets.GetScenarioFilePath(
                "Dependency_IsBuilt_WhenNotBuildingInsideVisualStudio",
                @"NuGetPackage\NuGetPackage.nuproj");
            var properties = MSBuild.Properties.Default;
            var result = await MSBuild.ExecuteAsync(projectPath, target, properties);
            result.AssertSuccessfulBuild();

            var warnings = result.WarningEvents.ToArray();

            if (target == "Rebuild")
            {
                Assert.Equal(4, warnings.Length);
                Assert.Equal("CsProj dependency Target Called: Clean", warnings[0].Message);
                Assert.Equal("NuProj dependency Target Called: Clean", warnings[1].Message);
                Assert.Equal("CsProj dependency Target Called: Build", warnings[2].Message);
                Assert.Equal("NuProj dependency Target Called: Build", warnings[3].Message);
            }
            else
            {
                Assert.Equal(2, warnings.Length);
                Assert.Equal("CsProj dependency Target Called: " + target, warnings[0].Message);
                Assert.Equal("NuProj dependency Target Called: " + target, warnings[1].Message);
            }
        }

        [Theory]
        [InlineData("Build")]
        [InlineData("Clean")]
        [InlineData("Rebuild")]
        public async Task Dependency_IsNotBuilt_WhenBuildingInsideVisualStudio(string target)
        {
            var projectPath = Assets.GetScenarioFilePath(
                "Dependency_IsNotBuilt_WhenBuildingInsideVisualStudio",
                @"NuGetPackage\NuGetPackage.nuproj");
            var properties = MSBuild.Properties.Default.AddRange(MSBuild.Properties.BuildingInsideVisualStudio);
            var result = await MSBuild.ExecuteAsync(projectPath, target, properties);
            result.AssertSuccessfulBuild();
        }
    }
}


text:
package org.honton.chas.exists.example;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;
import org.junit.jupiter.api.Assertions;

class BuildProperties {
  String localRepository;
  String groupId;
  String artifactId;
  String version;
  String pluginVersion;

  BuildProperties() throws IOException {
    Properties properties = new Properties();
    try (InputStream is = getClass().getResourceAsStream("/test.properties")) {
      Assertions.assertNotNull(is);
      properties.load(is);
    }

    localRepository = properties.getProperty("localRepository");
    Assertions.assertNotNull(localRepository);

    groupId = properties.getProperty("groupId");
    Assertions.assertNotNull(groupId);

    artifactId = properties.getProperty("artifactId");
    Assertions.assertNotNull(artifactId);

    version = properties.getProperty("version");
    Assertions.assertNotNull(version);

    pluginVersion = properties.getProperty("pluginVersion");
    Assertions.assertNotNull(pluginVersion);
  }
}


text:
'use strict'

const request = require('supertest')
const app = require('../../app/http/app')
const config = require('../../app/bootstrap/config')
const isValid = require('../_isValid')
const body = require('./_body')

describe('API errors', () => {
  describe('400 Bad request', () => {
    const route = '/asdfqwer'

    it('PUT should fail if parameter `url` is not given (since it is required)', (done) => {
      request(app)
        .put(route)
        .auth(config.username, config.password)
        .send({})
        .expect(400)
        .expect('Content-Type', /json/)
        .end(body(isValid.errorResponse, done))
    })

    it('PUT should fail if parameter `status_code` is not given (since it is required)', (done) => {
      request(app)
        .put(route)
        .auth(config.username, config.password)
        .send({'url': 'http://google.de'})
        .expect(400)
        .expect('Content-Type', /json/)
        .end(body(isValid.errorResponse, done))
    })

    it('PUT should reject the request, if parameter `url` is invalid', (done) => {
      request(app)
        .put(route)
        .auth(config.username, config.password)
        .send({'url': 'not_a_valid_url'})
        .expect(400)
        .expect('Content-Type', /json/)
        .end(body(isValid.errorResponse, done))
    })

    it('PUT should reject the request, if parameter `status_code` is invalid', (done) => {
      request(app)
        .put(route)
        .auth(config.username, config.password)
        .send({
          'url': 'http://google.de',
          'status_code': 'not_a_valid_status_code'
        })
        .expect(400)
        .expect('Content-Type', /json/)
        .end(body(isValid.errorResponse, done))
    })

    it('PUT should reject the request, if unknown parameters are present', (done) => {
      request(app)
        .put(route)
        .auth(config.username, config.password)
        .send({
          'url': 'http://google.de',
          'status_code': 301,
          'unknown_parameter': 123
        })
        .expect(400)
        .expect('Content-Type', /json/)
        .end(body(isValid.errorResponse, done))
    })

    it('POST should reject the request for a specific URI, if parameter `url` is invalid', (done) => {
      request(app)
        .post(route)
        .auth(config.username, config.password)
        .send({'url': 'not_a_valid_url'})
        .expect(400)
        .expect('Content-Type', /json/)
        .end(body(isValid.errorResponse, done))
    })

    it('POST should reject the request, if parameter `status_code` is invalid', (done) => {
      request(app)
        .post(route)
        .auth(config.username, config.password)
        .send({
          'url': 'http://google.de',
          'status_code': 'not_a_valid_status_code'
        })
        .expect(400)
        .expect('Content-Type', /json/)
        .end(body(isValid.errorResponse, done))
    })

    it('POST should reject the request, if unknown parameters are present', (done) => {
      request(app)
        .post(route)
        .auth(config.username, config.password)
        .send({
          'url': 'http://google.de',
          'status_code': 301,
          'unknown_parameter': 123
        })
        .expect(400)
        .expect('Content-Type', /json/)
        .end(body(isValid.errorResponse, done))
    })

    it('POST should reject the request for base URI, if parameter `url` is invalid', (done) => {
      request(app)
        .post('/')
        .auth(config.username, config.password)
        .send({'url': 'not_a_valid_url'})
        .expect(400)
        .expect('Content-Type', /json/)
        .end(body(isValid.errorResponse, done))
    })

    it('POST should reject the request for base URI, if parameter `url` is not given', (done) => {
      request(app)
        .post('/')
        .auth(config.username, config.password)
        .send({})
        .expect(400)
        .expect('Content-Type', /json/)
        .end(body(isValid.errorResponse, done))
    })

    it('POST should fail if parameter `status_code` is not given (since it is required)', (done) => {
      request(app)
        .post(route)
        .auth(config.username, config.password)
        .send({'url': 'http://google.de'})
        .expect(400)
        .expect('Content-Type', /json/)
        .end(body(isValid.errorResponse, done))
    })
  })

  describe('404 Not found', () => {
    const nonExistentRoute = '/sud8f6g6aqq1u2e'

    it('GET should return 404 on non existing resource', (done) => {
      request(app)
        .get(nonExistentRoute)
        .auth(config.username, config.password)
        .expect(404)
        .expect('Content-Type', /json/)
        .end(body(isValid.errorResponse, done))
    })

    it('DELETE should return 404 on non existing resource', (done) => {
      request(app)
        .delete(nonExistentRoute)
        .auth(config.username, config.password)
        .expect(404)
        .expect('Content-Type', /json/)
        .end(body(isValid.errorResponse, done))
    })

    it('POST should return 404 if resource if not available', (done) => {
      request(app)
        .post(nonExistentRoute)
        .auth(config.username, config.password)
        .send({
          url: 'https://yahoo.org',
          status_code: 301
        })
        .expect(404)
        .expect('Content-Type', /json/)
        .end(body(isValid.errorResponse, done))
    })
  })

  describe('405 Method not allowed', () => {
    const newRoute = '/lalala'
    before('Create a resource (needed for the next test case)', (done) => {
      request(app)
        .put(newRoute)
        .auth(config.username, config.password)
        .send({
          url: 'http://example.org/qwer',
          status_code: 308
        })
        .expect(201)
        .end(done)
    })

    it('PUT should refuse to overwrite an existing resource', (done) => {
      request(app)
        .put(newRoute)
        .auth(config.username, config.password)
        .send({
          url: 'http://example.org/1234',
          status_code: 307
        })
        .expect(405)
        .expect('Allow', 'GET, POST, DELETE')
        .expect('Content-Type', /json/)
        .end(body(isValid.errorResponse, done))
    })

    it('should refuse unkown methods, such as PATCH', (done) => {
      request(app)
        .patch(newRoute)
        .auth(config.username, config.password)
        .expect(405)
        .expect('Allow', 'GET, POST, PUT, DELETE')
        .expect('Content-Type', /json/)
        .end(body(isValid.errorResponse, done))
    })
  })
})


text:
{% extends "prodtask/_index.html" %}

{% load static  %}

{% block bl_title %}Core App of Monitoring{% endblock %}

{% block subtitle %}
{% if title %}{{ title }}{% else %}Datatable{% endif %}
{% endblock %}

{% block extra_css %}
{{ block.super }}

{% endblock %}

{% block base_js %}
{{ block.super }}

{% endblock %}

{% block extra_js %}
{{ block.super }}

{% endblock %}

{% block body %}

Request select parameters

        Request ID:

            <input id="reqid" />

        Physics group:

        <select id="phys_group">
            <option value="">All</option>
            <option value="NOVALI"> not VALI</option>
            <option value="BPHY">BPHY</option>
            <option value="COSM">COSM</option>
            <option value="DAPR">DAPR</option>
            <option value="EGAM">EGAM</option>
            <option value="EXOT">EXOT</option>
            <option value="FTAG">FTAG</option>
            <option value="HDBS">HDBS</option>
            <option value="HIGG">HIGG</option>
            <option value="HION">HION</option>
            <option value="IDET">IDET</option>
            <option value="IDTR">IDTR</option>
            <option value="JETM">JETM</option>
            <option value="LARG">LARG</option>
            <option value="MCGN">MCGN</option>
            <option value="SIMU">SIMU</option>
            <option value="MDET">MDET</option>
            <option value="MUON">MUON</option>
            <option value="PHYS">PHYS</option>
            <option value="REPR">REPR</option>
            <option value="STDM">SIMU</option>
            <option value="SOFT">SOFT</option>
            <option value="STDM">STDM</option>
            <option value="SUSY">SUSY</option>
            <option value="TAUP">TAUP</option>
            <option value="TCAL">TCAL</option>
            <option value="TDAQ">TDAQ</option>
            <option value="TOPQ">TOPQ</option>
            <option value="THLT">THLT</option>
            <option value="TRIG">TRIG</option>
            <option value="VALI">VALI</option>
            <option value="UPGR">UPGR</option>
        </select>

        Reference link:

            <input id="ref_link" />

        Description:

            <input id="description" />

        Manager:

            <input id="manager" />

        Project:

            <input id="project" />

        Campaign:

            <input id="campaign" />

        SubCampaign:

            <input id="subcampaign" />

        Type:

        <select id="type">
            <option value="">All</option>
            <option value="GROUP">GROUP</option>
            <option value="HLT">HLT</option>
            <option value="MC">MC</option>
            <option value="REPROCESSING">REPROCESSING</option>
            <option value="TIER0">TIER0</option>
            <option value="EVENTINDEX">EVENTINDEX</option>
        </select>

        Status:

        <select id="status">
            <option value="">All</option>
            <option value="notest">not Test</option>
            <option value="active">Active</option>
            <option value="ended">Ended</option>
            <option value="hold">Hold</option>
            <option value="approved">Approved</option>
            <option value="finished">Finished</option>
            <option value="monitoring">Monitoring</option>
            <option value="working">Working</option>
            <option value="reworking">Reworking</option>
            <option value="remonitoring">Remonitoring</option>
            <option value="cancelled">Cancelled</option>
            <option value="done">Done</option>
            <option value="processed">Processed</option>
            <option value="registered">Registered</option>
            <option value="test">Test</option>
            <option value="waiting">Waiting</option>
        </select>

        Provenance:

        <select id="provenance">
            <option value="">All</option>
            <option value="AP">ATLAS</option>
            <option value="GP">Group</option>
            <option value="None">User</option>
        </select>

        Open ended:

        <select id="open_ended">
            <option value="">All</option>
            <option value="Open ended">Open ended</option>
        </select>

<input id="update_request_table" type="button" value="Update table" />

Request status statistics

{{ table.as_html }}

{% endblock %}


text:
package jintgen.jigir;

import jintgen.isdl.EnumDecl;
import jintgen.isdl.OperandTypeDecl;
import jintgen.isdl.parser.Token;
import jintgen.isdl.verifier.JIGIRErrorReporter;
import jintgen.types.*;
import java.util.*;

/**
 * The JIGIRTypeEnv class represents a type environment for
 * JIGIR code. It supports void, boolean, integers, maps, and function
 * types.
 *
 * @author Ben L. Titzer
 */
public class JIGIRTypeEnv extends TypeEnv {
    public final Type VOID;
    public final Type BOOLEAN;
    public final TypeCon INT;
    public final TypeCon MAP;
    public final TypeCon FUNCTION;
    public final TypeCon ADDRESS;
    public final Relation ASSIGNABLE;
    public final Relation COMPARABLE;
    public final Relation PROMOTABLE;
    public final Relation CONVERTIBLE;
    public Arith.SHL SHL;
    public Arith.SHR SHR;
    public Arith.AND AND;

    /**
     * The TYPECON_int class represents the type constructor for types
     * based on "int". In JIGIR, such types have both a sign and a size.
     */
    protected class TYPECON_int extends TypeCon {
        final SignDimension sign;
        final SizeDimension size;

        TYPECON_int() {
            super("int");
            sign = new SignDimension();
            size = new SizeDimension();
            addDimension(sign);
            addDimension(size);
        }

        public Type newType(TypeEnv te, HashMap<String, List<Object>> dims) {
            HashMap<String, Object> dimInst = buildDimensions(te, dims);
            Type type = types.get(dimInst);
            if ( type != null ) return type;
            else return buildIntType(dimInst);
        }

        private Type buildIntType(HashMap<String, Object> dimInst) {
            Boolean sign = (Boolean) dimInst.get("sign");
            if ( sign == null ) sign = true; // signed by default
            Integer len = (Integer) dimInst.get("size");
            if ( len == null ) len = 32; // default size is 32 bits
            TYPE_int type_int = new TYPE_int(sign, len, dimInst);
            types.put(dimInst, type_int);
            return type_int;
        }

    }

    /**
     * The TYPECON_int class represents the type constructor for types
     * based on "int". In JIGIR, such types have both a sign and a size.
     */
    protected class TYPECON_addr extends TypeCon {
        final SignDimension relative;
        final SizeDimension align;

        TYPECON_addr() {
            super("address");
            relative = new SignDimension();
            align = new SizeDimension();
            addDimension(relative);
            addDimension(align);
        }

        public Type newType(TypeEnv te, HashMap<String, List<Object>> dims) {
            HashMap<String, Object> dimInst = buildDimensions(te, dims);
            Type type = types.get(dimInst);
            if ( type != null ) return type;
            else return buildAddrType(dimInst);
        }

        private Type buildAddrType(HashMap<String, Object> dimInst) {
            Boolean rel = (Boolean) dimInst.get("sign");
            if ( rel == null ) rel = false; // absolute by  default
            Integer align = (Integer) dimInst.get("size");
            if ( align == null ) align = 1; // default alignment is 1 unit
            TYPE_addr type_addr = new TYPE_addr(rel, align, dimInst);
            types.put(dimInst, type_addr);
            return type_addr;
        }

    }

    /**
     * The TYPE_int class represents integer types that
     * include a sign and a size.
     */
    public class TYPE_int extends Type {
        protected final boolean signed;
        protected final int size;

        protected TYPE_int(boolean sign, int len, HashMap<String, Object> dims) {
            super(INT, dims);
            signed = sign;
            size = len;
        }

        protected TYPE_int(boolean sign, int len) {
            super(INT, new HashMap<String, Object>());
            signed = sign;
            size = len;
        }

        public boolean isSigned() {
            return signed;
        }

        public int getSize() {
            return size;
        }

        public String toString() {
            return (signed ? "-int." : "+int.") + size;
        }
    }

    /**
     * The TYPE_addr class represents integer types that
     * include a sign and a size.
     */
    public class TYPE_addr extends Type {
        protected final boolean relative;
        protected final int align;

        protected TYPE_addr(boolean sign, int len, HashMap<String, Object> dims) {
            super(ADDRESS, dims);
            relative = sign;
            align = len;
        }

        protected TYPE_addr(boolean sign, int len) {
            super(ADDRESS, new HashMap<String, Object>());
            relative = sign;
            align = len;
        }

        public boolean isRelative() {
            return relative;
        }

        public int getAlign() {
            return align;
        }

        public String toString() {
            return (relative ? "-address." : "address.") + align;
        }
    }

    public class TYPE_enum extends TypeCon {
        public final EnumDecl decl;
        protected TYPE_enum(EnumDecl decl) {
            super(decl.name.image);
            this.decl = decl;
        }
    }

    public class TYPE_enum_kind extends TypeCon {
        public final EnumDecl decl;
        protected TYPE_enum_kind(EnumDecl decl) {
            super(decl.name.image+"$kind");
            this.decl = decl;
        }
    }

    public class TYPE_operand extends TypeCon {
        public final OperandTypeDecl decl;
        protected TYPE_operand(OperandTypeDecl decl) {
            super(decl.name.image);
            this.decl = decl;
        }
    }

    public JIGIRTypeEnv(JIGIRErrorReporter er) {
        super(er);

        ASSIGNABLE = new TransitiveRelation("assignable");
        COMPARABLE = new TransitiveRelation("comparable");
        PROMOTABLE = new Relation("promotable");
        CONVERTIBLE = new Relation("convertible");

        // initialize the boolean type constructor
        TypeCon VTC = new TypeCon("void");
        VOID = VTC.newType(this);
        // initialize the boolean type constructor
        TypeCon BOOL = new TypeCon("boolean");
        BOOLEAN = BOOL.newType(this);

        // initialize the integer type constructor
        INT = new TYPECON_int();

        // initialize the address type constructor
        ADDRESS = new TYPECON_addr();

        // initialize the map type constructor
        MAP = new TypeCon("map");
        MAP.addDimension(new ParamDimension("types", variance(ParamDimension.INVARIANT, ParamDimension.INVARIANT)));

        // initialize the function type constructor
        FUNCTION = new TypeCon("function");
        FUNCTION.addDimension(new ParamDimension("param", ParamDimension.CONTRAVARIANT));
        FUNCTION.addDimension(new ParamDimension("return", variance(ParamDimension.COVARIANT)));

        // add the global type constructors
        addTypeCon(VTC);
        addTypeCon(BOOL, COMPARABLE, ASSIGNABLE, PROMOTABLE, CONVERTIBLE);
        addTypeCon(INT, COMPARABLE, ASSIGNABLE, PROMOTABLE, CONVERTIBLE);
        addTypeCon(ADDRESS, COMPARABLE, ASSIGNABLE, PROMOTABLE);
        addTypeCon(MAP, ASSIGNABLE);
        addTypeCon(FUNCTION);

        // add the relations
        addRelation(ASSIGNABLE);
        addRelation(COMPARABLE);
        addRelation(PROMOTABLE);

        // add binops for booleans
        addBinOp(BOOL, BOOL, new Logical.AND());
        addBinOp(BOOL, BOOL, new Logical.OR());
        addBinOp(BOOL, BOOL, new Logical.XOR());
        addBinOp(BOOL, BOOL, new Logical.EQU());
        addBinOp(BOOL, BOOL, new Logical.NEQU());

        // add comparisons for booleans
        addBinOp(BOOL, BOOL, new Logical.EQU());
        addBinOp(BOOL, BOOL, new Logical.NEQU());

        // add comparisons for integers
        addBinOp(INT, INT, new Logical.EQU());
        addBinOp(INT, INT, new Logical.NEQU());
        addBinOp(INT, INT, new Logical.GR());
        addBinOp(INT, INT, new Logical.GREQ());
        addBinOp(INT, INT, new Logical.LESS());
        addBinOp(INT, INT, new Logical.LESSEQU());

        // add binops for integers
        addBinOp(INT, INT, new Arith.ADD());
        addBinOp(INT, INT, new Arith.SUB());
        addBinOp(INT, INT, new Arith.DIV());
        addBinOp(INT, INT, new Arith.MOD());
        addBinOp(INT, INT, new Arith.MUL());
        AND = new Arith.AND();
        addBinOp(INT, INT, AND);
        addBinOp(INT, INT, new Arith.OR());
        addBinOp(INT, INT, new Arith.XOR());
        SHL = new Arith.SHL();
        addBinOp(INT, INT, SHL);
        SHR = new Arith.SHR();
        addBinOp(INT, INT, SHR);

        // add logical not operator
        addUnOp(BOOL, new Logical.NOT());

        // add unary integer operators
        addUnOp(INT, new Arith.NEG());
        addUnOp(INT, new Arith.COMP());
        addUnOp(INT, new Arith.UNSIGN());

        // add convertibility relations
        CONVERTIBLE.add(BOOL, INT);
        CONVERTIBLE.add(ADDRESS, INT);
        CONVERTIBLE.add(INT, ADDRESS);
    }

    List<Integer> variance(int... i) {
        List<Integer> l = new LinkedList<Integer>();
        for ( int j : i) l.add(j);
        return l;
    }

    public TypeRef newIntTypeRef(Token sign, Token n, Token size) {
        List<Object> sign_list = new LinkedList<Object>();
        sign_list.add(sign);
        List<Object> size_list = new LinkedList<Object>();
        size_list.add(size);
        TypeRef ref = new TypeRef(n);
        ref.addDimension("sign", sign_list);
        ref.addDimension("size", size_list);
        return ref;
    }

    public TYPE_int newIntType(boolean sign, int size) {
        List<Object> sign_list = new LinkedList<Object>();
        sign_list.add(sign);
        List<Object> size_list = new LinkedList<Object>();
        size_list.add(size);
        HashMap<String, List<Object>> map = new HashMap<String, List<Object>>();
        map.put("size", size_list);
        map.put("sign", sign_list);
        return (TYPE_int)INT.newType(this, map);
    }

    public Type resolveOperandType(OperandTypeDecl ot) {
        TypeCon tc = resolveTypeCon(ot.name.image);
        return tc.newType(this);
    }

    public Type resolveType(Token tok) {
        TypeCon tc = resolveTypeCon(tok.image);
        if ( tc == null ) ERROR.UnresolvedType(tok);
        return tc.newType(this);
    }

    public void addOperandType(OperandTypeDecl ot) {
        TypeCon tycon = new TYPE_operand(ot);
        addTypeCon(tycon, ASSIGNABLE, COMPARABLE);
	if (ot.isValue()) {
	    // Value types may be converted to their underlying type.
	    TypeCon baseCon =
		((OperandTypeDecl.Value) ot).typeRef.resolveTypeCon(this);
	    CONVERTIBLE.add(tycon, baseCon);
	}

    }

    public Type addEnum(EnumDecl ot) {
        addTypeCon(new TYPE_enum(ot), ASSIGNABLE, COMPARABLE);
        TYPE_enum_kind tc = new TYPE_enum_kind(ot);
        addTypeCon(tc);
        return tc.newType(this);
    }
}


text:
<?php
$edit_data = $this->db->get_where('degree', array('d_id' => $param2))->result_array();
foreach ($edit_data as $row):
    ?>

                                    * <?php echo "is ".ucwords("mandatory field");?>

                            <?php echo form_open(base_url() . 'admin/degree/do_update/' . $row['d_id'], array('class' => 'form-horizontal form-groups-bordered validate', 'id' => 'degreeformedit', 'target' => '_top')); ?>

                                <?php echo ucwords("department name");?>*

                                    <input type="text" class="form-control" name="d_name" id="d_name" value="<?php echo $row['d_name']; ?>"   />

                                  <lable class="error" id="error_lable_exist" style="color:#f85d2c"></lable>

                                <?php echo ucwords("status");?>

                                    <select name="degree_status" class="form-control" >
                                        <option value="1" <?php if ($row['d_status'] == '1') {
                            echo "selected";
                        } ?>>Active</option>
                                        <option value="0" <?php if ($row['d_status'] == '0') {
                            echo "selected";
                        } ?>>Inactive</option>
                                    </select>

                                    <button type="submit" id="btnupd" class="submit btn btn-info vd_bg-green"><?php echo ucwords("update");?></button>

                            </form>

    <?php
endforeach;
?>


text:
import os
import sys

os.environ['DJANGO_SETTINGS_MODULE'] = 'nikola_auth.tests.settings'

from django.test import simple as test_simple

import django
if hasattr(django, 'setup'):
    django.setup()

def run(*test_args):
    if not test_args:
        test_args = ['tests']
    parent = os.path.join(
        os.path.dirname(os.path.abspath(__file__)),
        "..",
        "..",
    )
    sys.path.insert(0, parent)
    failures = test_simple.DjangoTestSuiteRunner().run_tests(test_args)
    sys.exit(failures)

if __name__ == '__main__':
    run(*sys.argv[1:])


text:
using System;
using System.Collections;
using System.Threading;
using System.Text;
using System.IO.Ports;
using System.Globalization;

using LibSystem;

namespace LibRoboteqController
{
	/// <summary>
	/// class RQController encapsulates all AX2850 commands, queries and mode switching, handles RS232 communication, including monitoring and heartbeat.
	/// it is intended to be the AX2850 hardware controller layer, not aware of robot configuration.
	/// </summary>
	public class ControllerRQAX2850 : ControllerBase
	{
		private string m_portName;
		private SerialPort m_port = null;
		private RQInteractionQueue[] m_queues = new RQInteractionQueue[4];
		private RQInteractionQueue m_commandPowerLeftQueue;
		private RQInteractionQueue m_commandPowerRightQueue;
		private RQInteractionQueue m_commandQueue;
		private RQInteractionQueue m_queryQueue;

		private RQInteractionQueue m_currentQueue = null;
		private object m_currentQueuePadlock = "";

		private Hashtable m_measuredValues = new Hashtable();
		public Hashtable measuredValues { get { return m_measuredValues; } }

		private Logger m_logger = null;
		private ArrayList m_loggedValueNames = new ArrayList();

		private ArrayList m_querySet = new ArrayList(); // of RQQuery, queries to use on regular basis as watchdog quieter.

		#region state variables

		private bool m_isOnline = false;
		public bool isOnline {
			get { return m_isOnline; }			// cable connected, port alive, receiving data and is either grabbed or monitored
			set
			{
				m_isOnline = value;
			}
		}

		private bool m_isGrabbed = false;
		public bool isGrabbed {
			get { return m_isGrabbed; }		// is online, watchdog satisfied (we are sending stream of queries) and ready for commands
			set
			{
				// the value is ignored - you can set it to true only to make a point
				m_isGrabbed = true;
				m_isMonitored = false;
			}
		}

		private bool m_isMonitored = false;
		public bool isMonitored {
			get { return m_isMonitored; }	// is online, but not in RS232 mode, we are receiving monitoring lines
			set
			{
				// the value is ignored - you can set it to true only to make a point
				m_isMonitored = true;
				m_isGrabbed = false;
			}
		}

		public bool isUnknownState {
			get { return !m_isGrabbed && !m_isMonitored; }
			set
			{
				// after commands that may change the state (like reset) - let the incoming stream set the state as appropriate.
				// the value is ignored - you can set it to true only to make a point
				isOnline = false;
				m_isMonitored = false;
				m_isGrabbed = false;
			}
		}

		#endregion // state variables

		#region lifecycle

		public ControllerRQAX2850(string portName)
		{
			m_portName = portName;

			m_queues[0] = m_commandPowerLeftQueue = new RQMotorCommandQueue("commandPowerLeft");
			m_queues[1] = m_commandPowerRightQueue = new RQMotorCommandQueue("commandPowerRight");
			m_queues[2] = m_commandQueue = new RQInteractionQueue("command");
			m_queues[3] = m_queryQueue = new RQInteractionQueue("query");

			m_querySet.Add(new RQQueryAnalogInputs(m_measuredValues));
			m_querySet.Add(new RQQueryDigitalInputs(m_measuredValues));
			m_querySet.Add(new RQQueryHeatsinkTemperature(m_measuredValues));
			m_querySet.Add(new RQQueryMotorAmps(m_measuredValues));
			m_querySet.Add(new RQQueryMotorPower(m_measuredValues));
			m_querySet.Add(new RQQueryVoltage(m_measuredValues));
			m_querySet.Add(new RQQueryEncoderLeftAbsolute(m_measuredValues));
			m_querySet.Add(new RQQueryEncoderRightAbsolute(m_measuredValues));
			m_querySet.Add(new RQQueryEncoderSpeed(m_measuredValues));

			foreach (RQQuery query in m_querySet)
			{
				foreach(string vName in query.ValueNames)
				{
					m_loggedValueNames.Add(vName);
				}
			}

			m_logger = new Logger(m_measuredValues, m_loggedValueNames);

			startMonitoringThread();
		}

		public override void init()					// throws ControllerException
		{
			ensurePort();
			isUnknownState = true;
		}

		public override void Dispose()
		{
			lock (this)
			{
				m_port.Close();
				m_port = null;

				killMonitoringThread();
			}
		}

		#endregion // lifecycle

		public override bool DeviceValid()			// IdentifyDeviceType found something real
		{
			return true;
		}

		public override void IdentifyDeviceType()
		{
		}

		public override bool GrabController()				// returns true on success
		{
			ensurePort();

			byte[] oneCR = new byte[] { 0x0D };

			for (int i = 0; i < 10; i++)
			{
				Thread.Sleep(30);						// 10 doesn't work, 20 and more works fine
				m_port.Write(oneCR, 0, 1);
			}

			isUnknownState = true;

			//m_queryQueue.Enqueue(m_querySet[0]);

			return true;
		}

		public override bool ResetController()				// returns true on success
		{
			ensurePort();
			m_port.WriteLine("%rrrrrr");

			isUnknownState = true;

			return true;
		}

		public override int SetMotorPowerOrSpeedLeft(int powerOrSpeed)
		{
			RQCommandMotorPowerLeft cmd = new RQCommandMotorPowerLeft(powerOrSpeed);

			cmd.queue = m_commandPowerLeftQueue;		// to allow re-queueing of a failed command

			m_commandPowerLeftQueue.Enqueue(cmd);

			return powerOrSpeed;
		}

		public override int SetMotorPowerOrSpeedRight(int powerOrSpeed)
		{
			RQCommandMotorPowerRight cmd = new RQCommandMotorPowerRight(powerOrSpeed);

			cmd.queue = m_commandPowerRightQueue;		// to allow re-queueing of a failed command

			m_commandPowerRightQueue.Enqueue(cmd);

			return powerOrSpeed;
		}

		public override string ToString()
		{
			return "RoboteQ AX2850 Controller";
		}

		#region serial port operations

		private void ensurePort()
		{
			if (m_port == null)
			{
				m_port = new SerialPort(m_portName, 9600, System.IO.Ports.Parity.Even, 7, System.IO.Ports.StopBits.One);

				// Attach a method to be called when there is data waiting in the port's buffer
				m_port.DataReceived += new SerialDataReceivedEventHandler(port_DataReceived);
				m_port.ErrorReceived += new SerialErrorReceivedEventHandler(port_ErrorReceived);

				m_port.NewLine = "\r";
				m_port.DtrEnable = true;
				m_port.Handshake = System.IO.Ports.Handshake.None;
				m_port.Encoding = Encoding.ASCII;
				m_port.RtsEnable = true;

				// Open the port for communications
				m_port.Open();
				m_port.DiscardInBuffer();
			}
		}

		void port_ErrorReceived(object sender, SerialErrorReceivedEventArgs e)
		{
			Tracer.Error("port_ErrorReceived: " + e.ToString());
		}

		private StringBuilder m_sb = new StringBuilder();
		private int m_wCnt = 0;		// watchdog "W" consecutive count to make sure we've grabbed the controller all right

		private void port_DataReceived(object sender, SerialDataReceivedEventArgs e)
		{
			long timestamp = DateTime.Now.Ticks;
			isOnline = true;
			while (m_port.BytesToRead > 0)
			{
				byte b = (byte)m_port.ReadByte();
				byte[] bb = new byte[1];
				bb[0] = b;
				Encoding enc = Encoding.ASCII;
				string RxString = enc.GetString(bb);
				if (RxString == "\r")
				{
					m_wCnt = 0;
					onStringReceived(m_sb.ToString(), timestamp);
					m_sb.Remove(0, m_sb.Length);
				}
				else if (isUnknownState && RxString == "W")
				{
					//Tracer.Trace("got W");
					m_wCnt++;
					if (m_wCnt == 3)
					{
						// we detected watchdog. Set state flags, so that queries and commands may flow and supress watchdog
						isGrabbed = true;
						Tracer.Trace("OK: watchdog detected");
					}
				}
				else
				{
					m_wCnt = 0;
					m_sb.Append(RxString);
				}
			}

			// Show all the incoming data in the port's buffer
			//Tracer.Trace(port.ReadExisting());
		}

		#endregion // serial port operations

		/// <summary>
		/// hopefully not crippled string came in - wether a monitoring stream, a response to query or an echo from query or command
		/// </summary>
		/// <param name="str"></param>
		private void onStringReceived(string str, long timestamp)
		{
			try
			{
				if (str.StartsWith(":") && (str.Length == 25 || str.Length == 33))
				{
					isMonitored = true;

					// :0000000000FE00009898396AB7B70000  - page 103 of controller doc
					// the 9898 is temperature 1 and 2
					// the 396A is voltages
					// the 0000 at the end is speed - 00 left 00 right

					interpretMonitoringString(str, timestamp);

				}
				else if (isGrabbed)
				{
					lock (m_currentQueuePadlock)
					{
						if (m_currentQueue != null)
						{
							if (m_currentQueue.isProcessingInteraction)
							{
								if (m_currentQueue.onStringReceived(str, timestamp))		// last line will return true
								{
									m_currentQueue = null;
								}
							}
						}
					}
				}
			}
			catch(Exception exc)
			{
			}
		}

		#region interpretMonitoringString()

		// value names here must be in accordance to monitoring line that comes from controller in R/C mode:
		private static string[] monitorStringValueNames = new string[] {
			"Command1", "Command2", "Motor_Power_Left", "Motor_Power_Right", "Analog_Input_1", "Analog_Input_2",
			"Motor_Amps_Left", "Motor_Amps_Right", "Heatsink_Temperature_Left", "Heatsink_Temperature_Right",
			"Main_Battery_Voltage", "Internal_Voltage", "Value1", "Value2",
			"Encoder_Speed_Left", "Encoder_Speed_Right", "1", "2", "3", "4"		// some extra just in case
		};

		private static byte[] monitorStringValueConverters = new byte[] {
			0, 0, 0, 0, 4, 4,
			0, 0, 3, 3,
			1, 2, 0, 0,
			4, 4, 0, 0, 0, 0
		};

		private void interpretMonitoringString(string monStr, long timestamp)
		{
			// Tracer.Trace("MON: " + monStr);

			int j = 0;
			for (int i = 1; i < monStr.Length && j < monitorStringValueNames.GetLength(0) ; i += 2)
			{
				string sHexVal = monStr.Substring(i, 2);
				string valueName = monitorStringValueNames[j];

				RQMeasuredValue measuredValue = new RQMeasuredValue();
				bool mustAdd = false;

				if (m_measuredValues.ContainsKey(valueName))
				{
					measuredValue = (RQMeasuredValue)m_measuredValues[valueName];
				}
				else
				{
					measuredValue = new RQMeasuredValue();
					mustAdd = true;
				}

				lock (measuredValue)
				{
					measuredValue.timestamp = timestamp;
					measuredValue.valueName = valueName;
					measuredValue.stringValue = sHexVal;
					measuredValue.intValue = Int32.Parse(sHexVal, NumberStyles.HexNumber);
					switch (monitorStringValueConverters[j])
					{
						default:
							measuredValue.doubleValue = (double)measuredValue.intValue;
							break;
						case 1:
							measuredValue.doubleValue = RQVoltage.convertToMainVoltage(sHexVal);
							break;
						case 2:
							measuredValue.doubleValue = RQVoltage.convertToInternalVoltage(sHexVal);
							break;
						case 3:
							measuredValue.doubleValue = RQTemperature.convertToCelcius(sHexVal);
							break;
						case 4:
							measuredValue.intValue = RQCompressedHex.convertToInt(sHexVal);
							measuredValue.doubleValue = (double)measuredValue.intValue;
							break;
					}
				}

				if (mustAdd)
				{
					m_measuredValues.Add(valueName, measuredValue);
				}

				// Tracer.Trace(valueName + "=" + sHexVal + "=" + measuredValue.doubleValue);
				j++;
			}
		}

		#endregion // interpretMonitoringString()

		private void controlLoop()
		{
			while (true)
			{
				lock (this)
				{
					if (isGrabbed)
					{
						Tracer.Trace2("grabbed");

						lock (m_currentQueuePadlock)
						{
							if (m_currentQueue != null)
							{
								// still processing current query
								if (m_currentQueue.checkForTimeout())
								{
									m_currentQueue = null;
								}
							}
						}

						if (m_currentQueue == null)
						{
							// we are for sure not processing any interaction.
							// find first queue in priority list that has a processable interaction:
							RQInteractionQueue queue = null;
							foreach (RQInteractionQueue q in m_queues)
							{
								if (q.isProcessingInteraction || q.HasInteractionsQueued)
								{
									queue = q;
									break;
								}
							}

							if (queue != null)
							{
								lock (queue.padlock)
								{
									if (!queue.isProcessingInteraction)
									{
										// done with the current interaction, get next one:
										if (queue.HasInteractionsQueued)
										{
											m_currentQueue = queue;		// when responses are processed, this is the queue to use.
											queue.lastSentTicks = DateTime.Now.Ticks;
											m_port.WriteLine(queue.dequeueForSend());
										}
									}
								}
							}
							else
							{
								// all queues are empty, replentish the query queue:
								foreach (RQQuery q in m_querySet)
								{
									q.reset();
									m_queryQueue.Enqueue(q);
								}
							}
						}
					}
					else if (isMonitored)
					{
						Tracer.Trace2("monitored");
					}
					else if (isOnline)
					{
						Tracer.Trace2("online - receiving data");
					}
					else
					{
						Tracer.Trace2("not connected");
					}

					logMeasuredValues();
				}

				Thread.Sleep(1);
			}
		}

		private DateTime m_lastMeasuredValuesLoggedTime = DateTime.MinValue;
		private int measuredValuesLogIntervalMs = 1000;
		private DateTime m_firstLogCall;

		private void logMeasuredValues()
		{
			if (m_measuredValues.Count < 2)
			{
				m_firstLogCall = DateTime.Now;
				return;
			}

			//if ((DateTime.Now - m_firstLogCall).TotalSeconds < 10)
			//{
			//    return;
			//}

			if(    (DateTime.Now - m_lastMeasuredValuesLoggedTime).TotalMilliseconds >= measuredValuesLogIntervalMs
				&& (isMonitored || isGrabbed)
				)
			{
				m_lastMeasuredValuesLoggedTime = DateTime.Now;

				Logger.Log();
			}
		}

		#region Monitoring Thread

		private Thread m_monitoringThread = null;
		private DateTime m_started = DateTime.Now;

		private void startMonitoringThread()
		{
			try
			{
				m_monitoringThread = new Thread(new System.Threading.ThreadStart(controlLoop));
				m_monitoringThread.Name = "RoboteqControllerControlLoop";
				m_monitoringThread.IsBackground = true;
				// see Entry.cs for how the current culture is set:
				m_monitoringThread.CurrentCulture = Thread.CurrentThread.CurrentCulture; //new CultureInfo("en-US", false);
				m_monitoringThread.CurrentUICulture = Thread.CurrentThread.CurrentUICulture; //new CultureInfo("en-US", false);
				m_monitoringThread.Priority = ThreadPriority.AboveNormal;
				m_started = DateTime.Now;
				m_monitoringThread.Start();
				Thread.Sleep(0);			//Give thread time to start. By documentation, 0 should work, but it does not!
			}
			catch (Exception exc)
			{
				Tracer.Error("startMonitoringThread" + exc.Message);
			}
		}

		/// <summary>
		/// we need to kill the thread if a long upload/download is in progress and we click "Stop" or close the dialog
		/// </summary>
		/// <returns></returns>
		private bool killMonitoringThread()
		{
			bool ret = (m_monitoringThread != null);

			Thread rtThread = m_monitoringThread;

			Tracer.Trace("killMonitoringThread");
			if (rtThread != null)
			{
				try
				{
					Tracer.Trace("killMonitoringThread - aborting");
					if (rtThread.IsAlive)
					{
						rtThread.Abort();
					}
				}
				catch (Exception e)
				{
					Tracer.Error("killMonitoringThread - while aborting - " + e);
				}
				m_monitoringThread = null;
				//				Project.inhibitRefresh = false;
				Tracer.Trace("killMonitoringThread - finished");
			}
			else
			{
				Tracer.Trace("killMonitoringThread - no thread to kill");
			}
			return ret;
		}

		#endregion // Monitoring Thread
	}
}


text:
MATLAB implementation of the seam-carving algorithm for image retargeting.

## Reference
1. Avidan, S. and Shamir, A. ["Seam Carving for Content-Aware Image Resizing"][seam_1]. Mitsubishi Electric Research Laboratories. Technical Report TR2007-087. August 2008.

2. Rubinstein, M. et al. ["Improved Seam Carving for Video Retargeting"][seam_2]. Mitsubishi Electric Research Laboratories. Technical Report TR2008-064. August 2008.

[seam_1]: http://perso.crans.org/frenoy/matlab2012/seamcarving.pdf
[seam_2]: http://www.merl.com/publications/docs/TR2008-064.pdf


text:
/**
 * Capabilities.ts
 *
 * Export utility types / functions for working with plugin capabilities
 */

/**
 * ActivationMode describes the policy in which the plugin should be activated.
 * `immediate` means the plugin will be executed at startup,
 * `on-demand` means the plugin will be executed when it encounters a command or event it can handle
 */
export type ActivationMode = "immediate" | "on-demand"

export interface Capabilities {
    commands?: { [commandName: string]: ICommandInfo }
}

export interface ICommandInfo {
    name: string
    details: string
}

/**
 * Interface describing
 */
export interface IPluginFilter {
    fileType: string
    requiredCapabilities: Capabilities
}

export const createPluginFilter = (fileType: string, requiredCapabilities?: Capabilities) => ({
    fileType,
    requiredCapabilities,
})

export const createPluginFilterForCommand = (fileType: string, command: string) => {
    const commands = {}
    commands[command] = null
    return createPluginFilter(fileType, {
        commands,
    })
}

export interface IPluginMetadata {
    name: string
    main: string
    engines: any
    oni: IPluginCapabilities
}

export interface IPluginCapabilities extends Capabilities {
    activationMode?: ActivationMode
    supportedFileTypes?: string[]
}

/**
 * Returns true if the metadata matches the filter, false otherwise
 */
export const doesMetadataMatchFilter = (metadata: IPluginMetadata, filter: IPluginFilter) => {

    if (!filter) {
        return true
    }

    const expectedFileType = filter.fileType

    if (!metadata.oni) {
        return false
    }

    if (!doesPluginSupportFiletype(metadata.oni, expectedFileType)) {
        return false
    }

    return true
}

export const doesPluginSupportFiletype = (pluginCapabilities: IPluginCapabilities, fileType: string) => {

    if (!pluginCapabilities.supportedFileTypes || !pluginCapabilities.supportedFileTypes.length) {
        return false
    }

    const matches = pluginCapabilities.supportedFileTypes.filter((ft) => {
            return ft === "*" || ft === fileType
    })

    return matches.length > 0
}