JRUBY PENDING - This is just crazy, and crashes JRuby with its crazy regexes
*** Parameters: ***
require 'maruku/ext/div'; {} # params
*** Markdown input: ***
+-----------------------------------{.warning}------
| this is the last warning!
|
| please, go away!
|
| +------------------------------------- {.menace} --
| | or else terrible things will happen
| +--------------------------------------------------
+---------------------------------------------------
*** Output of inspect ***
md_el(:document,[
	md_el(:div,[
		md_par(["this is the last warning!"]),
		md_par(["please, go away!"]),
		md_el(:div,[md_par(["or else terrible things will happen"])],{:label=>nil,:num=>nil,:type=>nil},[[:class, "menace"]])
	],{:label=>nil,:num=>nil,:type=>nil},[[:class, "warning"]])
],{},[])
*** Output of to_html ***

this is the last warning!

please, go away!

or else terrible things will happen

*** Output of to_latex ***
this is the last warning!

please, go away!

or else terrible things will happen
*** Output of to_md ***
this is the last warning!

please, go away!

or else terrible things will happen
*** Output of to_s ***
this is the last warning!please, go away!or else terrible things will happen

{'repo_name': 'bhollis/maruku', 'stars': '487', 'repo_language': 'Ruby', 'file_name': 'entities.xml', 'mime_type': 'text/plain', 'hash': -7710862087474819501, 'source_dataset': 'data'}


<?php
/*
 * Copyright 2014 Google Inc.
 *
 * 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.
 */

class Google_Service_Sheets_CreateDeveloperMetadataRequest extends Google_Model
{
  protected $developerMetadataType = 'Google_Service_Sheets_DeveloperMetadata';
  protected $developerMetadataDataType = '';

  /**
   * @param Google_Service_Sheets_DeveloperMetadata
   */
  public function setDeveloperMetadata(Google_Service_Sheets_DeveloperMetadata $developerMetadata)
  {
    $this->developerMetadata = $developerMetadata;
  }
  /**
   * @return Google_Service_Sheets_DeveloperMetadata
   */
  public function getDeveloperMetadata()
  {
    return $this->developerMetadata;
  }
}

{'repo_name': 'GibbonEdu/core', 'stars': '232', 'repo_language': 'PHP', 'file_name': 'installerFunctions.php', 'mime_type': 'text/x-php', 'hash': -6585303276105769431, 'source_dataset': 'data'}


