import Login from "../Login";
import CreateUpdate from "../CreateUpdate";

describe("global/components/sign-in-up/Login", () => {
  def("user", () => factory("user"));
  def("authentication", () =>
    fixtures.authentication({ user: $user })
  );
  def("handleViewChange", () => jest.fn());
  def("settings", () => factory("settings"));
  def("root", () => (
    <Login
      dispatch={$dispatch}
      handleViewChange={$handleViewChange}
      user={$user}
      authentication={$authentication}
      settings={$settings}
    />
  ));
  def("wrapper", () => mount($withApp($root)));

  it("matches the snapshot", () => {
    expect(shallow($root)).toMatchSnapshot();
  });

  it("should trigger handleViewChange callback when show forgot is clicked", () => {
    $handleViewChange.mockClear();
    $wrapper
      .find('[data-id="show-forgot"]')
      .first()
      .simulate("click");
    expect($handleViewChange).toHaveBeenCalled();
  });

  it("should trigger handleViewChange callback when show create is clicked", () => {
    $handleViewChange.mockClear();
    $wrapper
      .find('[data-id="show-create"]')
      .first()
      .simulate("click");
    expect($handleViewChange).toHaveBeenCalled();
  });
});

{'repo_name': 'ManifoldScholar/manifold', 'stars': '149', 'repo_language': 'JavaScript', 'file_name': 'bugs.md', 'mime_type': 'text/plain', 'hash': 2614165610571815724, 'source_dataset': 'data'}


/*
 * Copyright 2016-2019 Talsma ICT
 *
 * 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 using collected Javadoc data to detect
 * {@linkplain nl.talsmasoftware.umldoclet.javadoc.dependencies.PackageDependency package dependencies}
 * and any cycles in them.
 */
package nl.talsmasoftware.umldoclet.javadoc.dependencies;

{'repo_name': 'talsma-ict/umldoclet', 'stars': '106', 'repo_language': 'Java', 'file_name': 'header.txt', 'mime_type': 'text/plain', 'hash': -8772383512437736129, 'source_dataset': 'data'}


# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# 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.
# ==============================================================================
"""Logging tensorflow::tfprof::OpLog.

OpLog is used to add extra model information for offline analysis by tfprof.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function

import os
import sys

import six
from tensorflow.python.framework import ops
from tensorflow.python.framework import tensor_shape
from tensorflow.python.platform import gfile
from tensorflow.tools.tfprof import tfprof_log_pb2

TRAINABLE_VARIABLES = '_trainable_variables'
REGISTERED_FLOP_STATS = 'flops'

def _fill_missing_graph_shape(graph, run_meta):
  """Fill Tensor shapes in 'graph' with run time shape from 'run_meta'."""
  for dev_stat in run_meta.step_stats.dev_stats:
    for node_stat in dev_stat.node_stats:
      if not node_stat.output:
        continue
      try:
        op = graph.get_operation_by_name(node_stat.node_name)
      except KeyError as e:
        # Graph doesn't contains the node_stat, usually RecvTensor.
        continue
      if len(node_stat.output) != len(op.outputs):
        # For example, conditional op has only 1 output at run time.
        continue
      for (i, node_stat_out) in enumerate(node_stat.output):
        if op.outputs[i].get_shape().is_fully_defined():
          continue
        node_stat_dims = node_stat_out.tensor_description.shape.dim
        node_stat_shape = tensor_shape.TensorShape(
            [d.size for d in node_stat_dims])
        try:
          op.outputs[i].set_shape(op.outputs[i].get_shape().merge_with(
              node_stat_shape))
        except ValueError as e:
          sys.stderr.write('Node %s incompatible shapes: %s.\n' %
                           (node_stat.node_name, e))
  return graph

def _get_logged_ops(graph, run_meta=None, add_trace=True):
  """Extract trainable model parameters and FLOPs for ops from a Graph.

  Args:
    graph: tf.Graph.
    run_meta: RunMetadata proto used to complete shape information.
    add_trace: Whether to add op trace information.
  Returns:
    logged_ops: dict mapping from op_name to OpLogEntry.
  """
  if run_meta:
    graph = _fill_missing_graph_shape(graph, run_meta)

  op_missing_shape = 0
  logged_ops = {}
  for op in graph.get_operations():
    try:
      stats = ops.get_stats_for_node_def(
          graph, op.node_def, REGISTERED_FLOP_STATS)
    except ValueError:
      # Catch Exception When shape is incomplete. Skip it.
      op_missing_shape += 1
      stats = None

    entry = tfprof_log_pb2.OpLogEntry()
    entry.name = op.name
    add_entry = False
    if stats and stats.value:
      entry.float_ops = int(stats.value)
      add_entry = True

    if add_trace:
      for tb in op.traceback:
        trace = entry.code_def.traces.add()
        trace.file = tb[0] if tb[0] else 'none'
        trace.lineno = tb[1] if tb[1] else -1
        trace.function = tb[2] if tb[2] else 'none'
        trace.line = tb[3] if tb[3] else 'none'
      add_entry = True

    if add_entry:
      logged_ops[entry.name] = entry

  for v in graph.get_collection(ops.GraphKeys.TRAINABLE_VARIABLES):
    if v.op.name not in logged_ops:
      entry = tfprof_log_pb2.OpLogEntry()
      entry.name = v.op.name
      entry.types.append(TRAINABLE_VARIABLES)
      logged_ops[entry.name] = entry
    else:
      logged_ops[v.op.name].types.append(TRAINABLE_VARIABLES)
  if op_missing_shape > 0 and not run_meta:
    sys.stderr.write('%d ops no flops stats due to incomplete shapes. '
                     'Consider passing run_meta to use run_time shapes.\n' %
                     op_missing_shape)
  return logged_ops

def _merge_default_with_oplog(graph, op_log=None, run_meta=None,
                              add_trace=True):
  """Merge the tfprof default extra info with caller's op_log.

  Args:
    graph: tf.Graph.
    op_log: OpLog proto.
    run_meta: RunMetadata proto used to complete shape information.
    add_trace: Whether to add op trace information.
  Returns:
    tmp_op_log: Merged OpLog proto.
  """
  tmp_op_log = tfprof_log_pb2.OpLog()
  logged_ops = _get_logged_ops(graph, run_meta, add_trace=add_trace)
  if not op_log:
    tmp_op_log.log_entries.extend(logged_ops.values())
  else:
    all_ops = dict()
    for entry in op_log.log_entries:
      all_ops[entry.name] = entry
    for op_name, entry in six.iteritems(logged_ops):
      if op_name in all_ops:
        all_ops[op_name].types.extend(entry.types)
        if entry.float_ops > 0 and all_ops[op_name].float_ops == 0:
          all_ops[op_name].float_ops = entry.float_ops
        if entry.code_def.traces and not all_ops[op_name].code_def.traces:
          all_ops[op_name].code_def.MergeFrom(entry.code_def)
      else:
        all_ops[op_name] = entry
    tmp_op_log.log_entries.extend(all_ops.values())
  return tmp_op_log

def write_op_log(graph, log_dir, op_log=None, run_meta=None, add_trace=True):
  """Log provided 'op_log', and add additional model information below.

    The API also assigns ops in tf.trainable_variables() an op type called
    '_trainable_variables'.
    The API also logs 'flops' statistics for ops with op.RegisterStatistics()
    defined. flops calculation depends on Tensor shapes defined in 'graph',
    which might not be complete, 'run_meta', if provided, completes the shape
    information with best effort.

  Args:
    graph: tf.Graph.
    log_dir: directory to write the log file.
    op_log: (Optional) OpLog proto to be written. If not provided, an new
        one is created.
    run_meta: (Optional) RunMetadata proto that helps flops computation using
        run time shape information.
    add_trace: Whether to add op trace information. Used to support "code" view.
  """
  op_log = _merge_default_with_oplog(graph, op_log, run_meta, add_trace)

  with gfile.Open(os.path.join(log_dir, 'tfprof_log'), 'w') as log:
    log.write(op_log.SerializeToString())

{'repo_name': 'ryfeus/lambda-packs', 'stars': '940', 'repo_language': 'Python', 'file_name': 'six.py', 'mime_type': 'text/x-python', 'hash': -2046424911283835337, 'source_dataset': 'data'}


#ifndef _LINUX_RECIPROCAL_DIV_WRAPPER_H
#define _LINUX_RECIPROCAL_DIV_WRAPPER_H 1

#include <linux/types.h>

/*
 * This algorithm is based on the paper "Division by Invariant
 * Integers Using Multiplication" by Torbjörn Granlund and Peter
 * L. Montgomery.
 *
 * The assembler implementation from Agner Fog, which this code is
 * based on, can be found here:
 * http://www.agner.org/optimize/asmlib.zip
 *
 * This optimization for A/B is helpful if the divisor B is mostly
 * runtime invariant. The reciprocal of B is calculated in the
 * slow-path with reciprocal_value(). The fast-path can then just use
 * a much faster multiplication operation with a variable dividend A
 * to calculate the division A/B.
 */

#define reciprocal_value rpl_reciprocal_value
struct reciprocal_value {
	u32 m;
	u8 sh1, sh2;
};

struct reciprocal_value rpl_reciprocal_value(u32 d);

#define reciprocal_divide rpl_reciprocal_divide
static inline u32 rpl_reciprocal_divide(u32 a, struct reciprocal_value R)
{
	u32 t = (u32)(((u64)a * R.m) >> 32);
	return (t + ((a - t) >> R.sh1)) >> R.sh2;
}

#endif /* _LINUX_RECIPROCAL_DIV_WRAPPER_H */

{'repo_name': 'openvswitch/ovs', 'stars': '2290', 'repo_language': 'C', 'file_name': 'opt_xensource_libexec_InterfaceReconfigureBridge.py', 'mime_type': 'text/x-python', 'hash': -8222293644092308338, 'source_dataset': 'data'}


diff --git a/CMakeLists.txt b/CMakeLists.txt
index 41a2124..4e214eb 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -143,7 +143,7 @@ if(SNAPPY_BUILD_TESTS)
       "${PROJECT_SOURCE_DIR}/snappy-test.cc"
   )
   target_compile_definitions(snappy_unittest PRIVATE -DHAVE_CONFIG_H)
-  target_link_libraries(snappy_unittest snappy ${GFLAGS_LIBRARIES})
+  target_link_libraries(snappy_unittest snappy ${GFLAGS_LIBRARIES} ${GTEST_LIBRARIES} pthread)

   if(HAVE_LIBZ)
     target_link_libraries(snappy_unittest z)

{'repo_name': 'nebulasio/go-nebulas', 'stars': '709', 'repo_language': 'Go', 'file_name': 'main.go', 'mime_type': 'text/x-c', 'hash': 1097609004592769210, 'source_dataset': 'data'}


---
date_added: 2020-06-24
title: Natural Gas (CH4) Alarm
model: PA-210WYS
category: sensor
type: Gas Sensor
standard: global
flash: tuya-convert
image: /assets/images/PA-210WYS.jpg
template: '{"NAME":"PA-210WYS","GPIO":[255,107,255,108,255,255,0,0,255,255,255,255,255],"FLAG":0,"BASE":54}'
link: https://www.aliexpress.com/item/4001057961462.html
link2:
---

 by blakadder

This is a Tuya natural gas (CH4) sensor with an LCD display and alarm function. It has a TYWE3S module and an Eastsoft HR8P506FHLQ MCU.

Identified with MCU Product ID: `{"p":"sclatjo1jqscmwwe","v":"1.0.0","m":0}`.

## Functions
`dpID 1` gas: 0 = detected gas / 1 = no gas
`dpID 2` gas amount = displayed %LEL value *10
`dpID 11` error state: 0x00 = default / 0x02 = gas detected
`dpID 16` mute sound: 0 = nothing / 1 = mutes currently playing sound

Sensor uses the built in speaker as an alarm and to play an array of voice prompts following almost every action:

The speaker and onboard led are controlled by the MCU and there is no way to control them by software.

Temperature is not reported on any dpId (same behaviour as in original firmware) and is only displayed on the built-in LCD.

On the back is a 2pin JST connector with pins labelled `+` and `-` which is supposed to be used with an electric valve to trigger automatic shutoff when gas is detected.

## Configuration
Please read [TuyaMCU](https://tasmota.github.io/docs/TuyaMCU) article to understand the terminology and configuration process.

Change device to a TuyaMCU module (or apply the provided template, result is the same)
```console
Module 54
```

Set the following configuration:
```json
Backlog TuyaMCU 11,1; TuyaMCU 12,16; TuyaMCU 51,51
```

## Functions
Gas sensor status will be mapped to POWER1. ON is "gas detected" and OFF is "no gas detected".

POWER2 can be turned on to stop currently playing sound/voice prompt.

Gas value is sent on dpId2. Use a rule to send it to a custom topic:

```console
Rule1 ON TuyaReceived#dptype2id2 DO Publish stat/%topic%/GAS %value% ENDON
```
Enable rule with `Rule1 1`

Label webUI buttons
```console
Backlog WebButton1 Gas; WebButton2 Mute
```

{'repo_name': 'blakadder/templates', 'stars': '102', 'repo_language': 'HTML', 'file_name': 'page.html', 'mime_type': 'text/plain', 'hash': -5167815108657220104, 'source_dataset': 'data'}


/*
 * Scala (https://www.scala-lang.org)
 *
 * Copyright EPFL and Lightbend, Inc.
 *
 * Licensed under Apache License 2.0
 * (http://www.apache.org/licenses/LICENSE-2.0).
 *
 * See the NOTICE file distributed with this work for
 * additional information regarding copyright ownership.
 */

package scala.tools.nsc
package doc
package base
package comment

import scala.collection._

/** A Scaladoc comment and all its tags.
  *
  * '''Note:''' the only instantiation site of this class is in [[model.CommentFactory]].
  *
  * @author Manohar Jonnalagedda
  * @author Gilles Dubochet */
abstract class Comment {

  /** The main body of the comment that describes what the entity does and is.  */
  def body: Body

  private def closeHtmlTags(inline: Inline): Inline = {
    val stack = mutable.ListBuffer.empty[HtmlTag]
    def scan(i: Inline): Unit = {
      i match {
        case Chain(list) =>
          list foreach scan
        case tag: HtmlTag => {
          if (stack.nonEmpty && tag.canClose(stack.last)) {
            stack.remove(stack.length-1)
          } else {
            tag.close match {
              case Some(t) =>
                stack += t
              case None =>
                ;
            }
          }
        }
        case _ =>
          ;
      }
    }
    scan(inline)
    Chain(List(inline) ++ stack.reverse)
  }

  /** A shorter version of the body. Either from `@shortDescription` or the
   *  first sentence of the body. */
  def short: Inline = {
    shortDescription orElse body.summary match {
      case Some(s) =>
        closeHtmlTags(s)
      case _ =>
        Text("")
    }
  }

  /** A list of authors. The empty list is used when no author is defined. */
  def authors: List[Body]

  /** A list of other resources to see, including links to other entities or
    * to external documentation. The empty list is used when no other resource
    * is mentioned. */
  def see: List[Body]

  /** A description of the result of the entity. Typically, this provides additional
    * information on the domain of the result, contractual post-conditions, etc. */
  def result: Option[Body]

  /** A map of exceptions that the entity can throw when accessed, and a
    * description of what they mean. */
  def throws: Map[String, Body]

  /** A map of value parameters, and a description of what they are. Typically,
    * this provides additional information on the domain of the parameters,
    * contractual pre-conditions, etc. */
  def valueParams: Map[String, Body]

  /** A map of type parameters, and a description of what they are. Typically,
    * this provides additional information on the domain of the parameters. */
  def typeParams: Map[String, Body]

  /** The version number of the entity. There is no formatting or further
    * meaning attached to this value. */
  def version: Option[Body]

  /** A version number of a containing entity where this member-entity was introduced. */
  def since: Option[Body]

  /** An annotation as to expected changes on this entity. */
  def todo: List[Body]

  /** Whether the entity is deprecated. Using the `@deprecated` Scala attribute
    * is preferable to using this Scaladoc tag. */
  def deprecated: Option[Body]

  /** An additional note concerning the contract of the entity. */
  def note: List[Body]

  /** A usage example related to the entity. */
  def example: List[Body]

  /** A description for the primary constructor */
  def constructor: Option[Body]

  /** A set of diagram directives for the inheritance diagram */
  def inheritDiagram: List[String]

  /** A set of diagram directives for the content diagram */
  def contentDiagram: List[String]

  /** The group this member is part of */
  def group: Option[String]

  /** Member group descriptions */
  def groupDesc: Map[String,Body]

  /** Member group names (overriding the short tag) */
  def groupNames: Map[String,String]

  /** Member group priorities */
  def groupPrio: Map[String,Int]

  /** A list of implicit conversions to hide */
  def hideImplicitConversions: List[String]

  /** A short description used in the entity-view and search results */
  def shortDescription: Option[Text]

  override def toString =
    body.toString + "\n" +
    (authors map ("@author " + _.toString)).mkString("\n") +
    (result map ("@return " + _.toString)).mkString("\n") +
    (version map ("@version " + _.toString)).mkString
}

{'repo_name': 'scala/scala', 'stars': '12803', 'repo_language': 'Scala', 'file_name': 'm2-settings.xml', 'mime_type': 'text/xml', 'hash': 460515155398822014, 'source_dataset': 'data'}


---
license: >
    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.

title: Geolocation
---

Geolocation
===========

> The `geolocation` object provides access to the device's GPS sensor.

Geolocation provides location information for the device, such as latitude and longitude. Common sources of location information include Global Positioning System (GPS) and location inferred from network signals such as IP address, RFID, WiFi and Bluetooth MAC addresses, and GSM/CDMA cell IDs. No guarantee is given that the API returns the device's actual location.

This API is based on the [W3C Geo location API Specification](http://dev.w3.org/geo/api/spec-source.html).  Some devices already provide an implementation of this spec.  For those devices, the built-in support is used instead of replacing it with Cordova's implementation.  For devices that don't have geolocation support, Cordova's implementation should be compatible with the W3C specification.

Methods
-------

- [geolocation.getCurrentPosition](geolocation.getCurrentPosition.html)
- [geolocation.watchPosition](geolocation.watchPosition.html)
- [geolocation.clearWatch](geolocation.clearWatch.html)

Arguments
---------

- [geolocationSuccess](parameters/geolocationSuccess.html)
- [geolocationError](parameters/geolocationError.html)
- [geolocationOptions](parameters/geolocation.options.html)

Objects (Read-Only)
-------------------

- [Position](Position/position.html)
- [PositionError](PositionError/positionError.html)
- [Coordinates](Coordinates/coordinates.html)

{'repo_name': 'apache/cordova-docs', 'stars': '298', 'repo_language': 'JavaScript', 'file_name': 'media.release.md', 'mime_type': 'text/html', 'hash': 8688480851330721699, 'source_dataset': 'data'}


.syntax--ruby {
    .syntax--punctuation {
        &.syntax--separator {
            color: @cyan;
        }
    }

    .syntax--variable {
        &.syntax--block {
            color: @red;
        }

        &.syntax--instance {
            color: @red;

            .syntax--punctuation {
                color: currentColor;
            }
        }
    }
}

{'repo_name': 'atom-material/atom-material-syntax', 'stars': '226', 'repo_language': 'CSS', 'file_name': 'gfm.less', 'mime_type': 'text/plain', 'hash': -3931673275243146857, 'source_dataset': 'data'}


//
//  ParseMessage.h
//  Monal
//
//  Created by Anurodh Pokharel on 7/13/13.
//
//

#import "XMPPParser.h"
#import "XMPPMessage.h"

@interface ParseMessage : XMPPParser
{

}
@property (nonatomic, strong, readonly) NSString* stanzaId;

/**
 In the event of MUC this is ths user who really sent the message and from is the group name.
 */
@property (nonatomic, copy, readonly) NSString* actualFrom;
@property (nonatomic, copy, readonly) NSString* messageText;
@property (nonatomic, copy, readonly) NSString* subject;
@property (nonatomic, assign, readonly) BOOL hasBody;
@property (nonatomic, copy, readonly) NSDate *delayTimeStamp;
@property (nonatomic, copy, readonly) NSString* avatarData;
@property (nonatomic, copy, readonly) NSString* oobURL;
@property (nonatomic, assign, readonly) BOOL composing;
@property (nonatomic, assign, readonly) BOOL notComposing;
@property (nonatomic, copy, readonly) NSString* mamQueryId;

/** Messages that are requesting a resposne */
@property (nonatomic, assign, readonly) BOOL requestReceipt;
/** Messages that are the resposne */
@property (nonatomic, copy, readonly) NSString* receivedID;

@property (nonatomic, assign, readonly) BOOL mucInvite;
@property (nonatomic, assign, readonly) BOOL mamResult;

/** OMEMO */
@property (nonatomic, strong, readonly) NSMutableArray *devices;

@property (nonatomic, copy, readonly) NSString* sid; // sender device id
@property (nonatomic, copy, readonly) NSString* encryptedPayload;
@property (nonatomic, copy, readonly) NSString* iv;
@property (nonatomic, strong, readonly) NSMutableArray *signalKeys;

@end

{'repo_name': 'anurodhp/Monal', 'stars': '272', 'repo_language': 'Objective-C', 'file_name': 'updateLocalization.sh', 'mime_type': 'text/plain', 'hash': -7305788784417438642, 'source_dataset': 'data'}


#pragma kernel InitPredators
#pragma kernel EmitPredators
#pragma kernel InteractPredators
#pragma kernel UpdatePredators

#pragma kernel Wrap

#define THREAD [numthreads(256, 1, 1)]

#include "../Common/Random.cginc"
#include "../Common/Predator.cginc"

#include "../Common/MembraneNode.cginc"
#include "../Common/MembraneEdge.cginc"

AppendStructuredBuffer<uint> _PredatorPoolAppend;
ConsumeStructuredBuffer<uint> _PredatorPoolConsume;

StructuredBuffer<Predator> _PredatorsRead;
RWStructuredBuffer<Predator> _Predators;
int _EmitCount, _PredatorsCount;

StructuredBuffer<MembraneNode> _MembraneNodes;
StructuredBuffer<MembraneEdge> _MembraneEdges;
int _MembraneNodesCount;

float _DT, _Time;
float _Limit, _Drag;
float _Rate;
float _Tension;
float4 _Point;

Predator create()
{
    Predator c;
    c.position = float2(0, 0);
    c.velocity = c.force = float2(0, 0);
    c.radius = 1;
    c.stress = 0;
    c.alive = true;
    return c;
}

float proj_distance(float2 a, float2 b, float2 p, out float2 proj)
{
    float2 ba = b - a;
    float lba = length(ba);
    float2 nba = normalize(ba);

    float2 pa = p.xy - a;
    float l = dot(pa, nba);
    proj = nba * l + a;
    return distance(p.xy, proj);
}

bool encloses(float2 p)
{
    bool c = false;
    for (int i = 0; i < _MembraneNodesCount; i++)
    {
        MembraneEdge e = _MembraneEdges[i];
        if (!e.alive)
            continue;

        MembraneNode na = _MembraneNodes[e.a];
        MembraneNode nb = _MembraneNodes[e.b];
        if (!na.alive || !nb.alive)
            continue;

        float2 a = na.position;
        float2 b = nb.position;
        if (((a.y > p.y) != (b.y > p.y)) && (p.x < (b.x - a.x) * (p.y - a.y) / (b.y - a.y) + a.x))
        {
            c = !c;
        }
    }
    return c;
}

int find_closest_edge(float2 p)
{
    int closest = -1;
    float minDist = 100000;

    for (int i = 0; i < _MembraneNodesCount; i++)
    {
        MembraneEdge e = _MembraneEdges[i];
        if (!e.alive)
            continue;

        MembraneNode na = _MembraneNodes[e.a];
        MembraneNode nb = _MembraneNodes[e.b];
        if (!na.alive || !nb.alive)
            continue;

        float2 proj;
        float d = proj_distance(na.position, nb.position, p, proj);
        if (d < minDist)
        {
            closest = i;
            minDist = d;
        }
    }

    return closest;
}

THREAD
void InitPredators (uint3 id : SV_DispatchThreadID)
{
    int idx = (int) id.x;
    if (_PredatorsCount <= idx) return;

    _Predators[idx].alive = false;
    _PredatorPoolAppend.Append(idx);
}

THREAD
void EmitPredators (uint3 id : SV_DispatchThreadID)
{
    if ((uint)_EmitCount <= id.x) return;

    float2 offset = random_point_on_circle(id.xx + float2(0, _Time));

    uint idx = _PredatorPoolConsume.Consume();
    Predator c = create();
    c.position = offset * 5;
    c.radius = 0.25;
    _Predators[idx] = c;
}

THREAD
void InteractPredators (uint3 id : SV_DispatchThreadID)
{
    int idx = (int) id.x;
    if (_PredatorsCount <= idx)
        return;

    Predator c = _PredatorsRead[idx];
    if (!c.alive)
    {
        _Predators[idx] = c;
        return;
    }

    for (int i = 0; i < _PredatorsCount; i++)
    {
        if (idx == i)
            continue;

        Predator other = _PredatorsRead[i];
        if (!other.alive)
            continue;

        float2 dir = c.position - other.position;
        float l = length(dir);
        float r = c.radius + other.radius;
        if (0 < l && l < r)
        {
            c.force += normalize(dir) * (r - l);
        }
    }

    _Predators[idx] = c;
}

THREAD
void UpdatePredators (uint3 id : SV_DispatchThreadID)
{
    int idx = (int) id.x;
    if (_PredatorsCount <= idx) return;

    Predator c = _Predators[idx];
    if (!c.alive) return;

    float2 repulse = _Point.xy - c.position.xy;
    float lr = length(repulse);
    float nl = saturate(1.0 - lr * _Point.w);
    c.force += - normalize(repulse) * nl * 0.1;

    c.velocity += c.force;
    c.velocity += random_point_on_circle(id.xy + float2(0, _Time));
    float2 vel = c.velocity * _DT;
    float vl = length(vel);
    if (0 < vl)
    {
        c.position += normalize(vel) * min(vl, _Limit);
    }
    c.radius = max(0.25, c.radius - _DT * 0.5);
    c.velocity *= _Drag;
    c.force = float2(0, 0);
    _Predators[idx] = c;
}

THREAD
void RemovePredators (uint3 id : SV_DispatchThreadID)
{
    int idx = (int) id.x;
    if (_PredatorsCount <= idx)
        return;

    Predator c = _Predators[idx];
    if (c.alive && c.stress >= 1.0)
    {
        c.alive = false;
        _PredatorPoolAppend.Append(idx);
    }
    _Predators[idx] = c;
}

THREAD
void Wrap (uint3 id : SV_DispatchThreadID)
{
    int idx = (int) id.x;
    if (_PredatorsCount <= idx)
        return;

    Predator c = _Predators[idx];
    if (!c.alive)
    {
        _Predators[idx] = c;
        return;
    }

    if (!encloses(c.position))
    {
        int closest = find_closest_edge(c.position);
        if (closest >= 0)
        {
            MembraneEdge e = _MembraneEdges[closest];
            float2 v = _MembraneNodes[e.a].position - _MembraneNodes[e.b].position;
            float2 perp = float2(-v.y, v.x);
            c.force += -normalize(perp) * _Tension;
            c.stress = saturate(c.stress + _DT);
        }
    }
    _Predators[idx] = c;
}

{'repo_name': 'mattatz/CellularGrowth', 'stars': '201', 'repo_language': 'C#', 'file_name': 'AudioManager.asset', 'mime_type': 'text/plain', 'hash': 8114414584027633162, 'source_dataset': 'data'}


//
//  main.m
//  CGCalendarViewDemo
//
//  Created by Chen Liang on 5/14/14.
//  Copyright (c) 2014 CapitalGene. All rights reserved.
//

#import <UIKit/UIKit.h>

#import "CGAppDelegate.h"

int main(int argc, char * argv[])
{
    @autoreleasepool {
        return UIApplicationMain(argc, argv, nil, NSStringFromClass([CGAppDelegate class]));
    }
}

{'repo_name': 'CapitalGene/objc-CGCalendarView', 'stars': '132', 'repo_language': 'Objective-C', 'file_name': 'contents.xcworkspacedata', 'mime_type': 'text/xml', 'hash': 4267690684246573682, 'source_dataset': 'data'}


/*---------------------------------------------------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Copyright (C) 2011-2019 OpenFOAM Foundation
     \\/     M anipulation  |
-------------------------------------------------------------------------------
License
    This file is part of OpenFOAM.

    OpenFOAM is free 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.

    OpenFOAM 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 OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.

\*---------------------------------------------------------------------------*/

#include "C.H"
#include "addToRunTimeSelectionTable.H"

// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //

namespace Foam
{
    defineTypeNameAndDebug(C, 0);
    addToRunTimeSelectionTable(solidProperties, C,);
    addToRunTimeSelectionTable(solidProperties, C, dictionary);
}

// * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //

Foam::C::C()
:
    solidProperties(2010, 710, 0.04, 0.0, 1.0)
{
    if (debug)
    {
        WarningInFunction
            << "Properties of graphite need to be checked!!!"
            << endl;
    }
}

Foam::C::C(const dictionary& dict)
:
    C()
{
    readIfPresent(dict);
}

// * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //

void Foam::C::write(Ostream& os) const
{
    solidProperties::write(os);
}

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

{'repo_name': 'OpenFOAM/OpenFOAM-dev', 'stars': '633', 'repo_language': 'C++', 'file_name': 'tensorOperator.sty', 'mime_type': 'text/plain', 'hash': -1220237230495412869, 'source_dataset': 'data'}


//
//  UserInfoViewController.m
//  SportsContact
//
//  Created by bobo on 14-7-9.
//  Copyright (c) 2014年 CAF. All rights reserved.
//

#import "UserInfoViewController.h"
#import "InfoEngine.h"
#import "MatchEngine.h"
#import <UIImageView+WebCache.h>
#import "ViewUtil.h"
#import "LocationInfoManager.h"
#import "DateUtil.h"
#import "MainNavigationController.h"
#import "NoticeManager.h"
#import "ValueSelectionViewController.h"
#import "UIImage+Util.h"
#import <BmobSDK/Bmob.h>
#import "TeamEngine.h"
#import "BPush.h"
#import "BPushUtil.h"

#define kUserInfoCellBase @"base_cell"
#define kUserInfoCellData @"data_cell"
#define kUserInfoCellControll1 @"controll1_cell"
#define kUserInfoCellControll2 @"controll2_cell"
#define kUserInfoCellExploits @"exploits_cell"
#define kUserInfoCellSchedule @"schedule_cell"
#define kUserInfoCellLoading @"loading_cell"

#import "CHTumblrMenuView.h"
#import <ShareSDK/ShareSDK.h>

#define IMAGE_NAME @"sharesdk_img"
#define IMAGE_EXT @"jpg"

#define TITLE @"测试_Title"
#define CONTENT @"测试_Content"
#define URL @"http://www.baidu.com"

#import "AppDelegate.h"

@interface UserInfoViewController () <ValueSelectionDelegate>

//@property (nonatomic,strong) UserInfo *userInfo;

@property (weak, nonatomic) IBOutlet UIView *settingToolView;
@property (weak, nonatomic) IBOutlet UILabel *teamNameLabel;
@property (nonatomic) BOOL isSetting;
@property (nonatomic, strong) NSArray *dataSource;
@property (nonatomic, assign) BOOL isExploitsLoaded;
@property (nonatomic, assign) BOOL isScheduleLoaded;
@property (nonatomic, strong) NSArray *exploits;
@property (nonatomic, strong) NSArray *schedule;
@property (nonatomic, strong) NSArray *teams;
@property (nonatomic, weak) NSTimer *timer;

@property (strong, nonatomic)  NSString *shareTitle;
@property (strong, nonatomic)  NSString *shareContent;
@property (strong, nonatomic)  NSString *shareUrl;
@property (assign) BOOL  bmobInitSuccessful;

@property (strong, nonatomic) UIView *tipview;

@end

@implementation UserInfoViewController
@synthesize tipview = _tipview;

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];

    self.bmobInitSuccessful = NO;

    self.title = @"个人中心";
    self.dataSource = [NSMutableArray arrayWithCapacity:0];
    self.isSetting = NO;
    self.isExploitsLoaded = NO;
    self.isScheduleLoaded = NO;
    if ([self.userInfo.objectId isEqualToString:[BmobUser getCurrentUser].objectId])
    {
        self.viewType = UserInfoViewTypeOwn;
    }

    if (self.viewType != UserInfoViewTypeOwn)
    {
        self.dataSource = @[kUserInfoCellBase, kUserInfoCellData, kUserInfoCellControll2, kUserInfoCellExploits, kUserInfoCellSchedule];
    }else
    {
        UIButton *rightBtn = [self rightButtonWithImage:[UIImage imageNamed:@"btn_setting"] hightlightedImage:[UIImage imageNamed:@"btn_setting_hl"]];
        [rightBtn addTarget:self action:@selector(onSetting:) forControlEvents:UIControlEventTouchUpInside];
        self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:rightBtn];
        self.dataSource = @[kUserInfoCellBase, kUserInfoCellData, kUserInfoCellControll1, kUserInfoCellExploits, kUserInfoCellSchedule];
        self.userInfo = [[UserInfo alloc] initWithDictionary:[BmobUser getCurrentUser]];
    }
    [self.tableView reloadData];

    self.settingToolView.hidden = YES;
    UIView *toolView = [self.settingToolView viewWithTag:0xF0];
    [ViewUtil addSingleTapGestureForView:toolView target:self action:@selector(onSetting:)];

    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(needRefresh) name:kObserverUserInfoChanged object:nil];
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(needRefresh) name:kObserverMatchInfoChanged object:nil];
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(needRefresh) name:kObserverMatchAdded object:nil];

//    AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;

//    if (appDelegate.bmobInitState) {
//        [self loadUserInfo];
//    }else{
//        [[NSNotificationCenter defaultCenter] removeObserver:self name:kBmobInitSuccessNotification object:nil];
//        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(loadUserInfo) name:kBmobInitSuccessNotification object:nil];
//    }

//    [self showLoadingView];

    self.refreshControl = [[ODRefreshControl alloc] initInScrollView:self.tableView];
    [self.refreshControl addTarget:self action:@selector(dropViewDidBeginRefreshing:) forControlEvents:UIControlEventValueChanged];

    // Do any additional setup after loading the view.
    _tipview = [[UIView alloc] init];

}

-(void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
}

- (void)dropViewDidBeginRefreshing:(ODRefreshControl *)refreshControl
{
    [self loadUserInfoWithHandler:^{
        [refreshControl   endRefreshing];
    }];
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (void)viewDidAppear:(BOOL)animated
{
    [super viewDidAppear:animated];
//    if (self.isNeedRefresh)
//    {

//
//    AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
//    if (appDelegate.bmobInitState) {

        self.isNeedRefresh = NO;
        [self showLoadingView];
        [self loadUserInfoWithHandler:^{
            [self hideLoadingView];
        }];

//    }

    NSTimer *timer = [NSTimer scheduledTimerWithTimeInterval:4.0 target:self selector:@selector(updateTeamName) userInfo:nil repeats:YES];
    self.timer = timer;
}

- (void)viewWillDisappear:(BOOL)animated
{
    [super viewWillDisappear:animated];
    if (self.timer)
    {
        [self.timer invalidate];
        self.timer = nil;
    }
    [self hideSettingToolView];
    self.isSetting = NO;
}

-(void)loadUserInfo{

//    self.bmobInitSuccessful = YES;
//    __weak typeof(self) weakSelf = self;
//    [weakSelf loadUserInfoWithHandler:^{
        [self hideLoadingView];
//    }];
}

- (void)showSettingToolView
{
    self.settingToolView.hidden = NO;

    UIView *bgView = [self.settingToolView viewWithTag:0xF0];
    UIView *toolView = [self.settingToolView viewWithTag:0xF1];
    [UIView animateWithDuration:0.4 animations:^{
        CGRect frame = toolView.frame;
        frame.origin.y = 0;
        toolView.frame  = frame;
        bgView.alpha = 0.3;
    } completion:nil];
}

- (void)hideSettingToolView
{
    UIView *bgView = [self.settingToolView viewWithTag:0xF0];
    UIView *toolView = [self.settingToolView viewWithTag:0xF1];
    [UIView animateWithDuration:0.4 animations:^{
        CGRect frame = toolView.frame;
        frame.origin.y = - frame.size.height;
        toolView.frame  = frame;
        bgView.alpha = 0;
    } completion:^(BOOL finished) {
        self.settingToolView.hidden = YES;
    }];
}

- (void)loadUserInfoWithHandler:(void (^)())handler
{
    [InfoEngine getInfoWithUserId:self.userInfo.objectId block:^(id result, NSError *error) {
        if (handler) {
            handler ();
        }

        if (error) {
            [self showMessage:[Util errorStringWithCode:error.code]];
        }else
        {
            self.userInfo = result;
            if (self.viewType != UserInfoViewTypeOwn)
            {
                self.isExploitsLoaded = NO;
                self.isScheduleLoaded = NO;
                __weak typeof(self)weakSelf = self;
                [self loadTeamsData:^{
                    [weakSelf loadExploitsData];
                }];

                [self loadScheduleData];

                if (!self.ownTeams) {
                    [self loadOwnTeamsData];
                }

            }else
            {
                self.isExploitsLoaded = NO;
                self.isScheduleLoaded = NO;
                __weak typeof(self)weakSelf = self;
                [self loadTeamsData:^{
                    [weakSelf loadExploitsData];
                }];

                [self loadScheduleData];

            }
            [self.tableView reloadData];
        }
    }];
}
- (void)loadOwnTeamsData
{
    [InfoEngine getTeamsWithUserId:[BmobUser getCurrentUser].objectId block:^(id result, NSError *error) {
        if (error) {
            [self showMessage:[Util errorStringWithCode:error.code]];
        }else
        {
            self.ownTeams = result;
            NSInteger controllIndex = [self.dataSource indexOfObject:kUserInfoCellControll2];
            if (controllIndex != NSNotFound)
            {
                NSIndexPath *indexPath = [NSIndexPath indexPathForRow:controllIndex inSection:0];
                [self.tableView reloadRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationAutomatic];
            }

        }
    }];
}

- (void)loadTeamsData:(void(^)())block
{
//    [self showLoadingView];
    self.teamNameLabel.text = @"正在加载...";
    [InfoEngine getTeamsWithUserId:self.userInfo.objectId block:^(id result, NSError *error) {
//        [self hideLoadingView];

        if (error) {
            [self showMessage:[Util errorStringWithCode:error.code]];
            self.teamNameLabel.text = @"加载失败，请刷新！";
        }else
        {
            self.teams = result;
            NSInteger baseIndex = [self.dataSource indexOfObject:kUserInfoCellBase];
            if (baseIndex != NSNotFound)
            {
                NSIndexPath *indexPath = [NSIndexPath indexPathForRow:baseIndex inSection:0];
                [self.tableView reloadRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationAutomatic];
            }
            if ([self.teams count] == 0) {
                 self.teamNameLabel.text = @"暂无";
            }
        }

        if (block) {
            block();
        }
    }];
}

- (void)loadExploitsData
{
    [InfoEngine getPlayerScoreWithUserId:self.userInfo.objectId block:^(id result, NSError *error)
    {
        self.isExploitsLoaded = YES;
        if (error)
        {
            [self showMessage:[Util errorStringWithCode:error.code]];
        }else
        {
            self.exploits = result;
            NSInteger index = [self.dataSource indexOfObject:kUserInfoCellExploits];
//            NSLog(@"index %ld",(long)index);
            if (index != NSNotFound)
            {
                NSIndexPath *indexPath = [NSIndexPath indexPathForRow:index inSection:0];
                [self.tableView reloadRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationAutomatic];
            }
        }
    }];
}

- (void)loadScheduleData
{
    [InfoEngine getScheduleMatchWithUserId:self.userInfo.objectId block:^(id result, NSError *error)
     {
         self.isScheduleLoaded = YES;
         if (error)
         {
             [self showMessage:[Util errorStringWithCode:error.code]];
         }else
         {
             self.schedule = result;
             NSInteger index = [self.dataSource indexOfObject:kUserInfoCellSchedule];
             if (index != NSNotFound)
             {
                 NSIndexPath *indexPath = [NSIndexPath indexPathForRow:index inSection:0];
                 [self.tableView reloadRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationAutomatic];
             }
         }

     }];
}

#pragma mark - Push
- (void)addFriendPush
{
    UserInfo *selfUser = [[UserInfo alloc] initWithDictionary:[BmobUser getCurrentUser]];

    NSString *content =[NSString stringWithFormat:@"%@添加你为好友", selfUser.nickname ? selfUser.nickname : selfUser.username];
    Notice *msg = [[Notice alloc] init];
    msg.aps = [ApsInfo apsInfoWithAlert:content badge:0 sound:nil];
    msg.time = [[NSDate date] timeIntervalSince1970];
    msg.belongId = selfUser.username;
    msg.targetId = selfUser.objectId;
    msg.title = selfUser.nickname ? selfUser.nickname : selfUser.username;
//    msg.content = content;
    msg.type = NoticeTypePersonal;
    msg.subtype = NoticeSubtypeAddFriend;

    [[NoticeManager sharedManager] pushNotice:msg toUsername:self.userInfo.username];
}

- (void)invitePushWithTeam:(Team *)team
{
    if(!team.captain.username)
    {
        [self showMessage:@"球队未设置队长"];
        return;
    }
    Notice *msg = [[Notice alloc] init];
    NSString *toUsername = nil;
     UserInfo *selfUser = [[UserInfo alloc] initWithDictionary:[BmobUser getCurrentUser]];
    NSString *content = nil;
    if ([team.captain.username isEqualToString:selfUser.username])
    {
        content = [NSString stringWithFormat:@"邀请您加入%@",team.name];
        //[NSString stringWithFormat:@"%@队长邀请您加入球队", team.name];
        msg.subtype = NoticeSubtypeCaptainInvitation;
        msg.targetId = team.objectId;
        toUsername = self.userInfo.username;
    }else
    {
        NSString *selfUsername     = selfUser.nickname ? selfUser.nickname : selfUser.username;
        NSString *selfUserInfoName = self.userInfo.nickname ? self.userInfo.nickname : self.userInfo.username;
        content                    = [NSString stringWithFormat:@"%@邀请%@加入他所在的球队%@",selfUsername , selfUserInfoName ,team.name];
        msg.subtype                = NoticeSubtypeMemberInvitation;
        //targetId team的objectId和用户名
        msg.targetId               = [NSString stringWithFormat:@"%@&%@", team.objectId, self.userInfo.username];
        toUsername                 = team.captain.username;
        msg.title                  = [NSString stringWithFormat:@"%@&%@",selfUsername,team.name];
    }
    msg.aps = [ApsInfo apsInfoWithAlert:content badge:0 sound:nil];
    msg.time = [[NSDate date] timeIntervalSince1970];
    msg.belongId = selfUser.username;
    msg.title = team.name;
//    msg.content = content;
    msg.type = NoticeTypeTeam;
    [[NoticeManager sharedManager] pushNotice:[msg copy] toUsername:toUsername];
    [self showMessage:@"已发出邀请!"];
}

- (void)deleteTeammatePushWithTeam:(Team *)team
{
    UserInfo *selfUser = [[UserInfo alloc] initWithDictionary:[BmobUser getCurrentUser]];

    NSString *content =[NSString stringWithFormat:@"将您踢出球队"];
    Notice *msg = [[Notice alloc] init];
    msg.aps = [ApsInfo apsInfoWithAlert:content badge:0 sound:nil];
    msg.time = [[NSDate date] timeIntervalSince1970];
    msg.belongId = selfUser.username;
    msg.targetId = team.objectId;
    msg.title = team.name;
    //    msg.content = content;
    msg.type = NoticeTypeTeam;
    msg.subtype = NoticeSubtypeTeamKickout;

    [[NoticeManager sharedManager] pushNotice:msg toUsername:self.userInfo.username];
}

#pragma mark - Private methods

- (void)updateTeamName
{
    if (self.teamNameLabel && [self.teams count] > 0) {
        for (Team *team in self.teams)
        {
            if (![self.teamNameLabel.text isEqualToString:team.name]) {
                CATransition *transition = [CATransition animation];
                transition.duration = 0.4f;

                transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
                transition.type = kCATransitionFade;
                self.teamNameLabel.text = team.name;
                [self.teamNameLabel.layer addAnimation:transition forKey:nil];
                break;
            }
        }
    }

}

- (NSArray *)getCanInviteTeams
{
    NSMutableArray *ownTeams = [NSMutableArray arrayWithCapacity:0];
    for (Team *ownTeam in self.ownTeams)
    {
        BOOL isExist = NO;
        for (Team *team in self.teams) {
            if ([ownTeam.objectId isEqualToString:team.objectId])
            {
                isExist = YES;
            }
        }
        if (isExist)
            continue;
        [ownTeams addObject:ownTeam];
    }
    return ownTeams;
}

#pragma mark - ValueSelectionDelegate

- (void)valueSelection:(id)valueSelection didSaveAtIndex:(NSInteger)index
{
    Team *team = [self.ownTeams objectAtIndex:index];
    [self invitePushWithTeam:team];
}

#pragma mark - UITableViewDelegate, UITableViewDataSource

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    NSString *item = [self.dataSource objectAtIndex:indexPath.row];
    if ([item  isEqualToString:kUserInfoCellBase])
    {
        return 93.0;
    }else if ([item  isEqualToString:kUserInfoCellData])
    {
        return 126.0;
    }else if ([item  isEqualToString:kUserInfoCellControll1])
    {
        return 43.0;
    }else if ([item  isEqualToString:kUserInfoCellControll2])
    {
        return 43.0;
    }else if ([item  isEqualToString:kUserInfoCellSchedule])
    {
        return 101.0;
    }else if ([item  isEqualToString:kUserInfoCellExploits])
    {
        return 101.0;
    }else
    {
        return 44.0;
    }

}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    NSString *item = [self.dataSource objectAtIndex:indexPath.row];
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:item];
    if ([item  isEqualToString:kUserInfoCellBase])
    {
        UIImageView *avatarImageView = (id)[cell.contentView viewWithTag:0xF0];
        avatarImageView.layer.cornerRadius =avatarImageView.bounds.size.height / 2.0;
        [avatarImageView sd_setImageWithURL:[NSURL URLWithString:self.userInfo.avator.url] placeholderImage:[UIImage defaultAvatarImage] completed:nil];

        UILabel *nameLabel = (id)[cell.contentView viewWithTag:0xF1];
        nameLabel.text = self.userInfo.nickname ? self.userInfo.nickname : self.userInfo.username;

        UILabel *ageLabel = (id)[cell.contentView viewWithTag:0xF2];
        ageLabel.text = self.userInfo.birthday ? [NSString stringWithFormat:@"%ld岁", (long)[Util calAgeWithBirthDay:self.userInfo.birthday]] :@"未设置";

        UILabel *teamLabel = (id)[cell.contentView viewWithTag:0xF3];
        self.teamNameLabel = teamLabel;
        if (!self.teams) {
            teamLabel.text = @"";
        }else
        {
            if ([self.teams count] > 0)
            {
                teamLabel.text = [[self.teams firstObject] name];
            }else
            {
                teamLabel.text = @"暂无";
            }
        }

        UILabel *fieldLabel = (id)[cell.contentView viewWithTag:0xF4];
        fieldLabel.text = self.userInfo.midfielder ? positioningTypeStringFromEnum([self.userInfo.midfielder integerValue]) : @"暂无";
        UILabel *cityLabel = (id)[cell.contentView viewWithTag:0xF5];

        if ([self.userInfo.city integerValue] > 0)
        {
            LocationInfo *locInfo = [[LocationInfoManager sharedManager] locationInfoOfCode:[NSNumber numberWithInteger:[self.userInfo.city integerValue]]];
            cityLabel.text = [NSString stringWithFormat:@"%@ %@", locInfo.cityName, locInfo.districtName ? locInfo.districtName : @""];
        }else
        {
            cityLabel.text = @"暂无";
        }

    }else if ([item  isEqualToString:kUserInfoCellData])
    {
        UILabel *entryAuthCountLabel = (id)[cell.contentView viewWithTag:0xF0];
        entryAuthCountLabel.text = [NSString stringWithFormat:@"%ld", (long)[self.userInfo.games integerValue]];
        UILabel *entryCountLabel = (id)[cell.contentView viewWithTag:0xF1];
        entryCountLabel.text = [NSString stringWithFormat:@"%ld", (long)[self.userInfo.gamesTotal integerValue]];

        UILabel *assistsAuthCountLabel = (id)[cell.contentView viewWithTag:0xF2];
        assistsAuthCountLabel.text = [NSString stringWithFormat:@"%ld", (long)[self.userInfo.assists integerValue]];
        UILabel *assistsCountLabel = (id)[cell.contentView viewWithTag:0xF3];
        assistsCountLabel.text =  [NSString stringWithFormat:@"%ld", (long)[self.userInfo.assistsTotal integerValue]];

        UILabel *goalsAuthCountLabel = (id)[cell.contentView viewWithTag:0xF4];
        goalsAuthCountLabel.text =  [NSString stringWithFormat:@"%ld", (long)[self.userInfo.goals integerValue]];
        UILabel *goalsCountLabel = (id)[cell.contentView viewWithTag:0xF5];
        goalsCountLabel.text = [NSString stringWithFormat:@"%ld", (long)[self.userInfo.goalsTotal integerValue]];

        UILabel *scoreAuthAvgLabel = (id)[cell.contentView viewWithTag:0xF6];
        scoreAuthAvgLabel.text =  [NSString stringWithFormat:@"%.1f", [self.userInfo.score floatValue]];
        UILabel *scoreAvgLabel = (id)[cell.contentView viewWithTag:0xF7];
        scoreAvgLabel.text = [NSString stringWithFormat:@"%ld", (long)[self.userInfo.score integerValue]];

    }else if ([item  isEqualToString:kUserInfoCellControll1])
    {

    }else if ([item  isEqualToString:kUserInfoCellControll2])
    {
        UIButton *addFriendButton = (id)[cell.contentView viewWithTag:0xF0];
        addFriendButton.hidden = YES;
        UIButton *delFriendButton = (id)[cell.contentView viewWithTag:0xF1];
        delFriendButton.hidden = YES;
        UIButton *addTeammateButton = (id)[cell.contentView viewWithTag:0xF2];
        addTeammateButton.hidden = YES;
        UIButton *delTeammateButton = (id)[cell.contentView viewWithTag:0xF3];
        delTeammateButton.hidden = YES;
        NSMutableArray *controlls = [NSMutableArray arrayWithCapacity:0];
        if (self.viewType == UserInfoViewTypeInfo)
        {
            if(self.isFriend)
            {
                [controlls addObject:delFriendButton];
            }else
            {
                [controlls addObject:addFriendButton];
            }
            if ([[self getCanInviteTeams] count] > 0) {
                [controlls addObject:addTeammateButton];
            }
        }else if(self.viewType == UserInfoViewTypeTeam && [self.ownTeams count] == 1)
        {
            Team *team = [self.ownTeams firstObject];
            if(self.isFriend)
            {
                [controlls addObject:delFriendButton];
            }else
            {
                [controlls addObject:addFriendButton];
            }
            if ([team.captain.objectId isEqualToString:[BmobUser getCurrentUser].objectId])
            {
                if(self.isTeammate)
                {
                    [controlls addObject:delTeammateButton];
                }else
                {
                    if ([[self getCanInviteTeams] count] > 0) {
                        [controlls addObject:addTeammateButton];
                    }
                }
            }

        }
        CGRect frame = addFriendButton.frame;
        int count = (int)[controlls count];
        for (int i = 0;  i < count; i ++) {
            UIButton *controll = [controlls objectAtIndex:i];
            controll.hidden = NO;
            if (count == 2) {
                if (i == 1) {
                    frame.origin.x = 160;
                    frame.size.width = 160;
                }else
                {
                    frame.origin.x = 0;
                    frame.size.width = 160;
                }
            }else
            {
                frame.origin.x = 0;
                frame.size.width = 320;
            }
            controll.frame = frame;
        }

        /*
        if (self.isTeammateClickPush)
        {

            UIButton *leftBtn = (id)[cell.contentView viewWithTag:0xF0];
            leftBtn.hidden = YES;

            UIButton *rightBtn = (id)[cell.contentView viewWithTag:0xF1];
            rightBtn.hidden = YES;

            if (self.isCaptionClickPush)
            {

                UIButton *deleteButton = (id)[cell.contentView viewWithTag:0xF2];
                deleteButton.hidden=NO;
                [deleteButton setTitle:@"删除队友" forState:UIControlStateNormal];
                [deleteButton addTarget:self action:@selector(onDelTeammate:) forControlEvents:UIControlEventTouchUpInside];

            }
            else
            {
                UIButton *deleteButton = (id)[cell.contentView viewWithTag:0xF2];

                if (self.isFriend)
                {
                    deleteButton.hidden=YES;
                }
                else
                {

                    deleteButton.hidden=NO;
                    [deleteButton setTitle:@"加为好友" forState:UIControlStateNormal];
                    [deleteButton addTarget:self action:@selector(onAddFriend:) forControlEvents:UIControlEventTouchUpInside];

                }

            }

        }
        else
        {

            UIButton *leftBtn = (id)[cell.contentView viewWithTag:0xF0];
            if (self.isFriend)
            {
                [leftBtn setTitle:@"删除好友" forState:UIControlStateNormal];
                [leftBtn removeTarget:self action:@selector(onAddFriend:) forControlEvents:UIControlEventTouchUpInside];
                [leftBtn addTarget:self action:@selector(onDelFriend:) forControlEvents:UIControlEventTouchUpInside];
            }else
            {
                [leftBtn setTitle:@"加为好友" forState:UIControlStateNormal];
                [leftBtn removeTarget:self action:@selector(onDelFriend:) forControlEvents:UIControlEventTouchUpInside];
                [leftBtn addTarget:self action:@selector(onAddFriend:) forControlEvents:UIControlEventTouchUpInside];
            }

            UIButton *rightBtn = (id)[cell.contentView viewWithTag:0xF1];
            if ([[self getCanInviteTeams] count] > 0 && [self.teams count] < 2)
            {
                rightBtn.hidden = NO;
                [rightBtn addTarget:self action:@selector(onInviting:) forControlEvents:UIControlEventTouchUpInside];
            }else
            {
                rightBtn.hidden = YES;
            }

            UIButton *deleteButton = (id)[cell.contentView viewWithTag:0xF2];
            deleteButton.hidden=YES;

        }
        */

    }else if ([item  isEqualToString:kUserInfoCellSchedule])
    {
        UILabel *mesaageLabel = (id)[cell.contentView viewWithTag:0xFA];
        UILabel *dateLabel = (id)[cell.contentView viewWithTag:0xF0];
        if (self.isScheduleLoaded && [self.schedule isKindOfClass:[NSArray class]] && [self.schedule count] > 0)
        {
            mesaageLabel.superview.hidden = YES;
            dateLabel.superview.hidden = NO;
            Tournament *match = [self.schedule firstObject];

            dateLabel.text = [DateUtil formatedDate:match.start_time byDateFormat:@"MM/dd HH:mm"];

            UILabel *nameLabel = (id)[cell.contentView viewWithTag:0xF1];
            nameLabel.text = [NSString stringWithFormat:@"%@ - %@", match.home_court.name ? match.home_court.name : @"", match.opponent.name ? match.opponent.name : @""];

            UILabel *addressLabel = (id)[cell.contentView viewWithTag:0xF2];
            addressLabel.text = match.site;
        }else
        {
            mesaageLabel.superview.hidden = NO;
            dateLabel.superview.hidden = YES;
            if (!self.isScheduleLoaded) {
                mesaageLabel.text = @"正在加载赛程...";
            }else if ([self.schedule isKindOfClass:[NSArray class]])
            {
                mesaageLabel.text = @"暂无赛程信息";
            }else
            {
                mesaageLabel.text = @"赛程信息加载出错";
            }
        }
    }else if ([item  isEqualToString:kUserInfoCellExploits])
    {
        UILabel *mesaageLabel = (id)[cell.contentView viewWithTag:0xFA];
        UILabel *dateLabel = (id)[cell.contentView viewWithTag:0xF0];
        if (self.isExploitsLoaded && [self.exploits isKindOfClass:[NSArray class]] && [self.exploits count] > 0)
        {
            mesaageLabel.superview.hidden = YES;
            dateLabel.superview.hidden = NO;
            PlayerScore *score = [self.exploits firstObject];
            dateLabel.text = [DateUtil formatedDate:score.competition.start_time byDateFormat:@"MM/dd HH:mm"];

            UILabel *homeCourtLabel = (id)[cell.contentView viewWithTag:0xF1];
            homeCourtLabel.text =score.competition.home_court.name;

            UILabel *scoreLabel = (id)[cell.contentView viewWithTag:0xF2];
            if (self.teams.count >=1 ) {
                for (Team *team in self.teams) {
                    if ([team.objectId isEqualToString:score.competition.home_court.objectId] || [team.objectId isEqualToString:score.competition.opponent.objectId]) {
                        if ([team.objectId isEqualToString:score.competition.home_court.objectId]) {
                            if (score.competition.score_h || score.competition.score_h2) {
                                scoreLabel.text = [NSString stringWithFormat:@"%d - %d", [score.competition.score_h intValue], [score.competition.score_h2 intValue]];
                            }else
                            {
                                scoreLabel.text = @"0 - 0";
                            }
                        }else{
                            if (score.competition.score_o2 || score.competition.score_o) {
                                scoreLabel.text = [NSString stringWithFormat:@"%d - %d", [score.competition.score_o2 intValue], [score.competition.score_o intValue]];
                            }else
                            {
                                scoreLabel.text = @"0 - 0";
                            }
                        }
                    }
                    break;
                }
            }else{
                if (score.competition.score_h || score.competition.score_h2) {
                    scoreLabel.text = [NSString stringWithFormat:@"%d - %d", [score.competition.score_h intValue], [score.competition.score_h2 intValue]];
                }else
                {
                    scoreLabel.text = @"0 - 0";
                }
            }

            UILabel *opponentLabel = (id)[cell.contentView viewWithTag:0xF3];
            opponentLabel.text = score.competition.opponent.name;

            UILabel *goalsLabel = (id)[cell.contentView viewWithTag:0xF4];
//            goalsLabel.text = [NSString stringWithFormat:@"%@", score.goals];
            if (score.goals) {
                goalsLabel.text = [NSString stringWithFormat:@"%@", score.goals];
            }else{
                goalsLabel.text = [NSString stringWithFormat:@"%@", @"0"];
            }

            UILabel *assistsLabel = (id)[cell.contentView viewWithTag:0xF5];
            if (score.assists) {
                assistsLabel.text = [NSString stringWithFormat:@"%@", score.assists];
            }else{
                assistsLabel.text = [NSString stringWithFormat:@"%@", @"0"];
            }

        }else
        {
            mesaageLabel.superview.hidden = NO;
            dateLabel.superview.hidden = YES;
            if (!self.isExploitsLoaded) {
                mesaageLabel.text = @"正在加载战绩...";
            }else if ([self.exploits isKindOfClass:[NSArray class]])
            {
                 mesaageLabel.text = @"暂无战绩信息";
            }else
            {
                mesaageLabel.text = @"战绩信息加载出错";
            }
        }

    }else
    {

    }
    return cell;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return [self.dataSource count];
}
//push_exploits  push_schedule
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    [tableView deselectRowAtIndexPath:indexPath animated:YES];

//    if (self.isTeammateClickPush)
//    {
//
//    }
//    else
//    {

        NSString *item = [self.dataSource objectAtIndex:indexPath.row];
        if ([item  isEqualToString:kUserInfoCellSchedule])
        {
            if([self.schedule count] > 0)
            {
                [self performSegueWithIdentifier:@"push_schedule" sender:nil];
            }

        }else if ([item  isEqualToString:kUserInfoCellExploits])
        {
            if([self.exploits count] > 0)
            {
                [self performSegueWithIdentifier:@"push_exploits" sender:nil];
            }
        }

//    }

}

#pragma mark - Event handler

//- (void)handleUserInfoChange
//{
//    [self loadUserInfo];
//}
//
//- (void)handleMatchChange
//{
//    [self loadUserInfo];
//    [self loadExploitsData];
//    [self loadScheduleData];
//
//}

- (IBAction)onFriends:(id)sender {

    BDLog(@"on friends!");
}
- (IBAction)onNearbyMatch:(id)sender {

    BDLog(@"on nearby match!");
}

- (IBAction)onAddFriend:(id)sender
{
    BmobUser *user = [BmobUser getCurrentUser];
    BmobRelation *relation = [BmobRelation relation];
    [relation addObject:[BmobUser objectWithoutDatatWithClassName:nil objectId:self.userInfo.objectId]];
    [user addRelation:relation forKey:@"friends"];
    [self showLoadingView];
    [user updateInBackgroundWithResultBlock:^(BOOL isSuccessful, NSError *error) {
        [self hideLoadingView];
        if (isSuccessful)
        {
            [self showMessage:@"添加好友成功"];
            self.isFriend = YES;
            if ([self.dataSource indexOfObject:kUserInfoCellControll2] != NSNotFound)
            {
                NSIndexPath *index = [NSIndexPath indexPathForRow:[self.dataSource indexOfObject:kUserInfoCellControll2] inSection:0];
                [self.tableView reloadRowsAtIndexPaths:[NSArray arrayWithObject:index] withRowAnimation:UITableViewRowAnimationAutomatic];
            }
            [self performRunnable:^
            {
                [self addFriendPush];
            } afterDelay:1.5f];
        }else
        {
            BDLog(@"add friend error %@",error);
        }

    }];
}

- (IBAction)onDelFriend:(id)sender
{
    BmobUser *user = [BmobUser getCurrentUser];
    BmobRelation *relation = [BmobRelation relation];
    [relation removeObject:[BmobUser objectWithoutDatatWithClassName:nil objectId:self.userInfo.objectId]];
    [user addRelation:relation forKey:@"friends"];
    [self showLoadingView];
    [user updateInBackgroundWithResultBlock:^(BOOL isSuccessful, NSError *error) {
        [self hideLoadingView];
        if (isSuccessful)
        {
            [self showMessage:@"删除好友成功"];
            self.isFriend = NO;
            if ([self.dataSource indexOfObject:kUserInfoCellControll2] != NSNotFound)
            {
                NSIndexPath *index = [NSIndexPath indexPathForRow:[self.dataSource indexOfObject:kUserInfoCellControll2] inSection:0];
                [self.tableView reloadRowsAtIndexPaths:[NSArray arrayWithObject:index] withRowAnimation:UITableViewRowAnimationAutomatic];
            }

        }else
        {
            BDLog(@"del friend error %@", error);
        }

    }];
}

-(IBAction)onDelTeammate:(id)sender
{
    Team *team = nil;
    if(self.viewType == UserInfoViewTypeTeam && [self.ownTeams count] == 1)
    {
        team = [self.ownTeams firstObject];
    }else
    {
        return ;
    }
    //删除关联
    BmobObject *obj = [BmobObject objectWithoutDatatWithClassName:kTableTeam objectId:team.objectId];
    BmobRelation *relation = [[BmobRelation alloc] init];
    [relation removeObject:[BmobUser objectWithoutDatatWithClassName:nil objectId:self.userInfo.objectId]];

    [obj addRelation:relation forKey:@"footballer"];

    [obj updateInBackgroundWithResultBlock:^(BOOL isSuccessful, NSError *error)
    {

        [self.navigationController popViewControllerAnimated:YES];

        if (isSuccessful)
        {
            [self showMessage:@"删除队友成功！"];
            [self performRunnable:^{
                if (self.navigationController)
                {
                    [self.navigationController popViewControllerAnimated:YES];
                }
            } afterDelay:1.5];
            [self deleteTeammatePushWithTeam:team];
        }
        else
        {
            [self showMessage:@"删除队友失败！"];
        }

    }];

}

- (IBAction)onInviting:(UIButton *)sender
{
    if ([[self getCanInviteTeams] count] >= 2)
    {
        ValueSelectionViewController *selection = [self.storyboard instantiateViewControllerWithIdentifier:@"ValueSelectionViewController"];
        selection.title = @"所属球队";
        NSMutableArray *array = [NSMutableArray arrayWithCapacity:0];
        for (Team *aTeam in [self getCanInviteTeams]) {
            [array addObject:aTeam.name];
        }
        selection.buttonTitle = @"发送";
        selection.dataSource = array;
        selection.delegate = self;
        [self.navigationController pushViewController:selection animated:YES];

    }else if([[self getCanInviteTeams] count] == 1)
    {

        [sender setTitle:@"已邀请" forState:UIControlStateNormal];
        [self invitePushWithTeam:[[self getCanInviteTeams] firstObject]];

        sender.enabled = NO;
        [self performSelector:@selector(enableInviteButton:) withObject:sender afterDelay:30.0f];

    }else
    {
        [self showMessage:@"无所属球队"];
    }

}

-(void)enableInviteButton:(UIButton *)button{
    button.enabled = YES;
    [button setTitle:@"邀请入队" forState:UIControlStateNormal];
}

- (IBAction)onSetting:(UIButton *)sender
{
    self.isSetting = !self.isSetting;
    if (self.isSetting) {
        [self showSettingToolView];
    }else
    {
        [self hideSettingToolView];
    }
}
- (IBAction)onLogout:(id)sender
{

//#warning 删除tag
    [TeamEngine getTeamsObjectIdWith:[BmobUser getCurrentUser]
                               block:^(id result, NSError *error) {
                                   NSArray *array = result;
                                   if (array && array.count > 0) {
                                       [BPushUtil deleteTags:array];
                                   }
                               }];
    //退出时把百度的userid和channelId置空
    BmobUser *user = [BmobUser getCurrentUser];
    if (user) {
        [user deleteForKey:@"pushChannelId"];
        [user deleteForKey:@"pushUserId"];
        [user updateInBackgroundWithResultBlock:^(BOOL isSuccessful, NSError *error) {
            [BmobUser logout];
        }];
    }

    [[MainNavigationController shareMainNavigationController] popToLoginViewControllerAnimated:YES];
    if (![BmobUser getCurrentUser])
    {
        [NoticeManager updatePushProfile];
        [[NoticeManager sharedManager] unbindDB];
    }

}
- (IBAction)getShareUserClick:(id)sender
{

    [self hideSettingToolView];
    self.isSetting=NO;

    CHTumblrMenuView *menuView = [[CHTumblrMenuView alloc] init];
    [menuView addMenuItemWithTitle:@"短信" andIcon:[UIImage imageNamed:@"message.png"] andSelectedBlock:^{

        BDLog(@"短信 selected");

        [self showShareViewWithType:ShareTypeSMS];

    }];

    [menuView addMenuItemWithTitle:@"微信" andIcon:[UIImage imageNamed:@"wx.png"] andSelectedBlock:^{

        BDLog(@"微信 selected");

        [self showShareViewWithType:ShareTypeWeixiSession];

    }];

    [menuView addMenuItemWithTitle:@"微信朋友圈" andIcon:[UIImage imageNamed:@"pyq.png"] andSelectedBlock:^{

        BDLog(@"微信朋友圈");

        [self showShareViewWithType:ShareTypeWeixiTimeline];

    }];

    [menuView addMenuItemWithTitle:@"微博" andIcon:[UIImage imageNamed:@"wb.png"] andSelectedBlock:^{

        BDLog(@"微博 selected");

        [self showShareViewWithType:ShareTypeSinaWeibo];

    }];

    [menuView show];

}

-(void)showShareViewWithType:(ShareType)type
{

    self.shareTitle=@"个人总体数据";
    self.shareUrl=[NSString stringWithFormat:@"http://tq.codenow.cn/share/PersonTotalData?user=%@",[[BmobUser getCurrentUser] objectId]];
    self.shareContent=[NSString stringWithFormat:@"每一次进步，都是辛勤的付出！我的总体表现是:%@",self.shareUrl];

    id<ISSContent> content = [ShareSDK content:self.shareContent
                                defaultContent:nil
                                         image:[ShareSDK jpegImageWithImage:[UIImage imageNamed:@"res2.jpg"] quality:1]
                                         title:self.shareTitle
                                           url:self.shareUrl
                                   description:nil
                                     mediaType:SSPublishContentMediaTypeNews];

    id<ISSAuthOptions> authOptions = [ShareSDK authOptionsWithAutoAuth:YES
                                                         allowCallback:YES
                                                         authViewStyle:SSAuthViewStyleFullScreenPopup
                                                          viewDelegate:nil
                                               authManagerViewDelegate:nil];

    //在授权页面中添加关注官方微博
    [authOptions setFollowAccounts:[NSDictionary dictionaryWithObjectsAndKeys:
                                    [ShareSDK userFieldWithType:SSUserFieldTypeName value:@"踢球吧"],
                                    SHARE_TYPE_NUMBER(ShareTypeSinaWeibo),
                                    [ShareSDK userFieldWithType:SSUserFieldTypeName value:@"踢球吧"],
                                    SHARE_TYPE_NUMBER(ShareTypeTencentWeibo),
                                    nil]];
    __weak typeof(self) weakSelf = self;
    [ShareSDK shareContent:content
                      type:type
               authOptions:authOptions
             statusBarTips:YES
                    result:^(ShareType type, SSResponseState state, id<ISSPlatformShareInfo> statusInfo, id<ICMErrorInfo> error, BOOL end) {

                        if (state == SSPublishContentStateSuccess)
                        {
                            BDLog(@"分享成功!");
                            if (type == ShareTypeSinaWeibo) {
                                [weakSelf showMessage:@"分享成功"];
                            }

                        }
                        else if (state == SSPublishContentStateFail)
                        {
                            //                            if ([error errorCode] == -22003)
                            //                            {
                            //                                UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"TEXT_TIPS", @"提示")
                            //                                                                                message:[error errorDescription]
                            //                                                                                delegate:nil
                            //                                                                          cancelButtonTitle:NSLocalizedString(@"TEXT_KNOW", @"知道了")
                            //                                                                          otherButtonTitles:nil];
                            //                                [alertView show];
                            //                            }

                            BDLog(@"分享失败!***%ld，%@", (long)[error errorCode], [error errorDescription]);

                        }
                    }];
}

//-(void)contactUs{
//    ;
//}
- (IBAction)contactUs:(id)sender {
    [self performSegueWithIdentifier:@"toContactUsVC" sender:nil];
}

- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
    if ([segue.identifier isEqualToString:@"user_setting"]) {
        [segue.destinationViewController setValue:self.userInfo forKey:@"userInfo"];
    }else if ([segue.identifier isEqualToString:@"push_schedule"])
    {
        [segue.destinationViewController setValue:self.schedule forKey:@"schedule"];
        [segue.destinationViewController setValue:self.userInfo forKey:@"userInfo"];
    }else if ([segue.identifier isEqualToString:@"push_exploits"])
    {
        [segue.destinationViewController setValue:self.exploits forKey:@"exploits"];
        [segue.destinationViewController setValue:self.userInfo forKey:@"userInfo"];
        [segue.destinationViewController setValue:self.teams forKey:@"teams"];
    }
    //push_exploits
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end

{'repo_name': 'bmob/BmobTiQiuBa', 'stars': '123', 'repo_language': 'Objective-C', 'file_name': 'FancyCoverFlow.java', 'mime_type': 'text/x-java', 'hash': -2713163182725253279, 'source_dataset': 'data'}


// Copyright 2006-2008 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "src/base/logging.h"

#include <cctype>
#include <cstdarg>
#include <cstdio>
#include <cstdlib>

#include "src/base/debug/stack_trace.h"
#include "src/base/platform/platform.h"

namespace v8 {
namespace base {

namespace {

void DefaultDcheckHandler(const char* file, int line, const char* message);

void (*g_print_stack_trace)() = nullptr;

void (*g_dcheck_function)(const char*, int, const char*) = DefaultDcheckHandler;

void PrettyPrintChar(std::ostream& os, int ch) {
  switch (ch) {
#define CHAR_PRINT_CASE(ch) \
  case ch:                  \
    os << #ch;              \
    break;

    CHAR_PRINT_CASE('\0')
    CHAR_PRINT_CASE('\'')
    CHAR_PRINT_CASE('\\')
    CHAR_PRINT_CASE('\a')
    CHAR_PRINT_CASE('\b')
    CHAR_PRINT_CASE('\f')
    CHAR_PRINT_CASE('\n')
    CHAR_PRINT_CASE('\r')
    CHAR_PRINT_CASE('\t')
    CHAR_PRINT_CASE('\v')
#undef CHAR_PRINT_CASE
    default:
      if (std::isprint(ch)) {
        os << '\'' << ch << '\'';
      } else {
        auto flags = os.flags(std::ios_base::hex);
        os << "\\x" << static_cast<unsigned int>(ch);
        os.flags(flags);
      }
  }
}

void DefaultDcheckHandler(const char* file, int line, const char* message) {
  V8_Fatal(file, line, "Debug check failed: %s.", message);
}

}  // namespace

void SetPrintStackTrace(void (*print_stack_trace)()) {
  g_print_stack_trace = print_stack_trace;
}

void SetDcheckFunction(void (*dcheck_function)(const char*, int, const char*)) {
  g_dcheck_function = dcheck_function ? dcheck_function : &DefaultDcheckHandler;
}

// Define specialization to pretty print characters (escaping non-printable
// characters) and to print c strings as pointers instead of strings.
#define DEFINE_PRINT_CHECK_OPERAND_CHAR(type)                                \
  template <>                                                                \
  void PrintCheckOperand<type>(std::ostream & os, type ch) {                 \
    PrettyPrintChar(os, ch);                                                 \
  }                                                                          \
  template <>                                                                \
  void PrintCheckOperand<type*>(std::ostream & os, type * cstr) {            \
    os << static_cast<void*>(cstr);                                          \
  }                                                                          \
  template <>                                                                \
  void PrintCheckOperand<const type*>(std::ostream & os, const type* cstr) { \
    os << static_cast<const void*>(cstr);                                    \
  }

DEFINE_PRINT_CHECK_OPERAND_CHAR(char)
DEFINE_PRINT_CHECK_OPERAND_CHAR(signed char)
DEFINE_PRINT_CHECK_OPERAND_CHAR(unsigned char)
#undef DEFINE_PRINT_CHECK_OPERAND_CHAR

// Explicit instantiations for commonly used comparisons.
#define DEFINE_MAKE_CHECK_OP_STRING(type)                           \
  template std::string* MakeCheckOpString<type, type>(type, type,   \
                                                      char const*); \
  template void PrintCheckOperand<type>(std::ostream&, type);
DEFINE_MAKE_CHECK_OP_STRING(int)
DEFINE_MAKE_CHECK_OP_STRING(long)       // NOLINT(runtime/int)
DEFINE_MAKE_CHECK_OP_STRING(long long)  // NOLINT(runtime/int)
DEFINE_MAKE_CHECK_OP_STRING(unsigned int)
DEFINE_MAKE_CHECK_OP_STRING(unsigned long)       // NOLINT(runtime/int)
DEFINE_MAKE_CHECK_OP_STRING(unsigned long long)  // NOLINT(runtime/int)
DEFINE_MAKE_CHECK_OP_STRING(void const*)
#undef DEFINE_MAKE_CHECK_OP_STRING

// Explicit instantiations for floating point checks.
#define DEFINE_CHECK_OP_IMPL(NAME)                                            \
  template std::string* Check##NAME##Impl<float, float>(float lhs, float rhs, \
                                                        char const* msg);     \
  template std::string* Check##NAME##Impl<double, double>(                    \
      double lhs, double rhs, char const* msg);
DEFINE_CHECK_OP_IMPL(EQ)
DEFINE_CHECK_OP_IMPL(NE)
DEFINE_CHECK_OP_IMPL(LE)
DEFINE_CHECK_OP_IMPL(LT)
DEFINE_CHECK_OP_IMPL(GE)
DEFINE_CHECK_OP_IMPL(GT)
#undef DEFINE_CHECK_OP_IMPL

}  // namespace base
}  // namespace v8

namespace {

// FailureMessage is a stack allocated object which has a special marker field
// at the start and at the end. This makes it possible to retrieve the embedded
// message from the stack.
//
class FailureMessage {
 public:
  explicit FailureMessage(const char* format, va_list arguments) {
    memset(&message_, 0, arraysize(message_));
    v8::base::OS::VSNPrintF(&message_[0], arraysize(message_), format,
                            arguments);
  }

  static const uintptr_t kStartMarker = 0xdecade10;
  static const uintptr_t kEndMarker = 0xdecade11;
  static const int kMessageBufferSize = 512;

  uintptr_t start_marker_ = kStartMarker;
  char message_[kMessageBufferSize];
  uintptr_t end_marker_ = kEndMarker;
};

}  // namespace

void V8_Fatal(const char* file, int line, const char* format, ...) {
  va_list arguments;
  va_start(arguments, format);
  // Format the error message into a stack object for later retrieveal by the
  // crash processor.
  FailureMessage message(format, arguments);
  va_end(arguments);

  fflush(stdout);
  fflush(stderr);
  // Print the formatted message to stdout without cropping the output.
  v8::base::OS::PrintError("\n\n#\n# Fatal error in %s, line %d\n# ", file,
                           line);

  // Print the error message.
  va_start(arguments, format);
  v8::base::OS::VPrintError(format, arguments);
  va_end(arguments);
  // Print the message object's address to force stack allocation.
  v8::base::OS::PrintError("\n#\n#\n#\n#FailureMessage Object: %p", &message);

  if (v8::base::g_print_stack_trace) v8::base::g_print_stack_trace();

  fflush(stderr);
  v8::base::OS::Abort();
}

void V8_Dcheck(const char* file, int line, const char* message) {
  v8::base::g_dcheck_function(file, line, message);
}

{'repo_name': 'ovr/StaticScript', 'stars': '302', 'repo_language': 'TypeScript', 'file_name': 'do-simple-math.ts', 'mime_type': 'text/plain', 'hash': 7397752719395782507, 'source_dataset': 'data'}


op {
  graph_op_name: "SparseApplyAdadelta"
  in_arg {
    name: "accum"
    description: <<END
Should be from a Variable().
END
  }
  in_arg {
    name: "accum_update"
    description: <<END
: Should be from a Variable().
END
  }
  in_arg {
    name: "lr"
    description: <<END
Learning rate. Must be a scalar.
END
  }
  in_arg {
    name: "rho"
    description: <<END
Decay factor. Must be a scalar.
END
  }
  in_arg {
    name: "epsilon"
    description: <<END
Constant factor. Must be a scalar.
END
  }
  in_arg {
    name: "grad"
    description: <<END
The gradient.
END
  }
  in_arg {
    name: "indices"
    description: <<END
A vector of indices into the first dimension of var and accum.
END
  }
  out_arg {
    name: "out"
    description: <<END
Same as "var".
END
  }
  attr {
    name: "use_locking"
    description: <<END
If True, updating of the var and accum tensors will be protected by
a lock; otherwise the behavior is undefined, but may exhibit less contention.
END
  }
  summary: "var: Should be from a Variable()."
}

{'repo_name': 'Xilinx/Vitis-AI', 'stars': '259', 'repo_language': 'C++', 'file_name': 'README.md', 'mime_type': 'text/plain', 'hash': 4171117280005959649, 'source_dataset': 'data'}


/*! Foundation styling wrapper for Select
 * ©2018 SpryMedia Ltd - datatables.net/license
 */

(function( factory ){
	if ( typeof define === 'function' && define.amd ) {
		// AMD
		define( ['jquery', 'datatables.net-zf', 'datatables.net-select'], function ( $ ) {
			return factory( $, window, document );
		} );
	}
	else if ( typeof exports === 'object' ) {
		// CommonJS
		module.exports = function (root, $) {
			if ( ! root ) {
				root = window;
			}

			if ( ! $ || ! $.fn.dataTable ) {
				$ = require('datatables.net-zf')(root, $).$;
			}

			if ( ! $.fn.dataTable.select ) {
				require('datatables.net-select')(root, $);
			}

			return factory( $, root, root.document );
		};
	}
	else {
		// Browser
		factory( jQuery, window, document );
	}
}(function( $, window, document, undefined ) {

return $.fn.dataTable;

}));

{'repo_name': 'jolie/jolie', 'stars': '167', 'repo_language': 'Java', 'file_name': 'SodepRequestListener.java', 'mime_type': 'text/x-java', 'hash': 420622487665069930, 'source_dataset': 'data'}


function H = essential_sharp(Hp)
    %Reshape a [3x3x2k] matrix to a [3x6xk] matrix
    H = reshape(Hp,3,6,[]);
end

{'repo_name': 'NicolasBoumal/manopt', 'stars': '107', 'repo_language': 'MATLAB', 'file_name': 'basicexample.m', 'mime_type': 'text/plain', 'hash': 8301177066154519190, 'source_dataset': 'data'}


/*
 * cancel-info.c
 *
 *
 * Authors:
 *  Michi <st101564@stud.uni-stuttgart.de>
 *
 * Web page: https://ahoi.io/project/oregano
 *
 *
 * This program is free 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 2 of the
 * License, or (at your option) any later version.
 *
 * This program 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 this program; if not, write to the
 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
 * Boston, MA 02110-1301, USA.
 */

#include <glib.h>
#include "cancel-info.h"

struct _CancelInfo {
	guint ref_count;
	GMutex mutex;
	gboolean is_cancel;
};

static void cancel_info_finalize(CancelInfo *info);

CancelInfo *cancel_info_new() {
	CancelInfo *info =  g_new0(CancelInfo, 1);
	info->ref_count = 1;
	g_mutex_init(&info->mutex);

	return info;
}

void cancel_info_subscribe(CancelInfo *info) {
	g_mutex_lock(&info->mutex);
	info->ref_count++;
	g_mutex_unlock(&info->mutex);
}

void cancel_info_unsubscribe(CancelInfo *info) {
	g_mutex_lock(&info->mutex);
	info->ref_count--;
	guint ref_count = info->ref_count;
	g_mutex_unlock(&info->mutex);

	if (ref_count == 0)
		cancel_info_finalize(info);
}

gboolean cancel_info_is_cancel(CancelInfo *info) {
	g_mutex_lock(&info->mutex);
	gboolean is_cancel = info->is_cancel;
	g_mutex_unlock(&info->mutex);

	return is_cancel;
}

void cancel_info_set_cancel(CancelInfo *info) {
	g_mutex_lock(&info->mutex);
	info->is_cancel = TRUE;
	g_mutex_unlock(&info->mutex);
}

static void cancel_info_finalize(CancelInfo *info) {
	g_mutex_clear(&info->mutex);
	g_free(info);
}

{'repo_name': 'drahnr/oregano', 'stars': '148', 'repo_language': 'C', 'file_name': 'main.ui', 'mime_type': 'text/xml', 'hash': -7415371041013343121, 'source_dataset': 'data'}


package com.videffects.sample.interfaces

interface OnSelectShaderListener {

    /**
     * Argument should implement ShaderInterface of Filter
     */
    fun onSelectShader(shader: Any)
}

{'repo_name': 'krazykira/VidEffects', 'stars': '271', 'repo_language': 'Java', 'file_name': 'VideoController.kt', 'mime_type': 'text/plain', 'hash': -6353541229812553199, 'source_dataset': 'data'}


"use strict";

function getCurrentRequest(loaderContext) {
	if(loaderContext.currentRequest)
		return loaderContext.currentRequest;
	const request = loaderContext.loaders
		.slice(loaderContext.loaderIndex)
		.map(obj => obj.request)
		.concat([loaderContext.resource]);
	return request.join("!");
}

module.exports = getCurrentRequest;

{'repo_name': 'TriumphLLC/Blend4Web', 'stars': '643', 'repo_language': 'HTML', 'file_name': 'README.md', 'mime_type': 'text/plain', 'hash': -6994605580906377367, 'source_dataset': 'data'}


name=Golgari Rot Farm
image=https://magiccards.info/scans/en/ima/236.jpg
image_updated=2017-04-12
value=2.500
rarity=U
type=Land
ability=SN enters the battlefield tapped.;\
        When SN enters the battlefield, return a land you control to its owner's hand.;\
        {T}: Add {B}{G}.
timing=land
oracle=Golgari Rot Farm enters the battlefield tapped.\nWhen Golgari Rot Farm enters the battlefield, return a land you control to its owner's hand.\n{T}: Add {B}{G}.
status=not supported: add-multiple-mana

{'repo_name': 'magarena/magarena', 'stars': '290', 'repo_language': 'Java', 'file_name': 'result.txt', 'mime_type': 'text/plain', 'hash': 8261147489442545999, 'source_dataset': 'data'}


// Copyright (c) Microsoft.  All Rights Reserved.  Licensed under the Apache License, Version 2.0.  See License.txt in the project root for license information.

using System.Threading;
using Microsoft.CodeAnalysis.CodeRefactorings;

namespace Microsoft.CodeAnalysis.IntroduceVariable
{
    internal class IntroduceVariableResult : IIntroduceVariableResult
    {
        public static readonly IIntroduceVariableResult Failure = new IntroduceVariableResult(null);

        private readonly CodeRefactoring _codeRefactoring;

        public IntroduceVariableResult(CodeRefactoring codeRefactoring)
        {
            _codeRefactoring = codeRefactoring;
        }

        public bool ContainsChanges
        {
            get
            {
                return _codeRefactoring != null;
            }
        }

        public CodeRefactoring GetCodeRefactoring(CancellationToken cancellationToken)
        {
            return _codeRefactoring;
        }
    }
}

{'repo_name': 'mono/roslyn', 'stars': '187', 'repo_language': 'C#', 'file_name': 'VSL.Imports.Closed.targets', 'mime_type': 'text/plain', 'hash': 8025565065599529385, 'source_dataset': 'data'}


name: "Arthur Furlan"
twitter: "arthurfurlan"
bio: "Formado em Ciência da Computação pela UFPR, trabalha com tecnologia há mais de 12 anos e com DevOps desde 2010. Já contribuiu como SysAdmin em diversos projetos de Software Livre como BrOffice.org, PostgreSQL-BR, Mozila-BR, Django Brasil, FLISOL e desde 2013 atua como empreendedor na Configr."

{'repo_name': 'devopsdays/devopsdays-web', 'stars': '125', 'repo_language': 'HTML', 'file_name': 'default.md', 'mime_type': 'text/plain', 'hash': -6833163986775052768, 'source_dataset': 'data'}


package schema1

import (
	"crypto/x509"

	"github.com/Sirupsen/logrus"
	"github.com/docker/libtrust"
)

// Verify verifies the signature of the signed manifest returning the public
// keys used during signing.
func Verify(sm *SignedManifest) ([]libtrust.PublicKey, error) {
	js, err := libtrust.ParsePrettySignature(sm.all, "signatures")
	if err != nil {
		logrus.WithField("err", err).Debugf("(*SignedManifest).Verify")
		return nil, err
	}

	return js.Verify()
}

// VerifyChains verifies the signature of the signed manifest against the
// certificate pool returning the list of verified chains. Signatures without
// an x509 chain are not checked.
func VerifyChains(sm *SignedManifest, ca *x509.CertPool) ([][]*x509.Certificate, error) {
	js, err := libtrust.ParsePrettySignature(sm.all, "signatures")
	if err != nil {
		return nil, err
	}

	return js.VerifyChains(ca)
}

{'repo_name': 'hyperhq/hypercli', 'stars': '167', 'repo_language': 'Go', 'file_name': 'config_test.go', 'mime_type': 'text/plain', 'hash': -8044165593995884056, 'source_dataset': 'data'}


/*
Copyright 2017 The Kubernetes Authors.

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.
*/

// This file should be consistent with pkg/api/annotation_key_constants.go.

package v1

const (
	// ImagePolicyFailedOpenKey is added to pods created by failing open when the image policy
	// webhook backend fails.
	ImagePolicyFailedOpenKey string = "alpha.image-policy.k8s.io/failed-open"

	// PodPresetOptOutAnnotationKey represents the annotation key for a pod to exempt itself from pod preset manipulation
	PodPresetOptOutAnnotationKey string = "podpreset.admission.kubernetes.io/exclude"

	// MirrorAnnotationKey represents the annotation key set by kubelets when creating mirror pods
	MirrorPodAnnotationKey string = "kubernetes.io/config.mirror"

	// TolerationsAnnotationKey represents the key of tolerations data (json serialized)
	// in the Annotations of a Pod.
	TolerationsAnnotationKey string = "scheduler.alpha.kubernetes.io/tolerations"

	// TaintsAnnotationKey represents the key of taints data (json serialized)
	// in the Annotations of a Node.
	TaintsAnnotationKey string = "scheduler.alpha.kubernetes.io/taints"

	// SeccompPodAnnotationKey represents the key of a seccomp profile applied
	// to all containers of a pod.
	SeccompPodAnnotationKey string = "seccomp.security.alpha.kubernetes.io/pod"

	// SeccompContainerAnnotationKeyPrefix represents the key of a seccomp profile applied
	// to one container of a pod.
	SeccompContainerAnnotationKeyPrefix string = "container.seccomp.security.alpha.kubernetes.io/"

	// SeccompProfileRuntimeDefault represents the default seccomp profile used by container runtime.
	SeccompProfileRuntimeDefault string = "runtime/default"

	// DeprecatedSeccompProfileDockerDefault represents the default seccomp profile used by docker.
	// This is now deprecated and should be replaced by SeccompProfileRuntimeDefault.
	DeprecatedSeccompProfileDockerDefault string = "docker/default"

	// PreferAvoidPodsAnnotationKey represents the key of preferAvoidPods data (json serialized)
	// in the Annotations of a Node.
	PreferAvoidPodsAnnotationKey string = "scheduler.alpha.kubernetes.io/preferAvoidPods"

	// ObjectTTLAnnotations represents a suggestion for kubelet for how long it can cache
	// an object (e.g. secret, config map) before fetching it again from apiserver.
	// This annotation can be attached to node.
	ObjectTTLAnnotationKey string = "node.alpha.kubernetes.io/ttl"

	// annotation key prefix used to identify non-convertible json paths.
	NonConvertibleAnnotationPrefix = "non-convertible.kubernetes.io"

	kubectlPrefix = "kubectl.kubernetes.io/"

	// LastAppliedConfigAnnotation is the annotation used to store the previous
	// configuration of a resource for use in a three way diff by UpdateApplyAnnotation.
	LastAppliedConfigAnnotation = kubectlPrefix + "last-applied-configuration"

	// AnnotationLoadBalancerSourceRangesKey is the key of the annotation on a service to set allowed ingress ranges on their LoadBalancers
	//
	// It should be a comma-separated list of CIDRs, e.g. `0.0.0.0/0` to
	// allow full access (the default) or `18.0.0.0/8,56.0.0.0/8` to allow
	// access only from the CIDRs currently allocated to MIT & the USPS.
	//
	// Not all cloud providers support this annotation, though AWS & GCE do.
	AnnotationLoadBalancerSourceRangesKey = "service.beta.kubernetes.io/load-balancer-source-ranges"
)

{'repo_name': 'Azure/acs-engine', 'stars': '1049', 'repo_language': 'Go', 'file_name': 'Jenkinsfile.azure.kubernetes', 'mime_type': 'text/plain', 'hash': 7513683024411310480, 'source_dataset': 'data'}


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
  serializedVersion: 6
  m_ObjectHideFlags: 0
  m_CorrespondingSourceObject: {fileID: 0}
  m_PrefabInstance: {fileID: 0}
  m_PrefabAsset: {fileID: 0}
  m_Name: TowerBullet
  m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
  m_ShaderKeywords: _EMISSION
  m_LightmapFlags: 2
  m_EnableInstancingVariants: 0
  m_DoubleSidedGI: 0
  m_CustomRenderQueue: -1
  stringTagMap: {}
  disabledShaderPasses: []
  m_SavedProperties:
    serializedVersion: 3
    m_TexEnvs:
    - _BumpMap:
        m_Texture: {fileID: 0}
        m_Scale: {x: 1, y: 1}
        m_Offset: {x: 0, y: 0}
    - _DetailAlbedoMap:
        m_Texture: {fileID: 0}
        m_Scale: {x: 1, y: 1}
        m_Offset: {x: 0, y: 0}
    - _DetailMask:
        m_Texture: {fileID: 0}
        m_Scale: {x: 1, y: 1}
        m_Offset: {x: 0, y: 0}
    - _DetailNormalMap:
        m_Texture: {fileID: 0}
        m_Scale: {x: 1, y: 1}
        m_Offset: {x: 0, y: 0}
    - _EmissionMap:
        m_Texture: {fileID: 0}
        m_Scale: {x: 1, y: 1}
        m_Offset: {x: 0, y: 0}
    - _MainTex:
        m_Texture: {fileID: 0}
        m_Scale: {x: 1, y: 1}
        m_Offset: {x: 0, y: 0}
    - _MetallicGlossMap:
        m_Texture: {fileID: 0}
        m_Scale: {x: 1, y: 1}
        m_Offset: {x: 0, y: 0}
    - _OcclusionMap:
        m_Texture: {fileID: 0}
        m_Scale: {x: 1, y: 1}
        m_Offset: {x: 0, y: 0}
    - _ParallaxMap:
        m_Texture: {fileID: 0}
        m_Scale: {x: 1, y: 1}
        m_Offset: {x: 0, y: 0}
    m_Floats:
    - _BumpScale: 1
    - _Cutoff: 0.5
    - _DetailNormalMapScale: 1
    - _DstBlend: 0
    - _GlossMapScale: 1
    - _Glossiness: 0.5
    - _GlossyReflections: 1
    - _Metallic: 0
    - _Mode: 0
    - _OcclusionStrength: 1
    - _Parallax: 0.02
    - _SmoothnessTextureChannel: 0
    - _SpecularHighlights: 1
    - _SrcBlend: 1
    - _UVSec: 0
    - _ZWrite: 1
    m_Colors:
    - _Color: {r: 0, g: 1, b: 0, a: 1}
    - _EmissionColor: {r: 0, g: 1, b: 0, a: 1}

{'repo_name': 'yasgamesdev/MOBA_CSharp_Unity', 'stars': '169', 'repo_language': 'C#', 'file_name': 'AudioManager.asset', 'mime_type': 'text/plain', 'hash': 3347880725007934535, 'source_dataset': 'data'}