<?xml version="1.0" encoding="UTF-8"?>

<!-- generated on Tue Mar 31 12:21:47 2020 by Eclipse SUMO Version v1_5_0+1025-83bc0d0af0
This data file and the accompanying materials
are made available under the terms of the Eclipse Public License v2.0
which accompanies this distribution, and is available at
http://www.eclipse.org/legal/epl-v20.html
SPDX-License-Identifier: EPL-2.0
<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sumo.dlr.de/xsd/sumoConfiguration.xsd">

    <input>
        <net-file value="net.net.xml"/>
        <route-files value="input_routes.rou.xml"/>
        <additional-files value="input_additional.add.xml"/>
    </input>

    <output>
        <write-license value="true"/>
        <vehroute-output value="vehroutes.xml"/>
    </output>

    <time>
        <end value="1200"/>
    </time>

    <processing>
        <default.speeddev value="0"/>
        <pedestrian.model value="nonInteracting"/>
    </processing>

    <report>
        <xml-validation value="never"/>
        <duration-log.disable value="true"/>
        <no-step-log value="true"/>
    </report>

    <mesoscopic>
        <mesosim value="true"/>
        <meso-junction-control value="true"/>
    </mesoscopic>

</configuration>
-->

<meandata xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sumo.dlr.de/xsd/meandata_file.xsd">
    <interval begin="0.00" end="360.00" id="expect_300_vehs">
        <edge id="end" sampledSeconds="1245.58" traveltime="8.31" overlapTraveltime="8.45" density="11.53" laneDensity="11.53" occupancy="5.77" waitingTime="0.00" speed="36.11" departed="0" arrived="148" entered="152" left="0" laneChangedFrom="0" laneChangedTo="0"/>
        <edge id="jam0" sampledSeconds="4633.64" traveltime="30.05" overlapTraveltime="30.55" density="42.90" laneDensity="42.90" occupancy="21.45" waitingTime="0.00" speed="9.98" departed="0" arrived="0" entered="156" left="152" laneChangedFrom="0" laneChangedTo="0"/>
        <edge id="jam1" sampledSeconds="3471.78" traveltime="22.00" overlapTraveltime="22.55" density="48.22" laneDensity="48.22" occupancy="24.11" waitingTime="0.00" speed="9.09" departed="0" arrived="0" entered="159" left="156" laneChangedFrom="0" laneChangedTo="0"/>
        <edge id="jam2" sampledSeconds="1836.51" traveltime="11.48" overlapTraveltime="12.06" density="51.01" laneDensity="51.01" occupancy="25.51" waitingTime="0.00" speed="8.71" departed="0" arrived="0" entered="161" left="159" laneChangedFrom="0" laneChangedTo="0"/>
        <edge id="start" sampledSeconds="6943.22" traveltime="42.12" overlapTraveltime="42.82" density="64.29" laneDensity="64.29" occupancy="32.14" waitingTime="0.00" speed="7.12" departed="177" arrived="0" entered="0" left="161" laneChangedFrom="0" laneChangedTo="0"/>
    </interval>
    <interval begin="360.00" end="720.00" id="expect_300_vehs">
        <edge id="end" sampledSeconds="1543.97" traveltime="8.31" overlapTraveltime="8.45" density="14.30" laneDensity="14.30" occupancy="7.15" waitingTime="0.00" speed="36.11" departed="0" arrived="186" entered="186" left="0" laneChangedFrom="0" laneChangedTo="0"/>
        <edge id="jam0" sampledSeconds="1543.97" traveltime="8.31" overlapTraveltime="8.45" density="14.30" laneDensity="14.30" occupancy="7.15" waitingTime="0.00" speed="36.11" departed="0" arrived="0" entered="186" left="186" laneChangedFrom="0" laneChangedTo="0"/>
        <edge id="jam1" sampledSeconds="1029.22" traveltime="5.54" overlapTraveltime="5.68" density="14.29" laneDensity="14.29" occupancy="7.15" waitingTime="0.00" speed="36.11" departed="0" arrived="0" entered="186" left="186" laneChangedFrom="0" laneChangedTo="0"/>
        <edge id="jam2" sampledSeconds="514.47" traveltime="2.77" overlapTraveltime="2.91" density="14.29" laneDensity="14.29" occupancy="7.15" waitingTime="0.00" speed="36.11" departed="0" arrived="0" entered="186" left="186" laneChangedFrom="0" laneChangedTo="0"/>
        <edge id="start" sampledSeconds="5618.33" traveltime="30.21" overlapTraveltime="30.72" density="52.02" laneDensity="52.02" occupancy="26.01" waitingTime="0.00" speed="9.93" departed="185" arrived="0" entered="0" left="186" laneChangedFrom="0" laneChangedTo="0"/>
    </interval>
    <interval begin="720.00" end="1080.00" id="expect_300_vehs">
        <edge id="end" sampledSeconds="1543.97" traveltime="8.31" overlapTraveltime="8.45" density="14.30" laneDensity="14.30" occupancy="7.15" waitingTime="0.00" speed="36.11" departed="0" arrived="186" entered="186" left="0" laneChangedFrom="0" laneChangedTo="0"/>
        <edge id="jam0" sampledSeconds="1543.97" traveltime="8.31" overlapTraveltime="8.45" density="14.30" laneDensity="14.30" occupancy="7.15" waitingTime="0.00" speed="36.11" departed="0" arrived="0" entered="186" left="186" laneChangedFrom="0" laneChangedTo="0"/>
        <edge id="jam1" sampledSeconds="1029.22" traveltime="5.54" overlapTraveltime="5.68" density="14.29" laneDensity="14.29" occupancy="7.15" waitingTime="0.00" speed="36.11" departed="0" arrived="0" entered="186" left="186" laneChangedFrom="0" laneChangedTo="0"/>
        <edge id="jam2" sampledSeconds="514.72" traveltime="2.77" overlapTraveltime="2.91" density="14.30" laneDensity="14.30" occupancy="7.15" waitingTime="0.00" speed="36.11" departed="0" arrived="0" entered="185" left="186" laneChangedFrom="0" laneChangedTo="0"/>
        <edge id="start" sampledSeconds="5617.53" traveltime="30.23" overlapTraveltime="30.73" density="52.01" laneDensity="52.01" occupancy="26.01" waitingTime="0.00" speed="9.93" departed="186" arrived="0" entered="0" left="185" laneChangedFrom="0" laneChangedTo="0"/>
    </interval>
    <interval begin="1080.00" end="1200.00" id="expect_300_vehs">
        <edge id="end" sampledSeconds="519.57" traveltime="8.34" overlapTraveltime="8.47" density="14.43" laneDensity="14.43" occupancy="7.22" waitingTime="0.00" speed="35.99" departed="0" arrived="61" entered="62" left="0" laneChangedFrom="0" laneChangedTo="0"/>
        <edge id="jam0" sampledSeconds="518.66" traveltime="8.31" overlapTraveltime="8.45" density="14.41" laneDensity="14.41" occupancy="7.20" waitingTime="0.00" speed="36.09" departed="0" arrived="0" entered="62" left="62" laneChangedFrom="0" laneChangedTo="0"/>
        <edge id="jam1" sampledSeconds="346.07" traveltime="5.56" overlapTraveltime="5.70" density="14.42" laneDensity="14.42" occupancy="7.21" waitingTime="0.00" speed="35.99" departed="0" arrived="0" entered="62" left="62" laneChangedFrom="0" laneChangedTo="0"/>
        <edge id="jam2" sampledSeconds="172.58" traveltime="2.77" overlapTraveltime="2.91" density="14.38" laneDensity="14.38" occupancy="7.19" waitingTime="0.00" speed="36.11" departed="0" arrived="0" entered="62" left="62" laneChangedFrom="0" laneChangedTo="0"/>
        <edge id="start" sampledSeconds="1887.49" traveltime="30.25" overlapTraveltime="30.76" density="52.43" laneDensity="52.43" occupancy="26.22" waitingTime="0.00" speed="9.92" departed="62" arrived="0" entered="0" left="62" laneChangedFrom="0" laneChangedTo="0"/>
    </interval>
</meandata>

{'repo_name': 'eclipse/sumo', 'stars': '728', 'repo_language': 'C++', 'file_name': 'testsuite.neteditcheckoutput', 'mime_type': 'text/plain', 'hash': -7163799510425286501, 'source_dataset': 'data'}


comment.block

comment
This is a sample comment block that

comment
spans multiple lines.

start

comment *#

start

start

keyword #macro

text

lparen (

text

identifier outputItem

text

variable $item

text

rparen )

start

text

meta.tag.punctuation.tag-open.xml

meta.tag.tag-name.xml

li

meta.tag.punctuation.tag-close.xml

variable ${

identifier item

variable }

meta.tag.punctuation.end-tag-open.xml

meta.tag.tag-name.xml

li

meta.tag.punctuation.tag-close.xml

start

keyword #end

start

start

comment
## Define the items to iterate

start

keyword #set

text

lparen (

text

variable $items

text

keyword.operator

text

lparen [

constant.numeric

text.xml

text

constant.numeric

text.xml

text

constant.numeric

text.xml

text

constant.numeric

rparen ]

text

rparen )

start

start

meta.tag.punctuation.tag-open.xml

meta.tag.tag-name.xml

ul

meta.tag.punctuation.tag-close.xml

start

text

comment

## Iterate over the items and output the evens.

start

text

keyword #foreach

text

lparen (

text

variable $item

text

identifier in

text

variable $items

text

rparen )

start

text

keyword #if

text

lparen (

text

support.function

text.xml

identifier mod

lparen (

variable $item

text.xml

text

constant.numeric

rparen )

text

keyword.operator

text

constant.numeric

text

rparen )

start

text

identifier #outputItem

text

lparen (

variable $item

rparen )

start

text

keyword #end

start

text

keyword #end

start

meta.tag.punctuation.end-tag-open.xml

meta.tag.tag-name.xml

ul

meta.tag.punctuation.tag-close.xml

start

js-start

meta.tag.punctuation.tag-open.xml

meta.tag.script.tag-name.xml

script

meta.tag.punctuation.tag-close.xml

text

comment /*

comment
A sample function to decomstrate

comment

JavaScript highlighting and folding.

js-start

comment */

js-start

text

storage.type

function

text

entity.name.function

foo

paren.lparen

variable.parameter

items

punctuation.operator

variable.parameter

nada

paren.rparen

text

paren.lparen

js-start

text

keyword for

text

paren.lparen

storage.type

var

text

identifier i

keyword.operator

constant.numeric

punctuation.operator

text

identifier i

keyword.operator

identifier items

punctuation.operator

support.constant

length

punctuation.operator

text

identifier i

keyword.operator

paren.rparen

text

paren.lparen

js-start

text

support.function

alert

paren.lparen

identifier items

paren.lparen

identifier i

paren.rparen

text

keyword.operator

text

string "juhu

constant.language.escape

\n

string "

paren.rparen

punctuation.operator

text

paren.rparen

text

paren.rparen

start

meta.tag.punctuation.end-tag-open.xml

meta.tag.script.tag-name.xml

script

meta.tag.punctuation.tag-close.xml

start

css-start

meta.tag.punctuation.tag-open.xml

meta.tag.style.tag-name.xml

style

meta.tag.punctuation.tag-close.xml

css-comment css-start

text

comment /*

css-comment css-start

comment
A sample style to decomstrate

css-comment css-start

comment
CSS highlighting and folding.

css-start

comment */

css-ruleset

text

variable .class

text

paren.lparen

css-ruleset

text

support.type

font-family

punctuation.operator

text Monaco,

string.start

string
Courier New

string.end

text ,

support.constant.fonts

monospace

punctuation.operator

css-ruleset

text

support.type

font-size

punctuation.operator

text

constant.numeric

keyword px

punctuation.operator

css-ruleset

text

support.type

cursor

punctuation.operator

text

support.constant

text

punctuation.operator

css-start

text

paren.rparen

start

meta.tag.punctuation.end-tag-open.xml

meta.tag.style.tag-name.xml

style

meta.tag.punctuation.tag-close.xml

{'repo_name': 'c9/core', 'stars': '2441', 'repo_language': 'JavaScript', 'file_name': 'mock_analytics.js', 'mime_type': 'text/plain', 'hash': 3121277417071893875, 'source_dataset': 'data'}


/*
 * Licensed to the Apache Software Foundation (ASF) under one or more contributor license
 * agreements. See the NOTICE file distributed with this work for additional information regarding
 * copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance with the License. You may obtain a
 * copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed under the License
 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
 * or implied. See the License for the specific language governing permissions and limitations under
 * the License.
 */