[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (SD-WAN is Critical for IoT)
[#]: via: (https://www.networkworld.com/article/3393445/sd-wan-is-critical-for-iot.html#tk.rss_all)
[#]: author: (Rami Rammaha https://www.networkworld.com/author/Rami-Rammaha/)

SD-WAN is Critical for IoT
======

![istock][1]

The Internet of Things (IoT) is everywhere and its use is growing fast. IoT is used by local governments to build smart cities. It’s used to build smart businesses. And, consumers are benefitting as it’s built into smart homes and smart cars. Industry analyst first estimates that over 20 billion IoT devices will be connected by 2020. That’s a 2.5x increase from the more than 8 billion connected devices in 2017*.

Manufacturing companies have the highest IoT spend to date of industries while the health care market is experiencing the highest IoT growth. By 2020, 50 percent of IoT spending will be driven by manufacturing, transportation and logistics, and utilities.

IoT growth is being fueled by the promise of analytical data insights that will ultimately yield greater efficiencies and enhanced customer satisfaction. The top use cases driving IoT growth are self-optimizing production, predictive maintenance and automated inventory management.

From a high-level view, the IoT architecture includes sensors that collect and transmit data (i.e. temperature, speed, humidity, video feed, pressure, IR, proximity, etc.) from “things” like cars, trucks, machines, etc. that are connected over the internet. Data collected is then analyzed, translating raw data into actionable information. Businesses can then act on this information. And at more advanced levels, machine learning and AI algorithms learn and adapt to this information and automatically respond at a system level.

IDC estimates that by 2025, over 75 billion IoT devices* will be connected. By that time, nearly a quarter of the world’s projected 163 zettabytes* (163 trillion gigabytes) of data will have been created in real-time, and the vast majority of that data will have been created by IoT devices. This massive amount of data will drive an exponential increase in traffic on the network infrastructure requiring massive scalability. Also, this increasing amount of data will require tremendous processing power to mine it and transform it into actionable intelligence. In parallel, security risks will continue to increase as there will be many more potential entry points onto the network. Lastly, management of the overall infrastructure will require better orchestration of policies as well as the means to streamline on-going operations.

### **How does SD-WAN enable IoT business initiatives?**

There are three key elements that an [SD-WAN][2] platform must include:

  1. **Visibility** : Real-time visibility into the network is key. It takes the guesswork out of rapid problem resolution, enabling organizations to run more efficiently by accelerating troubleshooting and applying preventive measures. Furthermore, a CIO is able to pull metrics and see bandwidth consumed by any IoT application.
  2. **Security** : IoT traffic must be isolated from other application traffic. IT must prevent – or at least reduce – the possible attack surface that may be exposed to IoT device traffic. Also, the network must continue delivering other application traffic in the event of a melt down on a WAN link caused by a DDoS attack.
  3. **Agility** : With the increased number of connected devices, applications and users, a comprehensive, intelligent and centralized orchestration approach that continuously adapts to deliver the best experience to the business and users is critical to success.

### Key Silver Peak EdgeConnect SD-WAN capabilities for IoT

1\. Silver Peak has an [embedded real-time visibility engine][3] allowing IT to gain complete observability into the performance attributes of the network and applications in real-time. The [EdgeConnect][4] SD-WAN appliances deployed in branch offices send information to the centralized [Unity Orchestrator™][5]. Orchestrator collects the data and presents it in a comprehensive management dashboard via customizable widgets. These widgets provide a wealth of operational data including a health heatmap for every SD-WAN appliance deployed, flow counts, active tunnels, logical topologies, top talkers, alarms, bandwidth consumed by each application and location, latency and jitter and much more. Furthermore, the platform maintains weeks’ worth of data with context allowing IT to playback and see what has transpired at a specific time and location, similar to a DVR.

![Click to read Solution Brief][6]

2\. The second set of key capabilities center around security and end-to-end zone-based segmentation. An IoT traffic zone may be created on the LAN or branch side. IoT traffic is then mapped all the way across the WAN to the data center or cloud where the data will be processed. Zone-based segmentation is accomplished in a simplified and automated way within the Orchestrator GUI. In cases where further traffic inspection is required, IT can simply service chain to another security service. There are several key benefits realized by this approach. IT can easily and quickly apply segmentation policies; segmentation mitigates the attack surface; and IT can save on additional security investments.

![***Click to read Solution Brief ***][7]

3\. EdgeConnect employs machine learning at the global level where with internet sensors and third-party sensors feed into the cloud portal software. The software tracks the geolocation of all IP addresses and IP reputation, distributing signals down to the Unity Orchestrator running in each individual customer’s enterprise. In turn, it is speaking to the edge devices sitting in the branch offices. There, distributed learning is done by looking at the first packet, making an inference based on the first packet what the application is. So, if seeing that 100 times now, every time packets come from that particular IP address and turns out to be an IoT, we can make an inference that IP belongs to IoT application. In parallel, we’re using a mix of traditional techniques to validate the identification of the application. All this combined other multi-level intelligence enables simple and automated policy orchestration across a large number of devices and applications.

![***Click to read Solution Brief ***][8]

SD-WAN plays a foundational role as businesses continue to embrace IoT, but choosing the right SD-WAN platform is even more critical to ensuring businesses are ultimately able to fully optimize their operations.

* Source: [IDC][9]

--------------------------------------------------------------------------------

via: https://www.networkworld.com/article/3393445/sd-wan-is-critical-for-iot.html#tk.rss_all

作者：[Rami Rammaha][a]
选题：[lujun9972][b]
译者：[译者ID](https://github.com/译者ID)
校对：[校对者ID](https://github.com/校对者ID)

本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译，[Linux中国](https://linux.cn/) 荣誉推出

[a]: https://www.networkworld.com/author/Rami-Rammaha/
[b]: https://github.com/lujun9972
[1]: https://images.idgesg.net/images/article/2019/05/istock-1019172426-100795551-large.jpg
[2]: https://www.silver-peak.com/sd-wan/sd-wan-explained
[3]: https://www.silver-peak.com/resource-center/simplify-sd-wan-operations-greater-visibility
[4]: https://www.silver-peak.com/products/unity-edge-connect
[5]: https://www.silver-peak.com/products/unity-orchestrator
[6]: https://images.idgesg.net/images/article/2019/05/1_simplify-100795554-large.jpg
[7]: https://images.idgesg.net/images/article/2019/05/2_centralize-100795555-large.jpg
[8]: https://images.idgesg.net/images/article/2019/05/3_increase-100795558-large.jpg
[9]: https://www.information-age.com/data-forecast-grow-10-fold-2025-123465538/

{'repo_name': 'LCTT/TranslateProject', 'stars': '1607', 'repo_language': 'Shell', 'file_name': '20140513 What is Debian A brief introduction.md', 'mime_type': 'text/plain', 'hash': -5623131823007757387, 'source_dataset': 'data'}


<!DOCTYPE html>

    Some text

{'repo_name': 'Feodor2/Mypal', 'stars': '149', 'repo_language': 'None', 'file_name': 'moz.build', 'mime_type': 'text/plain', 'hash': 468012025888120446, 'source_dataset': 'data'}


function [g, gdata, gprior] = glmgrad(net, x, t, eso_w)
%GLMGRAD Evaluate gradient of error function for generalized linear model.
%
%	Description
%	G = GLMGRAD(NET, X, T) takes a generalized linear model data
%	structure NET  together with a matrix X of input vectors and a matrix
%	T of target vectors, and evaluates the gradient G of the error
%	function with respect to the network weights. The error function
%	corresponds to the choice of output unit activation function. Each
%	row of X corresponds to one input vector and each row of T
%	corresponds to one target vector.
%
%	[G, GDATA, GPRIOR] = GLMGRAD(NET, X, T) also returns separately  the
%	data and prior contributions to the gradient.
%
%	See also
%	GLM, GLMPAK, GLMUNPAK, GLMFWD, GLMERR, GLMTRAIN
%

%	Copyright (c) Ian T Nabney (1996-9)

% Check arguments for consistency
errstring = consist(net, 'glm', x, t);
if ~isempty(errstring);
  error(errstring);
end

y = glmfwd(net, x);
temp = y - t;
ndata = size(x, 1);
for m=1:ndata,
      delout(m,:)=eso_w(m,1)*temp(m,:);
end
gw1 = x'*delout;
gb1 = sum(delout, 1);

gdata = [gw1(:)', gb1];

[g, gdata, gprior] = gbayes(net, gdata);

{'repo_name': 'bayesnet/bnt', 'stars': '332', 'repo_language': 'MATLAB', 'file_name': 'Root', 'mime_type': 'text/plain', 'hash': 2573608941704110929, 'source_dataset': 'data'}


<template>

    <el-popover ref="notice-popover" v-model="popoverOpen" popper-class="notice-popover"
      placement="bottom-end" :offset="-3">
      <el-tabs class="tabs" v-model="activeTab" @tab-click="onTabChange">
        <template v-for="tab in tabOptions">
          <el-tab-pane class="tab-pane" :key="tab.title" :label="tab.titleShow"
            :name="tab.title">

            <notice-list :data="getNoticeData(tab.list)" title="通知"></notice-list>
          </el-tab-pane>
        </template>
      </el-tabs>
    </el-popover>

      <el-badge :value="13" class="badge">

      </el-badge>

</template>

{'repo_name': 'qidaizhe11/element-pro', 'stars': '245', 'repo_language': 'Vue', 'file_name': 'webpack.test.conf.js', 'mime_type': 'text/plain', 'hash': 8306272999067450110, 'source_dataset': 'data'}


CREATE SECURITY POLICY [FederatedSecurityPolicy]
ADD FILTER PREDICATE [rls].[fn_securitypredicate]([CustomerId])
ON [dbo].[Customer];
CREATE SECURITY POLICY [FederatedSecurityPolicy]
ADD FILTER PREDICATE [rls].[fn_securitypredicate1]([CustomerId])
    ON [dbo].[Customer],
ADD FILTER PREDICATE [rls].[fn_securitypredicate1]([VendorId])
    ON [dbo].[ Vendor],
ADD FILTER PREDICATE [rls].[fn_securitypredicate2]([WingId])
    ON [dbo].[Patient]
WITH (STATE = ON);
CREATE SECURITY POLICY rls.SecPol
    ADD FILTER PREDICATE rls.tenantAccessPredicate(TenantId) ON dbo.Sales,
    ADD BLOCK PREDICATE rls.tenantAccessPredicate(TenantId) ON dbo.Sales AFTER INSERT;

{'repo_name': 'antlr/grammars-v4', 'stars': '5202', 'repo_language': 'ANTLR', 'file_name': 'example2.asn', 'mime_type': 'text/plain', 'hash': -2285811139450145564, 'source_dataset': 'data'}


package cn.eyeblue.blog.rest.tank;

import cn.eyeblue.blog.rest.base.BaseEntityController;
import cn.eyeblue.blog.rest.base.WebResult;
import cn.eyeblue.blog.rest.core.Feature;
import cn.eyeblue.blog.rest.core.FeatureType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletResponse;

@RestController
@RequestMapping(value = "/api/tank")
public class TankController extends BaseEntityController<Tank, TankForm> {

    @Autowired
    TankService tankService;

    @Autowired
    private TankDao tankDao;

    public TankController() {
        super(Tank.class);
    }

    @RequestMapping("/fetch/upload/token")
    @Feature(FeatureType.USER_MINE)
    public WebResult uploadToken(
            @RequestParam String filename,
            @RequestParam Boolean privacy,
            @RequestParam Long size
    ) {

        Tank tank = tankService.httpFetchUploadToken(filename, privacy, size, checkUser());

        return success(tank);
    }

    @RequestMapping("/download/{uuid}")
    @Feature(FeatureType.USER_MINE)
    public void download(HttpServletResponse response, @PathVariable String uuid) throws Exception {

        String url = tankService.httpFetchDownloadUrl(uuid);

        response.sendRedirect(url);

    }

    @RequestMapping("/fetch/download/{uuid}")
    @Feature(FeatureType.USER_MINE)
    public WebResult fetchDownload(@PathVariable String uuid) throws Exception {

        String url = tankService.httpFetchDownloadUrl(uuid);

        return success(url);

    }

    //通过一个url直接上传到蓝眼云盘中。
    @RequestMapping("/crawl/direct")
    @Feature(FeatureType.USER_MINE)
    public WebResult crawlDirect(@RequestParam String url, @RequestParam(required = false) String filename) {

        Tank tank = tankService.httpCrawlDirect(url, checkUser(), filename);

        return success(tank);
    }

    @RequestMapping("/confirm")
    @Feature(FeatureType.USER_MINE)
    public WebResult confirm(@RequestParam String uuid, @RequestParam String matterUuid) {
        Tank tank = tankService.httpConfirm(uuid, matterUuid);
        return success(tank);
    }

}

{'repo_name': 'eyebluecn/blog', 'stars': '106', 'repo_language': 'JavaScript', 'file_name': 'shutdown.sh', 'mime_type': 'text/x-shellscript', 'hash': 7622962651245411583, 'source_dataset': 'data'}


#!/bin/bash
rm -f /usr/info/dir.info /usr/share/info/dir.info /usr/info/dir /usr/share/info/dir
for d in /usr/info /usr/share/info; do
    for f in $d/*; do
	case "$f" in
	    *\**)
		;;
	    */dir|*/dir.info*)
		;;
	    *-[0123456789]*)
		;;
	    *)
		install-info --quiet $f /usr/share/info/dir ||
		install-info  --quiet --entry="* $$f ($f): $$f" $$f /usr/share/info/dir
		;;
	esac
    done
done >/dev/null 2>&1

{'repo_name': 'adobe-flash/crossbridge', 'stars': '525', 'repo_language': 'C', 'file_name': 'p1.cpp', 'mime_type': 'text/x-c++', 'hash': -6804839807496424103, 'source_dataset': 'data'}


--- a/drivers/spi/Kconfig
+++ b/drivers/spi/Kconfig
@@ -713,6 +713,13 @@ config SPI_TLE62X0
 	  sysfs interface, with each line presented as a kind of GPIO
 	  exposing both switch control and diagnostic feedback.

+config SPI_RB4XX_CPLD
+	tristate "MikroTik RB4XX CPLD driver"
+	depends on ATH79_MACH_RB4XX
+	help
+	  SPI driver for the Xilinx CPLD chip present on the
+	  MikroTik RB4xx boards.
+
 #
 # Add new SPI protocol masters in alphabetical order above this line
 #
--- a/drivers/spi/Makefile
+++ b/drivers/spi/Makefile
@@ -67,6 +67,7 @@ spi-pxa2xx-platform-$(CONFIG_SPI_PXA2XX_
 obj-$(CONFIG_SPI_PXA2XX)		+= spi-pxa2xx-platform.o
 obj-$(CONFIG_SPI_PXA2XX_PCI)		+= spi-pxa2xx-pci.o
 obj-$(CONFIG_SPI_RB4XX)			+= spi-rb4xx.o
+obj-$(CONFIG_SPI_RB4XX_CPLD)		+= spi-rb4xx-cpld.o
 obj-$(CONFIG_SPI_QUP)			+= spi-qup.o
 obj-$(CONFIG_SPI_ROCKCHIP)		+= spi-rockchip.o
 obj-$(CONFIG_SPI_RB4XX)			+= spi-rb4xx.o

{'repo_name': 'openwrt-mirror/openwrt', 'stars': '507', 'repo_language': 'C', 'file_name': 'Makefile', 'mime_type': 'text/plain', 'hash': -4413499861722882444, 'source_dataset': 'data'}


{'repo_name': 'boai/BADemoTest', 'stars': '112', 'repo_language': 'Objective-C', 'file_name': 'Info.plist', 'mime_type': 'text/xml', 'hash': 2308076962092204213, 'source_dataset': 'data'}


# Solutions to Common Problems

This section describes solutions to problems that you might encounter:

- [Boot in Emergency Mode](boot-in-emergency-mode.md)
- [Resetting a Lost Root Password](resetting-a-lost-root-password.md)
- [Fixing Permissions on Network Configuration Files](network-config-files-permissions.md)
- [Permitting Root Login with SSH](permitting-root-login-with-ssh.md)
- [Fixing Sendmail](fixing-sendmail.md)

{'repo_name': 'vmware/photon', 'stars': '2047', 'repo_language': 'Python', 'file_name': 'm_machineid.py', 'mime_type': 'text/x-python', 'hash': 6256218055872595294, 'source_dataset': 'data'}


/* Generated by RuntimeBrowser.
 */

@protocol HFHomeKitItemProtocol <NSObject>

@required

- (<HFHomeKitObject> *)homeKitObject;

@end

{'repo_name': 'nst/iOS-Runtime-Headers', 'stars': '7551', 'repo_language': 'Objective-C', 'file_name': 'NPNameParser.h', 'mime_type': 'text/plain', 'hash': -7051428105274331502, 'source_dataset': 'data'}


python -m inspect_checkpoint --file_name=../models/vgg_16_3chan.ckpt --tensor_name=vgg_16/conv1/conv1_1/weights

{'repo_name': 'philferriere/tfwss', 'stars': '209', 'repo_language': 'Jupyter Notebook', 'file_name': 'requirements_ubu.txt', 'mime_type': 'text/plain', 'hash': -2045924748632427218, 'source_dataset': 'data'}


module.exports = {
    "index": 1,
    "lineNumber": 1,
    "column": 2,
    "message": "Invalid regular expression: /(?<AB>a)\\2/: Invalid escape"
};

{'repo_name': 'eslint/espree', 'stars': '1224', 'repo_language': 'JavaScript', 'file_name': 'options.js', 'mime_type': 'text/plain', 'hash': 8635456219412515484, 'source_dataset': 'data'}


Flask-Sockets
=============

Elegant WebSockets for your Flask apps.

.. image:: http://farm4.staticflickr.com/3689/9755961864_577e32a106_c.jpg

Simple usage of ``route`` decorator:

.. code-block:: python

    from flask import Flask
    from flask_sockets import Sockets

    app = Flask(__name__)
    sockets = Sockets(app)

    @sockets.route('/echo')
    def echo_socket(ws):
        while not ws.closed:
            message = ws.receive()
            ws.send(message)

    @app.route('/')
    def hello():
        return 'Hello World!'

    if __name__ == "__main__":
        from gevent import pywsgi
        from geventwebsocket.handler import WebSocketHandler
        server = pywsgi.WSGIServer(('', 5000), app, handler_class=WebSocketHandler)
        server.serve_forever()

Usage of `Flask blueprints`_:

.. code-block:: python

    from flask import Flask, Blueprint
    from flask_sockets import Sockets

    html = Blueprint(r'html', __name__)
    ws = Blueprint(r'ws', __name__)

    @html.route('/')
    def hello():
        return 'Hello World!'

    @ws.route('/echo')
    def echo_socket(socket):
        while not socket.closed:
            message = socket.receive()
            socket.send(message)

    app = Flask(__name__)
    sockets = Sockets(app)

    app.register_blueprint(html, url_prefix=r'/')
    sockets.register_blueprint(ws, url_prefix=r'/')

    if __name__ == "__main__":
        from gevent import pywsgi
        from geventwebsocket.handler import WebSocketHandler
        server = pywsgi.WSGIServer(('', 5000), app, handler_class=WebSocketHandler)
        server.serve_forever()

Combining WebSockets with Ajax (XHR) endpoints also comes handy with the support of session handling built-in to sockets as well. As an example you could use an Ajax login call which would create a new session and accordingly set a secure HttpOnly cookie to the browser. After authorization, you can connect to the WebSocket endpoint and reuse the session handling from Flask there as well (as shown here: https://pythonhosted.org/Flask-Session/). Access to other custom cookies is also possible via Flasks ``request.cookies`` property.

Serving WebSockets in Python was really difficult. Now it's not.

Installation
------------

To install Flask-Sockets, simply::

    $ pip install Flask-Sockets

Deployment
----------

A custom Gunicorn worker is included to make deployment as friendly as possible::

    $ gunicorn -k flask_sockets.worker hello:app

Production services are provided by `gevent <http://www.gevent.org>`_
and `gevent-websocket <https://bitbucket.org/noppo/gevent-websocket>`_.

The given example can run standalone as main.

Anything that inserts ``wsgi.websocket`` into the WSGI environ is
supported, but gevent-websocket is recommended.

Development / Testing
---------------------

Because the Werkzeug development server cannot provide the WSGI environ with
a websocket interface, it is not possible to run a Flask app using the standard
``app.run()``.

If you try to, Flask will still try to serve on all the specified routes, and
throw a ``KeyError`` whenever a client tries to connect to a websocket route.

Instead, just use the included gunicorn worker (explained above), or anything that
can insert ``wsgi.websocket`` into the WSGI environ.

WebSocket Interface
-------------------

The websocket interface that is passed into your routes is
`provided by gevent-websocket <https://bitbucket.org/noppo/gevent-websocket>`_.
The basic methods are fairly straightforward —
``send``, ``receive``, ``send_frame``, and ``close``.

Release History
---------------

v0.2.1
~~~~~~

- Add support of `Flask blueprints`_.

v0.2.0
~~~~~~

- Add request context into the socket handler.
- Fallback to Flask logic if websocket environment is not available.
- Use Flask routing to allow for variables in URL

v0.1.0
~~~~~~

- Initial release.

.. _Flask blueprints: http://flask.pocoo.org/docs/latest/blueprints/

{'repo_name': 'heroku-python/flask-sockets', 'stars': '1646', 'repo_language': 'Python', 'file_name': 'flask_sockets.py', 'mime_type': 'text/x-python', 'hash': 8724992255838742831, 'source_dataset': 'data'}


<?xml version="1.0" encoding="UTF-8"?>
<!--
  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.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>org.apache.nifi</groupId>
        <artifactId>nifi-websocket-bundle</artifactId>
        <version>1.13.0-SNAPSHOT</version>
    </parent>

    <artifactId>nifi-websocket-services-api-nar</artifactId>
    <version>1.13.0-SNAPSHOT</version>
    <packaging>nar</packaging>
    <properties>
        <maven.javadoc.skip>true</maven.javadoc.skip>
        <source.skip>true</source.skip>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.apache.nifi</groupId>
            <artifactId>nifi-standard-services-api-nar</artifactId>
            <version>1.13.0-SNAPSHOT</version>
            <type>nar</type>
        </dependency>
        <dependency>
            <groupId>org.apache.nifi</groupId>
            <artifactId>nifi-websocket-services-api</artifactId>
            <version>1.13.0-SNAPSHOT</version>
        </dependency>
    </dependencies>

</project>

{'repo_name': 'apache/nifi', 'stars': '2156', 'repo_language': 'Java', 'file_name': 'dependencies.xml', 'mime_type': 'text/xml', 'hash': 7483801780243275653, 'source_dataset': 'data'}


/*
* This file is part of the SDWebImage package.
* (c) Olivier Poitrey <rs@dailymotion.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

#import "SDGraphicsImageRenderer.h"
#import "SDImageGraphics.h"

@interface SDGraphicsImageRendererFormat ()
#if SD_UIKIT
@property (nonatomic, strong) UIGraphicsImageRendererFormat *uiformat API_AVAILABLE(ios(10.0), tvos(10.0));
#endif
@end

@implementation SDGraphicsImageRendererFormat
@synthesize scale = _scale;
@synthesize opaque = _opaque;
@synthesize preferredRange = _preferredRange;

#pragma mark - Property
- (CGFloat)scale {
#if SD_UIKIT
    if (@available(iOS 10.0, tvOS 10.10, *)) {
        return self.uiformat.scale;
    } else {
        return _scale;
    }
#else
    return _scale;
#endif
}

- (void)setScale:(CGFloat)scale {
#if SD_UIKIT
    if (@available(iOS 10.0, tvOS 10.10, *)) {
        self.uiformat.scale = scale;
    } else {
        _scale = scale;
    }
#else
    _scale = scale;
#endif
}

- (BOOL)opaque {
#if SD_UIKIT
    if (@available(iOS 10.0, tvOS 10.10, *)) {
        return self.uiformat.opaque;
    } else {
        return _opaque;
    }
#else
    return _opaque;
#endif
}

- (void)setOpaque:(BOOL)opaque {
#if SD_UIKIT
    if (@available(iOS 10.0, tvOS 10.10, *)) {
        self.uiformat.opaque = opaque;
    } else {
        _opaque = opaque;
    }
#else
    _opaque = opaque;
#endif
}

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
- (SDGraphicsImageRendererFormatRange)preferredRange {
#if SD_UIKIT
    if (@available(iOS 10.0, tvOS 10.10, *)) {
        if (@available(iOS 12.0, tvOS 12.0, *)) {
            return (SDGraphicsImageRendererFormatRange)self.uiformat.preferredRange;
        } else {
            BOOL prefersExtendedRange = self.uiformat.prefersExtendedRange;
            if (prefersExtendedRange) {
                return SDGraphicsImageRendererFormatRangeExtended;
            } else {
                return SDGraphicsImageRendererFormatRangeStandard;
            }
        }
    } else {
        return _preferredRange;
    }
#else
    return _preferredRange;
#endif
}

- (void)setPreferredRange:(SDGraphicsImageRendererFormatRange)preferredRange {
#if SD_UIKIT
    if (@available(iOS 10.0, tvOS 10.10, *)) {
        if (@available(iOS 12.0, tvOS 12.0, *)) {
            self.uiformat.preferredRange = (UIGraphicsImageRendererFormatRange)preferredRange;
        } else {
            switch (preferredRange) {
                case SDGraphicsImageRendererFormatRangeExtended:
                    self.uiformat.prefersExtendedRange = YES;
                    break;
                case SDGraphicsImageRendererFormatRangeStandard:
                    self.uiformat.prefersExtendedRange = NO;
                default:
                    // Automatic means default
                    break;
            }
        }
    } else {
        _preferredRange = preferredRange;
    }
#else
    _preferredRange = preferredRange;
#endif
}
#pragma clang diagnostic pop

- (instancetype)init {
    self = [super init];
    if (self) {
#if SD_UIKIT
        if (@available(iOS 10.0, tvOS 10.10, *)) {
            UIGraphicsImageRendererFormat *uiformat = [[UIGraphicsImageRendererFormat alloc] init];
            self.uiformat = uiformat;
        } else {
#endif
#if SD_WATCH
            CGFloat screenScale = [WKInterfaceDevice currentDevice].screenScale;
#elif SD_UIKIT
            CGFloat screenScale = [UIScreen mainScreen].scale;
#elif SD_MAC
            CGFloat screenScale = [NSScreen mainScreen].backingScaleFactor;
#endif
            self.scale = screenScale;
            self.opaque = NO;
            self.preferredRange = SDGraphicsImageRendererFormatRangeStandard;
#if SD_UIKIT
        }
#endif
    }
    return self;
}

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunguarded-availability"
- (instancetype)initForMainScreen {
    self = [super init];
    if (self) {
#if SD_UIKIT
        if (@available(iOS 10.0, tvOS 10.0, *)) {
            UIGraphicsImageRendererFormat *uiformat;
            // iOS 11.0.0 GM does have `preferredFormat`, but iOS 11 betas did not (argh!)
            if ([UIGraphicsImageRenderer respondsToSelector:@selector(preferredFormat)]) {
                uiformat = [UIGraphicsImageRendererFormat preferredFormat];
            } else {
                uiformat = [UIGraphicsImageRendererFormat defaultFormat];
            }
            self.uiformat = uiformat;
        } else {
#endif
#if SD_WATCH
            CGFloat screenScale = [WKInterfaceDevice currentDevice].screenScale;
#elif SD_UIKIT
            CGFloat screenScale = [UIScreen mainScreen].scale;
#elif SD_MAC
            CGFloat screenScale = [NSScreen mainScreen].backingScaleFactor;
#endif
            self.scale = screenScale;
            self.opaque = NO;
            self.preferredRange = SDGraphicsImageRendererFormatRangeStandard;
#if SD_UIKIT
        }
#endif
    }
    return self;
}
#pragma clang diagnostic pop

+ (instancetype)preferredFormat {
    SDGraphicsImageRendererFormat *format = [[SDGraphicsImageRendererFormat alloc] initForMainScreen];
    return format;
}

@end

@interface SDGraphicsImageRenderer ()
@property (nonatomic, assign) CGSize size;
@property (nonatomic, strong) SDGraphicsImageRendererFormat *format;
#if SD_UIKIT
@property (nonatomic, strong) UIGraphicsImageRenderer *uirenderer API_AVAILABLE(ios(10.0), tvos(10.0));
#endif
@end

@implementation SDGraphicsImageRenderer

- (instancetype)initWithSize:(CGSize)size {
    return [self initWithSize:size format:SDGraphicsImageRendererFormat.preferredFormat];
}

- (instancetype)initWithSize:(CGSize)size format:(SDGraphicsImageRendererFormat *)format {
    NSParameterAssert(format);
    self = [super init];
    if (self) {
        self.size = size;
        self.format = format;
#if SD_UIKIT
        if (@available(iOS 10.0, tvOS 10.0, *)) {
            UIGraphicsImageRendererFormat *uiformat = format.uiformat;
            self.uirenderer = [[UIGraphicsImageRenderer alloc] initWithSize:size format:uiformat];
        }
#endif
    }
    return self;
}

- (UIImage *)imageWithActions:(NS_NOESCAPE SDGraphicsImageDrawingActions)actions {
    NSParameterAssert(actions);
#if SD_UIKIT
    if (@available(iOS 10.0, tvOS 10.0, *)) {
        UIGraphicsImageDrawingActions uiactions = ^(UIGraphicsImageRendererContext *rendererContext) {
            if (actions) {
                actions(rendererContext.CGContext);
            }
        };
        return [self.uirenderer imageWithActions:uiactions];
    } else {
#endif
        SDGraphicsBeginImageContextWithOptions(self.size, self.format.opaque, self.format.scale);
        CGContextRef context = SDGraphicsGetCurrentContext();
        if (actions) {
            actions(context);
        }
        UIImage *image = SDGraphicsGetImageFromCurrentImageContext();
        SDGraphicsEndImageContext();
        return image;
#if SD_UIKIT
    }
#endif
}

@end

{'repo_name': 'SDWebImage/SDWebImage', 'stars': '22868', 'repo_language': 'Objective-C', 'file_name': 'SDWebImageTestCoder.m', 'mime_type': 'text/x-objective-c', 'hash': 8660210724076183244, 'source_dataset': 'data'}


{'repo_name': 'eleurent/rl-agents', 'stars': '149', 'repo_language': 'Python', 'file_name': 'test_mcts.py', 'mime_type': 'text/x-python', 'hash': 4193670399164301614, 'source_dataset': 'data'}


#ifndef MXQMETRIC3_INCLUDED // -*- C++ -*-
#define MXQMETRIC3_INCLUDED
#if !defined(__GNUC__)
#  pragma once
#endif

/************************************************************************

  3D Quadric Error Metric

  Copyright (C) 1998 Michael Garland.  See "COPYING.txt" for details.

  $Id: MxQMetric3.h,v 1.14 1999/12/15 18:07:45 garland Exp $

 ************************************************************************/

#include "MxMat3.h"
#include "MxMat4.h"

class MxQuadric3
{
private:
    double a2, ab, ac, ad;
    double     b2, bc, bd;
    double         c2, cd;
    double             d2;

    double r;

    void init(double a, double b, double c, double d, double area);
    void init(const Mat4& Q, double area);

public:
    MxQuadric3() { clear(); }
    MxQuadric3(double a, double b, double c, double d, double area=1.0)
	{ init(a, b, c, d, area); }
    MxQuadric3(const float *n, double d, double area=1.0)
	{ init(n[0], n[1], n[2], d, area); }
    MxQuadric3(const double *n, double d, double area=1.0)
	{ init(n[0], n[1], n[2], d, area); }
    MxQuadric3(const MxQuadric3& Q) { *this = Q; }

    Mat3 tensor() const;
    Vec3 vector() const { return Vec3(ad, bd, cd); }
    double offset() const { return d2; }
    double area() const { return r; }
    Mat4 homogeneous() const;

    void set_coefficients(const double *);
    void set_area(double a) { r=a; }
    void point_constraint(const float *);

    void clear(double val=0.0) { a2=ab=ac=ad=b2=bc=bd=c2=cd=d2=r=val; }
    MxQuadric3& operator=(const MxQuadric3& Q);
    MxQuadric3& operator+=(const MxQuadric3& Q);
    MxQuadric3& operator-=(const MxQuadric3& Q);
    MxQuadric3& operator*=(double s);
    MxQuadric3& transform(const Mat4& P);

    double evaluate(double x, double y, double z) const;
    double evaluate(const double *v) const {return evaluate(v[0], v[1], v[2]);}
    double evaluate(const float *v) const  {return evaluate(v[0], v[1], v[2]);}

    double operator()(double x, double y, double z) const
	{ return evaluate(x, y, z); }
    double operator()(const double *v) const {return evaluate(v[0],v[1],v[2]);}
    double operator()(const float *v) const  {return evaluate(v[0],v[1],v[2]);}

    bool optimize(Vec3& v) const;
    bool optimize(float *x, float *y, float *z) const;

    bool optimize(Vec3& v, const Vec3& v1, const Vec3& v2) const;
    bool optimize(Vec3& v,const Vec3& v1,const Vec3& v2,const Vec3& v3) const;

/*
    ostream& write(ostream& out)
	{
	    return out << a2 << " " << ab << " " << ac << " " << ad << " "
		       << b2 << " " << bc << " " << bd << " " << c2 << " "
		       << cd << " " << d2 << " " << r;
	}

    ostream& write_full(ostream& out)
	{
	    return out << a2 << " " << ab << " " << ac << " " << ad << " "
		       << ab << " " << b2 << " " << bc << " " << bd << " "
		       << ac << " " << bc << " " << c2 << " " << cd << " "
		       << ad << " " << bd << " " << cd << " " << d2;
	}

    istream& read(istream& in)
	{
	    return in >> a2 >> ab >> ac >> ad >> b2
		      >> bc >> bd >> c2 >> cd >> d2 >> r;
	}

    istream& read_full(istream& in)
	{
	    return in >> a2 >> ab >> ac >> ad
		      >> ab >> b2 >> bc >> bd
		      >> ac >> bc >> c2 >> cd
		      >> ad >> bd >> cd >> d2;
	}
*/
};

////////////////////////////////////////////////////////////////////////
//
// Quadric visualization routines
//

#define MX_RED_ELLIPSOIDS 0x1
#define MX_GREEN_ELLIPSOIDS 0x2
#define MX_CHARCOAL_ELLIPSOIDS 0x3

extern void mx_quadric_shading(int c=MX_GREEN_ELLIPSOIDS, bool twosided=true);
extern void mx_draw_quadric(const MxQuadric3& Q, double r, const float*v=NULL);
extern void mx_draw_osculant(float k1, float k2, float extent=1.0);

// MXQMETRIC3_INCLUDED
#endif

{'repo_name': 'OpenXRay/xray-15', 'stars': '145', 'repo_language': 'C++', 'file_name': 'pem.h', 'mime_type': 'text/x-c', 'hash': -12917975087318674, 'source_dataset': 'data'}


package docker.registry.web.support

class Tag {
    String name
    String imageId

    @Override
    String toString() {
        return "Tag{" +
                "name='" + name + '\'' +
                ", imageId='" + imageId + '\'' +
                '}'
    }
}

{'repo_name': 'atcol/docker-registry-ui', 'stars': '874', 'repo_language': 'Groovy', 'file_name': 'grails-wrapper.properties', 'mime_type': 'text/plain', 'hash': 2167184590001826542, 'source_dataset': 'data'}


from urlparse import urlparse

from couchpotato.core.event import addEvent, fireEvent
from couchpotato.core.helpers.encoding import simplifyString
from couchpotato.core.helpers.variable import getImdb, md5
from couchpotato.core.logger import CPLog
from couchpotato.core.media._base.providers.base import Provider

log = CPLog(__name__)

class UserscriptBase(Provider):

    type = 'userscript'

    version = 1
    http_time_between_calls = 0

    includes = []
    excludes = []

    def __init__(self):
        addEvent('userscript.get_includes', self.getInclude)
        addEvent('userscript.get_excludes', self.getExclude)
        addEvent('userscript.get_provider_version', self.getVersion)
        addEvent('userscript.get_movie_via_url', self.belongsTo)

    def search(self, name, year = None):
        result = fireEvent('movie.search', q = '%s %s' % (name, year), limit = 1, merge = True)

        if len(result) > 0:
            movie = fireEvent('movie.info', identifier = result[0].get('imdb'), extended = False, merge = True)
            return movie
        else:
            return None

    def belongsTo(self, url):

        host = urlparse(url).hostname
        host_split = host.split('.')
        if len(host_split) > 2:
            host = host[len(host_split[0]):]

        for include in self.includes:
            if host in include:
                return self.getMovie(url)

        return

    def getUrl(self, url):
        return self.getCache(md5(simplifyString(url)), url = url)

    def getMovie(self, url):
        try:
            data = self.getUrl(url)
        except:
            data = ''
        return self.getInfo(getImdb(data))

    def getInfo(self, identifier):
        return fireEvent('movie.info', identifier = identifier, extended = False, merge = True)

    def getInclude(self):
        return self.includes

    def getExclude(self):
        return self.excludes

    def getVersion(self):
        return self.version

{'repo_name': 'CouchPotato/CouchPotatoServer', 'stars': '3715', 'repo_language': 'Python', 'file_name': 'main.py', 'mime_type': 'text/x-python', 'hash': 6638077872312682183, 'source_dataset': 'data'}


{'repo_name': 'ripple/ripple-lib', 'stars': '859', 'repo_language': 'TypeScript', 'file_name': 'parseAccountFlags.ts', 'mime_type': 'text/plain', 'hash': -5548876373341466248, 'source_dataset': 'data'}


using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Rendering;

public class Laser : MonoBehaviour {

	public float m_delay = 0f;
	public float m_lifeTime = 1f;
	public bool m_isLoop = true;
	public float m_defaultLength = 5f;
	public float m_startSize = 1f;
	public float m_startHigh = 0f;
	public float m_endHigh = 0f;
	public Vector2 m_Title = new Vector2(1, 1);
	public Vector2 m_uvOffsetSpeed = new Vector2(0f, 0f);
	public Material m_material = null;
	static readonly Keyframe[] defaultKeyframe = new Keyframe[]{ new Keyframe(0, 1), new Keyframe(1, 1) };
	public AnimationCurve m_scaleCurve = new AnimationCurve(defaultKeyframe);
	public AnimationCurve m_widthCurve = new AnimationCurve(defaultKeyframe);
	public Gradient m_colorGradient = new Gradient();
	public Gradient m_lineColorGradient = new Gradient();
	public float m_hitRadius = 0f;
	public GameObject m_hitEffect = null;

	public Transform m_startTransfrom;
	public Transform m_endTransfrom;

	private LineRenderer m_lineRender;
	private float m_delayEndTime = 0;

	private float m_passTime = 0f;
	private Vector3 m_curStartPos = new Vector3();
	private Vector3 m_curEndPos = new Vector3();
	private float m_curSize = 1f;
	private Color m_curColor = Color.white;
	private Vector2 m_titleUVLength = new Vector2(1, 1);
	private Vector2 m_titleUVOffset = new Vector2(1, 1);
	private bool m_firstSetUV = true;
	private Vector2 m_curUVOffset = new Vector2(0f, 0f);
	// Use this for initialization
	void Start () {
		if (m_lineRender == null)
		{
			m_lineRender = GetComponent<LineRenderer>();
			if (m_lineRender == null)
			{
				m_lineRender = this.gameObject.AddComponent<LineRenderer>();
			}
		}

		m_lineRender.shadowCastingMode = ShadowCastingMode.Off;
		m_lineRender.receiveShadows = false;
		m_lineRender.textureMode = LineTextureMode.Tile;
		if (m_material != null)
		{
			m_lineRender.material = new Material(m_material);
		}

		m_lineRender.widthCurve = new AnimationCurve(m_widthCurve.keys);
		CaculateCurWidthCurve();

		Gradient newGradient = new Gradient();
		newGradient.mode = m_lineColorGradient.mode;
		newGradient.SetKeys(m_lineColorGradient.colorKeys, m_lineColorGradient.alphaKeys);
		m_lineRender.colorGradient = newGradient;
		//m_lineRender.colorGradient.SetKeys(m_lineColorGradient.colorKeys, m_lineColorGradient.alphaKeys);

		CaculateColorGradient();
	}

	private void OnEnable()
	{
		m_delayEndTime = Time.timeSinceLevelLoad + m_delay;

		if (m_Title.x < 1)
			m_Title.x = 1;
		if (m_Title.y < 1)
			m_Title.y = 1;

		if ((int)m_Title.x <= 1)
			m_titleUVOffset.x = 0;
		else
		{
			m_titleUVOffset.x = Random.Range(1, (int)m_Title.x + 1);
			m_titleUVOffset.x = (m_titleUVOffset.x - 1) / Mathf.Floor(m_Title.x);
		}

		if ((int)m_Title.y <= 1)
			m_titleUVOffset.y = 1;
		else
		{
			m_titleUVOffset.y = Random.Range(1, (int)m_Title.y + 1);
			m_titleUVOffset.y = (m_titleUVOffset.y - 1) / Mathf.Floor(m_Title.y);
		}

		m_titleUVLength.x = 1f / Mathf.Floor(m_Title.x);
		m_titleUVLength.y = 1f / Mathf.Floor(m_Title.y);

		m_firstSetUV = true;
	}

	// Update is called once per frame
	void Update () {
		if(m_lifeTime <= 0 || m_delayEndTime > Time.timeSinceLevelLoad)
		{
			if (m_lineRender)
				m_lineRender.enabled = false;

			if (m_hitEffect)
				m_hitEffect.SetActive(false);
			return;
		}

		m_passTime = Time.timeSinceLevelLoad - m_delayEndTime;
		if(m_passTime > m_lifeTime)
		{
			if(m_isLoop)
			{
				m_passTime -= m_lifeTime * ((int)(m_passTime / m_lifeTime));
			}else
			{
				if (m_lineRender)
					m_lineRender.enabled = false;

				if (m_hitEffect)
					m_hitEffect.SetActive(false);

				return;
			}
		}

		if (m_lineRender)
			m_lineRender.enabled = true;
		if (m_hitEffect)
			m_hitEffect.SetActive(true);

		if (m_startTransfrom == null)
		{
			m_curStartPos = this.transform.position;
		}else
		{
			m_curStartPos = m_startTransfrom.position;
			m_curStartPos.y += m_startHigh;
		}

		if(m_endTransfrom == null)
		{
			m_curEndPos = this.transform.rotation * Vector3.forward * m_defaultLength + m_curStartPos;
		}else
		{
			m_curEndPos = m_endTransfrom.position;
			m_curEndPos.y += m_endHigh;

			if(m_hitRadius > 0 )
			{
				float orginLength = (m_curEndPos - m_curStartPos).magnitude;
				float lineLength = orginLength - m_hitRadius;
				if (lineLength < 0 )
				{
					m_curEndPos = m_curStartPos;
				}else
				{
					m_curEndPos = Vector3.Lerp(m_curStartPos, m_curEndPos, lineLength / orginLength);
				}
			}
		}

		m_lineRender.positionCount = 2;
		m_lineRender.SetPosition(0, m_curStartPos);
		m_lineRender.SetPosition(1, m_curEndPos);

		CaculateColorGradient();
		CaculateCurWidthCurve();
		CaculateUVOffset();

		if(m_hitEffect != null)
		{
			m_hitEffect.transform.position = m_curEndPos;
			if((m_curStartPos - m_curEndPos).magnitude > 0.001f)
			{
				m_hitEffect.transform.rotation = Quaternion.LookRotation(m_curEndPos - m_curStartPos);
			}
		}

		//if (Mathf.Abs(m_uvOffsetSpeed.x)> 0.0001f || Mathf.Abs(m_uvOffsetSpeed.y) > 0.0001f)
		//{
		//	float offsetX = (Time.timeSinceLevelLoad - m_delayEndTime) * m_uvOffsetSpeed.x;
		//	if(offsetX > 1f)
		//	{
		//		offsetX -= (int)offsetX;
		//	}else if(offsetX < -1f)
		//	{
		//		offsetX += (1 + (int)Mathf.Abs(offsetX));
		//	}

		//	m_material.SetTextureOffset("_MainTex", new Vector2(offsetX, 0));
		//}
	}

	public void CaculateCurWidthCurve()
	{
		if (m_lineRender == null)
			return;

		float curScale = 1f;
		if (m_scaleCurve.length >= 2)
		{
			curScale = m_scaleCurve.Evaluate(m_passTime / m_lifeTime);
		}

		int framecount = m_lineRender.widthCurve.length;
		AnimationCurve curCurve = new AnimationCurve();
		for (int i = 0; i < framecount; i++)
		{
			float time = m_lineRender.widthCurve.keys[i].time;
			float value = curScale * m_startSize * m_widthCurve.Evaluate(time);
			//m_lineRender.widthCurve.keys[i] = new Keyframe(time, value);
			curCurve.AddKey(new Keyframe(time, value));
		}
		m_lineRender.widthCurve = curCurve;

		//m_lineRender.startWidth = m_startSize * curScale * m_withCurve.Evaluate(0);
		//m_lineRender.endWidth = m_startSize * curScale * m_withCurve.Evaluate(1);
	}

	public void CaculateColorGradient()
	{
		if (m_lineRender == null)
			return;

		Gradient newGradient = new Gradient();
		newGradient.mode = m_lineColorGradient.mode;
		//

		m_curColor = m_colorGradient.Evaluate(m_passTime / m_lifeTime);
		int count = m_lineRender.colorGradient.colorKeys.Length;
		GradientColorKey[] newColorKeys = new GradientColorKey[count];
		for (int i = 0; i < count; i++)
		{
			float time = m_lineRender.colorGradient.colorKeys[i].time;
			Color newColor = m_curColor * m_lineColorGradient.Evaluate(m_lineRender.colorGradient.colorKeys[i].time);
			newColorKeys[i] = new GradientColorKey(newColor, time);
		}

		count = m_lineRender.colorGradient.alphaKeys.Length;
		GradientAlphaKey[] newAlphaKeys = new GradientAlphaKey[count];
		for (int i = 0; i < count; i++)
		{
			float time = m_lineRender.colorGradient.alphaKeys[i].time;
			Color newColor = m_curColor * m_lineColorGradient.Evaluate(m_lineRender.colorGradient.alphaKeys[i].time);
			newAlphaKeys[i] = new GradientAlphaKey(newColor.a, time);
			//curGradient.
		}
		newGradient.SetKeys(newColorKeys, newAlphaKeys);
		m_lineRender.colorGradient = newGradient;
		//m_lineRender.colorGradient.SetKeys(newColorKeys, newAlphaKeys);
	}

	public void CaculateUVOffset()
	{
		if (m_lineRender == null)
			return;

		if (Mathf.Abs(m_uvOffsetSpeed.x) < 0.0001f && Mathf.Abs(m_uvOffsetSpeed.y) < 0.0001f && m_firstSetUV == false)
			return;

		if(m_firstSetUV)
		{
			new Texture();
			m_lineRender.material.SetTextureScale("_MainTex", m_titleUVLength);
			m_firstSetUV = false;
		}

		float offsetX = (Time.timeSinceLevelLoad - m_delayEndTime) * m_uvOffsetSpeed.x;
		float count = Mathf.Floor(offsetX / m_titleUVLength.x);

		if(offsetX >= 0)
		{
			m_curUVOffset.x = m_titleUVOffset.x + (offsetX - count * m_titleUVLength.x);
		} else
		{
			m_curUVOffset.x = m_titleUVOffset.x + m_titleUVLength.x + (offsetX + count * m_titleUVLength.x);
		}

		float offsetY = (Time.timeSinceLevelLoad - m_delayEndTime) * m_uvOffsetSpeed.y;
		count = Mathf.Floor(offsetY / m_titleUVLength.y);

		if (offsetY >= 0)
		{
			m_curUVOffset.y = m_titleUVOffset.y + (offsetY - count * m_titleUVLength.y);
		} else
		{
			m_curUVOffset.y = m_titleUVOffset.y + m_titleUVLength.y + (offsetY + count * m_titleUVLength.y);
		}

		m_lineRender.material.SetTextureOffset("_MainTex", m_curUVOffset);
	}
}

{'repo_name': 'XINCGer/Unity3DTraining', 'stars': '1280', 'repo_language': 'C#', 'file_name': 'AudioManager.asset', 'mime_type': 'text/plain', 'hash': 4751439422740181009, 'source_dataset': 'data'}