package org.apache.geode.management.internal.cli.shell;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.geode.management.internal.cli.GfshParser;

public class MultiCommandHelper {

  public static List<String> getMultipleCommands(String input) {
    Map<Integer, List<String>> listMap = new HashMap<Integer, List<String>>();
    String as[] = input.split(GfshParser.COMMAND_DELIMITER);
    int splitCount = 0;
    for (String a : as) {
      if (a.endsWith("\\")) {
        String a2 = a.substring(0, a.length() - 1);
        updateList(listMap, a2, splitCount);
      } else {
        updateList(listMap, a, splitCount);
        splitCount++;
      }
    }
    List<String> finalList = new ArrayList<String>();
    for (int i = 0; i < listMap.size(); i++) {
      List<String> list = listMap.get(i);
      StringBuilder sb = new StringBuilder();
      for (int k = 0; k < list.size(); k++) {
        sb.append(list.get(k));
        if (k < list.size() - 1)
          sb.append(";");
      }
      finalList.add(sb.toString());
    }
    return finalList;
  }

  private static void updateList(Map<Integer, List<String>> listMap, String a, int splitCount) {
    if (listMap.containsKey(splitCount))
      listMap.get(splitCount).add(a);
    else {
      List<String> list = new ArrayList<String>();
      list.add(a);
      listMap.put(splitCount, list);
    }
  }

}

{'repo_name': 'apache/geode', 'stars': '1792', 'repo_language': 'Java', 'file_name': 'expected-pom.xml', 'mime_type': 'text/xml', 'hash': -5771853639266867110, 'source_dataset': 'data'}


fileFormatVersion: 2
guid: 23db614d34f58ea42b67850906a103a2
timeCreated: 1443705694
licenseType: Store
ShaderImporter:
  defaultTextures:
  - _A: {instanceID: 0}
  - _B: {instanceID: 0}
  userData:
  assetBundleName:
  assetBundleVariant:

{'repo_name': 'XINCGer/ColaFrameWork', 'stars': '246', 'repo_language': 'C#', 'file_name': 'init.lua', 'mime_type': 'text/plain', 'hash': -8776551125224330936, 'source_dataset': 'data'}


include apache
include apache::mod::php
include apache::mod::cgi
include apache::mod::userdir
include apache::mod::disk_cache
include apache::mod::proxy_http

{'repo_name': 'phpservermon/phpservermon', 'stars': '1664', 'repo_language': 'PHP', 'file_name': 'status.cron.php', 'mime_type': 'text/x-php', 'hash': -3342223100502092285, 'source_dataset': 'data'}


CHANGELOG
=========

The changelog is maintained for all Symfony contracts at the following URL:
https://github.com/symfony/contracts/blob/master/CHANGELOG.md

{'repo_name': 'symfony/event-dispatcher-contracts', 'stars': '1884', 'repo_language': 'PHP', 'file_name': 'composer.json', 'mime_type': 'text/plain', 'hash': 8648741024065827224, 'source_dataset': 'data'}


## Golang Taiwan Gathering #11

### Time

#### 2014/09/24(Wed.) 19:30 ~ 21:30  (UDT+8)

### Resgistration Page:

#### [Regstration Info](http://golang.kktix.cc/events/gtg11)

### Talks

這次 Golang Taipei Gathering 在伯朗咖啡 ( 建國店 ) 場地。 本次活動沒有分享，純粹聚在一起認識一下，聊聊 Go。或者來做自己的事也可以。開放區座位沒有訂位，不過有預定要來的還是可以報名露個臉。 若有想分享的朋友請與我們聯繫，累積足夠講者後可舉辦 meetup 分享會。

{'repo_name': 'golangtw/GolangTaiwanGathering', 'stars': '175', 'repo_language': 'None', 'file_name': 'README.md', 'mime_type': 'text/plain', 'hash': 4228025217932501135, 'source_dataset': 'data'}


package com.mogujie.tt.ui.base;

import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.text.TextPaint;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.mogujie.tools.ScreenTools;
import com.mogujie.tt.R;
import com.mogujie.tt.ui.activity.SearchActivity;
import com.mogujie.tt.ui.widget.SearchEditText;
import com.mogujie.tt.ui.widget.TopTabButton;
import com.mogujie.tt.utils.Logger;

public abstract class TTBaseFragment extends Fragment {
	protected ImageView topLeftBtn;
	protected ImageView topRightBtn;
	protected TextView topTitleTxt;
	protected TextView topLetTitleTxt;
	protected TextView topRightTitleTxt;

	protected ViewGroup topBar;
	protected TopTabButton topContactTitle;
	protected SearchEditText topSearchEdt;
	protected ViewGroup topContentView;
	protected RelativeLayout topLeftContainerLayout;
	protected FrameLayout searchFrameLayout;
	protected FrameLayout topContactFrame;

	protected float x1, y1, x2, y2 = 0;
	protected static Logger logger = Logger.getLogger(TTBaseFragment.class);

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);

		topContentView = (ViewGroup) LayoutInflater.from(getActivity()).inflate(R.layout.tt_fragment_base, null);

		topBar = (ViewGroup) topContentView.findViewById(R.id.topbar);
		topTitleTxt = (TextView) topContentView.findViewById(R.id.base_fragment_title);
		topLetTitleTxt = (TextView) topContentView.findViewById(R.id.left_txt);
		topRightTitleTxt = (TextView) topContentView.findViewById(R.id.right_txt);
		topLeftBtn = (ImageView) topContentView.findViewById(R.id.left_btn);
		topRightBtn = (ImageView) topContentView.findViewById(R.id.right_btn);
		topContactTitle = (TopTabButton) topContentView.findViewById(R.id.contact_tile);
		topSearchEdt = (SearchEditText) topContentView.findViewById(R.id.chat_title_search);
		topLeftContainerLayout=(RelativeLayout)topContentView.findViewById(R.id.top_left_container);
		searchFrameLayout = (FrameLayout)topContentView.findViewById(R.id.searchbar);
		topContactFrame = (FrameLayout)topContentView.findViewById(R.id.contactTopBar);

		topTitleTxt.setVisibility(View.GONE);
		topRightBtn.setVisibility(View.GONE);
		topLeftBtn.setVisibility(View.GONE);
		topLetTitleTxt.setVisibility(View.GONE);
		topRightTitleTxt.setVisibility(View.GONE);
		topContactTitle.setVisibility(View.GONE);
		topSearchEdt.setVisibility(View.GONE);
	}

	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup vg,
			Bundle bundle) {
		if (null != topContentView) {
			((ViewGroup) topContentView.getParent()).removeView(topContentView);
			return topContentView;
		}
		return topContentView;
	}

	protected void setTopTitleBold(String title) {
		if (title == null) {
			return;
		}
		if (title.length() > 12) {
			title = title.substring(0, 11) + "...";
		}
		// 设置字体为加粗
		TextPaint paint =  topTitleTxt.getPaint();
		paint.setFakeBoldText(true);

		topTitleTxt.setText(title);
		topTitleTxt.setVisibility(View.VISIBLE);

	}

	protected void setTopTitle(String title) {
		if (title == null) {
			return;
		}
		if (title.length() > 12) {
			title = title.substring(0, 11) + "...";
		}
		topTitleTxt.setText(title);
		topTitleTxt.setVisibility(View.VISIBLE);
	}

	protected void hideTopTitle() {
		topTitleTxt.setVisibility(View.GONE);
	}

	protected void showContactTopBar() {
		topContactFrame.setVisibility(View.VISIBLE);
		topContactTitle.setVisibility(View.VISIBLE);
	}

	protected void setTopLeftButton(int resID) {
		if (resID <= 0) {
			return;
		}

		topLeftBtn.setImageResource(resID);
		topLeftBtn.setVisibility(View.VISIBLE);
	}

    protected void setTopLeftButtonPadding(int l,int t,int r,int b) {
        topLeftBtn.setPadding(l,t,r,b);
    }

	protected void hideTopLeftButton() {
		topLeftBtn.setVisibility(View.GONE);
	}

	protected void setTopLeftText(String text) {
		if (null == text) {
			return;
		}
		topLetTitleTxt.setText(text);
		topLetTitleTxt.setVisibility(View.VISIBLE);
	}

	protected void setTopRightText(String text) {
		if (null == text) {
			return;
		}
		topRightTitleTxt.setText(text);
		topRightTitleTxt.setVisibility(View.VISIBLE);
	}

	protected void setTopRightButton(int resID) {
		if (resID <= 0) {
			return;
		}

		topRightBtn.setImageResource(resID);
		topRightBtn.setVisibility(View.VISIBLE);
	}

	protected void hideTopRightButton() {
		topRightBtn.setVisibility(View.GONE);
	}

	protected void setTopBar(int resID) {
		if (resID <= 0) {
			return;
		}
		topBar.setBackgroundResource(resID);
	}

    protected void hideTopBar()
    {
        topBar.setVisibility(View.GONE);
        LinearLayout.LayoutParams linearParams =(LinearLayout.LayoutParams) topContactFrame.getLayoutParams();
        linearParams.height = ScreenTools.instance(getActivity()).dip2px(45);
        topContactFrame.setLayoutParams(linearParams);
        topContactFrame.setPadding(0,ScreenTools.instance(getActivity()).dip2px(10),0,0);
    }

	protected void showTopSearchBar() {
		topSearchEdt.setVisibility(View.VISIBLE);
	}

	protected void hideTopSearchBar() {
		topSearchEdt.setVisibility(View.GONE);
	}

	protected void showSearchFrameLayout(){
		searchFrameLayout.setVisibility(View.VISIBLE);
        /**还是以前的页面，没有看psd是否改过*/
        searchFrameLayout.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View arg0) {
                showSearchView();
            }
        });
        //下面的历史代码
        //tryHandleSearchAction(action);
	}

	protected abstract void initHandler();

	@Override
	public void onActivityCreated(Bundle bundle) {
		logger.d("Fragment onActivityCreate:" + getClass().getName());
		super.onActivityCreated(bundle);
	}

	@Override
	public void onStart() {
		super.onStart();
	}

	@Override
	public void onStop() {
		super.onStop();
	}

	@Override
	public void onResume() {
		super.onResume();
	}

	@Override
	public void onPause() {
		super.onPause();
	}

	protected void initSearch() {
		setTopRightButton(R.drawable.tt_top_search);
		topRightBtn.setOnClickListener(new View.OnClickListener() {
			@Override
			public void onClick(View arg0) {
				showSearchView();
			}
		});
	}

	public void showSearchView() {
		startActivity(new Intent(getActivity(), SearchActivity.class));
	}

	protected void onSearchDataReady() {
		initSearch();
	}
}

{'repo_name': 'ccfish86/sctalk', 'stars': '136', 'repo_language': 'Java', 'file_name': 'dev-server.js', 'mime_type': 'text/plain', 'hash': 4035938249025207585, 'source_dataset': 'data'}


/*
 * Licensed to Green Energy Corp (www.greenenergycorp.com) under one or
 * more contributor license agreements. See the NOTICE file distributed
 * with this work for additional information regarding copyright ownership.
 * Green Energy Corp licenses this file to you under the Apache License,
 * Version 2.0 (the "License"); you may not use this file except in
 * compliance with the License.  You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 * This project was forked on 01/01/2013 by Automatak, LLC and modifications
 * may have been made to this file. Automatak, LLC licenses these modifications
 * to you under the terms of the License.
 */

#ifndef ASIODNP3_DNP3MANAGERIMPL_H
#define ASIODNP3_DNP3MANAGERIMPL_H

#include "openpal/logging/Logger.h"
#include "openpal/util/Uncopyable.h"

#include "asiopal/ThreadPool.h"
#include "asiopal/SerialTypes.h"
#include "asiopal/TLSConfig.h"
#include "asiopal/ChannelRetry.h"
#include "asiopal/ResourceManager.h"
#include "asiopal/IListener.h"
#include "asiopal/IPEndpoint.h"

#include "opendnp3/LogLevels.h"

#include "asiodnp3/IChannel.h"
#include "asiodnp3/IChannelListener.h"
#include "asiodnp3/IListenCallbacks.h"

namespace asiodnp3
{

class DNP3ManagerImpl : private openpal::Uncopyable
{

public:

	DNP3ManagerImpl(
	    uint32_t concurrencyHint,
	    std::shared_ptr<openpal::ILogHandler> handler,
	    std::function<void()> onThreadStart,
	    std::function<void()> onThreadExit
	);

	~DNP3ManagerImpl();

	void Shutdown();

	std::shared_ptr<IChannel> AddTCPClient(
	    const std::string& id,
	    uint32_t levels,
	    const asiopal::ChannelRetry& retry,
	    const std::string& host,
	    const std::string& local,
	    uint16_t port,
	    std::shared_ptr<IChannelListener> listener);

	std::shared_ptr<IChannel> AddTCPServer(
	    const std::string& id,
	    uint32_t levels,
	    const asiopal::ChannelRetry& retry,
	    const std::string& endpoint,
	    uint16_t port,
	    std::shared_ptr<IChannelListener> listener);

	std::shared_ptr<IChannel> AddSerial(
	    const std::string& id,
	    uint32_t levels,
	    const asiopal::ChannelRetry& retry,
	    asiopal::SerialSettings settings,
	    std::shared_ptr<IChannelListener> listener);

	std::shared_ptr<IChannel> AddTLSClient(
	    const std::string& id,
	    uint32_t levels,
	    const asiopal::ChannelRetry& retry,
	    const std::string& host,
	    const std::string& local,
	    uint16_t port,
	    const asiopal::TLSConfig& config,
	    std::shared_ptr<IChannelListener> listener,
	    std::error_code& ec);

	std::shared_ptr<IChannel> AddTLSServer(
	    const std::string& id,
	    uint32_t levels,
	    const asiopal::ChannelRetry& retry,
	    const std::string& endpoint,
	    uint16_t port,
	    const asiopal::TLSConfig& config,
	    std::shared_ptr<IChannelListener> listener,
	    std::error_code& ec);

	std::shared_ptr<asiopal::IListener> CreateListener(
	    std::string loggerid,
	    openpal::LogFilters loglevel,
	    asiopal::IPEndpoint endpoint,
	    const std::shared_ptr<IListenCallbacks>& callbacks,
	    std::error_code& ec
	);

	std::shared_ptr<asiopal::IListener> CreateListener(
	    std::string loggerid,
	    openpal::LogFilters loglevel,
	    asiopal::IPEndpoint endpoint,
	    const asiopal::TLSConfig& config,
	    const std::shared_ptr<IListenCallbacks>& callbacks,
	    std::error_code& ec
	);

private:

	openpal::Logger logger;
	const std::shared_ptr<asiopal::IO> io;
	asiopal::ThreadPool threadpool;
	std::shared_ptr<asiopal::ResourceManager> resources;

};

}

#endif

{'repo_name': 'thiagoralves/OpenPLC_v3', 'stars': '204', 'repo_language': 'C++', 'file_name': 'readme.md', 'mime_type': 'text/plain', 'hash': -998338468556754678, 'source_dataset': 'data'}


package test

import example.myapp.helloworld.grpc.{ GreeterService, GreeterServiceClient, HelloRequest }
import io.grpc.Status
import play.api.inject.bind
import play.api.inject.guice.GuiceApplicationBuilder
import play.api.libs.ws.{ WSClient, WSRequest }
import play.api.routing.Router
import play.api.test._
import play.grpc.specs2.ServerGrpcClient
import routers.HelloWorldRouter
import play.api.Configuration
import com.typesafe.config.ConfigFactory

class HelloSpecs2Spec extends ForServer with ServerGrpcClient with PlaySpecification with ApplicationFactories {

  protected def applicationFactory: ApplicationFactory =
    withGuiceApp(
      GuiceApplicationBuilder()
      .overrides(bind[Router].to[HelloWorldRouter])
      .configure(new Configuration(ConfigFactory.parseString("play.filters.hosts.allowed += 0.0.0.0").resolve()))
    )

  def wsUrl(path: String)(implicit running: RunningServer): WSRequest = {
    val ws = running.app.injector.instanceOf[WSClient]
    val url = running.endpoints.httpEndpoint.get.pathUrl(path)
    ws.url(url)
  }

  "A Play server bound to a gRPC router" should {
    "give a 404 when routing a non-gRPC request" >> { implicit rs: RunningServer =>
      val result = await(wsUrl("/").get)
      result.status must ===(404)
    }
    "give an Ok header when routing a non-existent gRPC method" >> { implicit rs: RunningServer =>
      val result = await(wsUrl(s"/${GreeterService.name}/FooBar").get)
      result.status must ===(200)
    }
    "give a 200 when routing an empty request to a gRPC method" >> { implicit rs: RunningServer =>
      val result = await(wsUrl(s"/${GreeterService.name}/SayHello").get)
      result.status must ===(200)
    }
    "work with a gRPC client" >> { implicit rs: RunningServer =>
      withGrpcClient[GreeterServiceClient] { client: GreeterServiceClient =>
        val reply = await(client.sayHello(HelloRequest("Alice")))
        reply.message must ===("Hello, Alice!")
      }
    }
  }

}

{'repo_name': 'playframework/play-samples', 'stars': '263', 'repo_language': 'JavaScript', 'file_name': 'hello.js', 'mime_type': 'text/plain', 'hash': 7338864707858335777, 'source_dataset': 'data'}


/*
 * JBoss, Home of Professional Open Source
 * Copyright 2018, Red Hat, Inc., and individual contributors
 * by the @authors tag. See the copyright.txt in the distribution for a
 * full listing of individual contributors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * http://www.apache.org/licenses/LICENSE-2.0
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.jboss.weld.tests.interceptors.abstractClass.proxy;

import jakarta.enterprise.context.ApplicationScoped;

/**
 *
 * @author Matej Novotny
 */
@ApplicationScoped
public class CarServiceman extends Serviceman<Car> {

    @Override
    @InterruptWork
    public Car repair() {
        //in order to boost economy, we don't repair things, we toss em away and sell you new car!
        return new Car();
    }
}

{'repo_name': 'weld/core', 'stars': '314', 'repo_language': 'Java', 'file_name': 'Baz.java', 'mime_type': 'text/x-java', 'hash': 674627760396762866, 'source_dataset': 'data'}


<Canvas>
    <Kind>42</Kind>
    <Name>SystemSettings</Name>
    <IsMinified>0</IsMinified>
    <XPosition>425.000000000</XPosition>
    <YPosition>153.000000000</YPosition>
</Canvas>
<Widget>
    <Kind>2</Kind>
    <Name>DEBUG</Name>
    <Value>0</Value>
</Widget>

{'repo_name': 'CLOUDS-Interactive-Documentary/CLOUDS', 'stars': '277', 'repo_language': 'HTML', 'file_name': 'WildBlue_inout.xml', 'mime_type': 'text/plain', 'hash': -7655244699015829847, 'source_dataset': 'data'}


using Microsoft.VisualStudio.TestTools.UnitTesting;
using MySqlConnector;
using RepoDb.Enumerations;
using RepoDb.MySqlConnector.IntegrationTests.Models;
using RepoDb.MySqlConnector.IntegrationTests.Setup;
using System;
using System.Linq;

namespace RepoDb.MySqlConnector.IntegrationTests.Operations
{
    [TestClass]
    public class AverageTest
    {
        [TestInitialize]
        public void Initialize()
        {
            Database.Initialize();
            Cleanup();
        }

        [TestCleanup]
        public void Cleanup()
        {
            Database.Cleanup();
        }

        #region DataEntity

        #region Sync

        [TestMethod]
        public void TestMySqlConnectionAverageWithoutExpression()
        {
            // Setup
            var tables = Database.CreateCompleteTables(10);

            using (var connection = new MySqlConnection(Database.ConnectionString))
            {
                // Act
                var result = connection.Average<CompleteTable>(e => e.ColumnInt,
                    (object)null);

                // Assert
                Assert.AreEqual(tables.Average(e => e.ColumnInt), Convert.ToDouble(result));
            }
        }

        [TestMethod]
        public void TestMySqlConnectionAverageWithExpression()
        {
            // Setup
            var tables = Database.CreateCompleteTables(10);

            using (var connection = new MySqlConnection(Database.ConnectionString))
            {
                // Act
                var ids = new[] { tables.First().Id, tables.Last().Id };
                var result = connection.Average<CompleteTable>(e => e.ColumnInt,
                    e => ids.Contains(e.Id));

                // Assert
                Assert.AreEqual(tables.Where(e => ids.Contains(e.Id)).Average(e => e.ColumnInt), Convert.ToDouble(result));
            }
        }

        [TestMethod, ExpectedException(typeof(NotSupportedException))]
        public void TestMySqlConnectionAverageWithHints()
        {
            // Setup
            var tables = Database.CreateCompleteTables(10);

            using (var connection = new MySqlConnection(Database.ConnectionString))
            {
                // Act
                connection.Average<CompleteTable>(e => e.ColumnInt,
                    (object)null,
                    hints: "WhatEver");
            }
        }

        #endregion

        #region Async

        [TestMethod]
        public void TestMySqlConnectionAverageAsyncWithoutExpression()
        {
            // Setup
            var tables = Database.CreateCompleteTables(10);

            using (var connection = new MySqlConnection(Database.ConnectionString))
            {
                // Act
                var result = connection.AverageAsync<CompleteTable>(e => e.ColumnInt,
                    (object)null).Result;

                // Assert
                Assert.AreEqual(tables.Average(e => e.ColumnInt), Convert.ToDouble(result));
            }
        }

        [TestMethod]
        public void TestMySqlConnectionAverageAsyncWithExpression()
        {
            // Setup
            var tables = Database.CreateCompleteTables(10);

            using (var connection = new MySqlConnection(Database.ConnectionString))
            {
                // Act
                var ids = new[] { tables.First().Id, tables.Last().Id };
                var result = connection.AverageAsync<CompleteTable>(e => e.ColumnInt,
                    e => ids.Contains(e.Id)).Result;

                // Assert
                Assert.AreEqual(tables.Where(e => ids.Contains(e.Id)).Average(e => e.ColumnInt), Convert.ToDouble(result));
            }
        }

        [TestMethod, ExpectedException(typeof(AggregateException))]
        public void TestMySqlConnectionAverageAsyncWithHints()
        {
            // Setup
            var tables = Database.CreateCompleteTables(10);

            using (var connection = new MySqlConnection(Database.ConnectionString))
            {
                // Act
                connection.AverageAsync<CompleteTable>(e => e.ColumnInt,
                    (object)null,
                    hints: "WhatEver").Wait();
            }
        }

        #endregion

        #endregion

        #region TableName

        #region Sync

        [TestMethod]
        public void TestMySqlConnectionAverageViaTableNameWithoutExpression()
        {
            // Setup
            var tables = Database.CreateCompleteTables(10);

            using (var connection = new MySqlConnection(Database.ConnectionString))
            {
                // Act
                var result = connection.Average(ClassMappedNameCache.Get<CompleteTable>(),
                    Field.Parse<CompleteTable>(e => e.ColumnInt).First(),
                    (object)null);

                // Assert
                Assert.AreEqual(tables.Average(e => e.ColumnInt), Convert.ToDouble(result));
            }
        }

        [TestMethod]
        public void TestMySqlConnectionAverageViaTableNameWithExpression()
        {
            // Setup
            var tables = Database.CreateCompleteTables(10);

            using (var connection = new MySqlConnection(Database.ConnectionString))
            {
                // Act
                var ids = new[] { tables.First().Id, tables.Last().Id };
                var result = connection.Average(ClassMappedNameCache.Get<CompleteTable>(),
                    Field.Parse<CompleteTable>(e => e.ColumnInt).First(),
                    new QueryField("Id", Operation.In, ids));

                // Assert
                Assert.AreEqual(tables.Where(e => ids.Contains(e.Id)).Average(e => e.ColumnInt), Convert.ToDouble(result));
            }
        }

        [TestMethod, ExpectedException(typeof(NotSupportedException))]
        public void TestMySqlConnectionAverageViaTableNameWithHints()
        {
            // Setup
            var tables = Database.CreateCompleteTables(10);

            using (var connection = new MySqlConnection(Database.ConnectionString))
            {
                // Act
                connection.Average(ClassMappedNameCache.Get<CompleteTable>(),
                    Field.Parse<CompleteTable>(e => e.ColumnInt).First(),
                    (object)null,
                    hints: "WhatEver");
            }
        }

        #endregion

        #region Async

        [TestMethod]
        public void TestMySqlConnectionAverageAsyncViaTableNameWithoutExpression()
        {
            // Setup
            var tables = Database.CreateCompleteTables(10);

            using (var connection = new MySqlConnection(Database.ConnectionString))
            {
                // Act
                var result = connection.AverageAsync(ClassMappedNameCache.Get<CompleteTable>(),
                    Field.Parse<CompleteTable>(e => e.ColumnInt).First(),
                    (object)null).Result;

                // Assert
                Assert.AreEqual(tables.Average(e => e.ColumnInt), Convert.ToDouble(result));
            }
        }

        [TestMethod]
        public void TestMySqlConnectionAverageAsyncViaTableNameWithExpression()
        {
            // Setup
            var tables = Database.CreateCompleteTables(10);

            using (var connection = new MySqlConnection(Database.ConnectionString))
            {
                // Act
                var ids = new[] { tables.First().Id, tables.Last().Id };
                var result = connection.AverageAsync(ClassMappedNameCache.Get<CompleteTable>(),
                    Field.Parse<CompleteTable>(e => e.ColumnInt).First(),
                    new QueryField("Id", Operation.In, ids)).Result;

                // Assert
                Assert.AreEqual(tables.Where(e => ids.Contains(e.Id)).Average(e => e.ColumnInt), Convert.ToDouble(result));
            }
        }

        [TestMethod, ExpectedException(typeof(AggregateException))]
        public void TestMySqlConnectionAverageAsyncViaTableNameWithHints()
        {
            // Setup
            var tables = Database.CreateCompleteTables(10);

            using (var connection = new MySqlConnection(Database.ConnectionString))
            {
                // Act
                connection.AverageAsync(ClassMappedNameCache.Get<CompleteTable>(),
                    Field.Parse<CompleteTable>(e => e.ColumnInt).First(),
                    (object)null,
                    hints: "WhatEver").Wait();
            }
        }

        #endregion

        #endregion
    }
}

{'repo_name': 'mikependon/RepoDb', 'stars': '486', 'repo_language': 'C#', 'file_name': 'development-experience.md', 'mime_type': 'text/plain', 'hash': 7537981493286969414, 'source_dataset': 'data'}


package fitnesse.testrunner.run;

import fitnesse.FitNesseContext;
import fitnesse.testrunner.WikiPageIdentity;
import fitnesse.testrunner.WikiTestPage;
import fitnesse.testsystems.TestPage;
import fitnesse.testutil.FitNesseUtil;
import fitnesse.wiki.PageData;
import fitnesse.wiki.PathParser;
import fitnesse.wiki.WikiPage;
import fitnesse.wiki.WikiPageUtil;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;

import java.util.Collection;
import java.util.Collections;
import java.util.LinkedList;
import java.util.List;

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

public class PagesByTestSystemTest {
  private WikiPage suite;
  private FitNesseContext context;

  @Before
  public void setUp() throws Exception {
    context = FitNesseUtil.makeTestContext();
    suite = WikiPageUtil.addPage(context.getRootPage(), PathParser.parse("SuitePage"), "This is the test suite\n");
  }

  @Test
  public void testPagesForTestSystemAreSurroundedBySuiteSetupAndTeardown() throws Exception {
    WikiPage root = context.getRootPage();
    WikiPage testPage = addTestPage(suite, "TestOne", "My test");
    WikiPage slimPage = addTestPage(suite, "AaSlimTest", "!define TEST_SYSTEM {slim}\n" +
            "|!-DT:fitnesse.slim.test.TestSlim-!|\n" +
            "|string|get string arg?|\n" +
            "|wow|wow|\n");
    WikiPage setUp = WikiPageUtil.addPage(root, PathParser.parse("SuiteSetUp"), "suite set up");
    WikiPage tearDown = WikiPageUtil.addPage(root, PathParser.parse("SuiteTearDown"), "suite tear down");

    LinkedList<WikiPage> testPages = new LinkedList<>();
    testPages.add(setUp);
    testPages.add(slimPage);
    testPages.add(testPage);
    testPages.add(tearDown);

    PagesByTestSystem pagesByTestSystem = new PagesByTestSystem(testPages);
    Collection<WikiPageIdentity> descriptors = pagesByTestSystem.identities();
    WikiPageIdentity fitDescriptor = new WikiPageIdentity(testPage);
    WikiPageIdentity slimDescriptor = new WikiPageIdentity(slimPage);

    assertTrue(descriptors.contains(fitDescriptor));
    assertTrue(descriptors.contains(slimDescriptor));

    List<TestPage> fitList = pagesByTestSystem.testPagesForIdentity(fitDescriptor);
    List<TestPage> slimList = pagesByTestSystem.testPagesForIdentity(slimDescriptor);

    assertEquals(3, fitList.size());
    assertEquals(3, slimList.size());

    Assert.assertEquals(setUp, ((WikiTestPage) fitList.get(0)).getSourcePage());
    assertEquals(testPage, ((WikiTestPage) fitList.get(1)).getSourcePage());
    assertEquals(tearDown, ((WikiTestPage) fitList.get(2)).getSourcePage());

    assertEquals(setUp, ((WikiTestPage) slimList.get(0)).getSourcePage());
    assertEquals(slimPage, ((WikiTestPage) slimList.get(1)).getSourcePage());
    assertEquals(tearDown, ((WikiTestPage) slimList.get(2)).getSourcePage());

    assertEquals(6, pagesByTestSystem.totalTestsToRun());
    assertEquals(6, pagesByTestSystem.testsToRun().size());
  }

  @Test
  public void testInserterChosen() {
    suite = WikiPageUtil.addPage(context.getRootPage(),
      PathParser.parse("SuitePage"),
      "This is the altered test suite\n!define ALL_UNCLE_SUITE_SETUPS {true}\n");

    PageListSetUpTearDownProcessor processor = PagesByTestSystem.createProcessor(Collections.singletonList(suite));
    assertEquals(PageListSetUpTearDownInserter.class, processor.getClass());
  }

  @Test
  public void testSurrounderChosen() {
    PageListSetUpTearDownProcessor processor = PagesByTestSystem.createProcessor(Collections.singletonList(suite));
    assertEquals(PageListSetUpTearDownSurrounder.class, processor.getClass());
  }

  private WikiPage addTestPage(WikiPage page, String name, String content) {
    WikiPage testPage = WikiPageUtil.addPage(page, PathParser.parse(name), content);
    PageData data = testPage.getData();
    data.setAttribute("Test");
    testPage.commit(data);
    return testPage;
  }

}

{'repo_name': 'unclebob/fitnesse', 'stars': '1547', 'repo_language': 'Java', 'file_name': 'console-runner.js', 'mime_type': 'text/plain', 'hash': 97812102130981142, 'source_dataset': 'data'}


/**
 * Licensed to jclouds, Inc. (jclouds) under one or more
 * contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  jclouds licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */
package org.jclouds.rackspace.cloudservers;

import static org.jclouds.location.reference.LocationConstants.PROPERTY_REGIONS;

import java.net.URI;
import java.util.Properties;

import org.jclouds.cloudservers.CloudServersApiMetadata;
import org.jclouds.providers.ProviderMetadata;
import org.jclouds.providers.internal.BaseProviderMetadata;

/**
 * Implementation of {@link org.jclouds.types.ProviderMetadata} for Rackspace Cloud Servers US.
 *
 * @author Adrian Cole
 */
public class CloudServersUSProviderMetadata extends BaseProviderMetadata {

   public static Builder builder() {
      return new Builder();
   }

   @Override
   public Builder toBuilder() {
      return builder().fromProviderMetadata(this);
   }

   public CloudServersUSProviderMetadata() {
      super(builder());
   }

   public CloudServersUSProviderMetadata(Builder builder) {
      super(builder);
   }

   public static Properties defaultProperties() {
      Properties properties = new Properties();
      properties.setProperty(PROPERTY_REGIONS, "US");
      return properties;
   }

   public static class Builder extends BaseProviderMetadata.Builder {

      protected Builder(){
         id("cloudservers-us")
         .name("Rackspace Cloud Servers US")
         .apiMetadata(new CloudServersApiMetadata())
         .homepage(URI.create("http://www.rackspace.com/cloud/cloud_hosting_products/servers"))
         .console(URI.create("https://manage.rackspacecloud.com"))
         .linkedServices("cloudloadbalancers-us", "cloudservers-us", "cloudfiles-us")
         .iso3166Codes("US-IL", "US-TX");
      }

      @Override
      public CloudServersUSProviderMetadata build() {
         return new CloudServersUSProviderMetadata(this);
      }

      @Override
      public Builder fromProviderMetadata(
            ProviderMetadata in) {
         super.fromProviderMetadata(in);
         return this;
      }
   }
}

{'repo_name': 'jclouds/legacy-jclouds', 'stars': '477', 'repo_language': 'Java', 'file_name': 'archetype-metadata.xml', 'mime_type': 'text/xml', 'hash': 278272165431460659, 'source_dataset': 'data'}


!IF 0

Copyright (c) 1994  Microsoft Corporation

Module Name:

    sources.

Abstract:

    This file specifies the target component being built and the list of
    sources files needed to build that component.  Also specifies optional
    compiler switches and libraries that are unique for the component being
    built.

Author:

    Steve Wood (stevewo) 12-Apr-1989

Revision History:

!ENDIF

!INCLUDE ..\wininet.inc

MINORCOMP=inetui

TARGETNAME=inetui

INCLUDES=..\inc

SOURCES=ierrui.cxx      \
        ierrdlg.cxx     \
        dialui.cxx      \
        schnlui.cxx     \
        persist.cxx

{'repo_name': 'pustladi/Windows-2000', 'stars': '258', 'repo_language': 'C', 'file_name': 'c23.err', 'mime_type': 'text/plain', 'hash': -6937888070672219862, 'source_dataset': 'data'}


//----------------------------------------------------------------------------
//
//	MODULE:		RelationChangeObserver.h
//
//	PURPOSE:	RelationChangeObserver declaration
//
//	CREATED:	26.04.2002
//
//	(c) 2002 Monolith Productions, Inc.  All Rights Reserved
//
//
//	COMMENTS:	-
//
//
//----------------------------------------------------------------------------

#ifndef __RELATIONCHANGEOBSERVER_H__
#define __RELATIONCHANGEOBSERVER_H

#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000

#include "AIAssert.h"

// Forward Declarations:

class IRelationChangeObserver;
class IRelationChangeSubject;
class RelationChangeNotifier;

//-------------------------------------------------------------------------
//
//	CLASS:		IRelationChangeObserver
//
//	PURPOSE:	Defines an interface for objects which want to know when
//				relationships change.  Any change will result in the below
//				functions being called.
//
//-------------------------------------------------------------------------
class IRelationChangeObserver
{
public:
	virtual int OnRelationChange(HOBJECT) = 0;
};

//-------------------------------------------------------------------------
//
//	CLASS:		IRelationChangeSubject
//
//	PURPOSE:	Defines an interface for objects which want to know when
//				relationships change.  Any change will result in the below
//				functions being called.
//
//-------------------------------------------------------------------------
class IRelationChangeSubject
{
public:
	virtual void UnregisterObserver(RelationChangeNotifier*) = 0;
	virtual void RegisterObserver(RelationChangeNotifier*) = 0;
};

//-------------------------------------------------------------------------
//
//	CLASS:		RelationChangeNotifier
//
//	PURPOSE:	Simple instance which ties a container class and a reciever
//				together.  Placing an instance of this class and setting
//				the Subject and Observer will give the subject the method
//				needed to publish changes.
//
//	NOTE:		This class is NOT save/loadable!  Insure that the Set*
//				functions are called before the class it used.
//
//-------------------------------------------------------------------------
class RelationChangeNotifier
{
public:
	RelationChangeNotifier() :
	m_pObserver( 0 ),
	m_pSubject( 0 )
	{
	}

	// Unregister the Notifier when it is destroyed.  It is assumed that
	// this is done when the containing class, the Observer, is destroyed.
	~RelationChangeNotifier()
	{
		if ( m_pSubject )
		{
			m_pSubject->UnregisterObserver( this );
		}
	}

	// Sets the Subject, asserting if the passed in subject is NULL or if
	// the subject was already set.
	void SetSubject(IRelationChangeSubject* pSubject)
	{
		AIASSERT( m_pSubject==0, 0, "" );
		AIASSERT( pSubject!=0, 0, "Subject already set" );
		m_pSubject = pSubject;
		m_pSubject->RegisterObserver( this );
	}

	// Sets the Observer, asserting if the passed in subject is NULL or if
	// the observer was already set.
	void SetObserver(IRelationChangeObserver* pObserver )
	{
		AIASSERT( pObserver!=0, 0, "Null Observer passed into SetObserver" );
		AIASSERT( m_pObserver==0, 0, "Observer always set" );
		m_pObserver = pObserver;
	}

	void DoNotification(HOBJECT hChanged)
	{
		AIASSERT( m_pObserver, 0, "No observer set." );
		m_pObserver->OnRelationChange(hChanged);
	}

protected:
	RelationChangeNotifier(const RelationChangeNotifier& rhs) {}
	RelationChangeNotifier& operator=(const RelationChangeNotifier& rhs ) {}

private:

	// Don't Save:
	// Pointer to the container instance which will handle the notification
	IRelationChangeObserver* m_pObserver;
	IRelationChangeSubject* m_pSubject;
};

#endif // __RELATIONCHANGEOBSERVER_H

{'repo_name': 'jsj2008/lithtech', 'stars': '126', 'repo_language': 'C++', 'file_name': 'vs_powershield1.vsh', 'mime_type': 'text/plain', 'hash': -5173205715646227989, 'source_dataset': 'data'}


"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.merge = merge;
exports.validate = validate;
exports.normalizeReplacements = normalizeReplacements;

function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }

function merge(a, b) {
  var _b$placeholderWhiteli = b.placeholderWhitelist,
      placeholderWhitelist = _b$placeholderWhiteli === void 0 ? a.placeholderWhitelist : _b$placeholderWhiteli,
      _b$placeholderPattern = b.placeholderPattern,
      placeholderPattern = _b$placeholderPattern === void 0 ? a.placeholderPattern : _b$placeholderPattern,
      _b$preserveComments = b.preserveComments,
      preserveComments = _b$preserveComments === void 0 ? a.preserveComments : _b$preserveComments;
  return {
    parser: Object.assign({}, a.parser, b.parser),
    placeholderWhitelist: placeholderWhitelist,
    placeholderPattern: placeholderPattern,
    preserveComments: preserveComments
  };
}

function validate(opts) {
  if (opts != null && typeof opts !== "object") {
    throw new Error("Unknown template options.");
  }

  var _ref = opts || {},
      placeholderWhitelist = _ref.placeholderWhitelist,
      placeholderPattern = _ref.placeholderPattern,
      preserveComments = _ref.preserveComments,
      parser = _objectWithoutProperties(_ref, ["placeholderWhitelist", "placeholderPattern", "preserveComments"]);

  if (placeholderWhitelist != null && !(placeholderWhitelist instanceof Set)) {
    throw new Error("'.placeholderWhitelist' must be a Set, null, or undefined");
  }

  if (placeholderPattern != null && !(placeholderPattern instanceof RegExp) && placeholderPattern !== false) {
    throw new Error("'.placeholderPattern' must be a RegExp, false, null, or undefined");
  }

  if (preserveComments != null && typeof preserveComments !== "boolean") {
    throw new Error("'.preserveComments' must be a boolean, null, or undefined");
  }

  return {
    parser: parser,
    placeholderWhitelist: placeholderWhitelist || undefined,
    placeholderPattern: placeholderPattern == null ? undefined : placeholderPattern,
    preserveComments: preserveComments == null ? false : preserveComments
  };
}

function normalizeReplacements(replacements) {
  if (Array.isArray(replacements)) {
    return replacements.reduce(function (acc, replacement, i) {
      acc["$" + i] = replacement;
      return acc;
    }, {});
  } else if (typeof replacements === "object" || replacements == null) {
    return replacements || undefined;
  }

  throw new Error("Template replacements must be an array, object, null, or undefined");
}

{'repo_name': 'wallace5303/dapps', 'stars': '384', 'repo_language': 'JavaScript', 'file_name': 'README.md', 'mime_type': 'text/html', 'hash': 8758404738558479940, 'source_dataset': 'data'}


#!/bin/bash
#
# Description : Descent 1 & 2 thks to DXX-Rebirth v0.61.0 0.60.0-beta2-544-g427f45fdd703 compiled on 17/Sep/2019
# Author      : Jose Cerrejon Gonzalez (ulysess@gmail_dot._com)
# Version     : 1.0.3 (17/Aug/20)
# Compatible  : Raspberry Pi 1-4 (tested on Raspberry Pi 4)
#
# HELP	      : https://github.com/dxx-rebirth/dxx-rebirth
#				https://github.com/dxx-rebirth/dxx-rebirth/blob/master/INSTALL.markdown
#
. ./scripts/helper.sh || . ./helper.sh || wget -q 'https://github.com/jmcerrejon/PiKISS/raw/master/scripts/helper.sh'
clear
check_board || { echo "Missing file helper.sh. I've tried to download it for you. Try to run the script again." && exit 1; }

D1X_SHARE_URL='https://www.dxx-rebirth.com/download/dxx/content/descent-pc-shareware.zip'
D2X_SHARE_URL='https://www.dxx-rebirth.com/download/dxx/content/descent2-pc-demo.zip'
DXX_URL='https://misapuntesde.com/rpi_share/dxx-rebirth.tar.gz'
D1X_HIGH_TEXTURE_URL='https://www.dxx-rebirth.com/download/dxx/res/d1xr-hires.dxa'
D1X_OGG_URL='https://www.dxx-rebirth.com/download/dxx/res/d1xr-sc55-music.dxa'
D2X_OGG_URL='https://www.dxx-rebirth.com/download/dxx/res/d2xr-sc55-music.dxa'
D1X_DATA="$HOME/.d1x-rebirth/Data"
D2X_DATA="$HOME/.d2x-rebirth/Data"
BINARY_DIR='/usr/games'

if  which /usr/games/d1x-rebirth >/dev/null ; then
    read -p "Warning!: D1X Rebirth already installed. Press [ENTER] to exit..."
    exit;
fi

if  which /usr/games/d2x-rebirth >/dev/null ; then
    read -p "Warning!: D2X Rebirth already installed. Press [ENTER] to exit..."
    exit
fi

generateIconsD1X() {
    if [[ ! -e ~/.local/share/applications/d1x.desktop ]]; then
cat << EOF > ~/.local/share/applications/d1x.desktop
[Desktop Entry]
Name=Descent 1
Exec=/usr/games/d1x-rebirth
Icon=terminal
Type=Application
Comment=The game requires the player to navigate labyrinthine mines while fighting virus-infected robots.
Categories=Game;ActionGame;
EOF
    fi
}

generateIconsD2X() {
    if [[ ! -e ~/.local/share/applications/d2x.desktop ]]; then
cat << EOF > ~/.local/share/applications/d2x.desktop
[Desktop Entry]
Name=Descent 2
Exec=/usr/games/d2x-rebirth
Icon=terminal
Type=Application
Comment=Complete 24 levels where different types of AI-controlled robots will try to destroy you.
Categories=Game;ActionGame;
EOF
    fi
}

DXX_RPI() {
    # Compile from source code:
	# It needs sudo apt install -y libsdl1.2-dev libsdl-mixer1.2-dev libphysfs-dev libsdl2-image-dev scons libsdl2-net-dev
	# git clone https://github.com/dxx-rebirth/dxx-rebirth.git
	# type scons inside the dir created
	# compress with tar -czvf ~/dxx-rebirth.tar.gz d1x-rebirth d2x-rebirth
	if ! isPackageInstalled libphysfs1; then
    	sudo apt install -y libphysfs1
	fi

	if ! isPackageInstalled libglu1-mesa; then
		sudo apt install -y libglu1-mesa
	fi
    # Binaries
    sudo wget -O "$BINARY_DIR"/dxx-rebirth.tar.gz "$DXX_URL"
    cd "$BINARY_DIR"
    sudo tar -xzvf "$BINARY_DIR"/dxx-rebirth.tar.gz
    # Shareware demo datas
    wget -P "$D1X_DATA" "$D1X_SHARE_URL"
    wget -P "$D2X_DATA" "$D2X_SHARE_URL"
    unzip -qq "$D1X_DATA"/descent-pc-shareware.zip -d "$D1X_DATA"
    unzip -qq "$D2X_DATA"/descent2-pc-demo.zip -d "$D2X_DATA"
    # Some extra addons to improve the game experience ;)
    clear && echo -e "\nInstalling HIGH textures quality pack...\n\nPlease wait...\n" && sudo wget -P "$D1X_DATA" $D1X_HIGH_TEXTURE_URL
    echo -e "\n\nInstalling OGG Music for better experience...\n\n· All music was recorded with the Roland Sound Canvas SC-55 MIDI Module.\n\nPlease wait...\n" && sudo wget -P "$D1X_DATA" $D1X_OGG_URL && sudo wget -P "$D2X_DATA" $D2X_OGG_URL
    # Cleaning da house
    sudo rm "$BINARY_DIR"/dxx-rebirth.tar.gz "$D1X_DATA"/descent-pc-shareware.zip "$D2X_DATA"/descent2-pc-demo.zip
    # Icons & info
    generateIconsD1X
    generateIconsD2X
}

echo -e "\nInstalling DXX-Rebirth...\n=========================\n\n· Please wait...\n"

DXX_RPI

echo -e "Done!. type /usr/games/d1x-rebirth or /usr/games/d2x-rebirth to Play or go to Desktop Game Menu option."
read -p "Press [ENTER] to go back to the menu..."

{'repo_name': 'jmcerrejon/PiKISS', 'stars': '164', 'repo_language': 'Shell', 'file_name': 'db.sh', 'mime_type': 'text/x-shellscript', 'hash': -5888801807097139796, 'source_dataset': 'data'}


version: 2
jobs:
  build:
    docker:
      - image: circleci/golang:1.11.4
    steps:
      - checkout
      - restore_cache:
          keys:
            - v1-pkg-cache
      - run: go version
      - run: go build oya.go
      - run: ./oya run develop
      - save_cache:
          key: v1-pkg-cache
          paths:
            - "/go/pkg"
      - run: curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
      - run: wget https://github.com/mozilla/sops/releases/download/3.3.1/sops_3.3.1_amd64.deb
      - run: sudo dpkg -i sops_3.3.1_amd64.deb
      - run: ./oya run testKeysImport
      - run: ./oya run test -t "~@nocircleci"
      - run: ./oya run testKeysRemove

  release:
    docker:
      - image: circleci/golang:1.11.4
    steps:
      - checkout
      - add_ssh_keys
      - restore_cache:
          keys:
            - v1-pkg-cache
      - run: go run oya.go run release
      - save_cache:
          key: v1-pkg-cache
          paths:
            - "/go/pkg"

  build-installer:
    docker:
      - image: scottyhardy/docker-wine:latest
    steps:
      - checkout
      - run: apt-get update && apt-get install -y wget curl zip osslsigncode
      - run: wget https://github.com/mozilla/sops/releases/download/3.3.1/sops_3.3.1_amd64.deb
      - run: dpkg -i sops_3.3.1_amd64.deb
      - run: curl https://oya.sh/get | bash
      - run: oya run -r fetchBinary
      - run: oya run -r buildInstaller
      - run: oya run -r signInstaller
      - run: oya run -r releaseInstaller

workflows:
  version: 2
  build-release:
    jobs:
      - build:
          filters:  # required since `release` has tag filters AND requires `build`
            tags:
              only: /.*/

      - release:
          requires:
            - build
          filters:
            tags:
              only: /v[0-9]+(\.[0-9]+)*/
            branches:
              ignore: /.*/

      - build-installer:
          requires:
            - release
          filters:
            tags:
              only: /v[0-9]+(\.[0-9]+)*/
            branches:
              ignore: /.*/

{'repo_name': 'tooploox/oya', 'stars': '152', 'repo_language': 'Go', 'file_name': 'env.go', 'mime_type': 'text/plain', 'hash': 4018754976801189724, 'source_dataset': 'data'}


/*
 * Use of this source code is governed by the MIT license that can be
 * found in the LICENSE file.
 */

package org.rust.lang.core.psi

import com.intellij.psi.PsiElement
import com.intellij.psi.search.LocalSearchScope
import com.intellij.psi.search.SearchScope
import com.intellij.psi.util.PsiTreeUtil
import org.rust.lang.core.macros.findMacroCallExpandedFrom
import org.rust.lang.core.macros.isExpandedFromIncludeMacro
import org.rust.lang.core.psi.ext.*

/**
 * Mixin methods to implement PSI interfaces without copy pasting and
 * introducing monster base classes. Can be simplified when Kotlin supports
 * default methods in interfaces with mixed Kotlin-Java hierarchies (KT-9073 ).
 */
object RsPsiImplUtil {
    fun crateRelativePath(element: RsNamedElement): String? {
        val name = element.name ?: return null
        val qualifier = element.containingMod.crateRelativePath ?: return null
        return "$qualifier::$name"
    }

    fun modCrateRelativePath(mod: RsMod): String? {
        val segments = mod.superMods.asReversed().drop(1).map {
            it.modName ?: return null
        }
        if (segments.isEmpty()) return ""
        return "::" + segments.joinToString("::")
    }

    /**
     * Used by [RsTypeParameter] and [RsLifetimeParameter].
     * @return null if default scope should be used
     */
    fun getParameterUseScope(element: RsElement): SearchScope? {
        val owner = element.contextStrict<RsGenericDeclaration>()
        if (owner != null) return localOrMacroSearchScope(owner)

        return null
    }

    /**
     * @return null if default scope should be used
     */
    fun getDeclarationUseScope(element: RsVisible): SearchScope? =
        getDeclarationUseScope(element, RsVisibility.Public)

    private fun getDeclarationUseScope(
        element: RsVisible,
        restrictedVis: RsVisibility
    ): SearchScope? {
        when (element) {
            is RsEnumVariant -> return getDeclarationUseScope(element.parentEnum, restrictedVis)
            is RsFieldDecl -> return getDeclarationUseScope(
                element.contextStrict<RsFieldsOwner>() as RsVisible,
                element.visibility
            )
        }

        val owner = PsiTreeUtil.getContextOfType(
            element,
            true,
            RsItemElement::class.java,
            RsMod::class.java
        ) as? RsElement ?: return null

        return when (owner) {
            // Trait members inherit visibility from the trait
            is RsTraitItem -> getDeclarationUseScope(owner)

            is RsImplItem -> {
                // Members of `impl Trait for ...` inherit visibility from the implemented trait
                val traitRef = owner.traitRef
                if (traitRef != null) return getDeclarationUseScope(traitRef.resolveToTrait() ?: return null)

                // Inherent impl members
                getTopLevelDeclarationUseScope(element, owner.containingMod, restrictedVis)
            }

            is RsMod -> getTopLevelDeclarationUseScope(element, owner, restrictedVis)
            is RsForeignModItem -> getTopLevelDeclarationUseScope(element, owner.containingMod, restrictedVis)

            // In this case `owner` is function or code block, i.e. it's local scope
            else -> localOrMacroSearchScope(owner)
        }
    }

    private fun getTopLevelDeclarationUseScope(
        element: RsVisible,
        containingMod: RsMod,
        restrictedVis: RsVisibility
    ): SearchScope? {
        val restrictedMod = when (val visibility = restrictedVis.intersect(element.visibility)) {
            RsVisibility.Public -> return null
            RsVisibility.Private -> containingMod
            is RsVisibility.Restricted -> visibility.inMod
        }

        if (!restrictedMod.hasChildFiles()) return localOrMacroSearchScope(restrictedMod)

        // TODO restrict scope to [restrictedMod]. We can't use `DirectoryScope` b/c file from any
        //   directory can be included via `#[path]` attribute or `include!()` macro.
        return null
    }

    /**
     * If the [scope] is inside a macro expansion, we can't use it as a local search scope
     * because elements inside the scope can be referenced from the macro call body via
     * [org.rust.lang.core.resolve.ref.RsMacroBodyReferenceDelegateImpl]. We use the macro
     * call as a search scope in this case
     */
    fun localOrMacroSearchScope(scope: PsiElement): LocalSearchScope =
        LocalSearchScope(scope.findMacroCallExpandedFrom() ?: scope)
}

// TODO support local modules, e.g. `fn foo() { #[path = "baz.rs"] mod bar; }`
private fun RsMod.hasChildFiles(): Boolean =
    expandedItemsExceptImplsAndUses.any {
        it is RsModDeclItem || it is RsModItem && it.hasChildFiles() || it.isExpandedFromIncludeMacro
    }

{'repo_name': 'intellij-rust/intellij-rust', 'stars': '3111', 'repo_language': 'Kotlin', 'file_name': 'vec_deque.rs', 'mime_type': 'text/x-c', 'hash': -8052739745727114276, 'source_dataset': 'data'}


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
  serializedVersion: 6
  m_ObjectHideFlags: 0
  m_PrefabParentObject: {fileID: 0}
  m_PrefabInternal: {fileID: 0}
  m_Name: pu_particle
  m_Shader: {fileID: 10720, guid: 0000000000000000f000000000000000, type: 0}
  m_ShaderKeywords:
  m_LightmapFlags: 4
  m_EnableInstancingVariants: 0
  m_DoubleSidedGI: 0
  m_CustomRenderQueue: -1
  stringTagMap: {}
  disabledShaderPasses: []
  m_SavedProperties:
    serializedVersion: 3
    m_TexEnvs:
    - _MainTex:
        m_Texture: {fileID: 2800000, guid: 792eb533b6929e143be6764f1639ef40, type: 3}
        m_Scale: {x: 1, y: 1}
        m_Offset: {x: 0, y: 0}
    m_Floats:
    - _InvFade: 1
    m_Colors:
    - _Color: {r: 1, g: 1, b: 1, a: 1}
    - _EmisColor: {r: 0.47794116, g: 0.41468424, b: 0.41468424, a: 0}
    - _TintColor: {r: 1, g: 1, b: 1, a: 0.5019608}

{'repo_name': 'MLJejuCamp2017/DRL_based_SelfDrivingCarControl', 'stars': '230', 'repo_language': 'C#', 'file_name': 'AudioManager.asset', 'mime_type': 'text/plain', 'hash': -1347749740860703694, 'source_dataset': 'data'}


/*
    Copyright © 2014-2019 by The qTox Project Contributors

    This file is part of qTox, a Qt-based graphical interface for Tox.

    qTox is libre software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    qTox is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with qTox.  If not, see <http://www.gnu.org/licenses/>.
*/

#pragma once

#include <QHBoxLayout>
#include <QPushButton>
#include <QStyleFactory>

#include <array>
#include <memory>

class Camera;
class Core;
class GenericForm;
class GeneralForm;
class IAudioControl;
class PrivacyForm;
class AVForm;
class QLabel;
class QTabWidget;
class ContentLayout;
class UpdateCheck;
class Widget;

class SettingsWidget : public QWidget
{
    Q_OBJECT
public:
    SettingsWidget(UpdateCheck* updateCheck, IAudioControl& audio, Core *core, Widget* parent = nullptr);
    ~SettingsWidget();

    bool isShown() const;
    void show(ContentLayout* contentLayout);
    void setBodyHeadStyle(QString style);

    void showAbout();

public slots:
    void onUpdateAvailable(void);

private slots:
    void onTabChanged(int);

private:
    void retranslateUi();

private:
    std::unique_ptr<QVBoxLayout> bodyLayout;
    std::unique_ptr<QTabWidget> settingsWidgets;
    std::array<std::unique_ptr<GenericForm>, 6> cfgForms;
    int currentIndex;
};

{'repo_name': 'qTox/qTox', 'stars': '3127', 'repo_language': 'C++', 'file_name': 'config.yml', 'mime_type': 'text/plain', 'hash': 127875922090963829, 'source_dataset': 'data'}


StartChar: Utilde.sc
Encoding: 1114944 -1 1651
Width: 620
VWidth: 0
Flags: HMW
LayerCount: 2
Fore
Refer: 1532 -1 N 1 0 0 1 0 0 2
Validated: 32769
EndChar

{'repo_name': 'georgd/EB-Garamond', 'stars': '557', 'repo_language': 'HTML', 'file_name': 'contents.plist', 'mime_type': 'text/xml', 'hash': 2392781358153384134, 'source_dataset': 'data'}


/**
 * @file
 * A Backbone View acting as a controller for CKEditor toolbar configuration.
 */

(function ($, Drupal, Backbone, CKEDITOR, _) {

  'use strict';

  Drupal.ckeditor.ControllerView = Backbone.View.extend(/** @lends Drupal.ckeditor.ControllerView# */{

    /**
     * @type {object}
     */
    events: {},

    /**
     * Backbone View acting as a controller for CKEditor toolbar configuration.
     *
     * @constructs
     *
     * @augments Backbone.View
     */
    initialize: function () {
      this.getCKEditorFeatures(this.model.get('hiddenEditorConfig'), this.disableFeaturesDisallowedByFilters.bind(this));

      // Push the active editor configuration to the textarea.
      this.model.listenTo(this.model, 'change:activeEditorConfig', this.model.sync);
      this.listenTo(this.model, 'change:isDirty', this.parseEditorDOM);
    },

    /**
     * Converts the active toolbar DOM structure to an object representation.
     *
     * @param {Drupal.ckeditor.ConfigurationModel} model
     *   The state model for the CKEditor configuration.
     * @param {bool} isDirty
     *   Tracks whether the active toolbar DOM structure has been changed.
     *   isDirty is toggled back to false in this method.
     * @param {object} options
     *   An object that includes:
     * @param {bool} [options.broadcast]
     *   A flag that controls whether a CKEditorToolbarChanged event should be
     *   fired for configuration changes.
     *
     * @fires event:CKEditorToolbarChanged
     */
    parseEditorDOM: function (model, isDirty, options) {
      if (isDirty) {
        var currentConfig = this.model.get('activeEditorConfig');

        // Process the rows.
        var rows = [];
        this.$el
          .find('.ckeditor-active-toolbar-configuration')
          .children('.ckeditor-row').each(function () {
            var groups = [];
            // Process the button groups.
            $(this).find('.ckeditor-toolbar-group').each(function () {
              var $group = $(this);
              var $buttons = $group.find('.ckeditor-button');
              if ($buttons.length) {
                var group = {
                  name: $group.attr('data-drupal-ckeditor-toolbar-group-name'),
                  items: []
                };
                $group.find('.ckeditor-button, .ckeditor-multiple-button').each(function () {
                  group.items.push($(this).attr('data-drupal-ckeditor-button-name'));
                });
                groups.push(group);
              }
            });
            if (groups.length) {
              rows.push(groups);
            }
          });
        this.model.set('activeEditorConfig', rows);
        // Mark the model as clean. Whether or not the sync to the textfield
        // occurs depends on the activeEditorConfig attribute firing a change
        // event. The DOM has at least been processed and posted, so as far as
        // the model is concerned, it is clean.
        this.model.set('isDirty', false);

        // Determine whether we should trigger an event.
        if (options.broadcast !== false) {
          var prev = this.getButtonList(currentConfig);
          var next = this.getButtonList(rows);
          if (prev.length !== next.length) {
            this.$el
              .find('.ckeditor-toolbar-active')
              .trigger('CKEditorToolbarChanged', [
                (prev.length < next.length) ? 'added' : 'removed',
                _.difference(_.union(prev, next), _.intersection(prev, next))[0]
              ]);
          }
        }
      }
    },

    /**
     * Asynchronously retrieve the metadata for all available CKEditor features.
     *
     * In order to get a list of all features needed by CKEditor, we create a
     * hidden CKEditor instance, then check the CKEditor's "allowedContent"
     * filter settings. Because creating an instance is expensive, a callback
     * must be provided that will receive a hash of {@link Drupal.EditorFeature}
     * features keyed by feature (button) name.
     *
     * @param {object} CKEditorConfig
     *   An object that represents the configuration settings for a CKEditor
     *   editor component.
     * @param {function} callback
     *   A function to invoke when the instanceReady event is fired by the
     *   CKEditor object.
     */
    getCKEditorFeatures: function (CKEditorConfig, callback) {
      var getProperties = function (CKEPropertiesList) {
        return (_.isObject(CKEPropertiesList)) ? _.keys(CKEPropertiesList) : [];
      };

      var convertCKERulesToEditorFeature = function (feature, CKEFeatureRules) {
        for (var i = 0; i < CKEFeatureRules.length; i++) {
          var CKERule = CKEFeatureRules[i];
          var rule = new Drupal.EditorFeatureHTMLRule();

          // Tags.
          var tags = getProperties(CKERule.elements);
          rule.required.tags = (CKERule.propertiesOnly) ? [] : tags;
          rule.allowed.tags = tags;
          // Attributes.
          rule.required.attributes = getProperties(CKERule.requiredAttributes);
          rule.allowed.attributes = getProperties(CKERule.attributes);
          // Styles.
          rule.required.styles = getProperties(CKERule.requiredStyles);
          rule.allowed.styles = getProperties(CKERule.styles);
          // Classes.
          rule.required.classes = getProperties(CKERule.requiredClasses);
          rule.allowed.classes = getProperties(CKERule.classes);
          // Raw.
          rule.raw = CKERule;

          feature.addHTMLRule(rule);
        }
      };

      // Create hidden CKEditor with all features enabled, retrieve metadata.
      // @see \Drupal\ckeditor\Plugin\Editor\CKEditor::buildConfigurationForm().
      var hiddenCKEditorID = 'ckeditor-hidden';
      if (CKEDITOR.instances[hiddenCKEditorID]) {
        CKEDITOR.instances[hiddenCKEditorID].destroy(true);
      }
      // Load external plugins, if any.
      var hiddenEditorConfig = this.model.get('hiddenEditorConfig');
      if (hiddenEditorConfig.drupalExternalPlugins) {
        var externalPlugins = hiddenEditorConfig.drupalExternalPlugins;
        for (var pluginName in externalPlugins) {
          if (externalPlugins.hasOwnProperty(pluginName)) {
            CKEDITOR.plugins.addExternal(pluginName, externalPlugins[pluginName], '');
          }
        }
      }
      CKEDITOR.inline($('#' + hiddenCKEditorID).get(0), CKEditorConfig);

      // Once the instance is ready, retrieve the allowedContent filter rules
      // and convert them to Drupal.EditorFeature objects.
      CKEDITOR.once('instanceReady', function (e) {
        if (e.editor.name === hiddenCKEditorID) {
          // First collect all CKEditor allowedContent rules.
          var CKEFeatureRulesMap = {};
          var rules = e.editor.filter.allowedContent;
          var rule;
          var name;
          for (var i = 0; i < rules.length; i++) {
            rule = rules[i];
            name = rule.featureName || ':(';
            if (!CKEFeatureRulesMap[name]) {
              CKEFeatureRulesMap[name] = [];
            }
            CKEFeatureRulesMap[name].push(rule);
          }

          // Now convert these to Drupal.EditorFeature objects. And track which
          // buttons are mapped to which features.
          // @see getFeatureForButton()
          var features = {};
          var buttonsToFeatures = {};
          for (var featureName in CKEFeatureRulesMap) {
            if (CKEFeatureRulesMap.hasOwnProperty(featureName)) {
              var feature = new Drupal.EditorFeature(featureName);
              convertCKERulesToEditorFeature(feature, CKEFeatureRulesMap[featureName]);
              features[featureName] = feature;
              var command = e.editor.getCommand(featureName);
              if (command) {
                buttonsToFeatures[command.uiItems[0].name] = featureName;
              }
            }
          }

          callback(features, buttonsToFeatures);
        }
      });
    },

    /**
     * Retrieves the feature for a given button from featuresMetadata. Returns
     * false if the given button is in fact a divider.
     *
     * @param {string} button
     *   The name of a CKEditor button.
     *
     * @return {object}
     *   The feature metadata object for a button.
     */
    getFeatureForButton: function (button) {
      // Return false if the button being added is a divider.
      if (button === '-') {
        return false;
      }

      // Get a Drupal.editorFeature object that contains all metadata for
      // the feature that was just added or removed. Not every feature has
      // such metadata.
      var featureName = this.model.get('buttonsToFeatures')[button.toLowerCase()];
      // Features without an associated command do not have a 'feature name' by
      // default, so we use the lowercased button name instead.
      if (!featureName) {
        featureName = button.toLowerCase();
      }
      var featuresMetadata = this.model.get('featuresMetadata');
      if (!featuresMetadata[featureName]) {
        featuresMetadata[featureName] = new Drupal.EditorFeature(featureName);
        this.model.set('featuresMetadata', featuresMetadata);
      }
      return featuresMetadata[featureName];
    },

    /**
     * Checks buttons against filter settings; disables disallowed buttons.
     *
     * @param {object} features
     *   A map of {@link Drupal.EditorFeature} objects.
     * @param {object} buttonsToFeatures
     *   Object containing the button-to-feature mapping.
     *
     * @see Drupal.ckeditor.ControllerView#getFeatureForButton
     */
    disableFeaturesDisallowedByFilters: function (features, buttonsToFeatures) {
      this.model.set('featuresMetadata', features);
      // Store the button-to-feature mapping. Needs to happen only once, because
      // the same buttons continue to have the same features; only the rules for
      // specific features may change.
      // @see getFeatureForButton()
      this.model.set('buttonsToFeatures', buttonsToFeatures);

      // Ensure that toolbar configuration changes are broadcast.
      this.broadcastConfigurationChanges(this.$el);

      // Initialization: not all of the default toolbar buttons may be allowed
      // by the current filter settings. Remove any of the default toolbar
      // buttons that require more permissive filter settings. The remaining
      // default toolbar buttons are marked as "added".
      var existingButtons = [];
      // Loop through each button group after flattening the groups from the
      // toolbar row arrays.
      var buttonGroups = _.flatten(this.model.get('activeEditorConfig'));
      for (var i = 0; i < buttonGroups.length; i++) {
        // Pull the button names from each toolbar button group.
        var buttons = buttonGroups[i].items;
        for (var k = 0; k < buttons.length; k++) {
          existingButtons.push(buttons[k]);
        }
      }
      // Remove duplicate buttons.
      existingButtons = _.unique(existingButtons);
      // Prepare the active toolbar and available-button toolbars.
      for (var n = 0; n < existingButtons.length; n++) {
        var button = existingButtons[n];
        var feature = this.getFeatureForButton(button);
        // Skip dividers.
        if (feature === false) {
          continue;
        }

        if (Drupal.editorConfiguration.featureIsAllowedByFilters(feature)) {
          // Existing toolbar buttons are in fact "added features".
          this.$el.find('.ckeditor-toolbar-active').trigger('CKEditorToolbarChanged', ['added', existingButtons[n]]);
        }
        else {
          // Move the button element from the active the active toolbar to the
          // list of available buttons.
          $('.ckeditor-toolbar-active li[data-drupal-ckeditor-button-name="' + button + '"]')
            .detach()
            .appendTo('.ckeditor-toolbar-disabled > .ckeditor-toolbar-available > ul');
          // Update the toolbar value field.
          this.model.set({isDirty: true}, {broadcast: false});
        }
      }
    },

    /**
     * Sets up broadcasting of CKEditor toolbar configuration changes.
     *
     * @param {jQuery} $ckeditorToolbar
     *   The active toolbar DOM element wrapped in jQuery.
     */
    broadcastConfigurationChanges: function ($ckeditorToolbar) {
      var view = this;
      var hiddenEditorConfig = this.model.get('hiddenEditorConfig');
      var getFeatureForButton = this.getFeatureForButton.bind(this);
      var getCKEditorFeatures = this.getCKEditorFeatures.bind(this);
      $ckeditorToolbar
        .find('.ckeditor-toolbar-active')
        // Listen for CKEditor toolbar configuration changes. When a button is
        // added/removed, call an appropriate Drupal.editorConfiguration method.
        .on('CKEditorToolbarChanged.ckeditorAdmin', function (event, action, button) {
          var feature = getFeatureForButton(button);

          // Early-return if the button being added is a divider.
          if (feature === false) {
            return;
          }

          // Trigger a standardized text editor configuration event to indicate
          // whether a feature was added or removed, so that filters can react.
          var configEvent = (action === 'added') ? 'addedFeature' : 'removedFeature';
          Drupal.editorConfiguration[configEvent](feature);
        })
        // Listen for CKEditor plugin settings changes. When a plugin setting is
        // changed, rebuild the CKEditor features metadata.
        .on('CKEditorPluginSettingsChanged.ckeditorAdmin', function (event, settingsChanges) {
          // Update hidden CKEditor configuration.
          for (var key in settingsChanges) {
            if (settingsChanges.hasOwnProperty(key)) {
              hiddenEditorConfig[key] = settingsChanges[key];
            }
          }

          // Retrieve features for the updated hidden CKEditor configuration.
          getCKEditorFeatures(hiddenEditorConfig, function (features) {
            // Trigger a standardized text editor configuration event for each
            // feature that was modified by the configuration changes.
            var featuresMetadata = view.model.get('featuresMetadata');
            for (var name in features) {
              if (features.hasOwnProperty(name)) {
                var feature = features[name];
                if (featuresMetadata.hasOwnProperty(name) && !_.isEqual(featuresMetadata[name], feature)) {
                  Drupal.editorConfiguration.modifiedFeature(feature);
                }
              }
            }
            // Update the CKEditor features metadata.
            view.model.set('featuresMetadata', features);
          });
        });
    },

    /**
     * Returns the list of buttons from an editor configuration.
     *
     * @param {object} config
     *   A CKEditor configuration object.
     *
     * @return {Array}
     *   A list of buttons in the CKEditor configuration.
     */
    getButtonList: function (config) {
      var buttons = [];
      // Remove the rows.
      config = _.flatten(config);

      // Loop through the button groups and pull out the buttons.
      config.forEach(function (group) {
        group.items.forEach(function (button) {
          buttons.push(button);
        });
      });

      // Remove the dividing elements if any.
      return _.without(buttons, '-');
    }
  });

})(jQuery, Drupal, Backbone, CKEDITOR, _);

{'repo_name': 'fossasia/phimpme-drupal', 'stars': '1111', 'repo_language': 'PHP', 'file_name': 'jquery.ui.datepicker.css', 'mime_type': 'text/plain', 'hash': -8295359776048861906, 'source_dataset': 'data'}


import getRethink from '../../../../database/rethinkDriver'
import Meeting from '../../../../database/types/Meeting'
import getMailManager from '../../../../email/getMailManager'
import newMeetingSummaryEmailCreator from '../../../../email/newMeetingSummaryEmailCreator'
import {GQLContext} from '../../../graphql'

export default async function sendNewMeetingSummary(newMeeting: Meeting, context: GQLContext) {
  const {id: meetingId, teamId, summarySentAt} = newMeeting
  if (summarySentAt) return
  const now = new Date()
  const r = await getRethink()
  const {dataLoader} = context
  const [meetingMembers, team] = await Promise.all([
    dataLoader.get('meetingMembersByMeetingId').load(meetingId),
    dataLoader.get('teams').load(teamId),
    r
      .table('NewMeeting')
      .get(meetingId)
      .update({summarySentAt: now})
      .run()
  ])
  const {name: teamName, orgId} = team
  const userIds = meetingMembers.map(({userId}) => userId)
  const [content, users, organization] = await Promise.all([
    newMeetingSummaryEmailCreator({meetingId, context}),
    dataLoader.get('users').loadMany(userIds),
    dataLoader.get('organizations').load(orgId)
  ])
  const {tier, name: orgName} = organization
  const emailAddresses = users.map(({email}) => email)
  const {subject, body, html} = content
  await getMailManager().sendEmail({
    to: emailAddresses,
    subject,
    body,
    html,
    tags: ['type:meetingSummary', `tier:${tier}`, `team:${teamName}:${orgName}:${teamId}:${orgId}`]
  })
}

{'repo_name': 'ParabolInc/parabol', 'stars': '950', 'repo_language': 'TypeScript', 'file_name': 'config.yml', 'mime_type': 'text/plain', 'hash': 3715064547680517323, 'source_dataset': 'data'}


// @flow

import noteToObject from '../noteToObject';
import isNote from '../isNote';
import { SHARP } from '../constants/Accidental';

const isSharp = (note: ScientificNote) => {
  if (!isNote(note)) {
    return false;
  }

  return noteToObject(note).accidental === SHARP;
};

export default isSharp;

{'repo_name': 'madewithlove/music-fns', 'stars': '423', 'repo_language': 'JavaScript', 'file_name': 'chromaticc.test.js', 'mime_type': 'text/x-java', 'hash': -7727559363543184902, 'source_dataset': 'data'}


      SUBROUTINE OFFSET_ccsdt_lambda1_16_1(l_a_offset,k_a_offset,size)
C     $Id$
C     This is a Fortran77 program generated by Tensor Contraction Engine v.1.0
C     Copyright (c) Battelle & Pacific Northwest National Laboratory (2002)
C     i1 ( h2 p11 h10 p12 )_yt
      IMPLICIT NONE
#include "global.fh"
#include "mafdecls.fh"
#include "sym.fh"
#include "errquit.fh"
#include "tce.fh"
      INTEGER l_a_offset
      INTEGER k_a_offset
      INTEGER size
      INTEGER length
      INTEGER addr
      INTEGER h2b
      INTEGER p11b
      INTEGER h10b
      INTEGER p12b
      length = 0
      DO h2b = 1,noab
      DO p11b = noab+1,noab+nvab
      DO h10b = 1,noab
      DO p12b = noab+1,noab+nvab
      IF (int_mb(k_spin+h2b-1)+int_mb(k_spin+p11b-1) .eq. int_mb(k_spin+
     &h10b-1)+int_mb(k_spin+p12b-1)) THEN
      IF (ieor(int_mb(k_sym+h2b-1),ieor(int_mb(k_sym+p11b-1),ieor(int_mb
     &(k_sym+h10b-1),int_mb(k_sym+p12b-1)))) .eq. ieor(irrep_y,irrep_t))
     & THEN
      IF ((.not.restricted).or.(int_mb(k_spin+h2b-1)+int_mb(k_spin+p11b-
     &1)+int_mb(k_spin+h10b-1)+int_mb(k_spin+p12b-1).ne.8)) THEN
      length = length + 1
      END IF
      END IF
      END IF
      END DO
      END DO
      END DO
      END DO
      IF (.not.MA_PUSH_GET(mt_int,2*length+1,'noname',l_a_offset,k_a_off
     &set)) CALL ERRQUIT('ccsdt_lambda1_16_1',0,MA_ERR)
      int_mb(k_a_offset) = length
      addr = 0
      size = 0
      DO h2b = 1,noab
      DO p11b = noab+1,noab+nvab
      DO h10b = 1,noab
      DO p12b = noab+1,noab+nvab
      IF (int_mb(k_spin+h2b-1)+int_mb(k_spin+p11b-1) .eq. int_mb(k_spin+
     &h10b-1)+int_mb(k_spin+p12b-1)) THEN
      IF (ieor(int_mb(k_sym+h2b-1),ieor(int_mb(k_sym+p11b-1),ieor(int_mb
     &(k_sym+h10b-1),int_mb(k_sym+p12b-1)))) .eq. ieor(irrep_y,irrep_t))
     & THEN
      IF ((.not.restricted).or.(int_mb(k_spin+h2b-1)+int_mb(k_spin+p11b-
     &1)+int_mb(k_spin+h10b-1)+int_mb(k_spin+p12b-1).ne.8)) THEN
      addr = addr + 1
      int_mb(k_a_offset+addr) = p12b - noab - 1 + nvab * (h10b - 1 + noa
     &b * (p11b - noab - 1 + nvab * (h2b - 1)))
      int_mb(k_a_offset+length+addr) = size
      size = size + int_mb(k_range+h2b-1) * int_mb(k_range+p11b-1) * int
     &_mb(k_range+h10b-1) * int_mb(k_range+p12b-1)
      END IF
      END IF
      END IF
      END DO
      END DO
      END DO
      END DO
      RETURN
      END

{'repo_name': 'nwchemgit/nwchem', 'stars': '180', 'repo_language': 'Fortran', 'file_name': 'doqmtests', 'mime_type': 'text/x-shellscript', 'hash': 7622694392282023586, 'source_dataset': 'data'}


---
title: Scroll Area
desc: The QScrollArea Vue component offers a way of customizing the scrollbars for all desktop browsers.
related:
  - /layout/drawer
---

The QScrollArea component offers a neat way of customizing the scrollbars by encapsulating your content. Think of it as a DOM element which has `overflow: auto`, but with your own custom styled scrollbar instead of browser's default one and a few nice features on top.

## Installation

<doc-installation components="QScrollArea" />

## Usage

The following examples are best seen on desktop as they make too little sense on a mobile device.

::: tip
You can also take a look at [Layout Drawer](/layout/drawer) to see some more examples of it in action.
:::

### Basic

<doc-example title="Basic" file="QScrollArea/Basic" />

### Styled

<doc-example title="Styled thumb and bar" file="QScrollArea/StyledBar" />

<doc-example title="Styled" file="QScrollArea/Styled" />

### Dark <q-badge align="top" label="v1.9+" />

<doc-example title="Dark" file="QScrollArea/Dark" />

### Controlling scrollbar visibility <q-badge align="top" label="v1.3+" />

When using the `visible` Boolean prop, the default mouse over/leave behavior is disabled, leaving you in full control of the scrollbar visibility.

<doc-example title="Controlling scrollbar visibility" file="QScrollArea/ScrollbarVisibility" />

### Delay

When content changes, the scrollbar appears then disappears again. You can set a certain delay (amount of time in milliseconds) before scrollbar disappears again (if component is not hovered):

<doc-example title="Delay" file="QScrollArea/Delay" />

### Scroll position

<doc-example title="Scroll Position" file="QScrollArea/ScrollPosition" />

### Horizontal mode

<doc-example title="Horizontal mode" file="QScrollArea/Horizontal" />

### Scroll event <q-badge align="top" label="v1.9.3+" />

Below is an example of using the `@scroll` event to synchronize the scrolling between two containers.

<doc-example title="Synchronized" file="QScrollArea/Synchronized" />

## QScrollArea API

<doc-api file="QScrollArea" />

{'repo_name': 'quasarframework/quasar', 'stars': '15416', 'repo_language': 'JavaScript', 'file_name': 'README.md', 'mime_type': 'text/html', 'hash': 1356063910805776972, 'source_dataset': 'data'}


lat-dataset-path: ./latency_dataset/wmt19ende_gpu_titanxp.csv
lat-dataset-size: 2000
latgpu: True
latiter: 20
latsilent: True

# below is the configs for the data point sampling space for the latency predictor

# model
arch: transformersuper_wmt_en_de
share-all-embeddings: True
max-tokens: 4096
data: data/binary/wmt19_en_de

# SuperTransformer configs
encoder-embed-dim: 640
decoder-embed-dim: 640

encoder-ffn-embed-dim: 3072
decoder-ffn-embed-dim: 3072

encoder-layers: 6
decoder-layers: 6

encoder-attention-heads: 8
decoder-attention-heads: 8

qkv-dim: 512

# SubTransformers search space
encoder-embed-choice: [640, 512]
decoder-embed-choice: [640, 512]

encoder-ffn-embed-dim-choice: [3072, 2048, 1024, 512]
decoder-ffn-embed-dim-choice: [3072, 2048, 1024, 512]

encoder-layer-num-choice: [6]
decoder-layer-num-choice: [6, 5, 4, 3, 2, 1]

encoder-self-attention-heads-choice: [8, 4, 2]
decoder-self-attention-heads-choice: [8, 4, 2]
decoder-ende-attention-heads-choice: [8, 4, 2]

# add -1 means that sometime only use the last layer, no concat
decoder-arbitrary-ende-attn-choice: [-1, 1, 2]

{'repo_name': 'mit-han-lab/hardware-aware-transformers', 'stars': '137', 'repo_language': 'Python', 'file_name': 'hf_bert_bpe.py', 'mime_type': 'text/x-python', 'hash': 5036836812312438232, 'source_dataset': 'data'}


#!/usr/bin/env node

var component = process.argv[2];
const workdir = "./workdir";

function Git (git_url, f) {
    if (!(git_url !== null && git_url !== undefined && git_url !== '')) {
        Stderr("Git url could not be null.\n");
        Stderr("[COUT] CO_RESULT = false\n");
        process.exit(1);
    }

    return Cmd('git clone ' + git_url + " " + workdir, null, f);
}

function Stdout (msg) {
    process.stdout.write(msg);
}

function Stderr (msg) {
    process.stderr.write(msg);
}

function Env () {
    var envs = new Array();
    co_data = process.env.CO_DATA;
    if (typeof co_data == 'string') {
        envs = co_data.split(' ')
    } else {
        envs = [];
    }

    var result = {};
    envs.forEach(function (v, i ,a) {
        kv = v.split('=');
        result[kv[0]] = kv[1];
    });
    return result;
}

async function Cmd (cmd, cwd, f) {
    if (!(cmd !== null && cmd !== undefined && cmd !== '')) {
        Stderr("Cmd could not be null.\n");
        Stderr("[COUT] CO_RESULT = false\n");
        process.exit(1);
    }

    var exec = require('child_process').exec;
    var e = exec(cmd, {
        cwd: cwd
    });

    e.stdout.on('data', data => Stdout(data));
    e.stderr.on('data', data => Stderr(data));

    return e.on('exit', (code) => {
        if (code == 0 || code == null) {
            if (f != null) {
                f();
            }
        } else {
            Stderr("[COUT] CO_RESULT = false\n");
            process.exit(1);
        }
    });
}

function getCmd(params, paramsList, baseCmd) {
    var cmd = baseCmd;

    if (!isNull(params['file'])) {
        cmd = cmd + " " + params['file'];
    }

    if (!isNull(params['output'])) {
        cmd = cmd + " -o " + params['output'];
    }

    console.log(cmd);
    return cmd;
}

function isNull(data) {
    return !(data !== null && data !== undefined && data !== '');
}

if (!(component !== null || component !== undefined || component !== '')) {
    Stderr("component could not be null\n");
    Stderr("[COUT] CO_RESULT = false\n");
    process.exit(1);
}

var paramsList = [
    "d"
];

var co_data = Env();
var cmd = getCmd(co_data, paramsList, "uglifyjs");

Git(co_data.git_url, () => {
    Cmd(cmd, workdir, () => {
        Stdout("[COUT] CO_RESULT = true\n");
    });
});

{'repo_name': 'Huawei/containerops', 'stars': '315', 'repo_language': 'Go', 'file_name': 'README.md', 'mime_type': 'text/plain', 'hash': 5450906784951175731, 'source_dataset': 'data'}


<template>
  <span
    :class="classes"
    :style="styles"
    :tabindex="tabIndex"
    :data-toggle-on="toggleOnData"
    :data-toggle-off="toggleOffData"
    class="mdc-icon-toggle"
    role="button"
    aria-pressed="false">
    <i
      :class="iconClasses"
      aria-hidden="true">{{ text }}</i>
  </span>
</template>

<script>
import MDCIconToggleFoundation from '@material/icon-toggle/foundation'
import { RippleBase } from '../ripple'

export default {
  name: 'mdc-icon-toggle',
  props: {
    toggleOn: [String, Object],
    toggleOff: [String, Object],
    value: Boolean,
    disabled: Boolean,
    accent: Boolean
  },
  data() {
    return {
      classes: {
        'mdc-icon-toggle--accent': this.accent
      },
      styles: {},
      iconClasses: {},
      tabIndex: 0,
      text: ''
    }
  },
  computed: {
    toggleOnData() {
      let toggle = this.toggleOn
      return (
        toggle &&
        JSON.stringify(
          typeof toggle === 'string'
            ? {
                content: toggle,
                cssClass: 'material-icons'
              }
            : {
                content: toggle.icon || toggle.content,
                label: toggle.label,
                cssClass: toggle.icon ? 'material-icons' : toggle.cssClass
              }
        )
      )
    },
    toggleOffData() {
      let toggle = this.toggleOff
      return (
        toggle &&
        JSON.stringify(
          typeof toggle === 'string'
            ? {
                content: toggle,
                cssClass: 'material-icons'
              }
            : {
                content: toggle.icon || toggle.content,
                label: toggle.label,
                cssClass: toggle.icon ? 'material-icons' : toggle.cssClass
              }
        )
      )
    }
  },
  watch: {
    value(value) {
      this.foundation && this.foundation.toggle(value)
    },
    disabled(disabled) {
      this.foundation && this.foundation.setDisabled(disabled)
    },
    toggleOnData() {
      this.foundation && this.foundation.refreshToggleData()
    },
    toggleOffData() {
      this.foundation && this.foundation.refreshToggleData()
    },
    accent(value) {
      this.$set(this.classes, 'mdc-icon-toggle--secondary', value)
    }
  },
  mounted() {
    this.foundation = new MDCIconToggleFoundation({
      addClass: className => this.$set(this.iconClasses, className, true),
      removeClass: className => this.$delete(this.iconClasses, className),
      registerInteractionHandler: (evt, handler) =>
        this.$el.addEventListener(evt, handler),
      deregisterInteractionHandler: (evt, handler) =>
        this.$el.removeEventListener(evt, handler),
      setText: text => {
        this.text = text
      },
      getTabIndex: () => this.tabIndex,
      setTabIndex: tabIndex => {
        this.tabIndex = tabIndex
      },
      getAttr: (name, value) => this.$el.getAttribute(name, value),
      setAttr: (name, value) => {
        this.$el.setAttribute(name, value)
      },
      rmAttr: name => {
        this.$el.removeAttribute(name)
      },
      notifyChange: evtData => {
        this.$emit('input', evtData.isOn)
      }
    })
    this.foundation.init()
    this.foundation.toggle(this.value)
    this.foundation.setDisabled(this.disabled)

    this.ripple = new RippleBase(this, {
      isUnbounded: () => true,
      isSurfaceActive: () => this.foundation.isKeyboardActivated()
    })
    this.ripple.init()
  },
  beforeDestroy() {
    this.foundation.destroy()
    this.ripple.destroy()
  }
}
</script>

{'repo_name': 'stasson/vue-mdc-adapter', 'stars': '426', 'repo_language': 'Vue', 'file_name': 'settings.json', 'mime_type': 'text/plain', 'hash': 3681349807451628071, 'source_dataset': 'data'}