content
stringlengths
23
1.05M
using System.Collections.Generic; namespace Identity.Api.Application.Configuration { public class EmailConfig { public string ApiKey { get; set; } public string FromEmail { get; set; } public string From { get; set; } public string ConfirmUrl { get; set; } public enum Template { EmailConfirm, EmailForgot, Invoice } public readonly Dictionary<Template, string> Templates = new() { { Template.EmailConfirm, "d-c4805aeb3bb145dc818a009ddca0bded"}, { Template.EmailForgot, "d-c4805aeb3bb145dc818a009ddca0bded"}, { Template.Invoice, "d-da275396c2354fb38d56ebb59fa1c63b" } }; } }
using MyDownloader.App; namespace MyDownloader.Core.UI { public class AppManager { private AppManager() { } private static AppManager instance = new AppManager(); public static AppManager Instance { get { return instance; } } private IApp application; public IApp Application { get { return application; } } public void Initialize(IApp app) { this.application = app; } } }
using System; namespace WaveDev.ModelR.Shared.Models { public class SceneObjectInfoModel { public SceneObjectInfoModel(Guid id, Guid sceneId) { Id = id; SceneId = sceneId; } public Guid Id { get; set; } public Guid SceneId { get; set; } public SceneObjectType SceneObjectType { get; set; } public string Name { get; set; } public TransformationInfoModel Transformation { get; set; } } }
using Microsoft.Xna.Framework.Graphics; using Terraria.ID; using Terraria.ModLoader; namespace ExampleMod.Tiles.Trees { public class ExamplePalmTree : ModPalmTree { public override Texture2D GetTexture() => ModContent.GetTexture("ExampleMod/Tiles/Trees/ExamplePalmTree"); public override Texture2D GetTopTextures() => ModContent.GetTexture("ExampleMod/Tiles/Trees/ExamplePalmTree_Tops"); public override int DropWood() => ItemID.SandBlock; // TODO } }
using Kingmaker.Blueprints; using Kingmaker.Blueprints.JsonSystem; using Kingmaker.UnitLogic.Abilities; using Kingmaker.UnitLogic.Abilities.Components.Base; namespace TabletopTweaks.NewComponents { [TypeId("e797289b00ee463d886561ad79c2ad4f")] public class AbilityRequirementHasResource : BlueprintComponent, IAbilityRestriction { public string GetAbilityRestrictionUIText() { return $"You don't have enough of required resource"; } public bool IsAbilityRestrictionPassed(AbilityData ability) { return ability.Caster.Resources.HasEnoughResource(Resource, Amount); } public int Amount; public BlueprintAbilityResourceReference Resource; } }
namespace AdventOfCode.Year2016; public class Day06 : Puzzle { private readonly string[] _messages; public Day06(string[] input) : base(input) { _messages = input; } public override DateTime Date => new DateTime(2016, 12, 6); public override string Title => "Signals and Noise"; public override string? CalculateSolution() { return Solution = string.Concat(_messages .Select(s => s.ToCharArray()) .SelectMany(cs => cs.Select((c, i) => (Index: i, Char: c))) .GroupBy(ic => ic.Index, (i, ic) => (Index: i, ic .Select(t => t.Char) .GroupBy(c => c, (c, cs) => (Char: c, Count: cs.Count())) .Aggregate((ccmax, cc) => ccmax.Count > cc.Count ? ccmax : cc) .Char)) .OrderBy(ic => ic.Index) .Select(ic => ic.Char)); } public override string? CalculateSolutionPartTwo() { return SolutionPartTwo = string.Concat(_messages .Select(s => s.ToCharArray()) .SelectMany(cs => cs.Select((c, i) => (Index: i, Char: c))) .GroupBy(ic => ic.Index, (i, ic) => (Index: i, ic .Select(t => t.Char) .GroupBy(c => c, (c, cs) => (Char: c, Count: cs.Count())) .Aggregate((ccmin, cc) => ccmin.Count < cc.Count ? ccmin : cc) .Char)) .OrderBy(ic => ic.Index) .Select(ic => ic.Char)); } }
using Newtonsoft.Json; using Newtonsoft.Json.Linq; namespace ResgateIO.Service { /// <summary> /// Static action values. /// </summary> public static class ResAction { /// <summary> /// Delete action is used with model change events when a property has been deleted from a model. /// </summary> /// <see>https://resgate.io/docs/specification/res-service-protocol/#delete-action</see> public static readonly JRaw Delete = new JRaw("{\"action\":\"delete\"}"); } }
using RxApp; using System; using System.Reactive.Linq; namespace RxApp.Example { public static class MainControllerService { public static IDisposable Create(IMainControllerModel model) { return model.OpenPage.Select(_ => new MainModel()).InvokeCommand(model.Open); } } }
using UnityEngine; using System.Collections; using System; public class StereoCamera : MonoBehaviour { Camera cameraMain, cameraL, cameraR; float eyeLFOVUpTan, eyeLFOVDownTan, eyeLFOVLeftTan, eyeLFOVRightTan; float eyeRFOVUpTan, eyeRFOVDownTan, eyeRFOVLeftTan, eyeRFOVRightTan; const float DEG2RAD = (float)(Math.PI / 180); Transform myTransform, cameraLTransform, cameraRTransform; Vector3 webVREuler = new Vector3(); Vector3 webVRPosition = new Vector3(); Vector3 myStartPosition; // Use this for initialization void Start() { cameraMain = GameObject.Find("CameraMain").GetComponent<Camera>(); cameraL = GameObject.Find("CameraL").GetComponent<Camera>(); cameraR = GameObject.Find("CameraR").GetComponent<Camera>(); myTransform = this.transform; myStartPosition = myTransform.localPosition; cameraLTransform = cameraL.transform; cameraRTransform = cameraR.transform; //eyeL_fovUpDegrees(53.09438705444336f); //eyeL_fovDownDegrees(53.09438705444336f); //eyeL_fovLeftDegrees(47.52769470214844f); //eyeL_fovRightDegrees(46.63209533691406f); //eyeR_fovUpDegrees(53.09438705444336f); //eyeR_fovDownDegrees(53.09438705444336f); //eyeR_fovLeftDegrees(47.52769470214844f); //eyeR_fovRightDegrees(46.63209533691406f); changeMode("normal"); Application.ExternalCall("vrInit"); } // Update is called once per frame void Update() { var unityEuler = ConvertWebVREulerToUnity(webVREuler); unityEuler.x = -unityEuler.x; unityEuler.z = -unityEuler.z; myTransform.rotation = Quaternion.Euler(unityEuler); var pos = webVRPosition; pos.z *= -1; myTransform.localPosition = myStartPosition + pos; StartCoroutine(WaitEndOfFrame()); } // Send post render update so we can submitFrame to vrDisplay. IEnumerator WaitEndOfFrame() { yield return new WaitForEndOfFrame(); Application.ExternalCall("postRender"); } #region receive values form JavaScript void eyeL_translation_x(float val) { cameraLTransform.position.Set(val, 0, 0); } void eyeR_translation_x(float val) { cameraRTransform.position.Set(val, 0, 0); } void eyeL_fovUpDegrees(float val) { eyeLFOVUpTan = (float)Math.Tan(val * DEG2RAD) * cameraMain.nearClipPlane; } void eyeL_fovDownDegrees(float val) { eyeLFOVDownTan = -(float)Math.Tan(val * DEG2RAD) * cameraMain.nearClipPlane; } void eyeL_fovLeftDegrees(float val) { eyeLFOVLeftTan = -(float)Math.Tan(val * DEG2RAD) * cameraMain.nearClipPlane; } void eyeL_fovRightDegrees(float val) { eyeLFOVRightTan = (float)Math.Tan(val * DEG2RAD) * cameraMain.nearClipPlane; cameraL.projectionMatrix = PerspectiveOffCenter( eyeLFOVLeftTan, eyeLFOVRightTan, eyeLFOVDownTan, eyeLFOVUpTan, cameraMain.nearClipPlane, cameraMain.farClipPlane); } void eyeR_fovUpDegrees(float val) { eyeRFOVUpTan = (float)Math.Tan(val * DEG2RAD) * cameraMain.nearClipPlane; } void eyeR_fovDownDegrees(float val) { eyeRFOVDownTan = -(float)Math.Tan(val * DEG2RAD) * cameraMain.nearClipPlane; } void eyeR_fovLeftDegrees(float val) { eyeRFOVLeftTan = -(float)Math.Tan(val * DEG2RAD) * cameraMain.nearClipPlane; } void eyeR_fovRightDegrees(float val) { try { eyeRFOVRightTan = (float)Math.Tan(val * DEG2RAD) * cameraMain.nearClipPlane; var m = PerspectiveOffCenter( eyeRFOVLeftTan, eyeRFOVRightTan, eyeRFOVDownTan, eyeRFOVUpTan, cameraMain.nearClipPlane, cameraMain.farClipPlane); cameraR.projectionMatrix = m; } catch (Exception ex) { Application.ExternalEval("console.log('" + ex.StackTrace + "')"); } } void euler_x(float val) { webVREuler.x = val; } void euler_y(float val) { webVREuler.y = val; } void euler_z(float val) { webVREuler.z = val; } void position_x(float val) { webVRPosition.x = val; } void position_y(float val) { webVRPosition.y = val; } void position_z(float val) { webVRPosition.z = val; } void changeMode(string mode) { switch (mode) { case "normal": cameraMain.GetComponent<Camera>().enabled = true; cameraL.GetComponent<Camera>().enabled = false; cameraR.GetComponent<Camera>().enabled = false; break; case "vr": cameraMain.GetComponent<Camera>().enabled = false; cameraL.GetComponent<Camera>().enabled = true; cameraR.GetComponent<Camera>().enabled = true; break; } } #endregion static Matrix4x4 PerspectiveOffCenter(float left, float right, float bottom, float top, float near, float far) { float x = 2.0F * near / (right - left); float y = 2.0F * near / (top - bottom); float a = (right + left) / (right - left); float b = (top + bottom) / (top - bottom); float c = -(far + near) / (far - near); float d = -(2.0F * far * near) / (far - near); float e = -1.0F; Matrix4x4 m = new Matrix4x4(); m[0, 0] = x; m[0, 1] = 0; m[0, 2] = a; m[0, 3] = 0; m[1, 0] = 0; m[1, 1] = y; m[1, 2] = b; m[1, 3] = 0; m[2, 0] = 0; m[2, 1] = 0; m[2, 2] = c; m[2, 3] = d; m[3, 0] = 0; m[3, 1] = 0; m[3, 2] = e; m[3, 3] = 0; return m; } /// <summary> /// Converts the given XYZ euler rotation taken from Threejs to a Unity Euler rotation /// </summary> Vector3 ConvertWebVREulerToUnity(Vector3 eulerThreejs) { eulerThreejs.x *= -1; eulerThreejs.z *= -1; Matrix4x4 threejsMatrix = CreateRotationalMatrixThreejs(ref eulerThreejs); Matrix4x4 unityMatrix = threejsMatrix; unityMatrix.m02 *= -1; unityMatrix.m12 *= -1; unityMatrix.m20 *= -1; unityMatrix.m21 *= -1; Quaternion rotation = ExtractRotationFromMatrix(ref unityMatrix); return rotation.eulerAngles; } /// <summary> /// Creates a rotation matrix for the given threejs euler rotation /// </summary> Matrix4x4 CreateRotationalMatrixThreejs(ref Vector3 eulerThreejs) { float c1 = Mathf.Cos(eulerThreejs.x); float c2 = Mathf.Cos(eulerThreejs.y); float c3 = Mathf.Cos(eulerThreejs.z); float s1 = Mathf.Sin(eulerThreejs.x); float s2 = Mathf.Sin(eulerThreejs.y); float s3 = Mathf.Sin(eulerThreejs.z); Matrix4x4 threejsMatrix = new Matrix4x4(); threejsMatrix.m00 = c2 * c3; threejsMatrix.m01 = -c2 * s3; threejsMatrix.m02 = s2; threejsMatrix.m10 = c1 * s3 + c3 * s1 * s2; threejsMatrix.m11 = c1 * c3 - s1 * s2 * s3; threejsMatrix.m12 = -c2 * s1; threejsMatrix.m20 = s1 * s3 - c1 * c3 * s2; threejsMatrix.m21 = c3 * s1 + c1 * s2 * s3; threejsMatrix.m22 = c1 * c2; threejsMatrix.m33 = 1; return threejsMatrix; } /// <summary> /// Extract rotation quaternion from transform matrix. /// </summary> /// <param name="matrix">Transform matrix. This parameter is passed by reference /// to improve performance; no changes will be made to it.</param> /// <returns> /// Quaternion representation of rotation transform. /// </returns> Quaternion ExtractRotationFromMatrix(ref Matrix4x4 matrix) { Vector3 forward; forward.x = matrix.m02; forward.y = matrix.m12; forward.z = matrix.m22; Vector3 upwards; upwards.x = matrix.m01; upwards.y = matrix.m11; upwards.z = matrix.m21; return Quaternion.LookRotation(forward, upwards); } }
using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using Senai.Filmes.WebApi.Domains; using Senai.Filmes.WebApi.Repository; namespace Senai.Filmes.WebApi.Controllers { [Produces("application/json")] [Route("api/[controller]")] [ApiController] public class GenerosController : ControllerBase { GeneroRepository generoRepository = new GeneroRepository(); [HttpGet] public List<GeneroDomain> ListarTodos() // Lista todos Jasons de uma lista { return generoRepository.Listar(); } [HttpGet("{id}")] // Lista um só objeto da lista public IActionResult BuscarPorId(int id) { GeneroDomain genero = generoRepository.BuscarPorId(id); if (genero == null) { return NotFound(); } return Ok(genero); } [HttpPost] // Poderia passar pela url mas JSON é mais seguro public IActionResult Cadastrar(GeneroDomain generoDomain) { generoRepository.Cadastrar(generoDomain); return Ok(); } [HttpDelete("{id}")] // Lista um só objeto da lista public IActionResult Deletar(int Id) { generoRepository.Deletar(Id); return Ok(); } [HttpPut("{id}")] public IActionResult Atualizar(int id, GeneroDomain genero) { generoRepository.Atualizar(id, genero); return Ok(); } [HttpGet("{nome}/buscar")] public List<GeneroDomain> BuscarGenerosPorNome(string nome) { List<GeneroDomain> generoLs = generoRepository.BuscarPorNome(nome); if (generoLs == null) { NotFound(); } return generoLs; } } }
using apigerence.Models; using apigerence.Models.Context; using System.Collections.Generic; using System.Linq; namespace apigerence.Repository { public class TurmaRepository : ITurma { private readonly MySqlContext _context; public TurmaRepository(MySqlContext context) => _context = context; public List<Turma> Get() => _context.Turmas.ToList(); public Turma Find(long id) => _context.Turmas.Find(id); public Turma Post(Turma request) { _context.Turmas.Add(request); _context.SaveChanges(); return request; } public Turma Put(Turma request) { Turma dado = _context.Turmas.Find(request.cod_turma); if (dado == null) return null; _context.Entry(dado).CurrentValues.SetValues(request); _context.SaveChanges(); return request; } public Turma Delete(long id) { Turma request = Find(id); if (request == null) return null; int vinculo = _context.SerieVinculos.Where(serie => serie.cod_turma == id).Count(); if (vinculo > 0) return null; _context.Turmas.Remove(request); _context.SaveChanges(); return request; } } }
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. using System; using System.Collections.Generic; using System.IO.Compression; using System.Text; namespace Steeltoe.Messaging.RabbitMQ.Support.PostProcessor { public abstract class AbstractDeflaterPostProcessor : AbstractCompressingPostProcessor { protected AbstractDeflaterPostProcessor() { } protected AbstractDeflaterPostProcessor(bool autoDecompress) : base(autoDecompress) { } public virtual CompressionLevel Level { get; set; } = CompressionLevel.Fastest; } }
using System; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; namespace AzureDevOps.DataIngestor.Sdk.Entities { [Table("VssProject")] public class VssProjectEntity : VssBaseEntity { [Key] public Guid ProjectId { get; set; } public string Name { get; set; } public string State { get; set; } public long Revision { get; set; } public string Visibility { get; set; } public DateTime LastUpdateTime { get; set; } public string Url { get; set; } } }
@using Microsoft.AspNetCore.Mvc.Localization @inject IViewLocalizer Localizer @{ ViewData["Title"] = @Localizer["TaskBoards"]; } <h2>@ViewData["Title"]</h2> <div id="gn-taskManageBoardsContainer"> <!-- Board List Template --> <script type="text/html" id="gn-taskBoardList"> <h4 class="gn-clickable gn-taskBoardListTitle" data-bind="click: toogleVisibility"> <i class="glyphicon glyphicon-triangle-right" data-bind="visible: !isExpanded()"></i><i class="glyphicon glyphicon-triangle-bottom" data-bind="visible: isExpanded"></i> <span data-bind="text: title"></span> <i class="glyphicon glyphicon-refresh spinning" style="display: none" data-bind="visible: isLoading"></i> </h4> <div class="container gn-commandWidgetTopMargin" data-bind="visible: isExpanded"> <div class="row gn-gridTableRow"> <div class="col-xs-12 col-sm-4 col-md-4 col-lg-4 gn-gridTableHeader gn-gridTableCell"> @Localizer["Name"] </div> <div class="col-xs-12 col-sm-2 col-md-2 col-lg-2 gn-gridTableHeader gn-gridTableCell"> @Localizer["Category"] </div> <div class="col-xs-12 col-sm-2 col-md-2 col-lg-2 gn-gridTableHeader gn-gridTableCell"> @Localizer["PlannedStart"] </div> <div class="col-xs-12 col-sm-2 col-md-2 col-lg-2 gn-gridTableHeader gn-gridTableCell"> @Localizer["PlannedEnd"] </div> <div class="col-xs-12 col-sm-2 col-md-2 col-lg-2 gn-gridTableHeader gn-gridTableCell"> </div> </div> <!-- ko foreach: boards --> <div class="row gn-gridTableRow"> <div class="col-xs-12 col-sm-4 col-md-4 col-lg-4 gn-gridTableCell"> <a class="gn-clickable" data-bind="text: name, href: $root.buildTaskBoardUrl"></a> </div> <div class="col-xs-12 col-sm-2 col-md-2 col-lg-2 gn-gridTableCell" data-bind="text: categoryName"> </div> <div class="col-xs-12 col-sm-2 col-md-2 col-lg-2 gn-gridTableCell" data-bind="formattedDateText: plannedStart"> </div> <div class="col-xs-12 col-sm-2 col-md-2 col-lg-2 gn-gridTableCell" data-bind="formattedDateText: plannedEnd"> </div> <div class="col-xs-12 col-sm-2 col-md-2 col-lg-2 gn-gridTableCell"> <a class="gn-clickable" data-bind="click: function(board) { $root.openEditBoardDialog(board); }" title="@Localizer["EditBoardToolTip"]"><i class="glyphicon glyphicon-pencil"></i></a> <a class="gn-clickable" data-bind="click: function(board) { $root.openDeleteBoardDialog(board); }" title="@Localizer["DeleteBoardToolTip"]"><i class="glyphicon glyphicon-trash"></i></a> <a class="gn-clickable" data-bind="click: function(board) { $root.openToogleBoardStatusDialog(board); }, attr: { title: $parent.toogleStatusToolTip }"><i class="glyphicon" data-bind="css: $parent.toogleStatusIcon"></i></a> </div> </div> <!-- /ko --> <div class="container row col-xs-12 col-sm-12 col-md-12 col-lg-12 gn-buttonContainer"> <button class="btn btn-default" data-bind="enable: currentPage() > 0 && !isLoading(), click: prevPage" title="@Localizer["PreviousPage"]"> <i class="glyphicon glyphicon-chevron-left" data-bind="visible: !prevLoading()"></i> <i class="glyphicon glyphicon-refresh spinning" style="display: none" data-bind="visible: prevLoading"></i> </button> <button class="btn btn-default" data-bind="enable: hasMore() && !isLoading(), click: nextPage" title="@Localizer["NextPage"]"> <i class="glyphicon glyphicon-chevron-right" data-bind="visible: !nextLoading()"></i> <i class="glyphicon glyphicon-refresh spinning" style="display: none" data-bind="visible: nextLoading"></i> </button> </div> </div> </script> <!-- Delete Board Dialog --> <div class="modal fade" role="dialog" data-bind="modal: showConfirmDeleteDialog"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal">&times;</button> <h4 class="modal-title">@Localizer["AreYouSure"]</h4> </div> <div class="modal-body"> <p>@Localizer["AreYouSureYouWantToDeleteTheBoard"]</p> </div> <div class="modal-footer"> <button type="button" class="btn btn-default" data-bind="click: deleteBoard">@Localizer["Yes"]</button> <button type="button" class="btn btn-default" data-bind="click: closeConfirmDeleteDialog">@Localizer["No"]</button> </div> </div> </div> </div> <!-- Toogle Board Status Dialog --> <div class="modal fade" role="dialog" data-bind="modal: showConfirmToogleStatusDialog"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal">&times;</button> <h4 class="modal-title">@Localizer["AreYouSure"]</h4> </div> <div class="modal-body"> <p data-bind="visible: isToogleStatusClosing">@Localizer["AreYouSureYouWantToCloseTheBoard"]</p><p data-bind="visible: !isToogleStatusClosing()">@Localizer["AreYouSureYouWantToReopenTheBoard"]</p> </div> <div class="modal-footer"> <button type="button" class="btn btn-primary" data-bind="click: toogleBoardStatus">@Localizer["Yes"]</button> <button type="button" class="btn btn-default" data-bind="click: closeConfirmToogleStatusDialog">@Localizer["No"]</button> </div> </div> </div> </div> <!-- Create / Edit Dialog --> <div class="modal fade" role="dialog" data-bind="modal: showBoardCreateEditDialog" id="gn-taskManageBoardsNewBoardDialog"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal">&times;</button> <h4 class="modal-title"><span data-bind="if: isEditingBoard">@Localizer["EditTaskBoard"]</span><span data-bind="if: !isEditingBoard()">@Localizer["CreateTaskBoard"]</span></h4> </div> <!-- Modal Body --> <div class="modal-body"> <div class="alert alert-danger gn-defaultContentTopMargin" style="display: none" data-bind="visible: errorOccured"> <strong>@Localizer["Error"]</strong> <span>@Localizer["ErrorOccured"]</span> </div> <form id="gn-taskBoardCreateEditForm"> <div class="form-group"> <label for="gn-boardName">@Localizer["Name"]</label> <input type="text" class="form-control" id="gn-boardName" placeholder="@Localizer["Name"]" name="boardName" data-bind="value: createEditBoardName, enterPressed: saveBoard" required/> </div> <div class="form-group"> <label for="gn-boardPlannedStart">@Localizer["Category"]</label> <select class="form-control" id="gn-selectedScriptLanguage" name="selectedScriptLanguage" data-bind="value: createEditBoardCategory, options: taskBoardCategoryList.boardCategories, optionsText: 'name', optionsCaption: '@Localizer["NoCategory"]'"></select> </div> <div class="form-group"> <label for="gn-boardPlannedStart">@Localizer["PlannedStart"]</label> <input type="text" class="form-control" id="gn-boardPlannedStart" placeholder="@Localizer["PlannedStart"]" name="boardPlannedStart" data-bind="dateTimePicker: createEditBoardPlannedStart"/> <div class="gn-textDanger" data-bind="visible: showDateValidationError" style="display: none">@Localizer["StartDateHasToBeBeforeEndDate"]</div> </div> <div class="form-group"> <label for="gn-boardPlannedEnd">@Localizer["PlannedEnd"]</label> <input type="text" class="form-control" id="gn-boardPlannedEnd" placeholder="@Localizer["PlannedEnd"]" name="boardPlannedEnd" data-bind="dateTimePicker: createEditBoardPlannedEnd"/> </div> </form> </div> <!-- Modal Footer --> <div class="modal-footer"> <button type="button" class="btn btn-primary" data-bind="click: saveBoard">@Localizer["Save"]</button> <button type="button" class="btn btn-default" data-bind="click: cancelBoardDialog">@Localizer["Cancel"]</button> </div> </div> </div> </div> <!-- Board Category List Template --> <script type="text/html" id="gn-taskBoardCategoryList"> <h4 class="gn-clickable gn-taskBoardListTitle" data-bind="click: toogleVisibility"> <i class="glyphicon glyphicon-triangle-right" data-bind="visible: !isExpanded()"></i><i class="glyphicon glyphicon-triangle-bottom" data-bind="visible: isExpanded"></i> @Localizer["TaskBoardCategories"] <i class="glyphicon glyphicon-refresh spinning" style="display: none" data-bind="visible: isLoading"></i> <i class="glyphicon glyphicon-warning-sign text-danger" title="@Localizer["ErrorOccured"]" style="display: none" data-bind="visible: errorOccured"></i> </h4> <div class="container" data-bind="visible: isExpanded"> <button type="button" class="btn btn-primary gn-commandWidgetTopMargin" data-bind="click: openNewBoardCategoryDialog, disable: isLoading()"> <i class="glyphicon glyphicon-plus" data-bind="visible: !isLoading()"></i><i class="glyphicon glyphicon-refresh spinning" style="display: none" data-bind="visible: isLoading"></i> @Localizer["CreateNewBoardCategory"] </button> <div class="row gn-gridTableRow gn-commandWidgetTopMargin"> <div class="col-xs-12 col-sm-7 col-md-7 col-lg-7 gn-gridTableHeader gn-gridTableCell"> @Localizer["Name"] </div> <div class="col-xs-12 col-sm-3 col-md-3 col-lg-3 gn-gridTableHeader gn-gridTableCell"> @Localizer["IsExpandedByDefault"] </div> <div class="col-xs-12 col-sm-2 col-md-2 col-lg-2 gn-gridTableHeader gn-gridTableCell"> </div> </div> <!-- ko foreach: boardCategories --> <div class="row gn-gridTableRow"> <div class="col-xs-12 col-sm-7 col-md-7 col-lg-7 gn-gridTableCell" data-bind="text: name"> </div> <div class="col-xs-12 col-sm-3 col-md-3 col-lg-3 gn-gridTableCell" data-bind="text: isExpandedByDefault ? '@Localizer["Yes"]' : '@Localizer["No"]'"> </div> <div class="col-xs-12 col-sm-2 col-md-2 col-lg-2 gn-gridTableCell"> <a class="gn-clickable" data-bind="click: function(category) { $parent.openEditBoardCategoryDialog(category); }" title="@Localizer["EditBoardCategoryToolTip"]"><i class="glyphicon glyphicon-pencil"></i></a> <a class="gn-clickable" data-bind="click: function(category) { $parent.openDeleteBoardCategoryDialog(category); }" title="@Localizer["DeleteBoardCategoryToolTip"]"><i class="glyphicon glyphicon-trash"></i></a> </div> </div> <!-- /ko --> </div> <!-- Create/Edit category --> <div class="modal fade" role="dialog" data-bind="modal: showCreateEditCategoryDialog"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal">&times;</button> <h4 class="modal-title"> <span data-bind="if: isEditingCategory">@Localizer["EditTaskBoardCategory"]</span><span data-bind="if: !isEditingCategory()">@Localizer["CreateTaskBoardCategory"]</span> <i class="glyphicon glyphicon-refresh spinning" style="display: none" data-bind="visible: isLoading"></i> </h4> </div> <!-- Modal Body --> <div class="modal-body"> <div class="alert alert-danger gn-defaultContentTopMargin" style="display: none" data-bind="visible: errorOccured"> <strong>@Localizer["Error"]</strong> <span>@Localizer["ErrorOccured"]</span> </div> <form id="gn-taskBoardCategoryCreateEditForm"> <div class="form-group"> <label for="gn-boardCategoryName">@Localizer["Name"]</label> <input type="text" class="form-control" id="gn-boardCategoryName" placeholder="@Localizer["Name"]" name="boardCategoryName" data-bind="value: showCreateEditCategoryName, enterPressed: saveBoardCategory" required/> </div> <div class="checkbox"> <label><input type="checkbox" data-bind="checked: showCreateEditCategoryExpandedByDefault"/>@Localizer["IsExpandedByDefaultCheckbox"]</label> </div> </form> </div> <!-- Modal Footer --> <div class="modal-footer"> <button type="button" class="btn btn-primary" data-bind="click: saveBoardCategory, disable: isLoading"> <i class="glyphicon glyphicon-refresh spinning" style="display: none" data-bind="visible: isLoading"></i> @Localizer["Save"] </button> <button type="button" class="btn btn-default" data-bind="click: cancelBoardCategoryDialog, disable: isLoading">@Localizer["Cancel"]</button> </div> </div> </div> </div> <!-- Delete category --> <div class="modal fade" role="dialog" data-bind="modal: showConfirmDeleteDialog"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal">&times;</button> <h4 class="modal-title"> @Localizer["AreYouSure"] <i class="glyphicon glyphicon-refresh spinning" style="display: none" data-bind="visible: isLoading"></i> </h4> </div> <div class="modal-body"> <div class="alert alert-danger gn-defaultContentTopMargin" style="display: none" data-bind="visible: errorOccured"> <strong>@Localizer["Error"]</strong> <span>@Localizer["ErrorOccured"]</span> </div> <p>@Localizer["AreYouSureYouWantToDeleteTheBoardCategory"]</p> <p data-bind="visible: isCategoryToDeleteUsedByBoard"> <strong>@Localizer["Warning"]</strong> <span>@Localizer["CategoryIsUsedByBoard"]</span> </p> </div> <div class="modal-footer"> <button type="button" class="btn btn-default" data-bind="click: deleteBoardCategory, disable: isLoading"> <i class="glyphicon glyphicon-refresh spinning" style="display: none" data-bind="visible: isLoading"></i> @Localizer["Yes"] </button> <button type="button" class="btn btn-default" data-bind="click: closeConfirmDeleteBoardCategoryDialog, disable: isLoading">@Localizer["No"]</button> </div> </div> </div> </div> </script> <!-- Command Buttons --> <button type="button" class="btn btn-primary gn-commandWidgetTopMargin" data-bind="click: openNewBoardDialog, disable: isLoading()" id="gn-taskManageBoardsNewBoardButton"> <i class="glyphicon glyphicon-plus" data-bind="visible: !isLoading()"></i><i class="glyphicon glyphicon-refresh spinning" style="display: none" data-bind="visible: isLoading"></i> @Localizer["CreateNewBoard"] </button> <div class="alert alert-danger gn-defaultContentTopMargin" style="display: none" data-bind="visible: errorOccured"> <strong>@Localizer["Error"]</strong> <span>@Localizer["ErrorOccured"]</span> <span data-bind="text: additionalErrorDetails, visible: additionalErrorDetails"></span> </div> <div data-bind="template: { name: 'gn-taskBoardList', data: openBoardList }"></div> <div data-bind="template: { name: 'gn-taskBoardList', data: closedBoardList }"></div> @if(User.IsInRole(RoleNames.TaskBoardCategoryManager)) { <div data-bind="template: { name: 'gn-taskBoardCategoryList', data: taskBoardCategoryList }"></div> } </div> @section Scripts { @await Html.PartialAsync("_ValidationScriptsPartial") <script src="~/lib/eonasdan-bootstrap-datetimepicker/build/js/bootstrap-datetimepicker.min.js"></script> <environment include="Development"> <script src="~/js/Task/manageBoards.viewmodel.js" asp-append-version="true"></script> </environment> <environment exclude="Development"> <script src="~/js/Task/manageBoards.viewmodel.min.js" asp-append-version="true"></script> </environment> <script type="text/javascript"> GoNorth.Task.ManageBoards.Localization = { OpenTaskBoards: "@Localizer["OpenTaskBoards"]", CloseTaskBoardToolTip: "@Localizer["CloseTaskBoardToolTip"]", ClosedTaskBoards: "@Localizer["ClosedTaskBoards"]", ReopenTaskBoardToolTip: "@Localizer["ReopenTaskBoardToolTip"]", }; jQuery(document).ready(function() { ko.applyBindings(new GoNorth.Task.ManageBoards.ViewModel(), jQuery("#gn-taskManageBoardsContainer")[0]); }); </script> } @section Styles { <link rel="stylesheet" href="~/lib/eonasdan-bootstrap-datetimepicker/build/css/bootstrap-datetimepicker.min.css" /> }
// Copyright (c) the authors of nanoGames. All rights reserved. // Licensed under the MIT license. See LICENSE.txt in the project root. namespace NanoGames.Games.NanoSoccer { internal interface Circle { Vector Position { get; set; } double Radius { get; } Vector Velocity { get; set; } double MaximumVelocity { get; } double Mass { get; } } }
@{ ViewData["Title"] = "Getting started"; } @section LeftNav { <nav> <h4 class="govuk-heading-s">Setup guides</h4> <p class="govuk-body">some options</p> <h4 class="govuk-heading-s">How to guides</h4> <p class="govuk-body">some options</p> </nav> } <main id="main-content" role="main"> <govukHeadingH1 text="GDS Razor Class Library"/> <div> <p class="govuk-body">add @@addTagHelper *, DFC.Personalisation.CommonUI to _ViewImports.cshtml</p> </div> </main>
using SongProcessor.Models; namespace SongProcessor.Gatherers; public interface IAnimeGatherer { string Name { get; } Task<IAnimeBase> GetAsync(int id, GatherOptions options); }
//Copyright (c) 2018 Yardi Technology Limited. Http://www.kooboo.com //All rights reserved. using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Globalization; namespace Kooboo.Lib.Helper { public static class DateTimeHelper { public static string ParseDateFormat(List<string> DateStrings) { HashSet<string> formates = GetPossibleFormats(DateStrings); return ParseDateFormat(DateStrings, formates); } private static HashSet<string> GetPossibleFormats(List<string> DateStrings) { var seps = getContainsSeps(DateStrings); var exclus = getExclusSeps(DateStrings); var formates = GetPossibleFormates(seps, exclus); List<string> withoutyear = new List<string>(); foreach (var item in formates) { var trimyear = TrimYear(item); if (!string.IsNullOrWhiteSpace(trimyear)) { withoutyear.Add(trimyear); } } foreach (var item in withoutyear) { formates.Add(item); } return formates; } public static string TrimYear(string formate) { int len = formate.Length; if (formate[0] == 'y' || formate[0] == 'Y') { for (int i = 0; i < len; i++) { if (formate[i] =='y' || formate[i] =='Y') { continue; } var currentchar = formate[i]; if (!Lib.Helper.CharHelper.IsAscii(currentchar)) { continue; } return formate.Substring(i); } } else if (formate[len -1] == 'y' || formate[len-1] == 'Y') { for (int i = len -1; i > 0; i--) { if (formate[i] == 'y' || formate[i] == 'Y') { continue; } var currentchar = formate[i]; if (!Lib.Helper.CharHelper.IsAscii(currentchar)) { continue; } return formate.Substring(0, i+1); } } return null; } public static string ParseDateFormat(IEnumerable<string> DateStrings, IEnumerable<string> availableFormats) { foreach (var format in availableFormats) { bool match = true; DateTime output; foreach (var date in DateStrings) { if (!DateTime.TryParseExact(date, format, DateTimeFormatInfo.InvariantInfo, DateTimeStyles.None, out output)) { match = false; break; } } if (match) { return format; } } return null; } private static List<string> getContainsSeps(List<string> datestrings) { List<string> result = new List<string>(); List<string> candidates = new List<string>(); candidates.Add(":"); candidates.Add("/"); candidates.Add("-"); candidates.Add(" "); candidates.Add("."); candidates.Add(","); foreach (var item in candidates) { bool hascand = true; foreach (var date in datestrings) { if (!date.Contains(item)) { hascand = false; break; } } if (hascand) { result.Add(item); } } return result; } private static List<string> getExclusSeps(List<string> datestrings) { List<string> result = new List<string>(); List<string> candidates = new List<string>(); candidates.Add(":"); candidates.Add("/"); candidates.Add("-"); candidates.Add(" "); candidates.Add("."); candidates.Add(","); foreach (var item in candidates) { bool withoutcand = true; foreach (var date in datestrings) { if (date.Contains(item)) { withoutcand = false; break; } } if (withoutcand) { result.Add(item); } } return result; } private static bool HasChar(List<string> datestrings, string sep) { foreach (var item in datestrings) { if (!item.Contains(sep)) { return false; } } return true; } public static HashSet<string> GetPossibleFormates(List<string> seps, List<string> exclus) { var allformats = AllFormates(); HashSet<string> result = new HashSet<string>(); foreach (var item in allformats) { bool match = true; foreach (var s in seps) { if (!item.Contains(s)) { match = false; break; } } if (!match) { continue; } // filter by exclus. bool excl = false; foreach (var e in exclus) { if (item.Contains(e)) { excl = true; break; } } if (excl) { continue; } result.Add(item); } return result; } public static HashSet<string> AllFormates() { HashSet<string> formates = new HashSet<string>(); var allcultures = CultureInfo.GetCultures(CultureTypes.AllCultures); foreach (var item in allcultures) { var allformats = item.DateTimeFormat.GetAllDateTimePatterns(); foreach (var f in allformats) { formates.Add(f); } } return formates; } // compare till minutes. public static bool EqualMinitues(DateTime timeone, DateTime timetwo) { return timeone.Year == timetwo.Year && timeone.DayOfYear == timetwo.DayOfYear && timeone.Hour == timetwo.Hour && timeone.Minute == timetwo.Minute; } } }
using System.Runtime.CompilerServices; [assembly: InternalsVisibleTo("CHG.Extensions.Security.Txt.Tests")]
using System; public partial class Tester { public void TestEnhancedInterpolatedStrings() { //var s0 = "hallo\"; var s1 = @"hallo\"; var s2 = $"Hello to {s1}"; var s3 = $@"Hello \ {s2}"; var s4 = $@"Hello \ {s2}"; Console.WriteLine(s1); Console.WriteLine(s2); Console.WriteLine(s3); Console.WriteLine(s4); } }
/* --------------------------------------- * Author: Martin Pane (martintayx@gmail.com) (@tayx94) * Collaborators: Lars Aalbertsen (@Rockylars) * Project: Graphy - Ultimate Stats Monitor * Date: 05-Dec-17 * Studio: Tayx * * This project is released under the MIT license. * Attribution is not required, but it is always welcomed! * -------------------------------------*/ using UnityEngine; using UnityEngine.UI; using System.Collections.Generic; using System.Text; using Tayx.Graphy.UI; using Tayx.Graphy.Utils; using Tayx.Graphy.Utils.NumString; #if UNITY_5_5_OR_NEWER using UnityEngine.Profiling; #endif namespace Tayx.Graphy.Advanced { public class G_AdvancedData : MonoBehaviour, IMovable, IModifiableState { /* ----- TODO: ---------------------------- * Add summaries to the variables. * Add summaries to the functions. * --------------------------------------*/ #region Variables -> Serialized Private [SerializeField] private List<Image> m_backgroundImages = new List<Image>(); [SerializeField] private Text m_graphicsDeviceVersionText = null; [SerializeField] private Text m_processorTypeText = null; [SerializeField] private Text m_operatingSystemText = null; [SerializeField] private Text m_systemMemoryText = null; [SerializeField] private Text m_graphicsDeviceNameText = null; [SerializeField] private Text m_graphicsMemorySizeText = null; [SerializeField] private Text m_screenResolutionText = null; [SerializeField] private Text m_gameWindowResolutionText = null; [Range(1, 60)] [SerializeField] private float m_updateRate = 1f; // 1 update per sec. #endregion #region Variables -> Private private GraphyManager m_graphyManager = null; private RectTransform m_rectTransform = null; private float m_deltaTime = 0.0f; private StringBuilder m_sb = null; private GraphyManager.ModuleState m_previousModuleState = GraphyManager.ModuleState.FULL; private GraphyManager.ModuleState m_currentModuleState = GraphyManager.ModuleState.FULL; private readonly string[] m_windowStrings = { "Window: ", "x", "@", "Hz", "[", "dpi]" }; #endregion #region Methods -> Unity Callbacks private void OnEnable() { Init(); } private void Update() { m_deltaTime += Time.unscaledDeltaTime; if (m_deltaTime > 1f / m_updateRate) { // Update screen window resolution m_sb.Length = 0; m_sb.Append(m_windowStrings[0]).Append(UnityEngine.Screen.width.ToStringNonAlloc()) .Append(m_windowStrings[1]).Append(UnityEngine.Screen.height.ToStringNonAlloc()) .Append(m_windowStrings[2]).Append(UnityEngine.Screen.currentResolution.refreshRate.ToStringNonAlloc()) .Append(m_windowStrings[3]) .Append(m_windowStrings[4]).Append(UnityEngine.Screen.dpi.ToStringNonAlloc()) .Append(m_windowStrings[5]); m_gameWindowResolutionText.text = m_sb.ToString(); // Reset variables m_deltaTime = 0f; } } #endregion #region Methods -> Public public void SetPosition(GraphyManager.ModulePosition newModulePosition) { float xSideOffsetBackgroundImage = Mathf.Abs(m_backgroundImages[0].rectTransform.anchoredPosition.x); float ySideOffset = Mathf.Abs(m_rectTransform.anchoredPosition.y); switch (newModulePosition) { case GraphyManager.ModulePosition.TOP_LEFT: m_rectTransform.anchorMax = Vector2.one; m_rectTransform.anchorMin = Vector2.up; m_rectTransform.anchoredPosition = new Vector2(0, -ySideOffset); m_backgroundImages[0].rectTransform.anchorMax = Vector2.up; m_backgroundImages[0].rectTransform.anchorMin = Vector2.zero; m_backgroundImages[0].rectTransform.anchoredPosition = new Vector2(xSideOffsetBackgroundImage, 0); break; case GraphyManager.ModulePosition.TOP_RIGHT: m_rectTransform.anchorMax = Vector2.one; m_rectTransform.anchorMin = Vector2.up; m_rectTransform.anchoredPosition = new Vector2(0, -ySideOffset); m_backgroundImages[0].rectTransform.anchorMax = Vector2.one; m_backgroundImages[0].rectTransform.anchorMin = Vector2.right; m_backgroundImages[0].rectTransform.anchoredPosition = new Vector2(-xSideOffsetBackgroundImage, 0); break; case GraphyManager.ModulePosition.BOTTOM_LEFT: m_rectTransform.anchorMax = Vector2.right; m_rectTransform.anchorMin = Vector2.zero; m_rectTransform.anchoredPosition = new Vector2(0, ySideOffset); m_backgroundImages[0].rectTransform.anchorMax = Vector2.up; m_backgroundImages[0].rectTransform.anchorMin = Vector2.zero; m_backgroundImages[0].rectTransform.anchoredPosition = new Vector2(xSideOffsetBackgroundImage, 0); break; case GraphyManager.ModulePosition.BOTTOM_RIGHT: m_rectTransform.anchorMax = Vector2.right; m_rectTransform.anchorMin = Vector2.zero; m_rectTransform.anchoredPosition = new Vector2(0, ySideOffset); m_backgroundImages[0].rectTransform.anchorMax = Vector2.one; m_backgroundImages[0].rectTransform.anchorMin = Vector2.right; m_backgroundImages[0].rectTransform.anchoredPosition = new Vector2(-xSideOffsetBackgroundImage, 0); break; case GraphyManager.ModulePosition.FREE: break; } switch (newModulePosition) { case GraphyManager.ModulePosition.TOP_LEFT: case GraphyManager.ModulePosition.BOTTOM_LEFT: m_processorTypeText .alignment = TextAnchor.UpperLeft; m_systemMemoryText .alignment = TextAnchor.UpperLeft; m_graphicsDeviceNameText .alignment = TextAnchor.UpperLeft; m_graphicsDeviceVersionText .alignment = TextAnchor.UpperLeft; m_graphicsMemorySizeText .alignment = TextAnchor.UpperLeft; m_screenResolutionText .alignment = TextAnchor.UpperLeft; m_gameWindowResolutionText .alignment = TextAnchor.UpperLeft; m_operatingSystemText .alignment = TextAnchor.UpperLeft; break; case GraphyManager.ModulePosition.TOP_RIGHT: case GraphyManager.ModulePosition.BOTTOM_RIGHT: m_processorTypeText .alignment = TextAnchor.UpperRight; m_systemMemoryText .alignment = TextAnchor.UpperRight; m_graphicsDeviceNameText .alignment = TextAnchor.UpperRight; m_graphicsDeviceVersionText .alignment = TextAnchor.UpperRight; m_graphicsMemorySizeText .alignment = TextAnchor.UpperRight; m_screenResolutionText .alignment = TextAnchor.UpperRight; m_gameWindowResolutionText .alignment = TextAnchor.UpperRight; m_operatingSystemText .alignment = TextAnchor.UpperRight; break; case GraphyManager.ModulePosition.FREE: break; } } public void SetState(GraphyManager.ModuleState state, bool silentUpdate = false) { if (!silentUpdate) { m_previousModuleState = m_currentModuleState; } m_currentModuleState = state; bool active = state == GraphyManager.ModuleState.FULL || state == GraphyManager.ModuleState.TEXT || state == GraphyManager.ModuleState.BASIC; gameObject.SetActive(active); m_backgroundImages.SetAllActive(active && m_graphyManager.Background); } /// <summary> /// Restores state to the previous one. /// </summary> public void RestorePreviousState() { SetState(m_previousModuleState); } public void UpdateParameters() { foreach (var image in m_backgroundImages) { image.color = m_graphyManager.BackgroundColor; } SetPosition(m_graphyManager.AdvancedModulePosition); SetState(m_graphyManager.AdvancedModuleState); } public void RefreshParameters() { foreach (var image in m_backgroundImages) { image.color = m_graphyManager.BackgroundColor; } SetPosition(m_graphyManager.AdvancedModulePosition); SetState(m_currentModuleState, true); } #endregion #region Methods -> Private private void Init() { //TODO: Replace this with one activated from the core and figure out the min value. if (!G_FloatString.Inited || G_FloatString.MinValue > -1000f || G_FloatString.MaxValue < 16384f) { G_FloatString.Init ( minNegativeValue: -1001f, maxPositiveValue: 16386f ); } m_graphyManager = transform.root.GetComponentInChildren<GraphyManager>(); m_sb = new StringBuilder(); m_rectTransform = GetComponent<RectTransform>(); #region Section -> Text m_processorTypeText.text = "CPU: " + SystemInfo.processorType + " [" + SystemInfo.processorCount + " cores]"; m_systemMemoryText.text = "RAM: " + SystemInfo.systemMemorySize + " MB"; m_graphicsDeviceVersionText.text = "Graphics API: " + SystemInfo.graphicsDeviceVersion; m_graphicsDeviceNameText.text = "GPU: " + SystemInfo.graphicsDeviceName; m_graphicsMemorySizeText.text = "VRAM: " + SystemInfo.graphicsMemorySize + "MB. Max texture size: " + SystemInfo.maxTextureSize + "px. Shader level: " + SystemInfo.graphicsShaderLevel; Resolution res = UnityEngine.Screen.currentResolution; m_screenResolutionText.text = "Screen: " + res.width + "x" + res.height + "@" + res.refreshRate + "Hz"; m_operatingSystemText.text = "OS: " + SystemInfo.operatingSystem + " [" + SystemInfo.deviceType + "]"; float preferredWidth = 0; // Resize the background overlay List<Text> texts = new List<Text>() { m_graphicsDeviceVersionText, m_processorTypeText, m_systemMemoryText, m_graphicsDeviceNameText, m_graphicsMemorySizeText, m_screenResolutionText, m_gameWindowResolutionText, m_operatingSystemText }; foreach (var text in texts) { if (text.preferredWidth > preferredWidth) { preferredWidth = text.preferredWidth; } } #endregion #region Section -> Background Images m_backgroundImages[0].rectTransform.SetSizeWithCurrentAnchors ( axis: RectTransform.Axis.Horizontal, size: preferredWidth + 10 ); m_backgroundImages[0].rectTransform.anchoredPosition = new Vector2 ( x: (preferredWidth + 15) / 2 * Mathf.Sign(m_backgroundImages[0].rectTransform.anchoredPosition.x), y: m_backgroundImages[0].rectTransform.anchoredPosition.y ); #endregion UpdateParameters(); } #endregion } }
using GeminiLab.Glos; using GeminiLab.XUnitTester.Gliep.Misc; using Xunit; namespace GeminiLab.XUnitTester.Gliep.Glos { public class Exceptions : GlosTestBase { [Fact] public void BadBranch() { var fun = Builder.AddFunctionRaw(new[] { (byte)GlosOp.BS, (byte)42, (byte)GlosOp.LdDel, (byte)GlosOp.Ld0, (byte)GlosOp.Ret, }, 0); Builder.Entry = fun; var exception = GlosRuntimeExceptionCatcher.Catch<GlosInvalidInstructionPointerException>(() => { Execute(); }); Assert.Equal(0, ViMa.CurrentCoroutine?.CallStackFrames[^1].InstructionPointer); Assert.Equal(44, ViMa.CurrentCoroutine?.CallStackFrames[^1].NextInstructionPointer); } [Fact] public void UnexpectedEndOfCode() { var fun = Builder.AddFunctionRaw(new[] { (byte)GlosOp.LdQ, (byte)0, (byte)0, (byte)0, }, 0); Builder.Entry = fun; GlosRuntimeExceptionCatcher.Catch<GlosUnexpectedEndOfCodeException>(() => { Execute(); }); fun = Builder.AddFunctionRaw(new[] { (byte)GlosOp.Ld, (byte)0, }, 0); Builder.Entry = fun; GlosRuntimeExceptionCatcher.Catch<GlosUnexpectedEndOfCodeException>(() => { Execute(); }); fun = Builder.AddFunctionRaw(new[] { (byte)GlosOp.LdS, }, 0); Builder.Entry = fun; GlosRuntimeExceptionCatcher.Catch<GlosUnexpectedEndOfCodeException>(() => { Execute(); }); } [Fact] public void LocalVariableOutOfRange() { var fun = Builder.AddFunctionRaw(new[] { (byte)GlosOp.LdLoc0, }, 0); Builder.Entry = fun; var exception = GlosRuntimeExceptionCatcher.Catch<GlosLocalVariableIndexOutOfRangeException>(() => { Execute(); }); Assert.Equal(0, exception.Index); fun = Builder.AddFunctionRaw(new[] { (byte)GlosOp.StLoc1, }, 0); Builder.Entry = fun; exception = GlosRuntimeExceptionCatcher.Catch<GlosLocalVariableIndexOutOfRangeException>(() => { Execute(); }); Assert.Equal(1, exception.Index); } [Fact] public void UnknownOp() { var fun = Builder.AddFunctionRaw(new[] { (byte)GlosOp.Invalid, }, 0); Builder.Entry = fun; var exception = GlosRuntimeExceptionCatcher.Catch<GlosUnknownOpException>(() => { Execute(); }); Assert.Equal((byte)GlosOp.Invalid, exception.Op); } [Fact] public void NotCallable() { var fgen = Builder.AddFunction(); fgen.AppendLdDel(); fgen.AppendLd(1); fgen.AppendCall(); fgen.SetEntry(); var exception = GlosRuntimeExceptionCatcher.Catch<GlosValueNotCallableException>(() => { Execute(); }); Assert.Equal(GlosValueType.Integer, exception.Value.Type); Assert.Equal(1, exception.Value.AssumeInteger()); } [Fact] public void AssertionFailed() { var fgen = Builder.AddFunction(); fgen.AppendLd(1); fgen.AppendGmt(); fgen.AppendRet(); fgen.SetEntry(); var exception = GlosRuntimeExceptionCatcher.Catch<GlosValueTypeAssertionFailedException>(() => { Execute(); }); Assert.Equal(new[] { GlosValueType.Table }, exception.Expected); Assert.Equal(GlosValueType.Integer, exception.Value.Type); Assert.Equal(1, exception.Value.AssumeInteger()); } [Fact] public void InvalidUnOperand() { var fgen = Builder.AddFunction(); fgen.AppendLdStr(""); fgen.AppendNeg(); fgen.SetEntry(); var exception = GlosRuntimeExceptionCatcher.Catch<GlosInvalidUnaryOperandTypeException>(() => { Execute(); }); Assert.Equal(GlosOp.Neg, exception.Op); Assert.Equal(GlosValueType.String, exception.Operand.Type); Assert.Equal("", exception.Operand.AssumeString()); fgen = Builder.AddFunction(); fgen.AppendLdStr(""); fgen.AppendNot(); fgen.SetEntry(); exception = GlosRuntimeExceptionCatcher.Catch<GlosInvalidUnaryOperandTypeException>(() => { Execute(); }); Assert.Equal(GlosOp.Not, exception.Op); Assert.Equal(GlosValueType.String, exception.Operand.Type); Assert.Equal("", exception.Operand.AssumeString()); } [Fact] public void IllLdStr() { var fgen = Builder.AddFunction(); var invalidIndex = Builder.StringCount + 100; fgen.AppendLdStr(invalidIndex); fgen.AppendRet(); fgen.SetEntry(); var exception = GlosRuntimeExceptionCatcher.Catch<GlosStringIndexOutOfRangeException>(() => { Execute(); }); Assert.Equal(invalidIndex, exception.Index); } [Fact] public void IllLdFun() { var fgen = Builder.AddFunction(); var invalidIndex = Builder.FunctionCount + 100; fgen.AppendLdFun(invalidIndex); fgen.AppendRet(); fgen.SetEntry(); var exception = GlosRuntimeExceptionCatcher.Catch<GlosFunctionIndexOutOfRangeException>(() => { Execute(); }); Assert.Equal(invalidIndex, exception.Index); } } }
namespace FF12RNGHelper.Core { /// <summary> /// The StealRngHelper contains the necessary logic /// to calculate and predict the outcome of stealing. /// </summary> public class StealRngHelper : BaseRngHelper { #region privates private StealFutureRng _futureRng; #endregion privates #region construction/initialization public StealRngHelper(PlatformType platform, CharacterGroup group) : base(platform, group) { _futureRng = new StealFutureRng(); } #endregion construction/intialization #region public methods public new StealFutureRng GetStealFutureRng() { return _futureRng; } #endregion public methods #region protected methods protected override void CalculateRngHelper() { int rarePosition = -1; int rarePositionCuffs = -1; bool rareSteal = false; bool rareStealCuffs = false; _futureRng = new StealFutureRng(); // Use these variables to check for first punch combo ComboFound = false; ComboPosition = -1; uint firstRngVal = DisplayRng.genrand(); uint secondRngVal = DisplayRng.genrand(); uint thirdRngVal = DisplayRng.genrand(); // We want to preserve the character index, since this loop is just for display: int indexStatic = Group.GetIndex(); Group.ResetIndex(); int start = GetLoopStartIndex(); int end = start + HealVals.Count + FutureRngPositionsToCalculate; for (int index = start; index < end; index++) { // Index starting at 0 LoopIndex = index - start; // Get the heal value once int currentHeal = Group.GetHealValue(firstRngVal); int nextHeal = Group.PeekHealValue(secondRngVal); // Set the next expected heal value if (index == start + HealVals.Count - 1 || index == 1) { NextHealValue = nextHeal; } // Advance the RNG before starting the loop in case we want to skip an entry uint firstRngValTemp = firstRngVal; uint secondRngValTemp = secondRngVal; uint thirdRngValTemp = thirdRngVal; firstRngVal = secondRngVal; secondRngVal = thirdRngVal; thirdRngVal = DisplayRng.genrand(); // Skip the entry if it's too long ago if (LoopIndex < HealVals.Count - HistoryToDisplay) continue; // Start actually collating data StealFutureRngInstance newRngInstance = new StealFutureRngInstance(); // check if we are calculating past RNG if (index < start + HealVals.Count) { newRngInstance.IsPastRng = true; } // Set useful information newRngInstance.Index = index; newRngInstance.CurrentHeal = currentHeal; newRngInstance.RandToPercent = Utils.RandToPercent(firstRngValTemp); newRngInstance.Lv99RedChocobo = firstRngValTemp < 0x1000000; // Handle stealing newRngInstance.NormalReward = Steal.CheckSteal2( firstRngValTemp, secondRngValTemp, thirdRngValTemp); newRngInstance.CuffsReward = Steal.CheckStealCuffs2( firstRngValTemp, secondRngValTemp, thirdRngValTemp); // Stealing directions CalculateStealDirections(firstRngValTemp, false, ref rareSteal, ref rarePosition); CalculateStealDirections(firstRngValTemp, true, ref rareStealCuffs, ref rarePositionCuffs); // Check for combo during string of punches CheckForCombo(firstRngValTemp); _futureRng.AddNextRngInstance(newRngInstance); } WriteStealDirectionsInfo(rarePosition, rarePositionCuffs); AttacksBeforeNextCombo = ComboPosition; Group.SetIndex(indexStatic); } #endregion protected methods #region private methods private void CalculateStealDirections( uint prng, bool cuffs, ref bool found, ref int position) { if (Steal.WouldRareStealSucceed(prng, cuffs) && !found && LoopIndex >= HealVals.Count) { found = true; position = LoopIndex - HealVals.Count; } } private void WriteStealDirectionsInfo(int rarePosition, int rarePositionCuffs) { _futureRng.SetStealDirections(new StealDirections { AdvanceForRare = rarePosition, AdvanceForRareCuffs = rarePositionCuffs }); } #endregion private methods } }
using System; using System.Collections.Generic; using System.IO; using UnityEditor; namespace HT.Framework.AssetBundleEditor { /// <summary> /// 资源文件 /// </summary> public sealed class AssetFileInfo : AssetInfoBase { /// <summary> /// 文件类型 /// </summary> public Type AssetType; /// <summary> /// 文件对象 /// </summary> public UnityEngine.Object AssetObject; /// <summary> /// 文件占硬盘内存大小 /// </summary> public long MemorySize; /// <summary> /// 文件占硬盘内存大小(显示格式) /// </summary> public string MemorySizeFormat; /// <summary> /// 显式打入的AB包 /// </summary> public string Bundled; /// <summary> /// 隐式打入的AB包【AB包名称,打入次数】 /// </summary> public Dictionary<string, int> IndirectBundled; /// <summary> /// 隐式打入的AB包关系【被隐式打入的依赖资源路径,AB包名称】 /// </summary> public Dictionary<string, string> IndirectBundledRelation; /// <summary> /// 依赖的资源文件 /// </summary> public List<string> Dependencies; /// <summary> /// 是否是有效资源 /// </summary> public bool IsValid; /// <summary> /// 是否是冗余资源 /// </summary> public bool IsRedundant; /// <summary> /// 文件后缀名 /// </summary> public string Extension; /// <summary> /// 是否已读取依赖资源文件 /// </summary> private bool _isReadDependenciesFile = false; public AssetFileInfo(string fullPath, string name, string extension) : base(fullPath, name) { AssetType = AssetDatabase.GetMainAssetTypeAtPath(AssetPath); AssetObject = AssetDatabase.LoadAssetAtPath(AssetPath, AssetType); MemorySize = new FileInfo(FullPath).Length; MemorySizeFormat = EditorUtility.FormatBytes(MemorySize); Bundled = ""; IndirectBundled = new Dictionary<string, int>(); IndirectBundledRelation = new Dictionary<string, string>(); Dependencies = new List<string>(); IsValid = AssetBundleEditorUtility.IsValidFile(extension); IsRedundant = false; Extension = extension; } /// <summary> /// 读取依赖的资源文件 /// </summary> public void ReadDependenciesFile() { if (!_isReadDependenciesFile) { _isReadDependenciesFile = true; AssetBundleEditorUtility.ReadAssetDependencies(AssetPath); } } /// <summary> /// 刷新冗余状态 /// </summary> public void UpdateRedundantState() { if (Bundled != "") { if (IndirectBundled.Count < 1) { IsRedundant = false; } else if (IndirectBundled.Count == 1) { IsRedundant = !IndirectBundled.ContainsKey(Bundled); } else if (IndirectBundled.Count > 1) { IsRedundant = true; } } else { IsRedundant = IndirectBundled.Count > 1; } } public override string ToString() { return Name; } } }
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** using System; using System.Collections.Generic; using System.Collections.Immutable; using System.Threading.Tasks; using Pulumi.Serialization; namespace Pulumi.Azure.ContainerService.Inputs { public sealed class RegistryTaskBaseImageTriggerArgs : Pulumi.ResourceArgs { /// <summary> /// Should the trigger be enabled? Defaults to `true`. /// </summary> [Input("enabled")] public Input<bool>? Enabled { get; set; } /// <summary> /// The name which should be used for this trigger. /// </summary> [Input("name", required: true)] public Input<string> Name { get; set; } = null!; /// <summary> /// The type of the trigger. Possible values are `All` and `Runtime`. /// </summary> [Input("type", required: true)] public Input<string> Type { get; set; } = null!; /// <summary> /// The endpoint URL for receiving the trigger. /// </summary> [Input("updateTriggerEndpoint")] public Input<string>? UpdateTriggerEndpoint { get; set; } /// <summary> /// Type of payload body for the trigger. Possible values are `Default` and `Token`. /// </summary> [Input("updateTriggerPayloadType")] public Input<string>? UpdateTriggerPayloadType { get; set; } public RegistryTaskBaseImageTriggerArgs() { } } }
using System.Collections; using System.Collections.Generic; using UnityEngine; namespace Interaction { public class ColliderInteractor : MonoBehaviour, IInteractor { public GameObject source => gameObject; public Selector selector; bool _isEnabled; public bool isEnabled { get => _isEnabled; set { _isEnabled = value; if(!_isEnabled) selector.Release(); } } public List<GameObject> blockedInteractors; public List<IInteractor> _blockInteractors = new List<IInteractor>(); // Start is called before the first frame update void Start() { isEnabled = true; foreach(var b in blockedInteractors) { _blockInteractors.Add(b.GetComponent<IInteractor>()); } } private void OnTriggerEnter(Collider other) { if (!isEnabled) return; var receiver = other.GetComponent<ColliderReceiver>(); if (receiver == null) return; receiver.interactor = this; foreach(var b in _blockInteractors) { b.isEnabled = false; } selector.Select(other.gameObject); } private void OnTriggerExit(Collider other) { foreach (var b in _blockInteractors) { b.isEnabled = true; } if (!isEnabled) return; var receiver = other.GetComponent<ColliderReceiver>(); if (receiver == null) return; selector.Release(); } } }
using System.Collections; using System.Collections.Generic; using System; using UnityEngine; public class ThirdPersonCameraController : MonoBehaviour { [SerializeField] float rotationSpeed = 10f; [SerializeField] Transform target; Player player = null; bool isCameraInverted = false; float mouseX, mouseY; private Vector3 velocity = Vector3.zero; // Start is called before the first frame update void Start() { Cursor.visible = false; Cursor.lockState = CursorLockMode.Locked; } private void Update() { if (Player.player != null && player == null) { player = Player.player; } if (Input.GetKeyDown(KeyCode.I)) { isCameraInverted = !isCameraInverted; } if (player) { LerpToPlayer(); } } private void LerpToPlayer() { Vector3 targetPos = player.transform.position; targetPos.Set(targetPos.x, targetPos.y + 1.3f, targetPos.z); if (targetPos == target.position) return; target.position = Vector3.SmoothDamp(target.position, targetPos, ref velocity, 0.001f); } private void LateUpdate() { CameraControl(); } void CameraControl() { if (player == null) return; if (isCameraInverted) { mouseX += Input.GetAxis("Mouse X") * rotationSpeed; mouseY += Input.GetAxis("Mouse Y") * rotationSpeed; } else { mouseX += Input.GetAxis("Mouse X") * rotationSpeed; mouseY -= Input.GetAxis("Mouse Y") * rotationSpeed; } mouseY = Mathf.Clamp(mouseY, -45, 60); transform.LookAt(target); target.rotation = Quaternion.Euler(mouseY, mouseX, 0); player.GetComponent<ThirdPersonMovementController>().mouseX = mouseX; //player.rotation = Quaternion.Euler(0, mouseX, 0); } }
using System; using System.Collections.Generic; using System.IO; using System.Linq; using Conllu.Extensions; namespace Conllu { public static class ConlluParser { /// <summary> /// Read and parse a CoNLL-U file /// </summary> /// <param name="filePath">The path to the file to read</param> /// <returns>An enumerable of sentences parsed from the file</returns> public static IEnumerable<Sentence> ParseFile(string filePath) => Parse(File.ReadLines(filePath)); /// <summary> /// Parse the given string /// </summary> /// <param name="text">The text to parse (should be in CoNLL-U format)</param> /// <returns>An enumerable of sentences parsed from the text</returns> public static IEnumerable<Sentence> ParseText(string text) => Parse(text.SplitLines()); /// <summary> /// Parses an enumerable of lines to an enumerable of sentences /// </summary> /// <param name="lines">The individual lines of the CoNLL-U data to parse</param> /// <returns>An enumerable of sentences parsed from the input</returns> /// <exception cref="Exception">When the input data cannot be parsed correctly (invalid format)</exception> public static IEnumerable<Sentence> Parse(IEnumerable<string> lines) { var i = 0; var sentence = new Sentence(); foreach (var line in lines) { // Finished reading sentence if (line == "" && !sentence.IsEmpty()) { yield return sentence; sentence = new Sentence(); } // Check if the comments contain metadata if we haven't started parsing the sentence yet if (line.StartsWith("#") && sentence.IsEmpty()) { var comps = line.TrimStart('#').Split("="); if (comps.Length == 2) sentence.Metadata[comps[0].Trim()] = comps[1].Trim(); } try { var t = Token.FromLine(line); if (t != null) sentence.Tokens.Add(t); } catch (Exception e) { throw new Exception($"Failed parsing line {i}: {e.Message}"); } i += 1; } if (!sentence.IsEmpty()) yield return sentence; } /// <summary> /// Serializes an enumerable of sentences into a string that can be written to a CoNLL-U file. /// </summary> /// <param name="sentences">The sentences to serialize</param> /// <returns>The given sentences in a CoNLL-U text format</returns> public static string Serialize(IEnumerable<Sentence> sentences) => string.Join('\n', sentences.Select(s => s.Serialize())); } }
using System; using DefensiveProgrammingFramework; namespace DefensiveProgrammingFramework { /// <summary> /// The then extensions methods. /// </summary> public static class ThenExtensions { #region Public Methods /// <summary> /// Executes the specified action when the condition result is true. /// </summary> /// <param name="conditionResult">If set to <c>true</c> the specified action will execute.</param> /// <param name="onTrue">The action that will execute if the condition result is true..</param> public static void Then(this bool conditionResult, Action onTrue) { onTrue.CannotBeNull(); if (conditionResult) { onTrue(); } } #endregion Public Methods } }
using System.Collections.Generic; using System.ComponentModel.DataAnnotations; namespace CommunityAssociationManager.Shared.Models { public class CommunityProperty { [Key] public long Id { get; set; } public uint OwnerId { get; set; } public virtual Community Owner { get; set; } public virtual IList<TaxRecurrance> TaxRecurrances { get; set; } } }
using UnityEngine; using UnityEngine.UI; using System.Collections; public class ResourceText : MonoBehaviour { public GameManager gm; public int ResourceType = 0; private Text t; // Use this for initialization void Start () { t = gameObject.GetComponent<Text>(); } // Update is called once per frame void Update () { if (gm.Selected != null) { switch (ResourceType) { case 0: t.text = gm.Selected.GetComponent<SSGPlanet>().OreAmount.ToString(); break; case 1: t.text = gm.Selected.GetComponent<SSGPlanet>().GasAmount.ToString(); break; case 2: t.text = gm.Selected.GetComponent<SSGPlanet>().CrystalAmount.ToString(); break; } } } }
var builder = WebApplication.CreateBuilder(args); // Add services to the container. builder.Services.AddAuthorization(); var app = builder.Build(); var loggerFactory = app.Services.GetRequiredService<ILoggerFactory>(); var logger = loggerFactory.CreateLogger<Program>(); app.UseRouting(); app.Use((context, next) => { logger.LogInformation(context.Request.Path); logger.LogInformation(context.Request.Headers.ContentLength?.ToString() ?? "no length set"); return next(context); }); app.UseAuthorization(); app.MapGet("/", context => Task.FromResult(context.Request.ContentLength)); app.MapPost("/", context => Task.FromResult(context.Request.ContentLength)); app.Run();
namespace BinanceAPI.Objects { /// <summary> /// The result of an operation /// </summary> public class CallResult { /// <summary> /// An error if the call didn't succeed, will always be filled if Success = false /// </summary> public Error? Error { get; internal set; } /// <summary> /// Whether the call was successful /// </summary> public bool Success => Error == null; /// <summary> /// ctor /// </summary> /// <param name="error"></param> public CallResult(Error? error) { Error = error; } /// <summary> /// Overwrite bool check so we can use if(callResult) instead of if(callResult.Success) /// </summary> /// <param name="obj"></param> public static implicit operator bool(CallResult obj) { return obj?.Success == true; } /// <summary> /// Create an error result /// </summary> /// <param name="error"></param> /// <returns></returns> public static WebCallResult CreateErrorResult(Error error) { return new WebCallResult(null, null, error); } } }
using System; using NUnit.Framework; namespace FastGraph.Tests.Structures { /// <summary> /// Tests for <see cref="SReversedEdge{TVertex,TEdge}"/>. ///</summary> [TestFixture] internal sealed class SReversedEdgeTests : EdgeTestsBase { [Test] public void Construction() { // Value type CheckEdge(new SReversedEdge<int, Edge<int>>(new Edge<int>(1, 2)), 2, 1); CheckEdge(new SReversedEdge<int, Edge<int>>(new Edge<int>(2, 1)), 1, 2); CheckEdge(new SReversedEdge<int, Edge<int>>(new Edge<int>(1, 1)), 1, 1); // Struct break the contract with their implicit default constructor var defaultEdge = default(SReversedEdge<int, Edge<int>>); // ReSharper disable HeuristicUnreachableCode // Justification: Since struct has implicit default constructor it allows initialization of invalid edge Assert.IsNull(defaultEdge.OriginalEdge); // ReSharper disable HeuristicUnreachableCode Assert.Throws<NullReferenceException>(() => { int _ = defaultEdge.Source; }); Assert.Throws<NullReferenceException>(() => { int _ = defaultEdge.Target; }); // ReSharper restore HeuristicUnreachableCode // Reference type var v1 = new TestVertex("v1"); var v2 = new TestVertex("v2"); CheckEdge(new SReversedEdge<TestVertex, Edge<TestVertex>>(new Edge<TestVertex>(v1, v2)), v2, v1); CheckEdge(new SReversedEdge<TestVertex, Edge<TestVertex>>(new Edge<TestVertex>(v2, v1)), v1, v2); CheckEdge(new SReversedEdge<TestVertex, Edge<TestVertex>>(new Edge<TestVertex>(v1, v1)), v1, v1); // Struct break the contract with their implicit default constructor var defaultEdge2 = default(SReversedEdge<TestVertex, Edge<TestVertex>>); // ReSharper disable HeuristicUnreachableCode // Justification: Since struct has implicit default constructor it allows initialization of invalid edge Assert.IsNull(defaultEdge2.OriginalEdge); // ReSharper disable HeuristicUnreachableCode Assert.Throws<NullReferenceException>(() => { TestVertex _ = defaultEdge2.Source; }); Assert.Throws<NullReferenceException>(() => { TestVertex _ = defaultEdge2.Target; }); // ReSharper restore HeuristicUnreachableCode } [Test] public void Construction_Throws() { // ReSharper disable once ObjectCreationAsStatement // ReSharper disable once AssignNullToNotNullAttribute Assert.Throws<ArgumentNullException>(() => new SReversedEdge<TestVertex, Edge<TestVertex>>(null)); } [Test] public void Equals() { var wrappedEdge = new Edge<int>(1, 2); var edge1 = new SReversedEdge<int, Edge<int>>(wrappedEdge); var edge2 = new SReversedEdge<int, Edge<int>>(wrappedEdge); var edge3 = new SReversedEdge<int, Edge<int>>(new Edge<int>(1, 2)); var edge4 = new SReversedEdge<int, Edge<int>>(new Edge<int>(2, 1)); Assert.AreEqual(edge1, edge1); Assert.AreEqual(edge1, edge2); Assert.AreEqual(edge2, edge1); Assert.IsTrue(edge1.Equals((object)edge2)); Assert.IsTrue(edge1.Equals(edge2)); Assert.IsTrue(edge2.Equals(edge1)); Assert.AreNotEqual(edge1, edge3); Assert.AreNotEqual(edge3, edge1); Assert.IsFalse(edge1.Equals((object)edge3)); Assert.IsFalse(edge1.Equals(edge3)); Assert.IsFalse(edge3.Equals(edge1)); Assert.AreNotEqual(edge1, edge4); Assert.AreNotEqual(edge4, edge1); Assert.IsFalse(edge1.Equals((object)edge4)); Assert.IsFalse(edge1.Equals(edge4)); Assert.IsFalse(edge4.Equals(edge1)); Assert.AreNotEqual(edge1, null); Assert.IsFalse(edge1.Equals(null)); } [Test] public void EqualsDefaultEdge_ReferenceTypeExtremities() { var edge1 = default(SReversedEdge<int, Edge<int>>); var edge2 = new SReversedEdge<int, Edge<int>>(); Assert.AreEqual(edge1, edge2); Assert.AreEqual(edge2, edge1); Assert.IsTrue(edge1.Equals(edge2)); Assert.IsTrue(edge2.Equals(edge1)); } [Test] public void Equals2() { var edge1 = new SReversedEdge<int, EquatableEdge<int>>(new EquatableEdge<int>(1, 2)); var edge2 = new SReversedEdge<int, EquatableEdge<int>>(new EquatableEdge<int>(1, 2)); var edge3 = new SReversedEdge<int, EquatableEdge<int>>(new EquatableEdge<int>(2, 1)); Assert.AreEqual(edge1, edge1); Assert.AreEqual(edge1, edge2); Assert.IsTrue(edge1.Equals((object)edge2)); Assert.AreNotEqual(edge1, edge3); Assert.IsFalse(edge1.Equals(null)); Assert.AreNotEqual(edge1, null); } [Test] public void Hashcode() { var wrappedEdge = new Edge<int>(1, 2); var edge1 = new SReversedEdge<int, Edge<int>>(wrappedEdge); var edge2 = new SReversedEdge<int, Edge<int>>(wrappedEdge); var edge3 = new SReversedEdge<int, Edge<int>>(new Edge<int>(1, 2)); var edge4 = new SReversedEdge<int, Edge<int>>(new Edge<int>(2, 1)); Assert.AreEqual(edge1.GetHashCode(), edge2.GetHashCode()); Assert.AreNotEqual(edge1.GetHashCode(), edge3.GetHashCode()); Assert.AreNotEqual(edge1.GetHashCode(), edge4.GetHashCode()); } [Test] public void HashcodeDefaultEdge_ReferenceTypeExtremities() { var edge1 = default(SReversedEdge<int, Edge<int>>); var edge2 = new SReversedEdge<int, Edge<int>>(); Assert.AreEqual(edge1.GetHashCode(), edge2.GetHashCode()); } [Test] public void ObjectToString() { var edge1 = new SReversedEdge<int, Edge<int>>(new Edge<int>(1, 2)); var edge2 = new SReversedEdge<int, Edge<int>>(new Edge<int>(2, 1)); var edge3 = new SReversedEdge<int, UndirectedEdge<int>>(new UndirectedEdge<int>(1, 2)); Assert.AreEqual("R(1 -> 2)", edge1.ToString()); Assert.AreEqual("R(2 -> 1)", edge2.ToString()); Assert.AreEqual("R(1 <-> 2)", edge3.ToString()); } } }
namespace LetsGraph.Model.Base { /// <summary> /// The types of relation. /// </summary> public enum RelationType { Contains } }
using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; namespace Macrocosm.Models { /// <summary> /// redis 相关model /// </summary> public class RedisKeyModel { public string Id { get; set; } public string Value { get; set; } } public class CountModel { public int DataCount { get; set; } public string DateTime { get; set; } } public class RedisListModel { //public virtual int DbNum { get; set; } //public virtual long Expires { get; set; } //public virtual string Size { get; set; } //public virtual string Type { get; set; } public virtual List<RedisKeyModel> RedisKeys { get; set; } public virtual int Count { get; set; } } }
using System; using System.Collections.Generic; namespace N.EntityFramework.Extensions { internal class BulkInsertResult<T> { internal int RowsAffected { get; set; } internal Dictionary<long, T> EntityMap { get; set; } } }
using System; using System.Linq; using System.Text.RegularExpressions; using NetMicro.Http; namespace NetMicro.Routing { public class Route : IRoute, IMiddleware { private static readonly Regex ParamRegex = new Regex(@":(?<name>[A-Za-z0-9_]*)", RegexOptions.Compiled); private readonly RouteFuncAsync _handlerFunc; private readonly string _method; private readonly MiddlewareManager _middlewareManager; private readonly string _name; private readonly Regex _regex; private readonly string _route; internal Route(string method, string name, string route, RouteFuncAsync handlerFunc) { _middlewareManager = new MiddlewareManager(); _method = method; _name = name; _route = route; _handlerFunc = handlerFunc; _regex = RouteToRegex(route); } public void Use(RouteFuncAsyncMiddleware middlewareFunc) { _middlewareManager.Use(middlewareFunc); } public IRequestHandler GetRequestHandler(Request request, IResponse response) { return Match(request) ? new MiddlewareRequestHandler(_middlewareManager.GetRuntime(_handlerFunc), GetContext(request, response)) : null; } private Context GetContext(Request request, IResponse response) { var path = GetPath(request); var groups = _regex.Match(path).Groups; var uriParams = _regex.GetGroupNames() .ToDictionary(groupName => groupName, groupName => groups[groupName].Value); return new Context(new SelectedRoute(_name, _route, uriParams), request, response); } private bool Match(Request request) { var path = GetPath(request); return _method == request.Method && _regex.IsMatch(path); } private static Regex RouteToRegex(string route) { var parts = route.Split(new[] {"/"}, StringSplitOptions.RemoveEmptyEntries); parts = parts.Select(part => !ParamRegex.IsMatch(part) ? part == "*" ? @".*" : part : string.Join("", ParamRegex.Matches(part) .Where(match => match.Success) .Select(match => $"(?<{match.Groups["name"].Value.Replace(".", @"\.")}>.+?)" ) ) ).ToArray(); var pattern = parts.Any() ? "^/" + string.Join("/", parts) + "$" : "^$"; return new Regex(pattern, RegexOptions.Compiled | RegexOptions.IgnoreCase); } private static string GetPath(Request context) { var path = context.Path; if (path.EndsWith("/")) path = path.TrimEnd('/'); return path; } } }
using FluentAssertions; using Nancy; using Nancy.Bootstrapper; using Nancy.Testing; using System; using System.Collections.Generic; using System.Linq; using TickTock.Core.Extensions; using TickTock.Core.Jobs; using TickTock.Gate.Modules; using Xunit; namespace TickTock.Gate.Tests.Modules { [Collection("Nancy")] public class JobsModuleTests : IDisposable { private readonly INancyBootstrapper bootstrapper; private readonly JobRepositoryStub repository; private readonly Browser browser; public JobsModuleTests() { repository = new JobRepositoryStub(with => { with.Job(Jobs.SampleHeader, Jobs.SampleData); }); bootstrapper = new ConfigurableBootstrapper(with => { with.Module<JobsModule>(); with.Dependency<JobRepository>(repository); }); browser = new Browser(bootstrapper, with => { }); } [Fact] public void PostingNewJobShouldReturn200() { BrowserResponse response; PostJobRequest request = new PostJobRequest(); response = browser.Post("/api/jobs", with => { with.JsonBody(request); }); response.StatusCode.Should().Be(HttpStatusCode.OK); } [Fact] public void PostingNewJobShouldReturnJson() { BrowserResponse response; PostJobRequest request = new PostJobRequest(); response = browser.Post("/api/jobs", with => { with.JsonBody(request); }); response.ContentType.Should().StartWith("application/json"); } [Fact] public void PostingNewJobShouldReturnItsIdentifier() { BrowserResponse response; PostJobRequest request = new PostJobRequest(); response = browser.Post("/api/jobs", with => { with.JsonBody(request); }); response.Body.DeserializeJson<PostJobResponse>().id.Should().HaveLength(32); } [Fact] public void GettingNotExistingJobShouldReturn404() { string id = Guid.NewGuid().ToHex(); BrowserResponse response = browser.Get($"/api/jobs/{id}", with => { }); response.StatusCode.Should().Be(HttpStatusCode.NotFound); } [Fact] public void GettingExistingJobShouldReturn200() { string id = Jobs.SampleHeader.Identifier.ToHex(); BrowserResponse response = browser.Get($"/api/jobs/{id}", with => { }); response.StatusCode.Should().Be(HttpStatusCode.OK); } [Fact] public void GettingExistingJobShouldReturnJson() { string id = Jobs.SampleHeader.Identifier.ToHex(); BrowserResponse response = browser.Get($"/api/jobs/{id}", with => { }); response.ContentType.Should().StartWith("application/json"); } [Fact] public void GettingExistingJobShouldReturnsItsData() { string id = Jobs.SampleHeader.Identifier.ToHex(); GetJobResponse data = new GetJobResponse { id = id, version = Jobs.SampleHeader.Version, name = Jobs.SampleData.Name, description = Jobs.SampleData.Description, executable = Jobs.SampleData.Executable, arguments = Jobs.SampleData.Arguments, blob = Jobs.SampleData.Blob.ToHex() }; BrowserResponse response = browser.Get($"/api/jobs/{id}", with => { }); response.Body.DeserializeJson<GetJobResponse>().ShouldBeEquivalentTo(data); } public void Dispose() { bootstrapper.Dispose(); } public class PostJobRequest { public string name; public string description; public string executable; public string arguments; public string blob; } public class PostJobResponse { public string id; } public class GetJobResponse { public string id; public int version; public string name; public string description; public string executable; public string arguments; public string blob; } public static class Jobs { public static readonly JobHeader SampleHeader = new JobHeader { Identifier = Guid.NewGuid(), Version = 1 }; public static readonly JobData SampleData = new JobData { Name = "tick-tock", Description = "Lorem ipsum dolor sit amet.", Executable = "tick-tock", Arguments = "--process", Blob = Guid.NewGuid() }; } public class JobRepositoryStub : JobRepository { private readonly Dictionary<JobHeader, JobData> items; public JobRepositoryStub(Action<JobRepositoryConfigurer> with) { base.New = Add; base.Single = Single; items = new Dictionary<JobHeader, JobData>(); with(new JobRepositoryConfigurer(items)); } private new JobHeader Add(JobData data) { JobHeader header = new JobHeader { Identifier = Guid.NewGuid(), Version = 1 }; items[header] = data; return header; } private new Job Single(Action<JobCriteria> with) { JobCriteria criteria = new JobCriteria(); with(criteria); return items .Where(x => criteria.Identifier.Is(x.Key.Identifier)) .OrderByDescending(x => x.Key.Version) .Select(x => new Job { Header = x.Key, Extract = callback => callback(x.Value) }) .SingleOrDefault(); } } public class JobRepositoryConfigurer { private readonly Dictionary<JobHeader, JobData> items; public JobRepositoryConfigurer(Dictionary<JobHeader, JobData> items) { this.items = items; } public void Job(JobHeader header, JobData data) { items[header] = data; } } } }
using System; using System.Threading; using System.Threading.Tasks; using MassTransit; using Microsoft.Extensions.Hosting; using SampleService.Contracts; namespace SampleService { public class CheckTheTimeService : IHostedService { public IPublishEndpoint PublishEndpoint { get; } public ISecondBus SecondBus { get; } Timer _timer; public CheckTheTimeService(IPublishEndpoint publishEndpoint, ISecondBus secondBus) { PublishEndpoint = publishEndpoint ?? throw new ArgumentNullException(nameof(publishEndpoint)); SecondBus = secondBus ?? throw new ArgumentNullException(nameof(secondBus)); } public Task StartAsync(CancellationToken cancellationToken) { _timer = new Timer(CheckTheTime, null, TimeSpan.FromSeconds(5), TimeSpan.FromSeconds(5)); return Task.CompletedTask; } async void CheckTheTime(object state) { var now = DateTimeOffset.Now; if (now.Millisecond % 2 == 0) { Console.WriteLine("Enviando pelo segundos bus"); await SecondBus.Publish<IsItTimeRabbit>(new {Texto = "Enviando pelo segundos bus"}); return; } Console.WriteLine("Enviando pelo primeiro bus"); await PublishEndpoint.Publish<IsItTimeRabbit>(new {Texto = "Enviando pelo primeiro bus"}); } public Task StopAsync(CancellationToken cancellationToken) { _timer.Dispose(); return Task.CompletedTask; } } }
using System; namespace Magnesium.Vulkan { internal enum VkComponentSwizzle : uint { ComponentSwizzleIdentity = 0, ComponentSwizzleZero = 1, ComponentSwizzleOne = 2, ComponentSwizzleR = 3, ComponentSwizzleG = 4, ComponentSwizzleB = 5, ComponentSwizzleA = 6, } }
//----------------------------------------------// // Gamelogic Grids // // http://www.gamelogic.co.za // // Copyright (c) 2013 Gamelogic (Pty) Ltd // //----------------------------------------------// namespace Gamelogic.Grids { /** Indicates that a grid supports an vertex grid. @copyright Gamelogic. @author Herman Tulleken @since 1.1 */ public interface ISupportsVertexGrid<TPoint> where TPoint : IGridPoint<TPoint> { /** Makes a grid that corresponds to the vertices of this grid. If point is inside this grid, then all of point.GetVertices() are in the grid returned by this method. */ IGrid<TNewCell, TPoint> MakeVertexGrid<TNewCell>(); } }
/* * 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. */ namespace Lucene.Net.Codecs.Intblock { using Sep; using Store; using System.Diagnostics; internal class IntBlockIndexReader : IntIndexInputReader { private readonly IndexInput _input; public readonly int[] PENDING; private int _upto; private bool _seekPending; private long _pendingFp; private int _pendingUpto; private long _lastBlockFp; private int _blockSize; private readonly IBlockReader _blockReader; public IntBlockIndexReader(IndexInput input, int[] pending, IBlockReader blockReader) { _input = input; PENDING = pending; _blockReader = blockReader; _blockSize = pending.Length; _upto = _blockSize; } internal virtual void Seek(long fp, int upto) { // TODO: should we do this in real-time, not lazy? _pendingFp = fp; _pendingUpto = upto; Debug.Assert(_pendingUpto >= 0, "pendingUpto=" + _pendingUpto); _seekPending = true; } internal void MaybeSeek() { if (!_seekPending) return; if (_pendingFp != _lastBlockFp) { // need new block _input.Seek(_pendingFp); _lastBlockFp = _pendingFp; _blockReader.Seek(_pendingFp); _blockSize = _blockReader.ReadBlock(); } _upto = _pendingUpto; // TODO: if we were more clever when writing the // index, such that a seek point wouldn't be written // until the int encoder "committed", we could avoid // this (likely minor) inefficiency: // This is necessary for int encoders that are // non-causal, ie must see future int values to // encode the current ones. while (_upto >= _blockSize) { _upto -= _blockSize; _lastBlockFp = _input.FilePointer; _blockSize = _blockReader.ReadBlock(); } _seekPending = false; } public override int Next() { MaybeSeek(); if (_upto == _blockSize) { _lastBlockFp = _input.FilePointer; _blockSize = _blockReader.ReadBlock(); _upto = 0; } return PENDING[_upto++]; } } }
using Nethereum.RPC.Eth.DTOs; namespace Nethereum.RPC.Eth.DTOs { public class ContractTransactionVO { public ContractTransactionVO(string contractAddress, string code, Transaction transaction) { ContractAddress = contractAddress; Code = code; Transaction = transaction; } public string ContractAddress { get; private set; } public string Code { get; private set; } public Transaction Transaction { get; private set; } } }
using UnityEngine; /// <summary> /// Component responsible for timing the player on an individual match level, /// for passing flame from one match to the next, and signaling losses and /// wins for each player. /// </summary> public class MatchBurnComponent : MonoBehaviour { [Tooltip("Rate at which match head shrinks from combustion. " + "Realistically a little faster than the matchstick.")] public int PlayerIndex = 0; [Header("Match Visuals")] [Tooltip("Transform of the primitive representing the matchstick.")] public Transform Matchstick; [Tooltip("Transform of the primitive representing the match's head.")] public Transform MatchstickHead; [Header("Burn Rates")] [Tooltip("Rate at which match head shrinks from combustion. " + "Realistically a little faster than the matchstick.")] public float HeadBurnRate = 0.05f; [Tooltip("Rate at which the matchstick shrinks from combustion.")] public float StickBurnRate = 0.1f; [Header("Physics")] [Tooltip("Transform who's position is used to check grounded state. " + "Need a reference to it to move as the match shrinks.")] public Transform GroundCheck; [Tooltip("BoxCollider to shrink alongside matchstick, to give the" + "appearance of a shrinking match.")] public BoxCollider MatchstickCollider; [Header("Match Status")] [Tooltip("Boolean to determine whether the match is the current match" + " the player is controlling.")] public bool isCurrentMatch; [Tooltip("Tracks whether the match has already been controlled by the" + " player.")] public bool isPreviousMatch; [Header("Misc")] [Tooltip("Main Camera to be passed along from match to match. This is " + "handled by the new Unity Input system in Versus Mode and Solo " + "Mode. If the scene is a Coop Mode scene, this can be safely left" + "unassigned.")] public Transform CamTransform; [Tooltip("Audio Component of the match.")] public MatchAudioComponent MatchAudioComponent; [Tooltip("The VFX Component of the match.")] public MatchVFXComponent vfxComponent; /// <summary> /// Tracks whether the head has fully burned up, signaling the behavior to /// move on to burning the matchstick. /// </summary> private bool headGone = false; /// <summary> /// Signals that the match has fully burned, ending the player's run. /// </summary> public delegate void BurnedOut(string cause); public static BurnedOut burnedOut; /// <summary> /// Signals that the match has made contact with another match, and the /// flame (and camera, if in Coop mode) should be passed along. /// </summary> public delegate void FlamePassed(int playerIndex); public static FlamePassed flamePassed; /// <summary> /// Delegate to signal that the player has reached the goal. /// </summary> public delegate void ReachedBonfire(int playerIndex); public static ReachedBonfire reachedBonfire; private void OnTriggerEnter(Collider other) { if (GameManager.GameState == GameState.Running) { MatchBurnComponent otherBurnComp = other.GetComponent<MatchBurnComponent>(); if (isCurrentMatch) { if (otherBurnComp != null) { if (otherBurnComp.CompareTag("MatchP1") || otherBurnComp.CompareTag("MatchP2")) { PassFlame(otherBurnComp); } } if (other.CompareTag("Bonfire")) { reachedBonfire?.Invoke(PlayerIndex); } if (other.CompareTag("Water")) { vfxComponent.Extinguish(true); SignalLossByWater(); } } } } private void Update() { if (GameManager.GameState == GameState.Running) { if (!headGone) { BurnHead(); } else { BurnMatchstick(); } } } /// <summary> /// Shrinks the scale of the match head to simulate burning. /// </summary> private void BurnHead() { MatchstickHead.localScale -= Vector3.one * HeadBurnRate * Time.deltaTime; if (MatchstickHead.localScale.x < 0.05f) { MatchstickHead.gameObject.SetActive(false); headGone = true; } } /// <summary> /// Shrinks the y scale of the matchstick and its collider to simulate /// burning. /// </summary> private void BurnMatchstick() { ReduceMatchstickTransformSize(); ReduceMatchstickColliderSize(); MoveVFXComponent(); MoveGroundCheckComponent(); MoveCameraComponent(); CheckBurnout(); } /// <summary> /// Determines if the match has lost based on the size of its matchstick. /// </summary> private void CheckBurnout() { if (Matchstick.localScale.y < 0.1f) { vfxComponent.Extinguish(false); if (isCurrentMatch) { SignalLossByBurnout(); } enabled = false; } } /// <summary> /// Moves camera in response to the shrinking of the stick, the give the /// illusion it is stationary. /// </summary> private void MoveCameraComponent() { CamTransform.position = new Vector3(CamTransform.position.x, CamTransform.position.y + (StickBurnRate * 0.25f * Time.deltaTime), CamTransform.position.z); } /// <summary> /// Moves the ground check component in response to the shrinking of the /// stick, to give the illusion that it is stationary. /// </summary> private void MoveGroundCheckComponent() { GroundCheck.position = new Vector3(GroundCheck.position.x, GroundCheck.position.y + (StickBurnRate * 0.5f * Time.deltaTime), GroundCheck.position.z); } /// <summary> /// Moves the vfx component in response to the shrinking of the stick, /// to give the illusion that it is stationary. /// </summary> private void MoveVFXComponent() { Vector3 newVFXPosition = new Vector3(vfxComponent.VFXSlot.position.x, vfxComponent.VFXSlot.position.y - (StickBurnRate * 0.5f * Time.deltaTime), vfxComponent.VFXSlot.position.z); vfxComponent.UpdateVFXPosition(newVFXPosition); } /// <summary> /// Transfers player control, burn behaviour and the camera (if in /// Coop Mode) to the next match. /// </summary> /// <param name="other">The collider of the next match to be lit.</param> private void PassFlame(MatchBurnComponent otherBurnComp) { if (!otherBurnComp.isPreviousMatch) { MatchAudioComponent.StopMatchLoopAudio(); // Update next match's state otherBurnComp.isCurrentMatch = true; otherBurnComp.HeadBurnRate = HeadBurnRate; otherBurnComp.StickBurnRate = StickBurnRate; // Update this match's state isPreviousMatch = true; gameObject.layer = 11; isCurrentMatch = false; int nextPlayerIndex; if (GameManager.GameMode == GameMode.Coop) { nextPlayerIndex = PlayerIndex == 1 ? 0 : 1; Vector3 camLocalPos = CamTransform.localPosition; CamTransform.SetParent(otherBurnComp.transform); otherBurnComp.CamTransform = CamTransform; CamTransform.localPosition = camLocalPos; } else { nextPlayerIndex = PlayerIndex; } otherBurnComp.vfxComponent.Ignite(); flamePassed?.Invoke(nextPlayerIndex); } } /// <summary> /// Reduces the collider size of the matchstick to match the transform size /// as the match shrinks due to burning. /// </summary> private void ReduceMatchstickColliderSize() { Vector3 newColliderSize = new Vector3(MatchstickCollider.size.x, MatchstickCollider.size.y - StickBurnRate * Time.deltaTime, MatchstickCollider.size.z); MatchstickCollider.size = newColliderSize; } /// <summary> /// Reduces the size of the transform representing the match as the match /// shrinks due to burning. /// </summary> private void ReduceMatchstickTransformSize() { Vector3 newMatchstickScale = new Vector3(Matchstick.localScale.x, Matchstick.localScale.y - StickBurnRate * Time.deltaTime, Matchstick.localScale.z); Matchstick.localScale = newMatchstickScale; } /// <summary> /// Signals to GameManager that a player has lost the game by way of /// burning out. /// </summary> private void SignalLossByBurnout() { string cause; switch (GameManager.GameMode) { case GameMode.Solo: cause = "You burned out!"; break; case GameMode.Coop: cause = "Player " + (PlayerIndex + 1) + " burned out!"; break; case GameMode.Versus: int winner = PlayerIndex == 0 ? 2 : 1; cause = "Player " + winner + " wins! (Player " + (PlayerIndex + 1) + " burned out)"; break; default: cause = ""; break; } burnedOut?.Invoke(cause); } /// <summary> /// Signals to the GameManager that a player has lost the game by way of /// water hazard. /// </summary> private void SignalLossByWater() { string cause; switch (GameManager.GameMode) { case GameMode.Solo: cause = "You were doused!"; break; case GameMode.Coop: cause = "Player " + (PlayerIndex + 1) + " was doused!"; break; case GameMode.Versus: int winner = PlayerIndex == 0 ? 2 : 1; cause = "Player " + winner + " wins! (Player " + (PlayerIndex + 1) + " was doused)"; break; default: cause = ""; break; } burnedOut?.Invoke(cause); } }
using System; class AAttribute : Attribute { public string Value; public AAttribute (string s) { Value = s; } } [A (value)] class MainClass { const string value = null; public static int Main () { var attr = typeof (MainClass).GetCustomAttributes (false) [0] as AAttribute; if (attr.Value != null) return 1; return 0; } }
/* * Util.cs * Copyright (c) 2006 David Astle * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework; using System; using System.Collections.Generic; namespace Xclna.Xna.Animation { /// <summary> /// Info on how a model is skinned. /// </summary> public enum SkinningType { /// <summary> /// No skinning. /// </summary> None, /// <summary> /// A max of four influences per vertex. /// </summary> FourBonesPerVertex, /// <summary> /// A max of eight influences per vertex. /// </summary> EightBonesPerVertex, /// <summary> /// A max of twelve influences per vertex. /// </summary> TwelveBonesPerVertex } /// <summary> /// Provides various animation utilities. /// </summary> public sealed class Util { /// <summary> /// Ticks per frame at 60 frames per second. /// </summary> public const long TICKS_PER_60FPS = TimeSpan.TicksPerSecond / 60; /// <summary> /// Gets info on what skinning info a vertex element array contains. /// </summary> /// <param name="elements">The vertex elements.</param> /// <returns>Info on what type of skinning the elements contain.</returns> public static SkinningType GetSkinningType(VertexElement[] elements) { int numIndexChannels = 0; int numWeightChannels = 0; foreach (VertexElement e in elements) { if (e.VertexElementUsage == VertexElementUsage.BlendIndices) numIndexChannels++; else if (e.VertexElementUsage == VertexElementUsage.BlendWeight) numWeightChannels++; } if (numIndexChannels == 3 || numWeightChannels == 3) return SkinningType.TwelveBonesPerVertex; else if (numIndexChannels == 2 || numWeightChannels == 2) return SkinningType.EightBonesPerVertex; else if (numIndexChannels == 1 || numWeightChannels == 1) return SkinningType.FourBonesPerVertex; return SkinningType.None; } /// <summary> /// Reflects a matrix across the Z axis by multiplying both the Z /// column and the Z row by -1 such that the Z,Z element stays intact. /// </summary> /// <param name="m">The matrix to be reflected across the Z axis</param> public static void ReflectMatrix(ref Matrix m) { m.M13 *= -1; m.M23 *= -1; m.M33 *= -1; m.M43 *= -1; m.M31 *= -1; m.M32 *= -1; m.M33 *= -1; m.M34 *= -1; } private static T Max<T>(params T[] items) where T : IComparable { IComparable max = null; foreach (IComparable c in items) { if (max == null) max = c; else { if (c.CompareTo(max) > 0) max = c; } } return (T)max; } /// <summary> /// Converts from an array of bytes to any vertex type. /// </summary> /// <typeparam name="T">The type of vertex to which we are converting the bytes</typeparam> /// <param name="data">The bytes that will be converted to the vertices</param> /// <param name="vertexSize">The size of one vertex</param> /// <param name="device">Any working device; required to use our conversion hack</param> /// <returns>An array of the converted vertices</returns> public static T[] Convert<T>(byte[] data, int vertexSize, GraphicsDevice device) where T : struct { T[] verts = new T[data.Length / vertexSize]; VertexDeclaration vertexDeclaration = new VertexDeclaration(verts.Length); using (VertexBuffer vb = new VertexBuffer(device, vertexDeclaration, data.Length, BufferUsage.None)) { vb.SetData<byte>(data); vb.GetData<T>(verts); } return verts; } private static Quaternion qStart, qEnd, qResult; private static Vector3 curTrans, nextTrans, lerpedTrans; private static Vector3 curScale, nextScale, lerpedScale; private static Matrix startRotation, endRotation; private static Matrix returnMatrix; /// <summary> /// Roughly decomposes two matrices and performs spherical linear interpolation /// </summary> /// <param name="start">Source matrix for interpolation</param> /// <param name="end">Destination matrix for interpolation</param> /// <param name="slerpAmount">Ratio of interpolation</param> /// <returns>The interpolated matrix</returns> public static Matrix SlerpMatrix(Matrix start, Matrix end, float slerpAmount) { if (start == end) return start; // Get rotation components and interpolate (not completely accurate but I don't want // to get into polar decomposition and this seems smooth enough) Quaternion.CreateFromRotationMatrix(ref start, out qStart); Quaternion.CreateFromRotationMatrix(ref end, out qEnd); Quaternion.Lerp(ref qStart, ref qEnd, slerpAmount, out qResult); // Get final translation components curTrans.X = start.M41; curTrans.Y = start.M42; curTrans.Z = start.M43; nextTrans.X = end.M41; nextTrans.Y = end.M42; nextTrans.Z = end.M43; Vector3.Lerp(ref curTrans, ref nextTrans, slerpAmount, out lerpedTrans); // Get final scale component Matrix.CreateFromQuaternion(ref qStart, out startRotation); Matrix.CreateFromQuaternion(ref qEnd, out endRotation); curScale.X = start.M11 - startRotation.M11; curScale.Y = start.M22 - startRotation.M22; curScale.Z = start.M33 - startRotation.M33; nextScale.X = end.M11 - endRotation.M11; nextScale.Y = end.M22 - endRotation.M22; nextScale.Z = end.M33 - endRotation.M33; Vector3.Lerp(ref curScale, ref nextScale, slerpAmount, out lerpedScale); // Create the rotation matrix from the slerped quaternions Matrix.CreateFromQuaternion(ref qResult, out returnMatrix); // Set the translation returnMatrix.M41 = lerpedTrans.X; returnMatrix.M42 = lerpedTrans.Y; returnMatrix.M43 = lerpedTrans.Z; // And the lerped scale component returnMatrix.M11 += lerpedScale.X; returnMatrix.M22 += lerpedScale.Y; returnMatrix.M33 += lerpedScale.Z; return returnMatrix; } /// <summary> /// Roughly decomposes two matrices and performs spherical linear interpolation /// </summary> /// <param name="start">Source matrix for interpolation</param> /// <param name="end">Destination matrix for interpolation</param> /// <param name="slerpAmount">Ratio of interpolation</param> /// <param name="result">Stores the result of hte interpolation.</param> public static void SlerpMatrix( ref Matrix start, ref Matrix end, float slerpAmount, out Matrix result) { if (start == end) { result = start; return; } // Get rotation components and interpolate (not completely accurate but I don't want // to get into polar decomposition and this seems smooth enough) Quaternion.CreateFromRotationMatrix(ref start, out qStart); Quaternion.CreateFromRotationMatrix(ref end, out qEnd); Quaternion.Lerp(ref qStart, ref qEnd, slerpAmount, out qResult); // Get final translation components curTrans.X = start.M41; curTrans.Y = start.M42; curTrans.Z = start.M43; nextTrans.X = end.M41; nextTrans.Y = end.M42; nextTrans.Z = end.M43; Vector3.Lerp(ref curTrans, ref nextTrans, slerpAmount, out lerpedTrans); // Get final scale component Matrix.CreateFromQuaternion(ref qStart, out startRotation); Matrix.CreateFromQuaternion(ref qEnd, out endRotation); curScale.X = start.M11 - startRotation.M11; curScale.Y = start.M22 - startRotation.M22; curScale.Z = start.M33 - startRotation.M33; nextScale.X = end.M11 - endRotation.M11; nextScale.Y = end.M22 - endRotation.M22; nextScale.Z = end.M33 - endRotation.M33; Vector3.Lerp(ref curScale, ref nextScale, slerpAmount, out lerpedScale); // Create the rotation matrix from the slerped quaternions Matrix.CreateFromQuaternion(ref qResult, out result); // Set the translation result.M41 = lerpedTrans.X; result.M42 = lerpedTrans.Y; result.M43 = lerpedTrans.Z; // Add the lerped scale component result.M11 += lerpedScale.X; result.M22 += lerpedScale.Y; result.M33 += lerpedScale.Z; } /// <summary> /// Determines whether or not a ModelMeshPart is skinned. /// </summary> /// <param name="meshPart">The part to check.</param> /// <returns>True if the part is skinned.</returns> public static bool IsSkinned(ModelMeshPart meshPart) { VertexElement[] ves = meshPart.VertexBuffer.VertexDeclaration.GetVertexElements(); foreach (VertexElement ve in ves) { //(BlendIndices with UsageIndex = 0) specifies matrix indices for fixed-function vertex // processing using indexed paletted skinning. if (ve.VertexElementUsage == VertexElementUsage.BlendIndices && ve.UsageIndex == 0) { return true; } } return false; } /// <summary> /// Determines whether or not a ModelMesh is skinned. /// </summary> /// <param name="mesh">The mesh to check.</param> /// <returns>True if the mesh is skinned.</returns> public static bool IsSkinned(ModelMesh mesh) { foreach (ModelMeshPart mmp in mesh.MeshParts) { if (IsSkinned(mmp)) return true; } return false; } /// <summary> /// Determines whether or not a Model is skinned. /// </summary> /// <param name="model">The model to check.</param> /// <returns>True if the model is skinned.</returns> public static bool IsSkinned(Model model) { foreach (ModelMesh mm in model.Meshes) { if (IsSkinned(mm)) return true; } return false; } } }
using System; namespace CK.MQTT.Sdk.Packets { internal class UnsubscribeAck : IFlowPacket, IEquatable<UnsubscribeAck> { public UnsubscribeAck( ushort packetId ) { PacketId = packetId; } public MqttPacketType Type => MqttPacketType.UnsubscribeAck; public ushort PacketId { get; } public bool Equals( UnsubscribeAck other ) { if( other == null ) return false; return PacketId == other.PacketId; } public override bool Equals( object obj ) { if( obj == null ) return false; if( !(obj is UnsubscribeAck unsubscribeAck)) return false; return Equals( unsubscribeAck ); } public static bool operator ==( UnsubscribeAck unsubscribeAck, UnsubscribeAck other ) { if( unsubscribeAck is null || other is null ) return Equals( unsubscribeAck, other ); return unsubscribeAck.Equals( other ); } public static bool operator !=( UnsubscribeAck unsubscribeAck, UnsubscribeAck other ) { if( unsubscribeAck is null || other is null ) return !Equals( unsubscribeAck, other ); return !unsubscribeAck.Equals( other ); } public override int GetHashCode() => PacketId.GetHashCode(); } }
using System.ComponentModel; using System.Windows; namespace XTool.ViewModels { public class Module : INotifyPropertyChanged { //public IDataService DataService { get; set; } //protected virtual string ModuleKey //{ // get { return this.GetType().Name.CamelToKebab(); } //} //private UserSettings _UserPreferences; //public UserSettings UserPreferences //{ // get // { // return _UserPreferences; // } // set // { // if (value != null) // { // _UserPreferences = value; // } // } //} //protected virtual void ApplyPreferences(UserSettings userPreferences) //{ //} //internal virtual void SetPreferences() //{ //} internal virtual string Filepath { get; set; } public bool IsInitialized { get; set; } public void Setup() { //if (DataService != null) //{ // IsInitialized = LoadData(); // Initialize(); //} } public virtual void Initialize() { } protected virtual bool LoadData() { return true; } protected virtual bool SaveData() { return true; } public virtual bool CanSaveWorkspace() { return true; } public virtual void SaveWorkspace() { SaveData(); } protected virtual void OnFailure(string message) { MessageBox.Show(message); } #region INotifyPropertyChanged Members public event PropertyChangedEventHandler PropertyChanged; public virtual void OnPropertyChanged(string propertyName) { if (PropertyChanged != null) { PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); } } #endregion } }
using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.UI; public class MainMenu : MonoBehaviour { public GameObject creditsPanel; public GameObject howToPlayPanel; public void Play() { EventManager.TriggerEvent(Statics.Events.playGame); } public void Credits() { howToPlayPanel.SetActive(false); creditsPanel.SetActive(!creditsPanel.activeSelf); } public void HowToPlay() { creditsPanel.SetActive(false); howToPlayPanel.SetActive(!howToPlayPanel.activeSelf); } public void Quit() { Application.Quit(); } }
using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Xml.Serialization; namespace gtest2html { public class XmlToHtml { #region Public Properties /// <summary> /// Output directory information. /// </summary> public DirectoryInfo OutputDirInfo; /// <summary> /// List of test resutl xml files. /// </summary> public IEnumerable<FileInfo> XmlFileInfos; #endregion #region Constructor and destructor(Finalizer) /// <summary> /// Constructor /// </summary> /// <param name="outputDir">Path to output report.</param> /// <param name="xmlFilePathList">List of file path to result of test in xml format.</param> public XmlToHtml(DirectoryInfo outputDir, IEnumerable<FileInfo> xmlFileInfos) { this.OutputDirInfo = outputDir; this.XmlFileInfos = xmlFileInfos; } #endregion #region Other methods and private properties in calling order /// <summary> /// Run convert. /// </summary> public void Convert() { this.ConvertXmlToHtml(); this.CreateIndexHtml(); } /// <summary> /// Convert xml into html. /// </summary> protected void ConvertXmlToHtml() { foreach (var xmlFileInfoItem in this.XmlFileInfos) { this.ConvertXmlToHtml(xmlFileInfoItem); } } /// <summary> /// Convert xml specified by argumetn xmlFilePaht. /// </summary> /// <param name="xmlFilePath">Path to xml file to be converted into </param> protected void ConvertXmlToHtml(FileInfo fileInfo) { //入力ファイル名を元に、出力ファイルのパスを特定する。 var inputFileName = Path.GetFileName(fileInfo.FullName); var outputFileName = Path.ChangeExtension(inputFileName, "html"); var outputFileInfo = new FileInfo(this.OutputDirInfo.FullName + @"\" + outputFileName); using (var xmlReader = new StreamReader(fileInfo.FullName, Encoding.GetEncoding("UTF-8"))) { var serializer = new XmlSerializer(typeof(TestSuites)); var testSuites = (TestSuites)serializer.Deserialize(xmlReader); var htmlTemplate = new TestSuiteHtmlTemplate(testSuites); var content = htmlTemplate.TransformText(); using (var htmlStream = new StreamWriter(outputFileInfo.FullName, false, Encoding.GetEncoding("UTF-8"))) { htmlStream.Write(content); } foreach (var testSuite in testSuites.TestItems) { foreach (var testCase in testSuite.TestCases) { if (testCase.IsFail) { this.ConvertErrorXmlToHtml(outputFileInfo, testSuite, testCase); } } } } } protected void ConvertErrorXmlToHtml(FileInfo parentFileInfo, TestSuite testSuite, TestCase testCase) { //入力ファイルを元に、出力ファイルのパスを特定する。 var outputFileName = testSuite.Name + "_" + testCase.Name + ".html"; var outputFileInfo = new FileInfo(this.OutputDirInfo.FullName + @"\" + outputFileName); /* * エラーメッセージに含まれている改行は、HTMLでは表示されない。 * そのため、事前に改行を「<br>」に置換する。 * 元のメッセージは加工したくないので、新規にFailureオブジェクトを生成して、 * そこに変換したメッセージをセットする。 */ var failure = new Failure { Message = testCase.Failure.Message.Replace("\n", "<br>") }; var htmlTempalte = new TestMessageTemplate(parentFileInfo.Name, failure); var content = htmlTempalte.TransformText(); using (var htmlStream = new StreamWriter(outputFileInfo.FullName, false, Encoding.GetEncoding("UTF-8"))) { htmlStream.Write(content); } } /// <summary> /// Create index.html file. /// </summary> protected void CreateIndexHtml() { var testSuiteList = new List<TestSuites>(); foreach (var xmlFileInfo in this.XmlFileInfos) { using (var xmlStream = new StreamReader(xmlFileInfo.FullName, Encoding.GetEncoding("UTF-8"))) { var serializer = new XmlSerializer(typeof(TestSuites)); var testSuites = (TestSuites)serializer.Deserialize(xmlStream); var testSuiteName = Path.GetFileNameWithoutExtension(xmlFileInfo.FullName); testSuites.TestName = testSuiteName; testSuiteList.Add(testSuites); } } var indexHtmlFilePath = this.OutputDirInfo.FullName + @"\index.html"; var indexTemplate = new IndexHtmlTemplate(testSuiteList); var content = indexTemplate.TransformText(); using (var htmlStream = new StreamWriter(indexHtmlFilePath, false, Encoding.GetEncoding("UTF-8"))) { htmlStream.Write(content); } } #endregion } }
using Octokit; using System; using System.Collections.Generic; using System.Threading.Tasks; namespace IssueCreator.Models { public class IssueMilestone { public int? Number { get; set; } public string Title { get; set; } public DateTimeOffset? DueOn { get; set; } public IssueMilestone(Milestone m) { Number = m.Number; Title = m.Title; DueOn = m.DueOn; } public IssueMilestone() // for deserialization { } public override string ToString() { return $"{Title}"; } internal static IEnumerable<IssueMilestone> FromMilestoneList(IReadOnlyList<Milestone> milestones) { List<IssueMilestone> result = new List<IssueMilestone>(); foreach (Milestone milestone in milestones) { result.Add(new IssueMilestone(milestone)); } return result; } } }
using UnityEngine; using UnityEngine.UI; public class StartUI : MonoBehaviour { public Text gameTitleText; public Text madeByText; void Start() { bool isGameOver = PlayerPrefs.GetInt("GameOver") == 1 ? true : false; if (isGameOver) { gameTitleText.text = "Game Over!"; madeByText.text = "Try again?"; } } }
using System.ComponentModel; using Autofac; using NSubstitute; using OpenTracker.Models.Dropdowns; using OpenTracker.Models.Requirements; using OpenTracker.Models.SaveLoad; using OpenTracker.Models.UndoRedo.Dropdowns; using Xunit; namespace OpenTracker.UnitTests.Models.Dropdowns { public class DropdownTests { private readonly IRequirement _requirement = Substitute.For<IRequirement>(); private readonly ICheckDropdown.Factory _checkDropdownFactory = _ => Substitute.For<ICheckDropdown>(); private readonly IUncheckDropdown.Factory _uncheckDropdownFactory = _ => Substitute.For<IUncheckDropdown>(); private readonly Dropdown _sut; public DropdownTests() { _sut = new Dropdown(_checkDropdownFactory, _uncheckDropdownFactory, _requirement); } [Fact] public void Checked_ShouldRaisePropertyChanged() { Assert.PropertyChanged(_sut, nameof(IDropdown.Checked), () => _sut.Checked = true); } [Theory] [InlineData(false, false)] [InlineData(true, true)] public void RequirementMet_ShouldReturnTrue_WhenRequirementIsMet(bool expected, bool met) { _requirement.Met.Returns(met); Assert.Equal(expected, _sut.RequirementMet); } [Fact] public void RequirementMet_ShouldRaisePropertyChanged() { Assert.PropertyChanged(_sut, nameof(IDropdown.RequirementMet), () => _requirement.PropertyChanged += Raise.Event<PropertyChangedEventHandler>( _requirement, new PropertyChangedEventArgs(nameof(IRequirement.Met)))); } [Fact] public void CreateCheckDropdownAction_ShouldReturnNewAction() { var checkDropdown = _sut.CreateCheckDropdownAction(); Assert.NotNull(checkDropdown); } [Fact] public void CreateUncheckDropdownAction_ShouldReturnNewAction() { var uncheckDropdown = _sut.CreateUncheckDropdownAction(); Assert.NotNull(uncheckDropdown); } [Fact] public void Reset_ShouldChangeCheckedToFalse() { _sut.Checked = true; _sut.Reset(); Assert.False(_sut.Checked); } [Fact] public void Load_ShouldDoNothing_WhenSaveDataIsNull() { _sut.Checked = true; _sut.Load(null); Assert.True(_sut.Checked); } [Fact] public void Load_ShouldSetCheckedToSaveDataValue_WhenSaveDataIsNotNull() { var saveData = new DropdownSaveData() { Checked = true }; _sut.Load(saveData); Assert.True(_sut.Checked); } [Fact] public void Save_ShouldSetSaveDataCheckedToTrue_WhenCheckedIsTrue() { _sut.Checked = true; var saveData = _sut.Save(); Assert.True(saveData.Checked); } [Fact] public void AutofacTest() { using var scope = ContainerConfig.Configure().BeginLifetimeScope(); var factory = scope.Resolve<IDropdown.Factory>(); var sut = factory(_requirement); Assert.NotNull((sut as Dropdown)); } } }
namespace WebServer.Server.Handlers { using System; using Server.HTTP.Contarcts; public class GETHandler : RequestHandler { public GETHandler(Func<IHttpContext, IHttpResponse> func) : base(func) { } } }
using System.Collections.Generic; namespace HouseofCat.Models.General { public class Stacky { public string ExceptionType { get; set; } public string Method { get; set; } public string FileName { get; set; } public int Line { get; set; } public List<string> StackLines { get; set; } } }
using System.Diagnostics; namespace BeeSharp.Types { public record Phantom<T, TPhantomTrait> { private readonly T value; public Phantom(T value) { this.value = value; } public static implicit operator T(Phantom<T, TPhantomTrait> phantom) => phantom.value; } }
using System; using System.Collections.Generic; using System.Linq; namespace BankoChecker { public class CardLine { public CardLine(string line, HashSet<int> numbersToCheck) { var lineNumbers = line.Split(','); foreach (var number in lineNumbers) { Numbers.Add(int.Parse(number), numbersToCheck.Contains(int.Parse(number))); } Bingo = Numbers.All(number => number.Value); } public Dictionary<int, bool> Numbers { get; private set; } = new Dictionary<int, bool>(); public bool Bingo { get; private set; } public List<string> GetLineValues() { var ceilings = new[] { 10, 20, 30, 40, 50, 60, 70, 80, 91 }; var numberRanges = Numbers.GroupBy(number => ceilings.First(ceiling => ceiling > number.Key)); List<string> values = new List<string>(); foreach (var ceiling in ceilings) { var range = numberRanges.FirstOrDefault(range => range.Key == ceiling); string number = range?.First().Key.ToString() ?? ""; bool color = range?.First().Value ?? false; values.Add(Utilities.GetNumberString(number, color, Bingo ? "strikethrough red" : "green")); } return values; } } }
using NPOI.Util; using System; using System.Text; namespace NPOI.HSSF.Record.Chart { /// * The dat record is used to store options for the chart. /// * NOTE: This source is automatically generated please do not modify this file. Either subclass or /// * Remove the record in src/records/definitions. /// /// * @author Glen Stampoultzis (glens at apache.org) public class DatRecord : StandardRecord { public const short sid = 4195; private short field_1_options; private BitField horizontalBorder = BitFieldFactory.GetInstance(1); private BitField verticalBorder = BitFieldFactory.GetInstance(2); private BitField border = BitFieldFactory.GetInstance(4); private BitField showSeriesKey = BitFieldFactory.GetInstance(8); /// Size of record (exluding 4 byte header) protected override int DataSize => 2; public override short Sid => 4195; /// Get the options field for the Dat record. public short Options { get { return field_1_options; } set { field_1_options = value; } } public DatRecord() { } /// Constructs a Dat record and Sets its fields appropriately. /// /// @param in the RecordInputstream to Read the record from public DatRecord(RecordInputStream in1) { field_1_options = in1.ReadShort(); } public override string ToString() { StringBuilder stringBuilder = new StringBuilder(); stringBuilder.Append("[DAT]\n"); stringBuilder.Append(" .options = ").Append("0x").Append(HexDump.ToHex(Options)) .Append(" (") .Append(Options) .Append(" )"); stringBuilder.Append(Environment.NewLine); stringBuilder.Append(" .horizontalBorder = ").Append(IsHorizontalBorder()).Append('\n'); stringBuilder.Append(" .verticalBorder = ").Append(IsVerticalBorder()).Append('\n'); stringBuilder.Append(" .border = ").Append(IsBorder()).Append('\n'); stringBuilder.Append(" .showSeriesKey = ").Append(IsShowSeriesKey()).Append('\n'); stringBuilder.Append("[/DAT]\n"); return stringBuilder.ToString(); } public override void Serialize(ILittleEndianOutput out1) { out1.WriteShort(field_1_options); } public override object Clone() { DatRecord datRecord = new DatRecord(); datRecord.field_1_options = field_1_options; return datRecord; } /// Sets the horizontal border field value. /// has a horizontal border public void SetHorizontalBorder(bool value) { field_1_options = horizontalBorder.SetShortBoolean(field_1_options, value); } /// has a horizontal border /// @return the horizontal border field value. public bool IsHorizontalBorder() { return horizontalBorder.IsSet(field_1_options); } /// Sets the vertical border field value. /// has vertical border public void SetVerticalBorder(bool value) { field_1_options = verticalBorder.SetShortBoolean(field_1_options, value); } /// has vertical border /// @return the vertical border field value. public bool IsVerticalBorder() { return verticalBorder.IsSet(field_1_options); } /// Sets the border field value. /// data table has a border public void SetBorder(bool value) { field_1_options = border.SetShortBoolean(field_1_options, value); } /// data table has a border /// @return the border field value. public bool IsBorder() { return border.IsSet(field_1_options); } /// Sets the show series key field value. /// shows the series key public void SetShowSeriesKey(bool value) { field_1_options = showSeriesKey.SetShortBoolean(field_1_options, value); } /// shows the series key /// @return the show series key field value. public bool IsShowSeriesKey() { return showSeriesKey.IsSet(field_1_options); } } }
namespace MercadoPagoCore.Resource.Payment { /// <summary> /// Tax. /// </summary> public class PaymentTax { /// <summary> /// Tax type. /// </summary> public string Type { get; set; } /// <summary> /// Tax value. /// </summary> public decimal? Value { get; set; } } }
[ComVisibleAttribute] // RVA: 0xB0FF0 Offset: 0xB10F1 VA: 0xB0FF0 public class SoapAttribute : Attribute // TypeDefIndex: 1183 { // Fields private bool _useAttribute; // 0x10 protected string ProtXmlNamespace; // 0x18 protected object ReflectInfo; // 0x20 // Properties public virtual bool UseAttribute { get; } public virtual string XmlNamespace { get; } // Methods // RVA: 0x175C970 Offset: 0x175CA71 VA: 0x175C970 public void .ctor() { } // RVA: 0x175C980 Offset: 0x175CA81 VA: 0x175C980 Slot: 4 public virtual bool get_UseAttribute() { } // RVA: 0x175C990 Offset: 0x175CA91 VA: 0x175C990 Slot: 5 public virtual string get_XmlNamespace() { } // RVA: 0x175C9A0 Offset: 0x175CAA1 VA: 0x175C9A0 Slot: 6 internal virtual void SetReflectionObject(object reflectionObject) { } }
using SFA.DAS.ProviderApprenticeshipsService.Domain.Interfaces; using SFA.DAS.ProviderApprenticeshipsService.Web.Models; namespace SFA.DAS.ProviderApprenticeshipsService.Web.Orchestrators { public class FiltersCookieManager : IFiltersCookieManager { private readonly ICookieStorageService<ApprenticeshipFiltersViewModel> _filterCookieStorageService; public FiltersCookieManager(ICookieStorageService<ApprenticeshipFiltersViewModel> filterCookieStorageService) { _filterCookieStorageService = filterCookieStorageService; } public ApprenticeshipFiltersViewModel GetCookie() { return _filterCookieStorageService.Get(nameof(ApprenticeshipFiltersViewModel)) ?? new ApprenticeshipFiltersViewModel(); } public void SetCookie(ApprenticeshipFiltersViewModel filtersViewModel) { _filterCookieStorageService.Delete(nameof(ApprenticeshipFiltersViewModel)); _filterCookieStorageService.Create(filtersViewModel, nameof(ApprenticeshipFiltersViewModel)); } } }
using System.Collections; using System.Collections.Generic; using UnityEngine; public class SortingSprite : MonoBehaviour { int depthSort; List<SpriteRenderer> sprites; Transform pivot; // Use this for initialization private void Start() { sprites = new List<SpriteRenderer>(); sprites.Add(transform.GetComponent<SpriteRenderer>()); pivot = transform.Find("Pivot"); for (int i = 0; i < transform.childCount; i++) { if (transform.GetChild(i).GetComponent<SpriteRenderer>()) sprites.Add(transform.GetChild(i).GetComponent<SpriteRenderer>()); } } // Update is called once per frame void Update() { foreach (SpriteRenderer spr in sprites) { depthSort = (int)((pivot.position.y) * 100.0f) * -1 + 1000; spr.sortingOrder = depthSort; } sprites[0].sortingOrder -= 1; sprites[1].sortingOrder += 3; sprites[2].sortingOrder += 3; sprites[3].sortingOrder += 4; sprites[4].sortingOrder += 3; sprites[5].sortingOrder += 4; sprites[6].sortingOrder += 1; sprites[7].sortingOrder += 2; sprites[8].sortingOrder += 1; sprites[10].sortingOrder -= 3; } }
using System; using System.Collections.Generic; namespace ExamTerm3 { interface IChatMediator { void SendMessage(User sender, User receiver, string message); void ReceiveMessage(User sender, User receiver, string message); void BroadcastMessage(User sender, List<User> receivers, string message); } }
using System; using System.IO; using OpenQA.Selenium.Chrome; using Microsoft.VisualStudio.TestTools.UnitTesting; using OpenQA.Selenium; using OpenQA.Selenium.Support.UI; using NUnit.Framework; namespace Unit_Tests { [TestClass] class Login_RegisterTest { private string url = "https://localhost:44372"; private ChromeDriver CreateDriver() { string path = Directory.GetCurrentDirectory(); string newPath = Path.GetFullPath(Path.Combine(path, @"..\..\chromeDriver\")); return new ChromeDriver(newPath); } [Test] public void RegisterTest() { ChromeDriver driver = CreateDriver(); RegisterUser(driver); DeleteUser(driver); driver.Quit(); } [Test] public void LoginTest() { ChromeDriver driver = CreateDriver(); RegisterUser(driver); Logout(driver); NavigateToLogin(driver); Login(driver); DeleteUser(driver); driver.Quit(); } [Test] public void AdminLoginTest() { ChromeDriver driver = CreateDriver(); LoginAdmin(driver); Logout(driver); driver.Quit(); } private void Login(ChromeDriver driver) { NavigateToLogin(driver); driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(20); driver.FindElement(By.Id("Input_Email")).SendKeys("usertest@gmail.com"); driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(20); driver.FindElement(By.Id("Input_Password")).SendKeys("123Bob?"); driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(20); driver.FindElement(By.XPath("/html/body/div/main/div/div[1]/section/form/div[5]/button")).Click(); } private void LoginAdmin(ChromeDriver driver) { NavigateToSite(driver); NavigateToLogin(driver); driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(20); driver.FindElement(By.Id("Input_Email")).SendKeys("admin@gmail.com"); driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(20); driver.FindElement(By.Id("Input_Password")).SendKeys("password"); driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(20); driver.FindElement(By.XPath("/html/body/div/main/div/div[1]/section/form/div[5]/button")).Click(); } private void Logout(ChromeDriver driver) { driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(20); driver.FindElement(By.XPath("/html/body/header/nav/div/div/ul[1]/li[2]/form/button")).Click(); } private void DeleteUser(ChromeDriver driver) { NavigateToUser(driver); driver.FindElement(By.Id("personal-data")).Click(); driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(20); driver.FindElement(By.Id("delete")).Click(); driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(20); driver.FindElement(By.Id("Input_Password")).SendKeys("123Bob?"); driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(20); driver.FindElement(By.XPath("/html/body/div/main/div/div/div[2]/div[2]/form/button")).Click(); } private void RegisterUser(ChromeDriver driver) { NavigateToSite(driver); NavigateToRegister(driver); driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(20); driver.FindElement(By.Id("Input_Email")).SendKeys("usertest@gmail.com"); driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(20); driver.FindElement(By.Id("Input_Password")).SendKeys("123Bob?"); driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(20); driver.FindElement(By.Id("Input_ConfirmPassword")).SendKeys("123Bob?"); driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(20); var userType = driver.FindElement(By.Id("Input_Name")); var selectElement1 = new SelectElement(userType); selectElement1.SelectByText("Admin"); driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(20); driver.FindElement(By.XPath("/html/body/div/main/div/div[1]/form/button")).Click(); } private void NavigateToLogin(ChromeDriver driver) { driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(20); driver.FindElement(By.LinkText("Login")).Click(); } private void NavigateToRegister(ChromeDriver driver) { driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(20); driver.FindElement(By.LinkText("Register")).Click(); } private void NavigateToSite(ChromeDriver driver) { driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(20); driver.Manage().Window.Maximize(); driver.Navigate().GoToUrl(url); } private void NavigateToUser(ChromeDriver driver) { driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(20); driver.FindElement(By.LinkText("Hello usertest@gmail.com!")).Click(); } } }
using System; namespace Harmony { public interface IHarmonyConfiguration { TimeSpan SynchronisationInterval { get; set; } int PastWeeksToSynchronise { get; } int FutureWeeksToSynchronise { get; } } }
using Android.App; using Android.Content; using Android.Widget; namespace Toggl.Droid.Widgets { [Service(Permission = Android.Manifest.Permission.BindRemoteviews)] public sealed class SuggestionsWidgetService : RemoteViewsService { public override IRemoteViewsFactory OnGetViewFactory(Intent intent) => new SuggestionsWidgetViewsFactory(ApplicationContext); } }
namespace SIData { public interface IAppSettingsCore { } }
using System.Collections.Generic; using Verse; namespace Spotted { class ConfigDef : Def { private List<string> args = new List<string>(); public List<string> GetArgs() { return args; } } }
using System.Runtime.InteropServices; namespace EnvDTE { public interface DTEEvents : _DTEEvents, _dispDTEEvents_Event { } }
using System.IO; using STAN_Database; using ProtoBuf; using System.Collections.Generic; using System.Linq; using System.Windows.Controls; using System; namespace STAN_PrePost { public class Functions { public string Between(string s, string start, string end) { int pFrom = s.IndexOf(start) + start.Length; int pTo = s.IndexOf(end); string result = s.Substring(pFrom, pTo - pFrom); return result; } public string Before(string s, string end) { int pTo = s.IndexOf(end); string result = s.Substring(0, pTo); return result; } public string BeforeLast(string s, string end) { int pTo = s.LastIndexOf(end); string result = s.Substring(0, pTo); return result; } public Tuple<Database, bool> OpenDatabase (string path) { //Reading binary file byte[] Input = File.ReadAllBytes(path); Database DB = ProtoDeserialize<Database>(Input); // Bool variable if Database is usefull bool GoOn = false; string error = "Database loading error:"; // Error message try { if (DB.NodeLib != null && DB.NodeLib.Count > 0) { if (DB.ElemLib != null && DB.ElemLib.Count > 0) { // Initialize Part Library and others if not exist DB.PartLib = new Dictionary<int, Part>(); if (DB.MatLib == null) DB.MatLib = new Dictionary<int, Material>(); if (DB.BCLib == null) DB.BCLib = new Dictionary<int, BoundaryCondition>(); if (DB.FELib == null) DB.FELib = new FE_Library(); if (DB.AnalysisLib == null) DB.AnalysisLib = new Analysis(); if (DB.Info == null) DB.Info = new Information(); // Create list with Parts - using LINQ select PID of all elements, remove duplicates and sort List<int> PartList = DB.ElemLib.Values.Select(x => x.PID).Distinct().ToList(); PartList.Sort(); // Create Part objects and add to Part Library foreach (int pid in PartList) { Part NewPart = new Part(pid); NewPart.CreatePart(DB.NodeLib, DB.ElemLib); DB.PartLib.Add(pid, NewPart); } DB.Set_nDOF(); // Calculate number of Degrees of Freedom // Create Boundary Conditions if (DB.BCLib != null) { foreach (BoundaryCondition bc in DB.BCLib.Values) { bc.Initialize(); } } GoOn = true; } } } catch { if(DB.NodeLib != null && DB.ElemLib != null) { error += "\n - Unknown error"; } } if (DB.NodeLib == null) { error += "\n - Nodes not detected"; } if (DB.ElemLib == null) { error += "\n - Elements not detected"; } if (GoOn == false) { System.Windows.Forms.MessageBox.Show(error); } Tuple<Database, bool> exit = new Tuple<Database, bool>(DB, GoOn); return exit; } public void AddPart2GUI(Part part, RenderInterface iRen, ListBox PartBox, TreeView Tree) { // Define Part TreeView item TreeViewItem TreePart = (TreeViewItem)Tree.Items[0]; // Add Part to Selection Box and Viewport PartBox.Items.Add("PID " + part.ID.ToString() + ": " + part.Name); iRen.AddActor(part.Get_Actor()); iRen.AddActor(part.GetEdges()); iRen.AppendFaces.AddInput(part.GetFaces()); // Add Part to TreeView TreeViewItem item = new TreeViewItem() { Header = "Part ID " + part.ID.ToString() + ": " + part.Name }; TreePart.Items.Add(item); TreePart.IsExpanded = true; // Expand Parts in Tree } public void AddBC2GUI(BoundaryCondition BC, RenderInterface iRen, TreeView Tree, bool Selected) { // Define BC TreeView item TreeViewItem TreeBC = (TreeViewItem)Tree.Items[2]; // Add BC actor to Viewport iRen.AddActor(BC.GetActor()[0]); iRen.AddActor(BC.GetActor()[1]); iRen.AddActor(BC.GetActor()[2]); BC.HideActor(); // Add BC to TreeView TreeViewItem item = new TreeViewItem() { Header = "BC ID " + BC.ID.ToString() + ": " + BC.Name, IsSelected = Selected }; TreeBC.Items.Add(item); TreeBC.IsExpanded = true; } public void AddMat2GUI (Material Mat, TreeView Tree) { // Define Mat TreeView item TreeViewItem TreeMat = (TreeViewItem)Tree.Items[1]; // Add BC to TreeView TreeViewItem item = new TreeViewItem() { Header = "Mat ID " + Mat.ID.ToString() + ": " + Mat.Name, IsSelected = true }; TreeMat.Items.Add(item); TreeMat.IsExpanded = true; } public ResultControl UpdateMesh(Database DB, RenderInterface iRen, ResultControl ResControl ) { // Catch increment int inc = ResControl.Step; // --- Scalar Bar --------------------------------------------- if (ResControl.Result != "None") { string title = ResControl.Result; if (ResControl.Result.Contains("Displacement")) // Use shorter title { title = ResControl.Result.Replace("Displacement", "Displ."); } if (ResControl.Result == "von Mises Stress") // Use shorter title { title = "Stress\nvon Mises"; } if (ResControl.Result == "Effective Strain") // Use shorter title { title = "Effective\nStrain"; } iRen.ChangeScalarName(title); iRen.ShowScalarBar(); } else { iRen.HideScalarBar(); } // --- Colormaps -------------------------------------------- // Set range of results (manual or automatic, depends on variable "Manual_Range") if (ResControl.ManualRange == false) { //Set automatic result range List<double> MinVal = new List<double>(); List<double> MaxVal = new List<double>(); foreach (Part p in DB.PartLib.Values) { double[] PartRange = p.Get_ScalarRange(inc, ResControl.Result, ResControl.ResultStyle); MinVal.Add(PartRange[0]); MaxVal.Add(PartRange[1]); } // Calculate total result range ResControl.ResultRange = new double[2] { MinVal.Min(), MaxVal.Max() }; } // Change Color LookupTable range iRen.ChangeColorRange(ResControl.ResultRange[0], ResControl.ResultRange[1]); // Update Parts foreach (Part p in DB.PartLib.Values) { p.UpdateNode(DB, inc); p.UpdateScalar(inc, ResControl.Result, ResControl.ResultStyle); } double[] N = iRen.Get_ClipPlane().GetNormal(); if (N[0] < 0) iRen.SetClipPlane("-X"); if (N[1] < 0) iRen.SetClipPlane("-Y"); if (N[2] < 0) iRen.SetClipPlane("-Z"); if (N[0] > 0) iRen.SetClipPlane("X"); if (N[1] > 0) iRen.SetClipPlane("Y"); if (N[2] > 0) iRen.SetClipPlane("Z"); // Refresh Viewport iRen.Refresh(); return ResControl; } public byte[] ProtoSerialize<T>(T record) where T : class { using (var stream = new MemoryStream()) { Serializer.Serialize(stream, record); return stream.ToArray(); } } public T ProtoDeserialize<T>(byte[] data) where T : class { using (var stream = new MemoryStream(data)) { return Serializer.Deserialize<T>(stream); } } } }
using FluentAssertions; using Xunit; namespace CSharpFunctionalExtensions.Tests.ResultTests.Extensions { public class TapAsyncRight : TapTestsBase { [Theory] [InlineData(true)] [InlineData(false)] public void Tap_AsyncRight_executes_action_on_result_success_and_returns_self(bool isSuccess) { Result result = Result.SuccessIf(isSuccess, ErrorMessage); var returned = result.Tap(Task_Action).Result; actionExecuted.Should().Be(isSuccess); result.Should().Be(returned); } [Theory] [InlineData(true)] [InlineData(false)] public void Tap_T_AsyncRight_executes_action_on_result_success_and_returns_self(bool isSuccess) { Result<T> result = Result.SuccessIf(isSuccess, T.Value, ErrorMessage); var returned = result.Tap(Task_Action).Result; actionExecuted.Should().Be(isSuccess); result.Should().Be(returned); } [Theory] [InlineData(true)] [InlineData(false)] public void Tap_T_AsyncRight_executes_action_T_on_result_success_and_returns_self(bool isSuccess) { Result<T> result = Result.SuccessIf(isSuccess, T.Value, ErrorMessage); var returned = result.Tap(Task_Action_T).Result; actionExecuted.Should().Be(isSuccess); result.Should().Be(returned); } [Theory] [InlineData(true)] [InlineData(false)] public void Tap_T_E_AsyncRight_executes_action_on_result_success_and_returns_self(bool isSuccess) { Result<T, E> result = Result.SuccessIf(isSuccess, T.Value, E.Value); var returned = result.Tap(Task_Action).Result; actionExecuted.Should().Be(isSuccess); result.Should().Be(returned); } [Theory] [InlineData(true)] [InlineData(false)] public void Tap_T_E_AsyncRight_executes_action_T_on_result_success_and_returns_self(bool isSuccess) { Result<T, E> result = Result.SuccessIf(isSuccess, T.Value, E.Value); var returned = result.Tap(Task_Action_T).Result; actionExecuted.Should().Be(isSuccess); result.Should().Be(returned); } [Theory] [InlineData(true, true)] [InlineData(true, false)] [InlineData(false, false)] public void Tap_T_AsyncRight_func_result(bool resultSuccess, bool funcSuccess) { Result<T> result = Result.SuccessIf(resultSuccess, T.Value, ErrorMessage); var returned = result.Tap(_ => GetResult(funcSuccess).AsTask()).Result; actionExecuted.Should().Be(resultSuccess); returned.Should().Be(funcSuccess ? result : FailedResultT); } [Theory] [InlineData(true, true)] [InlineData(true, false)] [InlineData(false, false)] public void Tap_T_AsyncRight_func_result_K(bool resultSuccess, bool funcSuccess) { Result<T> result = Result.SuccessIf(resultSuccess, T.Value, ErrorMessage); var returned = result.Tap(Func_Task_Result_K(funcSuccess)).Result; actionExecuted.Should().Be(resultSuccess); returned.Should().Be(funcSuccess ? result : FailedResultT); } [Theory] [InlineData(true, true)] [InlineData(true, false)] [InlineData(false, false)] public void Tap_T_AsyncRight_func_result_KE(bool resultSuccess, bool funcSuccess) { Result<T, E> result = Result.SuccessIf(resultSuccess, T.Value, E.Value); var returned = result.Tap(Func_Task_Result_KE(funcSuccess)).Result; actionExecuted.Should().Be(resultSuccess); returned.Should().Be(funcSuccess ? result : returned); } } }
/* © 2020 Ivan Pointer MIT License: https://github.com/ivanpointer/NuLog/blob/master/LICENSE Source on GitHub: https://github.com/ivanpointer/NuLog */ using FakeItEasy; using NuLog.Configuration; using NuLog.LogEvents; using NuLog.Targets; using System; using System.Collections.Generic; using System.Linq; using Xunit; namespace NuLog.Tests.Unit.Targets { /// <summary> /// Documents (and verifies) the expected behavior of the console target. /// /// These tests are excluded from the AppVeyor build - as something about them fails in AppVeyor /// - it seems that setting the console color doesn't work there. /// </summary> [Collection("ColorConsoleTargetTests")] [Trait("Category", "Unit-Exclude")] public class ColorConsoleTargetXCludeTests : ColorConsoleTargetTests { /// <summary> /// The console logger should set the background color, if configured. /// </summary> [Fact(DisplayName = "Should_SetBackgroundColor", Skip = "Color tests are broken temporarily.")] public void Should_SetBackgroundColor() { // Setup var layout = A.Fake<ILayout>(); var layoutFactory = A.Fake<ILayoutFactory>(); A.CallTo(() => layoutFactory.MakeLayout(A<string>.Ignored)) .Returns(layout); A.CallTo(() => layout.Format(A<LogEvent>.Ignored)) .Returns("Green background!"); var config = new TargetConfig { Properties = new Dictionary<string, object> { { "background", "DarkGreen" } } }; var logger = new ColorConsoleTarget(); logger.Configure(config); logger.Configure(config, layoutFactory); // Execute logger.Write(new LogEvent()); // Validate var message = this.textWriter.ConsoleMessages.Single(m => m.Message == "Green background!"); Assert.Equal(ConsoleColor.DarkGreen, message.BackgroundColor); } /// <summary> /// The console logger should set the foreground color, if configured. /// </summary> [Fact(DisplayName = "Should_SetForegroundColor", Skip = "Color tests are broken temporarily.")] public void Should_SetForegroundColor() { // Setup var layout = A.Fake<ILayout>(); var layoutFactory = A.Fake<ILayoutFactory>(); A.CallTo(() => layoutFactory.MakeLayout(A<string>.Ignored)) .Returns(layout); A.CallTo(() => layout.Format(A<LogEvent>.Ignored)) .Returns("Red foreground!"); var config = new TargetConfig { Properties = new Dictionary<string, object> { { "foreground", "Red" } } }; var logger = new ColorConsoleTarget(); logger.Configure(config); logger.Configure(config, layoutFactory); // Execute logger.Write(new LogEvent()); // Validate var message = this.textWriter.ConsoleMessages.Single(m => m.Message == "Red foreground!"); Assert.Equal(ConsoleColor.Red, message.ForegroundColor); } } }
namespace CarpgLobby.Api.Model { public class Change { public ChangeType Type { get; set; } public Server Server { get; set; } public int ServerID { get; set; } } }
using System; using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.Events; using Newtonsoft.Json; public class TensorboardManager : MonoBehaviour { //http://localhost:6006/data/plugin/scalars/scalars?run=BatchSize-inc1-run0&tag=Info/cumulative_reward public string TensorboardUrl = "http://localhost:6006"; public float TensorboardStartupTime = 10f; // Give Tensorboard some time to start public TensorFlowConfig tensorFlowCOnfig; public UnityEvent OnTensorboardSuccess = new UnityEvent(); public UnityEvent OnTensorboardFailure = new UnityEvent(); public IEnumerator GetRunStats(string runId, int runNumber, int incrementNumber, Action<RunStatistics> action) { var url = GetRunStatsUrl(runId); using (WWW www = new WWW(url)) { yield return www; if (string.IsNullOrEmpty(www.error) == true && string.IsNullOrEmpty(www.text) == false) { var runStats = new RunStatistics(); var buffer = "{\"data\":" + www.text + "}"; //var runData = JsonUtility.FromJson<RunData>(buffer); var runData = JsonConvert.DeserializeObject<RunData>(buffer); var accumulator = 0.0; foreach (var row in runData.data) { accumulator += row[2]; } runStats.runId = runId; runStats.runNumber = runNumber; runStats.incrementNumber = incrementNumber; runStats.averageReward = accumulator / (double)runData.data.Count; runStats.finalReward = runData.data[runData.data.Count - 1][2]; action(runStats); } else { Debug.Log("Failure getting stats for " + runId); } } } string GetRunStatsUrl(string runId) { return TensorboardUrl + "/data/plugin/scalars/scalars?run=" + runId + "&tag=Info/cumulative_reward"; } public void CheckTensorboard() { StartCoroutine(TestTensorboardCo(TensorboardUrl)); } public void StartTensorboard() { var args = new List<string>(); args.Add("--logdir=" + tensorFlowCOnfig.SummariesDirectory); CommandLineRunner.StartCommandLine(tensorFlowCOnfig.TensorboardDirectory, "tensorboard", args.ToArray()); } IEnumerator TestTensorboardCo(string UrlWithPort) { using (WWW www = new WWW(UrlWithPort)) { yield return www; // if there is no error, and is content if (string.IsNullOrEmpty(www.error) == true && string.IsNullOrEmpty(www.text) == false) { if (OnTensorboardSuccess != null) OnTensorboardSuccess.Invoke(); } else { Debug.Log("Tensorboard is off, starting TensorBoard and waiting a few seconds for startup"); StartTensorboard(); yield return new WaitForSeconds(TensorboardStartupTime); if (OnTensorboardFailure != null) OnTensorboardFailure.Invoke(); } } } }
using System; using UnityEngine; public class PlayerCostume : MonoBehaviour { public Profile profile; public string[] mountPaths; void Start() { profile.OnItemAdded.AddListener(OnProfileItemAdded); profile.OnItemRemoved.AddListener(OnProfileItemRemoved); profile.OnRevert.AddListener(OnProfileRevert); profile.Items.ForEach(item => { OnProfileItemAdded(item); }); } public void OnProfileItemAdded(Item item) { var mount = transform.Find(item.mountPath) as Transform; if (mount == null) { return; } mount.ClearChildren(); if (item.content == null) { return; } var appliedItem = Instantiate(item.content) as Transform; appliedItem.SetParent(mount); appliedItem.SetLayer(mount.gameObject.layer, true); appliedItem.localPosition = Vector3.zero; appliedItem.localRotation = Quaternion.identity; appliedItem.localScale = Vector3.one; } public void OnProfileItemRemoved(Item item) { var mount = transform.Find(item.mountPath) as Transform; if (mount == null) { return; } mount.ClearChildren(); } public void OnProfileRevert() { for (var i = 0; i < mountPaths.Length; i++) { var mount = transform.Find(mountPaths[i]) as Transform; if (mount == null) { continue; } mount.ClearChildren(); } profile.Items.ForEach(item => { OnProfileItemAdded(item); }); } }
namespace YukoBot.Models.Web { public class MessageCollectionItemWeb { public ulong ChannelId { get; set; } public ulong MessageId { get; set; } } }
using System.Collections; using System.Collections.Generic; using UnityEngine; using System; [DisallowMultipleComponent, DefaultExecutionOrder(-1)] public class TimeManager : MonoBehaviour, IExecutable { public static TimeManager Instance; private float m_InitialFixedDeltaTime; private float m_GameSpeed; public float GameSpeed { get => m_GameSpeed; set { if (value == 0.0f && m_GameSpeed != 0.0f) m_ResumeGameSpeed = m_GameSpeed; m_GameSpeed = value; } } [SerializeField] private bool m_PauseControl; private bool m_PauseInterrupted; private float m_ResumeGameSpeed; public bool Pause { get => m_GameSpeed == 0.0f; set { if (Pause != value) if (value) GameSpeed = 0.0f; else { m_HoldToUnPauseKeys.Clear(); m_UnPauseObject.Clear(); m_GameSpeed = m_ResumeGameSpeed; } } } private List<KeyCode> m_HoldToUnPauseKeys = new List<KeyCode>(); private HashSet<object> m_UnPauseObject = new HashSet<object>(); ////////////////////////////////////////////////////////////////////////// private void Awake() { if (Instance == null) Instance = this; m_GameSpeed = Time.timeScale; m_InitialFixedDeltaTime = Time.fixedDeltaTime; if (m_PauseControl) gameObject.AddComponent<RunnerLateUpdate>().Executable = this; } private void OnDestroy() { if (Instance == this) Instance = null; } private void LateUpdate() { if (Time.timeScale != m_GameSpeed) { Time.timeScale = m_GameSpeed; if (m_GameSpeed > 0.0f && m_GameSpeed <= 1.0f) Time.fixedDeltaTime = m_InitialFixedDeltaTime * m_GameSpeed; } } public void iExecute() { if (Pause) { if (m_UnPauseObject.Count > 0) { Pause = false; m_PauseInterrupted = true; } else foreach (var n in m_HoldToUnPauseKeys) if (Input.GetKey(n)) { Pause = false; m_PauseInterrupted = true; break; } } else if (m_PauseInterrupted) { bool onPause = true; if (m_UnPauseObject.Count > 0) onPause = false; else foreach (var n in m_HoldToUnPauseKeys) if (Input.GetKey(n)) { onPause = false; break; } if (onPause) { Pause = true; m_PauseInterrupted = false; } } } ////////////////////////////////////////////////////////////////////////// public void TogglePause() { Pause = !Pause; } public void AddUnpauseObject(object obj) { m_UnPauseObject.Add(obj); } public void RemoveUnpauseObject(object obj) { m_UnPauseObject.Remove(obj); } public void AddHoldUnpauseKey(KeyCode key) { m_HoldToUnPauseKeys.Add(key); } public void RemoveHoldUnpauseKey(KeyCode m_Key) { m_HoldToUnPauseKeys.Remove(m_Key); } }
using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using System.Linq; using Newtonsoft.Json; using Newtonsoft.Json.Linq; namespace BlockchainAppAPI.Models.Search { [Table("SearchObject", Schema="Search")] public class SearchObject: AuditBase { [Key] public Guid SearchObjectId { get; set; } public String Name { get; set; } public String Description { get; set; } public String CompiledQuery { get; set; } public String CompiledCountQuery { get; set; } public String _CompiledFieldList { get; set; } [NotMapped] public List<string> CompiledFieldList { get { return JArray.Parse(this._CompiledFieldList).Select(f => f.ToString()).ToList(); } set { this._CompiledFieldList = JsonConvert.SerializeObject(JArray.FromObject(value)); } } public Boolean IsValid { get; set; } public String ModuleName { get; set; } public String ObjectName { get; set; } public List<Selection> Selections { get; set; } } }
using ChaarrRescueMission.Properties; using System.Collections.Generic; using System.Linq; namespace ChaarrRescueMission.Model.Entity.Filtering { class EventFiltering { /// <summary> /// Filters events lists and deletes from them unnessecery events. /// </summary> public static IEnumerable<string> Filter(IEnumerable<string> list) { return list.Where(Event => Event != Resources.CaptionEventExpeditionEnergyChanged && Event != Resources.CaptionEventExpeditionMatterChanged && Event != Resources.CaptionEventPołudnicaEnergyChanged && Event != Resources.CaptionEventPołudnicaMatterChanged && Event != Resources.CaptionEventChaarrHatredChanged && Event != Resources.CaptionEventKnowledgeChanged && Event != Resources.CaptionEventCrewDeathsChanged && Event != Resources.CaptionEventSurvivorDeathsChanged && Event != Resources.CaptionEventUpkeepTime ).Reverse().ToList(); } } }
// Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. using System.Windows; using System.Windows.Controls; using System.Windows.Input; using System.Windows.Media; namespace AccessibilityInsights.SharedUx.Controls.CustomControls { /// <summary> /// Custom DataGrid class with enhancements to keyboard nav behavior. /// Ensures DataGrid is only one tab stop, despite WPF's best efforts /// </summary> class CustomDataGrid : DataGrid { public CustomDataGrid() : base() { this.PreviewKeyDown += CustomDataGrid_PreviewKeyDown; KeyboardNavigation.SetTabNavigation(this, KeyboardNavigationMode.Once); } /// <summary> /// Ensures tab/shift tab will always change focus away from datagrid /// </summary> private void CustomDataGrid_PreviewKeyDown(object sender, KeyEventArgs e) { var modKey = e.KeyboardDevice.Modifiers; if (!(e.Key == Key.Tab) || !(modKey == ModifierKeys.None || modKey == ModifierKeys.Shift)) return; var dir = modKey == ModifierKeys.Shift ? FocusNavigationDirection.Previous : FocusNavigationDirection.Next; // keep trying to move focus until focused element is not a descendant of the datagrid while (Keyboard.FocusedElement is Visual v && v.IsDescendantOf(this) && Keyboard.FocusedElement is FrameworkElement elem) { if (!elem.MoveFocus(new TraversalRequest(dir))) { break; } } e.Handled = true; } } }
using System.Collections.Immutable; using EagleSabi.Coordinator.Domain.Context.Round.Enums; using EagleSabi.Infrastructure.Common.Abstractions.EventSourcing.Models; using NBitcoin; using WalletWasabi.Crypto; using WalletWasabi.WabiSabi.Crypto; using WalletWasabi.WabiSabi.Models.MultipartyTransaction; namespace EagleSabi.Coordinator.Domain.Context.Round.Records; public record RoundState : IState { public RoundParameters? RoundParameters { get; init; } = default; public ImmutableList<InputState> Inputs { get; init; } = ImmutableList<InputState>.Empty; public ImmutableList<OutputState> Outputs { get; init; } = ImmutableList<OutputState>.Empty; public PhaseEnum Phase { get; init; } = PhaseEnum.New; public uint256 Id => RoundParameters?.Id ?? uint256.Zero; public bool Succeeded { get; init; } = false; } public record InputState( Coin Coin, OwnershipProof OwnershipProof, Guid AliceSecret = default, bool ConnectionConfirmed = false, bool ReadyToSign = false, WitScript? WitScript = null); public record OutputState( Script Script, long Value); public record RoundParameters( FeeRate FeeRate, CredentialIssuerParameters AmountCredentialIssuerParameters, CredentialIssuerParameters VsizeCredentialIssuerParameters, DateTimeOffset InputRegistrationStart, TimeSpan InputRegistrationTimeout, TimeSpan ConnectionConfirmationTimeout, TimeSpan OutputRegistrationTimeout, TimeSpan TransactionSigningTimeout, long MaxAmountCredentialValue, long MaxVsizeCredentialValue, long MaxVsizeAllocationPerAlice, MultipartyTransactionParameters MultipartyTransactionParameters ) { public uint256 BlameOf { get; init; } = uint256.Zero; private uint256? _id; public uint256 Id => _id ??= CalculateHash(); public DateTimeOffset InputRegistrationEnd => InputRegistrationStart + InputRegistrationTimeout; private uint256 CalculateHash() => RoundHasher.CalculateHash( InputRegistrationStart, InputRegistrationTimeout, ConnectionConfirmationTimeout, OutputRegistrationTimeout, TransactionSigningTimeout, MultipartyTransactionParameters.AllowedInputAmounts, MultipartyTransactionParameters.AllowedInputTypes, MultipartyTransactionParameters.AllowedOutputAmounts, MultipartyTransactionParameters.AllowedOutputTypes, MultipartyTransactionParameters.Network, MultipartyTransactionParameters.FeeRate.FeePerK, MultipartyTransactionParameters.MaxTransactionSize, MultipartyTransactionParameters.MinRelayTxFee.FeePerK, MaxAmountCredentialValue, MaxVsizeCredentialValue, MaxVsizeAllocationPerAlice, AmountCredentialIssuerParameters, VsizeCredentialIssuerParameters); }
using System.Collections; using System.Collections.Generic; using UnityEngine; public class CreateBullets : MonoBehaviour { public GameObject bullet; public float shotsPerSeconds; public float shotDelay; Transform bulletPoint; Transform player; float shotCounter; bool hasWaited = false; // Use this for initialization void Start () { GameObject goPlayer = GameObject.Find ("Player"); player = goPlayer.GetComponent<Transform> (); bulletPoint = GetComponent<Transform> (); StartCoroutine (StartTimer ()); } // Update is called once per frame void Update () { if (hasWaited) { float probability = Time.deltaTime * shotsPerSeconds; if (Random.value < probability) { Fire (); } } } void Fire () { GameObject bulletClone = Instantiate (bullet, bulletPoint.position, bulletPoint.rotation); Rigidbody bulletRig = bulletClone.GetComponent<Rigidbody> (); bulletRig.velocity = (player.position - bulletPoint.position).normalized * 30; } IEnumerator StartTimer () { yield return new WaitForSeconds (shotDelay); hasWaited = true; } }
using CLUNL.Data.Convertors; using System; using System.Text; namespace CLUNL.Data.Layer0.Buffers { /// <summary> /// A buffer that allows to directly write any primitive data and will auto convert them. /// </summary> public class TypeDataBuffer { /// <summary> /// Core byte buffer. /// </summary> public ByteBuffer CoreBuffer = new ByteBuffer(); /// <summary> /// Get the length of this buffer. /// </summary> public int Length { get => CoreBuffer.Length; } /// <summary> /// Obtain a TypeDataBuffer from a byte array. /// </summary> /// <param name="Data"></param> /// <returns></returns> public static TypeDataBuffer FromByteArray(byte[] Data) { TypeDataBuffer Buffer = new TypeDataBuffer(); Buffer.CoreBuffer = ByteBuffer.FromByteArray(Data); return Buffer; } /// <summary> /// Obtain a TypeDataBuffer from a ByteBuffer. /// </summary> /// <param name="vs"></param> /// <returns></returns> public static TypeDataBuffer FromByteBuffer(ByteBuffer vs) { TypeDataBuffer Buffer = new TypeDataBuffer(); Buffer.CoreBuffer = vs; return Buffer; } /// <summary> /// Obtain the core ByteBuffer. /// </summary> /// <returns></returns> public ByteBuffer ObtainByteBuffer() { return CoreBuffer; } /// <summary> /// Obtain a byte array of buffered data. /// </summary> /// <returns></returns> public byte[] ObtainByteArray() { return CoreBuffer.GetTotalData(); } /// <summary> /// Clear the buffer. /// </summary> public void Clear() { CoreBuffer.Clear(); } /// <summary> /// Obtain a byte array then clear the buffer. /// </summary> /// <returns></returns> public byte[] ObtainByteArrayAndClear() { return CoreBuffer.GetTotalDataAndClear(); } /// <summary> /// Read an array with primitive data. Nested array is <b>not</b> supported. /// </summary> /// <param name="T"></param> /// <returns></returns> public Array ReadArray(Type T) { var l = BitConverter.ToInt32(CoreBuffer.GetGroup(), 0); Array array = Array.CreateInstance(T, l); for (int i = 0; i < l; i++) { if (T == typeof(int)) { array.SetValue(BitConverter.ToInt32(CoreBuffer.GetGroup(), 0), i); } else if (T == typeof(uint)) { array.SetValue(BitConverter.ToUInt16(CoreBuffer.GetGroup(), 0), i); } else if (T == typeof(short)) { array.SetValue(BitConverter.ToInt16(CoreBuffer.GetGroup(), 0), i); } else if (T == typeof(ushort)) { array.SetValue(BitConverter.ToUInt16(CoreBuffer.GetGroup(), 0), i); } else if (T == typeof(long)) { array.SetValue(BitConverter.ToInt64(CoreBuffer.GetGroup(), 0), i); } else if (T == typeof(ulong)) { array.SetValue(BitConverter.ToUInt64(CoreBuffer.GetGroup(), 0), i); } else if (T == typeof(float)) { array.SetValue(BitConverter.ToSingle(CoreBuffer.GetGroup(), 0), i); } else if (T == typeof(double)) { array.SetValue(BitConverter.ToDouble(CoreBuffer.GetGroup(), 0), i); } else if (T == typeof(bool)) { array.SetValue(BitConverter.ToBoolean(CoreBuffer.GetGroup(), 0), i); } else if (T == typeof(char)) { array.SetValue(BitConverter.ToChar(CoreBuffer.GetGroup(), 0), i); } else if (T == typeof(string)) { array.SetValue(Encoding.UTF8.GetString(CoreBuffer.GetGroup()), i); } } return null; } /// <summary> /// Write an array with primitive data. Nested array is <b>not</b> supported. /// </summary> /// <param name="array"></param> public void WriteArray(Array array) { CoreBuffer.AppendGroup(BitConverter.GetBytes(array.Length)); foreach (var item in array) { if (item is int) { CoreBuffer.AppendGroup(BitConverter.GetBytes((int)item)); } else if (item is uint) { CoreBuffer.AppendGroup(BitConverter.GetBytes((uint)item)); } else if (item is float) { CoreBuffer.AppendGroup(BitConverter.GetBytes((float)item)); } else if (item is bool) { CoreBuffer.AppendGroup(BitConverter.GetBytes((bool)item)); } else if (item is double) { CoreBuffer.AppendGroup(BitConverter.GetBytes((double)item)); } else if (item is char) { CoreBuffer.AppendGroup(BitConverter.GetBytes((char)item)); } else if (item is long) { CoreBuffer.AppendGroup(BitConverter.GetBytes((long)item)); } else if (item is short) { CoreBuffer.AppendGroup(BitConverter.GetBytes((short)item)); } else if (item is ulong) { CoreBuffer.AppendGroup(BitConverter.GetBytes((ulong)item)); } else if (item is ushort) { CoreBuffer.AppendGroup(BitConverter.GetBytes((ushort)item)); } else if (item is string) { CoreBuffer.AppendGroup(Encoding.UTF8.GetBytes((string)item)); } } } /// <summary> /// Write a data which can be primitive or data with registered convertor. /// </summary> /// <param name="obj"></param> public void Write(object obj) { if (obj is int) { CoreBuffer.AppendGroup(BitConverter.GetBytes(TypeFlags.Int)); CoreBuffer.AppendGroup(BitConverter.GetBytes((int)obj)); } else if (obj is long) { CoreBuffer.AppendGroup(BitConverter.GetBytes(TypeFlags.Long)); CoreBuffer.AppendGroup(BitConverter.GetBytes((long)obj)); } else if (obj is ulong) { CoreBuffer.AppendGroup(BitConverter.GetBytes(TypeFlags.ULong)); CoreBuffer.AppendGroup(BitConverter.GetBytes((ulong)obj)); } else if (obj is short) { CoreBuffer.AppendGroup(BitConverter.GetBytes(TypeFlags.Short)); CoreBuffer.AppendGroup(BitConverter.GetBytes((short)obj)); } else if (obj is ushort) { CoreBuffer.AppendGroup(BitConverter.GetBytes(TypeFlags.UShort)); CoreBuffer.AppendGroup(BitConverter.GetBytes((ushort)obj)); } else if (obj is float) { CoreBuffer.AppendGroup(BitConverter.GetBytes(TypeFlags.Float)); CoreBuffer.AppendGroup(BitConverter.GetBytes((float)obj)); } else if (obj is double) { CoreBuffer.AppendGroup(BitConverter.GetBytes(TypeFlags.Double)); CoreBuffer.AppendGroup(BitConverter.GetBytes((double)obj)); } else if (obj is bool) { CoreBuffer.AppendGroup(BitConverter.GetBytes(TypeFlags.Bool)); CoreBuffer.AppendGroup(BitConverter.GetBytes((bool)obj)); } else if (obj is char) { CoreBuffer.AppendGroup(BitConverter.GetBytes(TypeFlags.Char)); CoreBuffer.AppendGroup(BitConverter.GetBytes((char)obj)); } else if (obj is string) { CoreBuffer.AppendGroup(BitConverter.GetBytes(TypeFlags.String)); CoreBuffer.AppendGroup(Encoding.UTF8.GetBytes((string)obj)); } else if (obj is Array) { CoreBuffer.AppendGroup(BitConverter.GetBytes(TypeFlags.Array)); var arr = (Array)obj; if (arr.Length > 0) { var item = arr.GetValue(0); if (item is int) { CoreBuffer.AppendGroup(BitConverter.GetBytes(TypeFlags.Int)); } else if (item is long) { CoreBuffer.AppendGroup(BitConverter.GetBytes(TypeFlags.Long)); } else if (item is ulong) { CoreBuffer.AppendGroup(BitConverter.GetBytes(TypeFlags.ULong)); } else if (item is short) { CoreBuffer.AppendGroup(BitConverter.GetBytes(TypeFlags.Short)); } else if (item is ushort) { CoreBuffer.AppendGroup(BitConverter.GetBytes(TypeFlags.UShort)); } else if (item is float) { CoreBuffer.AppendGroup(BitConverter.GetBytes(TypeFlags.Float)); } else if (item is double) { CoreBuffer.AppendGroup(BitConverter.GetBytes(TypeFlags.Double)); } else if (item is bool) { CoreBuffer.AppendGroup(BitConverter.GetBytes(TypeFlags.Bool)); } else if (item is char) { CoreBuffer.AppendGroup(BitConverter.GetBytes(TypeFlags.Char)); } else if (item is string) { CoreBuffer.AppendGroup(BitConverter.GetBytes(TypeFlags.String)); } } WriteArray((Array)obj); } else { var Convertor = ConvertorManager.CurrentConvertorManager.GetConvertor(obj.GetType()); CoreBuffer.AppendGroup(BitConverter.GetBytes(TypeFlags.CustomData)); CoreBuffer.AppendGroup(BitConverter.GetBytes(Convertor.DataHeader())); CoreBuffer.AppendGroup(Convertor.Serialize(obj)); } } /// <summary> /// Read a data which can be primitive or data with registered convertor. /// </summary> public object Read() { short flag = BitConverter.ToInt16(CoreBuffer.GetGroup(), 0); switch (flag) { case TypeFlags.Int: return BitConverter.ToInt32(CoreBuffer.GetGroup(), 0); case TypeFlags.Float: return BitConverter.ToSingle(CoreBuffer.GetGroup(), 0); case TypeFlags.Short: return BitConverter.ToInt16(CoreBuffer.GetGroup(), 0); case TypeFlags.UShort: return BitConverter.ToUInt16(CoreBuffer.GetGroup(), 0); case TypeFlags.Long: return BitConverter.ToInt64(CoreBuffer.GetGroup(), 0); case TypeFlags.ULong: return BitConverter.ToUInt64(CoreBuffer.GetGroup(), 0); case TypeFlags.Double: return BitConverter.ToDouble(CoreBuffer.GetGroup(), 0); case TypeFlags.Bool: return BitConverter.ToBoolean(CoreBuffer.GetGroup(), 0); case TypeFlags.Char: return BitConverter.ToChar(CoreBuffer.GetGroup(), 0); case TypeFlags.String: return Encoding.UTF8.GetString(CoreBuffer.GetGroup()); case TypeFlags.Array: { short DType = BitConverter.ToInt16(CoreBuffer.GetGroup(), 0); Type t; switch (DType) { case TypeFlags.Int: t = typeof(int); break; case TypeFlags.Float: t = typeof(float); break; case TypeFlags.Short: t = typeof(short); break; case TypeFlags.UShort: t = typeof(ushort); break; case TypeFlags.Long: t = typeof(long); break; case TypeFlags.ULong: t = typeof(ulong); break; case TypeFlags.Double: t = typeof(double); break; case TypeFlags.Bool: t = typeof(bool); break; case TypeFlags.Char: t = typeof(char); break; case TypeFlags.String: t = typeof(string); break; case TypeFlags.Array: { throw new Exception("Nested array is not supported!"); } default: throw new UndefinedTypeFlagException(flag); } var arr = ReadArray(t); return arr; } case TypeFlags.CustomData: { short DataHeader = BitConverter.ToInt16(CoreBuffer.GetGroup(), 0); foreach (var item in ConvertorManager.CurrentConvertorManager.AllConvertors()) { if (item.DataHeader() == DataHeader) { return item.Deserialize(CoreBuffer.GetGroup()); } else continue; } throw new ConvertorNotFoundException(); } default: throw new UndefinedTypeFlagException(flag); } } /// <summary> /// Convert from byte array to TypeDataBuffer. /// </summary> /// <param name="Data"></param> public static implicit operator TypeDataBuffer(byte[] Data) { TypeDataBuffer result = new TypeDataBuffer(); ByteBuffer vs = new ByteBuffer(); foreach (var item in Data) { vs.buf.Enqueue(item); } result.CoreBuffer = vs; return result; } /// <summary> /// Convert from TypeDataBuffer to byte array. /// </summary> /// <param name="Buffer"></param> public static implicit operator byte[](TypeDataBuffer Buffer) { return Buffer.ObtainByteArray(); } } /// <summary> /// Throw when the type flag is undefined. /// </summary> [Serializable] public class UndefinedTypeFlagException : Exception { /// <summary> /// Throw when the type flag is undefined. /// </summary> public UndefinedTypeFlagException(short TypeID) : base($"Undefined TypeFlag:{TypeID}") { } } /// <summary> /// Known type flags. /// </summary> public class TypeFlags { /// <summary> /// Int32, int /// </summary> public const short Int = 0x00; /// <summary> /// Single, float /// </summary> public const short Float = 0x01; /// <summary> /// Double, double /// </summary> public const short Double = 0x02; /// <summary> /// Int64, long /// </summary> public const short Long = 0x03; /// <summary> /// Unsigned Int64, ulong /// </summary> public const short ULong = 0x04; /// <summary> /// Int16, short /// </summary> public const short Short = 0x05; /// <summary> /// Unsigned Int16, ushort /// </summary> public const short UShort = 0x06; /// <summary> /// Boolean, bool /// </summary> public const short Bool = 0x07; /// <summary> /// Character, char /// </summary> public const short Char = 0x08; /// <summary> /// String, string /// </summary> public const short String = 0x09; /// <summary> /// Array /// </summary> public const short Array = 0x0A; /// <summary> /// KVCollection, not implemented yet. /// </summary> public const short KVCollection = 0x0B; /// <summary> /// Customed data, requies its convertor to be registered. /// </summary> public const short CustomData = 0x0C; } }
class Auu1gMpGu_LJpXyUTPbUjxvE { private float NI4qViu5IB3gH = 0.0f; public bool xWjryPbKNYChlhNiZxuTyxyP1vHgb = false; public double M2MCG_7QZZUz3wpNYeJHTOQVXrkjuKNt_R = 0.0; private bool iLswNIzLFCbdlXkoxp5z4Sq = false; string xPqzMpv1yoF6Z = null; int rdza3mRu1xyHi0YNjhd4ThYzA5r6FvwSlwUHvCb = 0; public bool TtgUvBvAgyC7JV97HJCcR = false; bool pEsz4lFPrflfUVMUD = false; public string m4ZozbFGLIqZwo22KU0lnobwdO7sw7N6 = null; public bool frXtgUx5HCA9DuuUJN = false; public int eEH1sdLWgbseCTEgcJ17NFc = 0; string yJ7vQ7keGA = null; private string Eq24Ija70Oh62enZ7AnOXsB2i4ZWAlluE7CPd = null; private double xOesbbHkmJVlJzRXtXBhIrNwYZ9UE7oo = 0.0; double EwD1WhaLBTBmw6_2bRWfuGIv2EM9XNmuaeu = 0.0; double xeyPZ7njkmAxrZAVD5rGf3WwqkQtQBldI = 0.0; private string f3LN2XWlKqnN0H4UjZqjQCnJ30IvQIYjP5X = null; private int wIt2R6pckchaDqcG3_JHb13g = 0; private float Pun7foZqLUnvMHt7i4KRAeAInK7hczud7fkuWk6u = 0.0f; float z8C5sKNJmSHbPeqQxpNt1tg1PMU = 0.0f; public bool QDSj8SPdvxSvmHTc7HBJB5pNV = false; string uRHCIUjLpsRa2OBf6XkClzkMk = null; float I0T_516uWt5PJg_wgtb6KDql0sqYdr6e = 0.0f; public bool p_9x2jmechn8 = false; private string DnolqLBIcjWFfTttG1Z1dVC = null; private double FbIh4vUlx6CtVh73GPz7JHLFnIIAubnlO6 = 0.0; public float ClBLdl1OTEruWf13QIPVHWWOPFUjiKVHLHZmP = 0.0f; double GuvZMfRV_rfXgGwyRj41V_L1BBi = 0.0; float WB7pAbBOTrOaOtouUVCxV72BR9yZeSHT_wyg = 0.0f; public float gus23JhSD7bFWI7KS4I8Nk13eptH4b = 0.0f; public int yycQF1QQTAz6A4M { get; set; } public int Vc9HS8acN9RU0BGEey3K7w2XkpkIkSVKi_MiB { get; set; } public double aGmyaUpOVcqFqj2_mImpb3QhZQUZdlwRKPReV4 { get { return xOesbbHkmJVlJzRXtXBhIrNwYZ9UE7oo; } set { xOesbbHkmJVlJzRXtXBhIrNwYZ9UE7oo = value; } } public int nUICqGRQXgEvav4J0JgwcEf40x1f29 { get; set; } public int k5nA1mcIl4U6MG0VR5u { get; set; } public float sJHa71hhldjBGvCQZFfF3Nm7h { get { return z8C5sKNJmSHbPeqQxpNt1tg1PMU; } set { z8C5sKNJmSHbPeqQxpNt1tg1PMU = value; } } public int mjwQ_6_XfWgGsgzmFpgCVyzsfdsS2FkXORv { get; set; } public int fclr0mCyogyT6 { get; set; } public int Eopnmrw57U2 { get; set; } public int WWHf4BiSI6gpsj_Zkv8J3Yc9 { get; set; } public int iQpi1VwsKtl2otAQw9PcI9QgQRfQSFL { get; set; } public int DrAvBj3HoUfnuJTTR4GLePwuu9HM_F4BHcp8RVw { get; set; } public int D6T2kOivHJ5CQt5aIWqBjQ { get; set; } public int aRJ5yWXNsaYlyBeN0dLIXzXWzuAjDAZ { get; set; } public int f0XraGXXRMyqWt4uY { get; set; } public int eD_NNmhxOFBAQkD1qcX7 { get; set; } public int hmQSuuVeZTybnONZJ3m01v_HNIfX { get; set; } public int VnVuvDvUg6Ub3FCpFLYAyl { get; set; } public int QusKrylrBkU9yW0Uy6FLMCAn { get; set; } public int zqPixcS1rI5fB3Qezm4jVGUKYIC { get; set; } public int D9c83OOSi8Epx4aPN8UpCInywV { get; set; } public int kvMi0T4h1uTJWktX { get; set; } public int Lvqo0h70VkcrP1uCa1Kbj { get; set; } public int oroR_4uayMMz { get; set; } public int rDJJQFEWSI87GtkzMdzz3W5Bop3Y { get; set; } public int vExjbiMQ7OLE { get; set; } public int gfT_63glIERMn6 { get; set; } public int CPWoJXYJcF0MleZ_aDebqxPPLnwnjuck1af { get; set; } public int ERlM2mI1dXw { get; set; } public bool xPpWCqSTmjDIxzc3da { get { return iLswNIzLFCbdlXkoxp5z4Sq; } set { iLswNIzLFCbdlXkoxp5z4Sq = value; } } public void B5ynrxYR906J8kL1FVQzyzok3NRB8Shln5SB3() { if(p_9x2jmechn8) { iLswNIzLFCbdlXkoxp5z4Sq = !xPpWCqSTmjDIxzc3da; } M2MCG_7QZZUz3wpNYeJHTOQVXrkjuKNt_R = M2MCG_7QZZUz3wpNYeJHTOQVXrkjuKNt_R; aGmyaUpOVcqFqj2_mImpb3QhZQUZdlwRKPReV4 = M2MCG_7QZZUz3wpNYeJHTOQVXrkjuKNt_R; for(int i=0;i<wIt2R6pckchaDqcG3_JHb13g;++i) { kvMi0T4h1uTJWktX+=1; zqPixcS1rI5fB3Qezm4jVGUKYIC+=kvMi0T4h1uTJWktX; } iLswNIzLFCbdlXkoxp5z4Sq = QDSj8SPdvxSvmHTc7HBJB5pNV && xWjryPbKNYChlhNiZxuTyxyP1vHgb; sJHa71hhldjBGvCQZFfF3Nm7h = WB7pAbBOTrOaOtouUVCxV72BR9yZeSHT_wyg + sJHa71hhldjBGvCQZFfF3Nm7h; FbIh4vUlx6CtVh73GPz7JHLFnIIAubnlO6 = FbIh4vUlx6CtVh73GPz7JHLFnIIAubnlO6 * GuvZMfRV_rfXgGwyRj41V_L1BBi; Pun7foZqLUnvMHt7i4KRAeAInK7hczud7fkuWk6u = 1326.0f; Pun7foZqLUnvMHt7i4KRAeAInK7hczud7fkuWk6u = 6716.0f; NI4qViu5IB3gH = 7685.0f; if(p_9x2jmechn8) { QDSj8SPdvxSvmHTc7HBJB5pNV = !QDSj8SPdvxSvmHTc7HBJB5pNV; } NI4qViu5IB3gH = gus23JhSD7bFWI7KS4I8Nk13eptH4b; I0T_516uWt5PJg_wgtb6KDql0sqYdr6e = gus23JhSD7bFWI7KS4I8Nk13eptH4b; iLswNIzLFCbdlXkoxp5z4Sq = frXtgUx5HCA9DuuUJN && p_9x2jmechn8; } public void NCeM1W5MUIwL0OwzI7q() { NI4qViu5IB3gH = sJHa71hhldjBGvCQZFfF3Nm7h + Pun7foZqLUnvMHt7i4KRAeAInK7hczud7fkuWk6u; I0T_516uWt5PJg_wgtb6KDql0sqYdr6e = gus23JhSD7bFWI7KS4I8Nk13eptH4b; Pun7foZqLUnvMHt7i4KRAeAInK7hczud7fkuWk6u = gus23JhSD7bFWI7KS4I8Nk13eptH4b; for(int i=0;i<DrAvBj3HoUfnuJTTR4GLePwuu9HM_F4BHcp8RVw;++i) { mjwQ_6_XfWgGsgzmFpgCVyzsfdsS2FkXORv+=1; vExjbiMQ7OLE+=mjwQ_6_XfWgGsgzmFpgCVyzsfdsS2FkXORv; } CPWoJXYJcF0MleZ_aDebqxPPLnwnjuck1af = vExjbiMQ7OLE * wIt2R6pckchaDqcG3_JHb13g; GuvZMfRV_rfXgGwyRj41V_L1BBi = 2827.0; EwD1WhaLBTBmw6_2bRWfuGIv2EM9XNmuaeu = 634.0; aGmyaUpOVcqFqj2_mImpb3QhZQUZdlwRKPReV4 = 5608.0; GuvZMfRV_rfXgGwyRj41V_L1BBi = aGmyaUpOVcqFqj2_mImpb3QhZQUZdlwRKPReV4 + xOesbbHkmJVlJzRXtXBhIrNwYZ9UE7oo; xPqzMpv1yoF6Z = string.Format(uRHCIUjLpsRa2OBf6XkClzkMk,yJ7vQ7keGA); aGmyaUpOVcqFqj2_mImpb3QhZQUZdlwRKPReV4 = FbIh4vUlx6CtVh73GPz7JHLFnIIAubnlO6 + M2MCG_7QZZUz3wpNYeJHTOQVXrkjuKNt_R; if(frXtgUx5HCA9DuuUJN && xPpWCqSTmjDIxzc3da) { pEsz4lFPrflfUVMUD = !pEsz4lFPrflfUVMUD; } gus23JhSD7bFWI7KS4I8Nk13eptH4b = 8190.0f; sJHa71hhldjBGvCQZFfF3Nm7h = 9342.0f; z8C5sKNJmSHbPeqQxpNt1tg1PMU = 3740.0f; } public void jnjhYxUGeyTm9bI8LyfrNClokEn1JDDggpd0() { uRHCIUjLpsRa2OBf6XkClzkMk = uRHCIUjLpsRa2OBf6XkClzkMk + uRHCIUjLpsRa2OBf6XkClzkMk; GuvZMfRV_rfXgGwyRj41V_L1BBi = GuvZMfRV_rfXgGwyRj41V_L1BBi * xOesbbHkmJVlJzRXtXBhIrNwYZ9UE7oo; if(pEsz4lFPrflfUVMUD && p_9x2jmechn8) { QDSj8SPdvxSvmHTc7HBJB5pNV = !QDSj8SPdvxSvmHTc7HBJB5pNV; } sJHa71hhldjBGvCQZFfF3Nm7h = sJHa71hhldjBGvCQZFfF3Nm7h / I0T_516uWt5PJg_wgtb6KDql0sqYdr6e; for(int i=0;i<Vc9HS8acN9RU0BGEey3K7w2XkpkIkSVKi_MiB;++i) { oroR_4uayMMz+=1; mjwQ_6_XfWgGsgzmFpgCVyzsfdsS2FkXORv+=oroR_4uayMMz; } if(frXtgUx5HCA9DuuUJN && xPpWCqSTmjDIxzc3da) { p_9x2jmechn8 = !p_9x2jmechn8; } xOesbbHkmJVlJzRXtXBhIrNwYZ9UE7oo = 8135.0; EwD1WhaLBTBmw6_2bRWfuGIv2EM9XNmuaeu = 6611.0; aGmyaUpOVcqFqj2_mImpb3QhZQUZdlwRKPReV4 = 69.0; gfT_63glIERMn6 = Eopnmrw57U2 + QusKrylrBkU9yW0Uy6FLMCAn; sJHa71hhldjBGvCQZFfF3Nm7h = NI4qViu5IB3gH - I0T_516uWt5PJg_wgtb6KDql0sqYdr6e; WWHf4BiSI6gpsj_Zkv8J3Yc9 = DrAvBj3HoUfnuJTTR4GLePwuu9HM_F4BHcp8RVw - fclr0mCyogyT6; } public void ItesjnjyFVafYpTjBF1eRzewCbb4qQ5() { if(p_9x2jmechn8 && iLswNIzLFCbdlXkoxp5z4Sq) { iLswNIzLFCbdlXkoxp5z4Sq = !iLswNIzLFCbdlXkoxp5z4Sq; } m4ZozbFGLIqZwo22KU0lnobwdO7sw7N6 = string.Format(yJ7vQ7keGA,m4ZozbFGLIqZwo22KU0lnobwdO7sw7N6); if(pEsz4lFPrflfUVMUD && QDSj8SPdvxSvmHTc7HBJB5pNV) { pEsz4lFPrflfUVMUD = !pEsz4lFPrflfUVMUD; } aGmyaUpOVcqFqj2_mImpb3QhZQUZdlwRKPReV4 = xOesbbHkmJVlJzRXtXBhIrNwYZ9UE7oo; GuvZMfRV_rfXgGwyRj41V_L1BBi = xOesbbHkmJVlJzRXtXBhIrNwYZ9UE7oo; EwD1WhaLBTBmw6_2bRWfuGIv2EM9XNmuaeu = xOesbbHkmJVlJzRXtXBhIrNwYZ9UE7oo + FbIh4vUlx6CtVh73GPz7JHLFnIIAubnlO6; if(frXtgUx5HCA9DuuUJN) { frXtgUx5HCA9DuuUJN = !TtgUvBvAgyC7JV97HJCcR; } DnolqLBIcjWFfTttG1Z1dVC = string.Format(Eq24Ija70Oh62enZ7AnOXsB2i4ZWAlluE7CPd,Eq24Ija70Oh62enZ7AnOXsB2i4ZWAlluE7CPd); I0T_516uWt5PJg_wgtb6KDql0sqYdr6e = z8C5sKNJmSHbPeqQxpNt1tg1PMU; I0T_516uWt5PJg_wgtb6KDql0sqYdr6e = z8C5sKNJmSHbPeqQxpNt1tg1PMU; z8C5sKNJmSHbPeqQxpNt1tg1PMU = 1945.0f; sJHa71hhldjBGvCQZFfF3Nm7h = 7627.0f; I0T_516uWt5PJg_wgtb6KDql0sqYdr6e = 5139.0f; uRHCIUjLpsRa2OBf6XkClzkMk = string.Format(yJ7vQ7keGA,yJ7vQ7keGA); } public void upWHRKmwBGsmh_9fZV() { fclr0mCyogyT6 = 98578; iQpi1VwsKtl2otAQw9PcI9QgQRfQSFL = 62966; ERlM2mI1dXw = 7835; vExjbiMQ7OLE = 65512; gfT_63glIERMn6 = 53914; zqPixcS1rI5fB3Qezm4jVGUKYIC = 97620; I0T_516uWt5PJg_wgtb6KDql0sqYdr6e = ClBLdl1OTEruWf13QIPVHWWOPFUjiKVHLHZmP * Pun7foZqLUnvMHt7i4KRAeAInK7hczud7fkuWk6u; if(QDSj8SPdvxSvmHTc7HBJB5pNV) { frXtgUx5HCA9DuuUJN = !iLswNIzLFCbdlXkoxp5z4Sq; } if(xWjryPbKNYChlhNiZxuTyxyP1vHgb) { pEsz4lFPrflfUVMUD = !frXtgUx5HCA9DuuUJN; } gus23JhSD7bFWI7KS4I8Nk13eptH4b = sJHa71hhldjBGvCQZFfF3Nm7h * I0T_516uWt5PJg_wgtb6KDql0sqYdr6e; p_9x2jmechn8 = QDSj8SPdvxSvmHTc7HBJB5pNV && xWjryPbKNYChlhNiZxuTyxyP1vHgb; FbIh4vUlx6CtVh73GPz7JHLFnIIAubnlO6 = EwD1WhaLBTBmw6_2bRWfuGIv2EM9XNmuaeu / FbIh4vUlx6CtVh73GPz7JHLFnIIAubnlO6; xPqzMpv1yoF6Z = xPqzMpv1yoF6Z; m4ZozbFGLIqZwo22KU0lnobwdO7sw7N6 = xPqzMpv1yoF6Z; xPqzMpv1yoF6Z = string.Format(f3LN2XWlKqnN0H4UjZqjQCnJ30IvQIYjP5X,Eq24Ija70Oh62enZ7AnOXsB2i4ZWAlluE7CPd); } public void ZGN6VUpxi3ZHOyg0vxoksuE0Y22KQ_() { Pun7foZqLUnvMHt7i4KRAeAInK7hczud7fkuWk6u = sJHa71hhldjBGvCQZFfF3Nm7h - Pun7foZqLUnvMHt7i4KRAeAInK7hczud7fkuWk6u; uRHCIUjLpsRa2OBf6XkClzkMk = m4ZozbFGLIqZwo22KU0lnobwdO7sw7N6; f3LN2XWlKqnN0H4UjZqjQCnJ30IvQIYjP5X = m4ZozbFGLIqZwo22KU0lnobwdO7sw7N6; k5nA1mcIl4U6MG0VR5u = 89667; WWHf4BiSI6gpsj_Zkv8J3Yc9 = 33824; hmQSuuVeZTybnONZJ3m01v_HNIfX = 83038; for(int i=0;i<vExjbiMQ7OLE;++i) { oroR_4uayMMz+=1; WWHf4BiSI6gpsj_Zkv8J3Yc9+=oroR_4uayMMz; } gfT_63glIERMn6 = kvMi0T4h1uTJWktX * gfT_63glIERMn6; z8C5sKNJmSHbPeqQxpNt1tg1PMU = sJHa71hhldjBGvCQZFfF3Nm7h - I0T_516uWt5PJg_wgtb6KDql0sqYdr6e; yycQF1QQTAz6A4M = D9c83OOSi8Epx4aPN8UpCInywV + mjwQ_6_XfWgGsgzmFpgCVyzsfdsS2FkXORv; aGmyaUpOVcqFqj2_mImpb3QhZQUZdlwRKPReV4 = 4758.0; EwD1WhaLBTBmw6_2bRWfuGIv2EM9XNmuaeu = 3361.0; M2MCG_7QZZUz3wpNYeJHTOQVXrkjuKNt_R = 8718.0; for(int i=0;i<iQpi1VwsKtl2otAQw9PcI9QgQRfQSFL;++i) { ERlM2mI1dXw+=1; hmQSuuVeZTybnONZJ3m01v_HNIfX+=ERlM2mI1dXw; } M2MCG_7QZZUz3wpNYeJHTOQVXrkjuKNt_R = xeyPZ7njkmAxrZAVD5rGf3WwqkQtQBldI / M2MCG_7QZZUz3wpNYeJHTOQVXrkjuKNt_R; } public void VwVdpjZ2QRXXGZSyseq6YNHLSutPO0HbMtgI() { m4ZozbFGLIqZwo22KU0lnobwdO7sw7N6 = uRHCIUjLpsRa2OBf6XkClzkMk + yJ7vQ7keGA; if(p_9x2jmechn8 || xPpWCqSTmjDIxzc3da) { xPpWCqSTmjDIxzc3da = !xPpWCqSTmjDIxzc3da; } f3LN2XWlKqnN0H4UjZqjQCnJ30IvQIYjP5X = uRHCIUjLpsRa2OBf6XkClzkMk; f3LN2XWlKqnN0H4UjZqjQCnJ30IvQIYjP5X = uRHCIUjLpsRa2OBf6XkClzkMk; z8C5sKNJmSHbPeqQxpNt1tg1PMU = sJHa71hhldjBGvCQZFfF3Nm7h / gus23JhSD7bFWI7KS4I8Nk13eptH4b; CPWoJXYJcF0MleZ_aDebqxPPLnwnjuck1af = eEH1sdLWgbseCTEgcJ17NFc + zqPixcS1rI5fB3Qezm4jVGUKYIC; ClBLdl1OTEruWf13QIPVHWWOPFUjiKVHLHZmP = z8C5sKNJmSHbPeqQxpNt1tg1PMU - NI4qViu5IB3gH; if(pEsz4lFPrflfUVMUD || pEsz4lFPrflfUVMUD) { pEsz4lFPrflfUVMUD = !pEsz4lFPrflfUVMUD; } m4ZozbFGLIqZwo22KU0lnobwdO7sw7N6 = xPqzMpv1yoF6Z + Eq24Ija70Oh62enZ7AnOXsB2i4ZWAlluE7CPd; I0T_516uWt5PJg_wgtb6KDql0sqYdr6e = sJHa71hhldjBGvCQZFfF3Nm7h; gus23JhSD7bFWI7KS4I8Nk13eptH4b = sJHa71hhldjBGvCQZFfF3Nm7h; if(xPpWCqSTmjDIxzc3da) { QDSj8SPdvxSvmHTc7HBJB5pNV = !xPpWCqSTmjDIxzc3da; } } public void ka9BjNmH3eif6Jo_kOy6b69DY_tTiUe88() { z8C5sKNJmSHbPeqQxpNt1tg1PMU = z8C5sKNJmSHbPeqQxpNt1tg1PMU * Pun7foZqLUnvMHt7i4KRAeAInK7hczud7fkuWk6u; sJHa71hhldjBGvCQZFfF3Nm7h = 756.0f; z8C5sKNJmSHbPeqQxpNt1tg1PMU = 4904.0f; sJHa71hhldjBGvCQZFfF3Nm7h = 1120.0f; if(pEsz4lFPrflfUVMUD || xWjryPbKNYChlhNiZxuTyxyP1vHgb) { xWjryPbKNYChlhNiZxuTyxyP1vHgb = !xWjryPbKNYChlhNiZxuTyxyP1vHgb; } NI4qViu5IB3gH = z8C5sKNJmSHbPeqQxpNt1tg1PMU; NI4qViu5IB3gH = z8C5sKNJmSHbPeqQxpNt1tg1PMU; GuvZMfRV_rfXgGwyRj41V_L1BBi = EwD1WhaLBTBmw6_2bRWfuGIv2EM9XNmuaeu + xeyPZ7njkmAxrZAVD5rGf3WwqkQtQBldI; rDJJQFEWSI87GtkzMdzz3W5Bop3Y = kvMi0T4h1uTJWktX + nUICqGRQXgEvav4J0JgwcEf40x1f29; TtgUvBvAgyC7JV97HJCcR = TtgUvBvAgyC7JV97HJCcR || xPpWCqSTmjDIxzc3da; TtgUvBvAgyC7JV97HJCcR = p_9x2jmechn8 && iLswNIzLFCbdlXkoxp5z4Sq; aRJ5yWXNsaYlyBeN0dLIXzXWzuAjDAZ = mjwQ_6_XfWgGsgzmFpgCVyzsfdsS2FkXORv - nUICqGRQXgEvav4J0JgwcEf40x1f29; iLswNIzLFCbdlXkoxp5z4Sq = xPpWCqSTmjDIxzc3da || xWjryPbKNYChlhNiZxuTyxyP1vHgb; } public void ZUYZFMuBXj9KG98Ns81klno() { Pun7foZqLUnvMHt7i4KRAeAInK7hczud7fkuWk6u = z8C5sKNJmSHbPeqQxpNt1tg1PMU + Pun7foZqLUnvMHt7i4KRAeAInK7hczud7fkuWk6u; DnolqLBIcjWFfTttG1Z1dVC = string.Format(uRHCIUjLpsRa2OBf6XkClzkMk,uRHCIUjLpsRa2OBf6XkClzkMk); xeyPZ7njkmAxrZAVD5rGf3WwqkQtQBldI = EwD1WhaLBTBmw6_2bRWfuGIv2EM9XNmuaeu * aGmyaUpOVcqFqj2_mImpb3QhZQUZdlwRKPReV4; p_9x2jmechn8 = QDSj8SPdvxSvmHTc7HBJB5pNV && frXtgUx5HCA9DuuUJN; WB7pAbBOTrOaOtouUVCxV72BR9yZeSHT_wyg = 8420.0f; sJHa71hhldjBGvCQZFfF3Nm7h = 7425.0f; ClBLdl1OTEruWf13QIPVHWWOPFUjiKVHLHZmP = 6700.0f; for(int i=0;i<mjwQ_6_XfWgGsgzmFpgCVyzsfdsS2FkXORv;++i) { Lvqo0h70VkcrP1uCa1Kbj+=1; CPWoJXYJcF0MleZ_aDebqxPPLnwnjuck1af+=Lvqo0h70VkcrP1uCa1Kbj; } oroR_4uayMMz = WWHf4BiSI6gpsj_Zkv8J3Yc9; mjwQ_6_XfWgGsgzmFpgCVyzsfdsS2FkXORv = WWHf4BiSI6gpsj_Zkv8J3Yc9; if(xWjryPbKNYChlhNiZxuTyxyP1vHgb && TtgUvBvAgyC7JV97HJCcR) { xPpWCqSTmjDIxzc3da = !xPpWCqSTmjDIxzc3da; } QDSj8SPdvxSvmHTc7HBJB5pNV = QDSj8SPdvxSvmHTc7HBJB5pNV && xWjryPbKNYChlhNiZxuTyxyP1vHgb; z8C5sKNJmSHbPeqQxpNt1tg1PMU = Pun7foZqLUnvMHt7i4KRAeAInK7hczud7fkuWk6u + z8C5sKNJmSHbPeqQxpNt1tg1PMU; } public void xzibP47IcLEQXzIlRiovgkvUXFX4DYPiWGDI6() { Eq24Ija70Oh62enZ7AnOXsB2i4ZWAlluE7CPd = uRHCIUjLpsRa2OBf6XkClzkMk + uRHCIUjLpsRa2OBf6XkClzkMk; m4ZozbFGLIqZwo22KU0lnobwdO7sw7N6 = string.Format(DnolqLBIcjWFfTttG1Z1dVC,Eq24Ija70Oh62enZ7AnOXsB2i4ZWAlluE7CPd); iQpi1VwsKtl2otAQw9PcI9QgQRfQSFL = Lvqo0h70VkcrP1uCa1Kbj; nUICqGRQXgEvav4J0JgwcEf40x1f29 = Lvqo0h70VkcrP1uCa1Kbj; iLswNIzLFCbdlXkoxp5z4Sq = p_9x2jmechn8 && frXtgUx5HCA9DuuUJN; DnolqLBIcjWFfTttG1Z1dVC = uRHCIUjLpsRa2OBf6XkClzkMk; xPqzMpv1yoF6Z = uRHCIUjLpsRa2OBf6XkClzkMk; xPpWCqSTmjDIxzc3da = pEsz4lFPrflfUVMUD || iLswNIzLFCbdlXkoxp5z4Sq; if(p_9x2jmechn8 || iLswNIzLFCbdlXkoxp5z4Sq) { iLswNIzLFCbdlXkoxp5z4Sq = !iLswNIzLFCbdlXkoxp5z4Sq; } NI4qViu5IB3gH = 275.0f; gus23JhSD7bFWI7KS4I8Nk13eptH4b = 7809.0f; WB7pAbBOTrOaOtouUVCxV72BR9yZeSHT_wyg = 4708.0f; DnolqLBIcjWFfTttG1Z1dVC = string.Format(Eq24Ija70Oh62enZ7AnOXsB2i4ZWAlluE7CPd,yJ7vQ7keGA); GuvZMfRV_rfXgGwyRj41V_L1BBi = xOesbbHkmJVlJzRXtXBhIrNwYZ9UE7oo + M2MCG_7QZZUz3wpNYeJHTOQVXrkjuKNt_R; } public void Vodjwo_PS53SwNIcXKUDEPCjRuby2NAVjt9() { GuvZMfRV_rfXgGwyRj41V_L1BBi = EwD1WhaLBTBmw6_2bRWfuGIv2EM9XNmuaeu; FbIh4vUlx6CtVh73GPz7JHLFnIIAubnlO6 = EwD1WhaLBTBmw6_2bRWfuGIv2EM9XNmuaeu; uRHCIUjLpsRa2OBf6XkClzkMk = string.Format(f3LN2XWlKqnN0H4UjZqjQCnJ30IvQIYjP5X,Eq24Ija70Oh62enZ7AnOXsB2i4ZWAlluE7CPd); if(xPpWCqSTmjDIxzc3da || iLswNIzLFCbdlXkoxp5z4Sq) { iLswNIzLFCbdlXkoxp5z4Sq = !iLswNIzLFCbdlXkoxp5z4Sq; } xPqzMpv1yoF6Z = m4ZozbFGLIqZwo22KU0lnobwdO7sw7N6; f3LN2XWlKqnN0H4UjZqjQCnJ30IvQIYjP5X = m4ZozbFGLIqZwo22KU0lnobwdO7sw7N6; WB7pAbBOTrOaOtouUVCxV72BR9yZeSHT_wyg = 5954.0f; NI4qViu5IB3gH = 2995.0f; Pun7foZqLUnvMHt7i4KRAeAInK7hczud7fkuWk6u = 2780.0f; I0T_516uWt5PJg_wgtb6KDql0sqYdr6e = I0T_516uWt5PJg_wgtb6KDql0sqYdr6e / z8C5sKNJmSHbPeqQxpNt1tg1PMU; k5nA1mcIl4U6MG0VR5u = f0XraGXXRMyqWt4uY; f0XraGXXRMyqWt4uY = f0XraGXXRMyqWt4uY; Eq24Ija70Oh62enZ7AnOXsB2i4ZWAlluE7CPd = Eq24Ija70Oh62enZ7AnOXsB2i4ZWAlluE7CPd; Eq24Ija70Oh62enZ7AnOXsB2i4ZWAlluE7CPd = Eq24Ija70Oh62enZ7AnOXsB2i4ZWAlluE7CPd; if(frXtgUx5HCA9DuuUJN || TtgUvBvAgyC7JV97HJCcR) { TtgUvBvAgyC7JV97HJCcR = !TtgUvBvAgyC7JV97HJCcR; } Eopnmrw57U2 = eEH1sdLWgbseCTEgcJ17NFc; Lvqo0h70VkcrP1uCa1Kbj = eEH1sdLWgbseCTEgcJ17NFc; } public void vt7T_oa_2CSP0LsfI() { uRHCIUjLpsRa2OBf6XkClzkMk = xPqzMpv1yoF6Z; yJ7vQ7keGA = xPqzMpv1yoF6Z; frXtgUx5HCA9DuuUJN = TtgUvBvAgyC7JV97HJCcR && iLswNIzLFCbdlXkoxp5z4Sq; M2MCG_7QZZUz3wpNYeJHTOQVXrkjuKNt_R = xOesbbHkmJVlJzRXtXBhIrNwYZ9UE7oo + FbIh4vUlx6CtVh73GPz7JHLFnIIAubnlO6; for(int i=0;i<aRJ5yWXNsaYlyBeN0dLIXzXWzuAjDAZ;++i) { WWHf4BiSI6gpsj_Zkv8J3Yc9+=1; Eopnmrw57U2+=WWHf4BiSI6gpsj_Zkv8J3Yc9; } if(frXtgUx5HCA9DuuUJN && xPpWCqSTmjDIxzc3da) { pEsz4lFPrflfUVMUD = !pEsz4lFPrflfUVMUD; } yJ7vQ7keGA = m4ZozbFGLIqZwo22KU0lnobwdO7sw7N6 + DnolqLBIcjWFfTttG1Z1dVC; xeyPZ7njkmAxrZAVD5rGf3WwqkQtQBldI = aGmyaUpOVcqFqj2_mImpb3QhZQUZdlwRKPReV4 - GuvZMfRV_rfXgGwyRj41V_L1BBi; Pun7foZqLUnvMHt7i4KRAeAInK7hczud7fkuWk6u = WB7pAbBOTrOaOtouUVCxV72BR9yZeSHT_wyg * I0T_516uWt5PJg_wgtb6KDql0sqYdr6e; ClBLdl1OTEruWf13QIPVHWWOPFUjiKVHLHZmP = WB7pAbBOTrOaOtouUVCxV72BR9yZeSHT_wyg / z8C5sKNJmSHbPeqQxpNt1tg1PMU; xeyPZ7njkmAxrZAVD5rGf3WwqkQtQBldI = xOesbbHkmJVlJzRXtXBhIrNwYZ9UE7oo; xOesbbHkmJVlJzRXtXBhIrNwYZ9UE7oo = xOesbbHkmJVlJzRXtXBhIrNwYZ9UE7oo; } public void Oz2wWqqv81N2Saasg8zyWy5dJjjdh() { p_9x2jmechn8 = TtgUvBvAgyC7JV97HJCcR || iLswNIzLFCbdlXkoxp5z4Sq; xeyPZ7njkmAxrZAVD5rGf3WwqkQtQBldI = FbIh4vUlx6CtVh73GPz7JHLFnIIAubnlO6 / EwD1WhaLBTBmw6_2bRWfuGIv2EM9XNmuaeu; GuvZMfRV_rfXgGwyRj41V_L1BBi = EwD1WhaLBTBmw6_2bRWfuGIv2EM9XNmuaeu / FbIh4vUlx6CtVh73GPz7JHLFnIIAubnlO6; NI4qViu5IB3gH = sJHa71hhldjBGvCQZFfF3Nm7h - NI4qViu5IB3gH; f3LN2XWlKqnN0H4UjZqjQCnJ30IvQIYjP5X = uRHCIUjLpsRa2OBf6XkClzkMk + uRHCIUjLpsRa2OBf6XkClzkMk; f3LN2XWlKqnN0H4UjZqjQCnJ30IvQIYjP5X = xPqzMpv1yoF6Z + xPqzMpv1yoF6Z; for(int i=0;i<D6T2kOivHJ5CQt5aIWqBjQ;++i) { QusKrylrBkU9yW0Uy6FLMCAn+=1; QusKrylrBkU9yW0Uy6FLMCAn+=QusKrylrBkU9yW0Uy6FLMCAn; } ClBLdl1OTEruWf13QIPVHWWOPFUjiKVHLHZmP = z8C5sKNJmSHbPeqQxpNt1tg1PMU + I0T_516uWt5PJg_wgtb6KDql0sqYdr6e; if(TtgUvBvAgyC7JV97HJCcR) { xWjryPbKNYChlhNiZxuTyxyP1vHgb = !xPpWCqSTmjDIxzc3da; } for(int i=0;i<fclr0mCyogyT6;++i) { Lvqo0h70VkcrP1uCa1Kbj+=1; D9c83OOSi8Epx4aPN8UpCInywV+=Lvqo0h70VkcrP1uCa1Kbj; } } public void A4ItGmdQ3liRCQZR_gfzvk3LwqsueatKKgy() { yJ7vQ7keGA = xPqzMpv1yoF6Z; f3LN2XWlKqnN0H4UjZqjQCnJ30IvQIYjP5X = xPqzMpv1yoF6Z; Eq24Ija70Oh62enZ7AnOXsB2i4ZWAlluE7CPd = f3LN2XWlKqnN0H4UjZqjQCnJ30IvQIYjP5X + Eq24Ija70Oh62enZ7AnOXsB2i4ZWAlluE7CPd; yycQF1QQTAz6A4M = Vc9HS8acN9RU0BGEey3K7w2XkpkIkSVKi_MiB / mjwQ_6_XfWgGsgzmFpgCVyzsfdsS2FkXORv; D6T2kOivHJ5CQt5aIWqBjQ = QusKrylrBkU9yW0Uy6FLMCAn / rdza3mRu1xyHi0YNjhd4ThYzA5r6FvwSlwUHvCb; xPqzMpv1yoF6Z = yJ7vQ7keGA; m4ZozbFGLIqZwo22KU0lnobwdO7sw7N6 = yJ7vQ7keGA; I0T_516uWt5PJg_wgtb6KDql0sqYdr6e = sJHa71hhldjBGvCQZFfF3Nm7h; NI4qViu5IB3gH = sJHa71hhldjBGvCQZFfF3Nm7h; if(p_9x2jmechn8 && xWjryPbKNYChlhNiZxuTyxyP1vHgb) { frXtgUx5HCA9DuuUJN = !frXtgUx5HCA9DuuUJN; } if(QDSj8SPdvxSvmHTc7HBJB5pNV && pEsz4lFPrflfUVMUD) { TtgUvBvAgyC7JV97HJCcR = !TtgUvBvAgyC7JV97HJCcR; } yycQF1QQTAz6A4M = gfT_63glIERMn6 * WWHf4BiSI6gpsj_Zkv8J3Yc9; f3LN2XWlKqnN0H4UjZqjQCnJ30IvQIYjP5X = m4ZozbFGLIqZwo22KU0lnobwdO7sw7N6; Eq24Ija70Oh62enZ7AnOXsB2i4ZWAlluE7CPd = m4ZozbFGLIqZwo22KU0lnobwdO7sw7N6; } public void bE3pZTE63waoOCQB_P5ZrM5n4ze28nT() { yJ7vQ7keGA = xPqzMpv1yoF6Z + yJ7vQ7keGA; ClBLdl1OTEruWf13QIPVHWWOPFUjiKVHLHZmP = 2114.0f; WB7pAbBOTrOaOtouUVCxV72BR9yZeSHT_wyg = 4044.0f; sJHa71hhldjBGvCQZFfF3Nm7h = 7726.0f; ClBLdl1OTEruWf13QIPVHWWOPFUjiKVHLHZmP = z8C5sKNJmSHbPeqQxpNt1tg1PMU - ClBLdl1OTEruWf13QIPVHWWOPFUjiKVHLHZmP; f3LN2XWlKqnN0H4UjZqjQCnJ30IvQIYjP5X = m4ZozbFGLIqZwo22KU0lnobwdO7sw7N6; yJ7vQ7keGA = m4ZozbFGLIqZwo22KU0lnobwdO7sw7N6; FbIh4vUlx6CtVh73GPz7JHLFnIIAubnlO6 = xeyPZ7njkmAxrZAVD5rGf3WwqkQtQBldI * aGmyaUpOVcqFqj2_mImpb3QhZQUZdlwRKPReV4; uRHCIUjLpsRa2OBf6XkClzkMk = DnolqLBIcjWFfTttG1Z1dVC + m4ZozbFGLIqZwo22KU0lnobwdO7sw7N6; gfT_63glIERMn6 = 22102; iQpi1VwsKtl2otAQw9PcI9QgQRfQSFL = 77273; gfT_63glIERMn6 = 16844; GuvZMfRV_rfXgGwyRj41V_L1BBi = GuvZMfRV_rfXgGwyRj41V_L1BBi; FbIh4vUlx6CtVh73GPz7JHLFnIIAubnlO6 = GuvZMfRV_rfXgGwyRj41V_L1BBi; TtgUvBvAgyC7JV97HJCcR = xWjryPbKNYChlhNiZxuTyxyP1vHgb && QDSj8SPdvxSvmHTc7HBJB5pNV; TtgUvBvAgyC7JV97HJCcR = xPpWCqSTmjDIxzc3da && TtgUvBvAgyC7JV97HJCcR; } public void K0oABrAMNqjFXODKKcadnZf4RUdjEkROtIFdobBJ() { pEsz4lFPrflfUVMUD = iLswNIzLFCbdlXkoxp5z4Sq && p_9x2jmechn8; pEsz4lFPrflfUVMUD = pEsz4lFPrflfUVMUD || pEsz4lFPrflfUVMUD; I0T_516uWt5PJg_wgtb6KDql0sqYdr6e = ClBLdl1OTEruWf13QIPVHWWOPFUjiKVHLHZmP; z8C5sKNJmSHbPeqQxpNt1tg1PMU = ClBLdl1OTEruWf13QIPVHWWOPFUjiKVHLHZmP; sJHa71hhldjBGvCQZFfF3Nm7h = WB7pAbBOTrOaOtouUVCxV72BR9yZeSHT_wyg / NI4qViu5IB3gH; z8C5sKNJmSHbPeqQxpNt1tg1PMU = I0T_516uWt5PJg_wgtb6KDql0sqYdr6e - z8C5sKNJmSHbPeqQxpNt1tg1PMU; M2MCG_7QZZUz3wpNYeJHTOQVXrkjuKNt_R = xOesbbHkmJVlJzRXtXBhIrNwYZ9UE7oo; aGmyaUpOVcqFqj2_mImpb3QhZQUZdlwRKPReV4 = xOesbbHkmJVlJzRXtXBhIrNwYZ9UE7oo; I0T_516uWt5PJg_wgtb6KDql0sqYdr6e = Pun7foZqLUnvMHt7i4KRAeAInK7hczud7fkuWk6u - I0T_516uWt5PJg_wgtb6KDql0sqYdr6e; NI4qViu5IB3gH = WB7pAbBOTrOaOtouUVCxV72BR9yZeSHT_wyg; ClBLdl1OTEruWf13QIPVHWWOPFUjiKVHLHZmP = WB7pAbBOTrOaOtouUVCxV72BR9yZeSHT_wyg; if(xWjryPbKNYChlhNiZxuTyxyP1vHgb && frXtgUx5HCA9DuuUJN) { frXtgUx5HCA9DuuUJN = !frXtgUx5HCA9DuuUJN; } if(TtgUvBvAgyC7JV97HJCcR) { xWjryPbKNYChlhNiZxuTyxyP1vHgb = !xWjryPbKNYChlhNiZxuTyxyP1vHgb; } } public void QUPkhmqkHhaVoru() { if(p_9x2jmechn8 || xPpWCqSTmjDIxzc3da) { xPpWCqSTmjDIxzc3da = !xPpWCqSTmjDIxzc3da; } if(TtgUvBvAgyC7JV97HJCcR || iLswNIzLFCbdlXkoxp5z4Sq) { iLswNIzLFCbdlXkoxp5z4Sq = !iLswNIzLFCbdlXkoxp5z4Sq; } p_9x2jmechn8 = frXtgUx5HCA9DuuUJN && frXtgUx5HCA9DuuUJN; iLswNIzLFCbdlXkoxp5z4Sq = iLswNIzLFCbdlXkoxp5z4Sq && xWjryPbKNYChlhNiZxuTyxyP1vHgb; if(p_9x2jmechn8) { iLswNIzLFCbdlXkoxp5z4Sq = !pEsz4lFPrflfUVMUD; } DnolqLBIcjWFfTttG1Z1dVC = Eq24Ija70Oh62enZ7AnOXsB2i4ZWAlluE7CPd; Eq24Ija70Oh62enZ7AnOXsB2i4ZWAlluE7CPd = Eq24Ija70Oh62enZ7AnOXsB2i4ZWAlluE7CPd; WWHf4BiSI6gpsj_Zkv8J3Yc9 = VnVuvDvUg6Ub3FCpFLYAyl - rDJJQFEWSI87GtkzMdzz3W5Bop3Y; Eq24Ija70Oh62enZ7AnOXsB2i4ZWAlluE7CPd = m4ZozbFGLIqZwo22KU0lnobwdO7sw7N6 + uRHCIUjLpsRa2OBf6XkClzkMk; Pun7foZqLUnvMHt7i4KRAeAInK7hczud7fkuWk6u = 9716.0f; z8C5sKNJmSHbPeqQxpNt1tg1PMU = 9689.0f; NI4qViu5IB3gH = 6145.0f; FbIh4vUlx6CtVh73GPz7JHLFnIIAubnlO6 = 227.0; GuvZMfRV_rfXgGwyRj41V_L1BBi = 4532.0; FbIh4vUlx6CtVh73GPz7JHLFnIIAubnlO6 = 646.0; } public void BEouangHqkaIIm1() { VnVuvDvUg6Ub3FCpFLYAyl = vExjbiMQ7OLE * WWHf4BiSI6gpsj_Zkv8J3Yc9; DrAvBj3HoUfnuJTTR4GLePwuu9HM_F4BHcp8RVw = 22038; DrAvBj3HoUfnuJTTR4GLePwuu9HM_F4BHcp8RVw = 61944; VnVuvDvUg6Ub3FCpFLYAyl = 56554; ERlM2mI1dXw = zqPixcS1rI5fB3Qezm4jVGUKYIC / f0XraGXXRMyqWt4uY; sJHa71hhldjBGvCQZFfF3Nm7h = ClBLdl1OTEruWf13QIPVHWWOPFUjiKVHLHZmP / Pun7foZqLUnvMHt7i4KRAeAInK7hczud7fkuWk6u; k5nA1mcIl4U6MG0VR5u = vExjbiMQ7OLE * VnVuvDvUg6Ub3FCpFLYAyl; Eq24Ija70Oh62enZ7AnOXsB2i4ZWAlluE7CPd = string.Format(DnolqLBIcjWFfTttG1Z1dVC,xPqzMpv1yoF6Z); gfT_63glIERMn6 = eD_NNmhxOFBAQkD1qcX7 - ERlM2mI1dXw; z8C5sKNJmSHbPeqQxpNt1tg1PMU = 1277.0f; gus23JhSD7bFWI7KS4I8Nk13eptH4b = 938.0f; WB7pAbBOTrOaOtouUVCxV72BR9yZeSHT_wyg = 3072.0f; if(xPpWCqSTmjDIxzc3da) { TtgUvBvAgyC7JV97HJCcR = !TtgUvBvAgyC7JV97HJCcR; } uRHCIUjLpsRa2OBf6XkClzkMk = string.Format(DnolqLBIcjWFfTttG1Z1dVC,yJ7vQ7keGA); } public void pjGHbM9ozxNoknCQLPS_S4RRC9gp9NdVE2() { if(xWjryPbKNYChlhNiZxuTyxyP1vHgb) { p_9x2jmechn8 = !frXtgUx5HCA9DuuUJN; } ClBLdl1OTEruWf13QIPVHWWOPFUjiKVHLHZmP = z8C5sKNJmSHbPeqQxpNt1tg1PMU * I0T_516uWt5PJg_wgtb6KDql0sqYdr6e; if(QDSj8SPdvxSvmHTc7HBJB5pNV && p_9x2jmechn8) { QDSj8SPdvxSvmHTc7HBJB5pNV = !QDSj8SPdvxSvmHTc7HBJB5pNV; } aRJ5yWXNsaYlyBeN0dLIXzXWzuAjDAZ = Vc9HS8acN9RU0BGEey3K7w2XkpkIkSVKi_MiB; D6T2kOivHJ5CQt5aIWqBjQ = Vc9HS8acN9RU0BGEey3K7w2XkpkIkSVKi_MiB; GuvZMfRV_rfXgGwyRj41V_L1BBi = M2MCG_7QZZUz3wpNYeJHTOQVXrkjuKNt_R - xeyPZ7njkmAxrZAVD5rGf3WwqkQtQBldI; z8C5sKNJmSHbPeqQxpNt1tg1PMU = NI4qViu5IB3gH; gus23JhSD7bFWI7KS4I8Nk13eptH4b = NI4qViu5IB3gH; EwD1WhaLBTBmw6_2bRWfuGIv2EM9XNmuaeu = 9282.0; FbIh4vUlx6CtVh73GPz7JHLFnIIAubnlO6 = 5105.0; FbIh4vUlx6CtVh73GPz7JHLFnIIAubnlO6 = 2897.0; f3LN2XWlKqnN0H4UjZqjQCnJ30IvQIYjP5X = Eq24Ija70Oh62enZ7AnOXsB2i4ZWAlluE7CPd; m4ZozbFGLIqZwo22KU0lnobwdO7sw7N6 = Eq24Ija70Oh62enZ7AnOXsB2i4ZWAlluE7CPd; CPWoJXYJcF0MleZ_aDebqxPPLnwnjuck1af = rDJJQFEWSI87GtkzMdzz3W5Bop3Y; nUICqGRQXgEvav4J0JgwcEf40x1f29 = rDJJQFEWSI87GtkzMdzz3W5Bop3Y; FbIh4vUlx6CtVh73GPz7JHLFnIIAubnlO6 = aGmyaUpOVcqFqj2_mImpb3QhZQUZdlwRKPReV4; M2MCG_7QZZUz3wpNYeJHTOQVXrkjuKNt_R = aGmyaUpOVcqFqj2_mImpb3QhZQUZdlwRKPReV4; } public void lHgHVwWVo7_7nw_kyg2B6uBdrf_diEyXDHAdA() { FbIh4vUlx6CtVh73GPz7JHLFnIIAubnlO6 = FbIh4vUlx6CtVh73GPz7JHLFnIIAubnlO6 + xOesbbHkmJVlJzRXtXBhIrNwYZ9UE7oo; gus23JhSD7bFWI7KS4I8Nk13eptH4b = 8756.0f; gus23JhSD7bFWI7KS4I8Nk13eptH4b = 5710.0f; gus23JhSD7bFWI7KS4I8Nk13eptH4b = 1212.0f; WB7pAbBOTrOaOtouUVCxV72BR9yZeSHT_wyg = I0T_516uWt5PJg_wgtb6KDql0sqYdr6e - I0T_516uWt5PJg_wgtb6KDql0sqYdr6e; k5nA1mcIl4U6MG0VR5u = oroR_4uayMMz / fclr0mCyogyT6; if(iLswNIzLFCbdlXkoxp5z4Sq || xWjryPbKNYChlhNiZxuTyxyP1vHgb) { xWjryPbKNYChlhNiZxuTyxyP1vHgb = !xWjryPbKNYChlhNiZxuTyxyP1vHgb; } D6T2kOivHJ5CQt5aIWqBjQ = ERlM2mI1dXw + wIt2R6pckchaDqcG3_JHb13g; xeyPZ7njkmAxrZAVD5rGf3WwqkQtQBldI = 8445.0; M2MCG_7QZZUz3wpNYeJHTOQVXrkjuKNt_R = 4157.0; EwD1WhaLBTBmw6_2bRWfuGIv2EM9XNmuaeu = 2834.0; yJ7vQ7keGA = string.Format(uRHCIUjLpsRa2OBf6XkClzkMk,Eq24Ija70Oh62enZ7AnOXsB2i4ZWAlluE7CPd); I0T_516uWt5PJg_wgtb6KDql0sqYdr6e = gus23JhSD7bFWI7KS4I8Nk13eptH4b - WB7pAbBOTrOaOtouUVCxV72BR9yZeSHT_wyg; TtgUvBvAgyC7JV97HJCcR = frXtgUx5HCA9DuuUJN || frXtgUx5HCA9DuuUJN; } public void luPNnyXpZROXK8ZGoKxDJoj6L_() { WWHf4BiSI6gpsj_Zkv8J3Yc9 = iQpi1VwsKtl2otAQw9PcI9QgQRfQSFL / VnVuvDvUg6Ub3FCpFLYAyl; f3LN2XWlKqnN0H4UjZqjQCnJ30IvQIYjP5X = uRHCIUjLpsRa2OBf6XkClzkMk + f3LN2XWlKqnN0H4UjZqjQCnJ30IvQIYjP5X; m4ZozbFGLIqZwo22KU0lnobwdO7sw7N6 = string.Format(m4ZozbFGLIqZwo22KU0lnobwdO7sw7N6,yJ7vQ7keGA); DnolqLBIcjWFfTttG1Z1dVC = string.Format(Eq24Ija70Oh62enZ7AnOXsB2i4ZWAlluE7CPd,f3LN2XWlKqnN0H4UjZqjQCnJ30IvQIYjP5X); z8C5sKNJmSHbPeqQxpNt1tg1PMU = WB7pAbBOTrOaOtouUVCxV72BR9yZeSHT_wyg + WB7pAbBOTrOaOtouUVCxV72BR9yZeSHT_wyg; I0T_516uWt5PJg_wgtb6KDql0sqYdr6e = sJHa71hhldjBGvCQZFfF3Nm7h / I0T_516uWt5PJg_wgtb6KDql0sqYdr6e; if(frXtgUx5HCA9DuuUJN || frXtgUx5HCA9DuuUJN) { frXtgUx5HCA9DuuUJN = !frXtgUx5HCA9DuuUJN; } eD_NNmhxOFBAQkD1qcX7 = 71563; fclr0mCyogyT6 = 4609; WWHf4BiSI6gpsj_Zkv8J3Yc9 = 92185; GuvZMfRV_rfXgGwyRj41V_L1BBi = 1491.0; M2MCG_7QZZUz3wpNYeJHTOQVXrkjuKNt_R = 4941.0; M2MCG_7QZZUz3wpNYeJHTOQVXrkjuKNt_R = 7438.0; Pun7foZqLUnvMHt7i4KRAeAInK7hczud7fkuWk6u = sJHa71hhldjBGvCQZFfF3Nm7h / ClBLdl1OTEruWf13QIPVHWWOPFUjiKVHLHZmP; } public void KxSQSeNWuR_LGnVoCatjCknOJo2joV() { GuvZMfRV_rfXgGwyRj41V_L1BBi = FbIh4vUlx6CtVh73GPz7JHLFnIIAubnlO6 / xOesbbHkmJVlJzRXtXBhIrNwYZ9UE7oo; xeyPZ7njkmAxrZAVD5rGf3WwqkQtQBldI = xOesbbHkmJVlJzRXtXBhIrNwYZ9UE7oo - aGmyaUpOVcqFqj2_mImpb3QhZQUZdlwRKPReV4; if(TtgUvBvAgyC7JV97HJCcR) { TtgUvBvAgyC7JV97HJCcR = !iLswNIzLFCbdlXkoxp5z4Sq; } QusKrylrBkU9yW0Uy6FLMCAn = hmQSuuVeZTybnONZJ3m01v_HNIfX / nUICqGRQXgEvav4J0JgwcEf40x1f29; M2MCG_7QZZUz3wpNYeJHTOQVXrkjuKNt_R = EwD1WhaLBTBmw6_2bRWfuGIv2EM9XNmuaeu; M2MCG_7QZZUz3wpNYeJHTOQVXrkjuKNt_R = EwD1WhaLBTBmw6_2bRWfuGIv2EM9XNmuaeu; mjwQ_6_XfWgGsgzmFpgCVyzsfdsS2FkXORv = rDJJQFEWSI87GtkzMdzz3W5Bop3Y / WWHf4BiSI6gpsj_Zkv8J3Yc9; if(QDSj8SPdvxSvmHTc7HBJB5pNV && TtgUvBvAgyC7JV97HJCcR) { p_9x2jmechn8 = !p_9x2jmechn8; } NI4qViu5IB3gH = WB7pAbBOTrOaOtouUVCxV72BR9yZeSHT_wyg * Pun7foZqLUnvMHt7i4KRAeAInK7hczud7fkuWk6u; QusKrylrBkU9yW0Uy6FLMCAn = VnVuvDvUg6Ub3FCpFLYAyl - ERlM2mI1dXw; pEsz4lFPrflfUVMUD = frXtgUx5HCA9DuuUJN && xWjryPbKNYChlhNiZxuTyxyP1vHgb; } public void aOOYiEPw3r7becWH_() { sJHa71hhldjBGvCQZFfF3Nm7h = sJHa71hhldjBGvCQZFfF3Nm7h * gus23JhSD7bFWI7KS4I8Nk13eptH4b; Pun7foZqLUnvMHt7i4KRAeAInK7hczud7fkuWk6u = z8C5sKNJmSHbPeqQxpNt1tg1PMU; z8C5sKNJmSHbPeqQxpNt1tg1PMU = z8C5sKNJmSHbPeqQxpNt1tg1PMU; WB7pAbBOTrOaOtouUVCxV72BR9yZeSHT_wyg = 5258.0f; NI4qViu5IB3gH = 5608.0f; NI4qViu5IB3gH = 7608.0f; NI4qViu5IB3gH = NI4qViu5IB3gH + I0T_516uWt5PJg_wgtb6KDql0sqYdr6e; xeyPZ7njkmAxrZAVD5rGf3WwqkQtQBldI = aGmyaUpOVcqFqj2_mImpb3QhZQUZdlwRKPReV4; GuvZMfRV_rfXgGwyRj41V_L1BBi = aGmyaUpOVcqFqj2_mImpb3QhZQUZdlwRKPReV4; M2MCG_7QZZUz3wpNYeJHTOQVXrkjuKNt_R = FbIh4vUlx6CtVh73GPz7JHLFnIIAubnlO6 + GuvZMfRV_rfXgGwyRj41V_L1BBi; if(TtgUvBvAgyC7JV97HJCcR && xWjryPbKNYChlhNiZxuTyxyP1vHgb) { pEsz4lFPrflfUVMUD = !pEsz4lFPrflfUVMUD; } FbIh4vUlx6CtVh73GPz7JHLFnIIAubnlO6 = xOesbbHkmJVlJzRXtXBhIrNwYZ9UE7oo + M2MCG_7QZZUz3wpNYeJHTOQVXrkjuKNt_R; p_9x2jmechn8 = xPpWCqSTmjDIxzc3da && TtgUvBvAgyC7JV97HJCcR; Vc9HS8acN9RU0BGEey3K7w2XkpkIkSVKi_MiB = Eopnmrw57U2 * nUICqGRQXgEvav4J0JgwcEf40x1f29; } public void e2NUG8rn4iF5MpVRQPL0rIy1C1eMXrNm() { M2MCG_7QZZUz3wpNYeJHTOQVXrkjuKNt_R = aGmyaUpOVcqFqj2_mImpb3QhZQUZdlwRKPReV4 * FbIh4vUlx6CtVh73GPz7JHLFnIIAubnlO6; kvMi0T4h1uTJWktX = ERlM2mI1dXw / yycQF1QQTAz6A4M; Vc9HS8acN9RU0BGEey3K7w2XkpkIkSVKi_MiB = DrAvBj3HoUfnuJTTR4GLePwuu9HM_F4BHcp8RVw * CPWoJXYJcF0MleZ_aDebqxPPLnwnjuck1af; if(frXtgUx5HCA9DuuUJN) { xPpWCqSTmjDIxzc3da = !xPpWCqSTmjDIxzc3da; } aGmyaUpOVcqFqj2_mImpb3QhZQUZdlwRKPReV4 = 776.0; GuvZMfRV_rfXgGwyRj41V_L1BBi = 3651.0; FbIh4vUlx6CtVh73GPz7JHLFnIIAubnlO6 = 3948.0; xPqzMpv1yoF6Z = xPqzMpv1yoF6Z + uRHCIUjLpsRa2OBf6XkClzkMk; kvMi0T4h1uTJWktX = 33412; vExjbiMQ7OLE = 75879; yycQF1QQTAz6A4M = 27821; m4ZozbFGLIqZwo22KU0lnobwdO7sw7N6 = string.Format(xPqzMpv1yoF6Z,m4ZozbFGLIqZwo22KU0lnobwdO7sw7N6); xeyPZ7njkmAxrZAVD5rGf3WwqkQtQBldI = 4757.0; xeyPZ7njkmAxrZAVD5rGf3WwqkQtQBldI = 5899.0; GuvZMfRV_rfXgGwyRj41V_L1BBi = 9564.0; kvMi0T4h1uTJWktX = 38561; rDJJQFEWSI87GtkzMdzz3W5Bop3Y = 74582; Vc9HS8acN9RU0BGEey3K7w2XkpkIkSVKi_MiB = 52303; } public void vUtvonqHqASIa0IfYg() { xOesbbHkmJVlJzRXtXBhIrNwYZ9UE7oo = 1613.0; aGmyaUpOVcqFqj2_mImpb3QhZQUZdlwRKPReV4 = 9611.0; M2MCG_7QZZUz3wpNYeJHTOQVXrkjuKNt_R = 8475.0; FbIh4vUlx6CtVh73GPz7JHLFnIIAubnlO6 = GuvZMfRV_rfXgGwyRj41V_L1BBi * xOesbbHkmJVlJzRXtXBhIrNwYZ9UE7oo; if(iLswNIzLFCbdlXkoxp5z4Sq && pEsz4lFPrflfUVMUD) { iLswNIzLFCbdlXkoxp5z4Sq = !iLswNIzLFCbdlXkoxp5z4Sq; } QusKrylrBkU9yW0Uy6FLMCAn = oroR_4uayMMz; rdza3mRu1xyHi0YNjhd4ThYzA5r6FvwSlwUHvCb = oroR_4uayMMz; xOesbbHkmJVlJzRXtXBhIrNwYZ9UE7oo = 7898.0; xeyPZ7njkmAxrZAVD5rGf3WwqkQtQBldI = 3046.0; xOesbbHkmJVlJzRXtXBhIrNwYZ9UE7oo = 6498.0; aGmyaUpOVcqFqj2_mImpb3QhZQUZdlwRKPReV4 = EwD1WhaLBTBmw6_2bRWfuGIv2EM9XNmuaeu * xOesbbHkmJVlJzRXtXBhIrNwYZ9UE7oo; xOesbbHkmJVlJzRXtXBhIrNwYZ9UE7oo = FbIh4vUlx6CtVh73GPz7JHLFnIIAubnlO6 * FbIh4vUlx6CtVh73GPz7JHLFnIIAubnlO6; z8C5sKNJmSHbPeqQxpNt1tg1PMU = sJHa71hhldjBGvCQZFfF3Nm7h - NI4qViu5IB3gH; k5nA1mcIl4U6MG0VR5u = CPWoJXYJcF0MleZ_aDebqxPPLnwnjuck1af + fclr0mCyogyT6; f3LN2XWlKqnN0H4UjZqjQCnJ30IvQIYjP5X = string.Format(yJ7vQ7keGA,xPqzMpv1yoF6Z); } public void yp1S0E9unHDwcHsbeHx4gdgvMDWNC8tPevYZIodK() { for(int i=0;i<oroR_4uayMMz;++i) { oroR_4uayMMz+=1; iQpi1VwsKtl2otAQw9PcI9QgQRfQSFL+=oroR_4uayMMz; } if(iLswNIzLFCbdlXkoxp5z4Sq || xPpWCqSTmjDIxzc3da) { xPpWCqSTmjDIxzc3da = !xPpWCqSTmjDIxzc3da; } if(xWjryPbKNYChlhNiZxuTyxyP1vHgb) { p_9x2jmechn8 = !xWjryPbKNYChlhNiZxuTyxyP1vHgb; } uRHCIUjLpsRa2OBf6XkClzkMk = f3LN2XWlKqnN0H4UjZqjQCnJ30IvQIYjP5X; uRHCIUjLpsRa2OBf6XkClzkMk = f3LN2XWlKqnN0H4UjZqjQCnJ30IvQIYjP5X; DnolqLBIcjWFfTttG1Z1dVC = DnolqLBIcjWFfTttG1Z1dVC + uRHCIUjLpsRa2OBf6XkClzkMk; NI4qViu5IB3gH = 103.0f; Pun7foZqLUnvMHt7i4KRAeAInK7hczud7fkuWk6u = 2550.0f; sJHa71hhldjBGvCQZFfF3Nm7h = 8954.0f; xWjryPbKNYChlhNiZxuTyxyP1vHgb = p_9x2jmechn8 || p_9x2jmechn8; WB7pAbBOTrOaOtouUVCxV72BR9yZeSHT_wyg = 8016.0f; sJHa71hhldjBGvCQZFfF3Nm7h = 2868.0f; z8C5sKNJmSHbPeqQxpNt1tg1PMU = 4280.0f; QusKrylrBkU9yW0Uy6FLMCAn = CPWoJXYJcF0MleZ_aDebqxPPLnwnjuck1af; Vc9HS8acN9RU0BGEey3K7w2XkpkIkSVKi_MiB = CPWoJXYJcF0MleZ_aDebqxPPLnwnjuck1af; if(pEsz4lFPrflfUVMUD || p_9x2jmechn8) { p_9x2jmechn8 = !p_9x2jmechn8; } } public void kYhoQdj2lVeY() { kvMi0T4h1uTJWktX = oroR_4uayMMz - aRJ5yWXNsaYlyBeN0dLIXzXWzuAjDAZ; I0T_516uWt5PJg_wgtb6KDql0sqYdr6e = Pun7foZqLUnvMHt7i4KRAeAInK7hczud7fkuWk6u / Pun7foZqLUnvMHt7i4KRAeAInK7hczud7fkuWk6u; NI4qViu5IB3gH = z8C5sKNJmSHbPeqQxpNt1tg1PMU * ClBLdl1OTEruWf13QIPVHWWOPFUjiKVHLHZmP; z8C5sKNJmSHbPeqQxpNt1tg1PMU = z8C5sKNJmSHbPeqQxpNt1tg1PMU / gus23JhSD7bFWI7KS4I8Nk13eptH4b; M2MCG_7QZZUz3wpNYeJHTOQVXrkjuKNt_R = EwD1WhaLBTBmw6_2bRWfuGIv2EM9XNmuaeu + M2MCG_7QZZUz3wpNYeJHTOQVXrkjuKNt_R; gus23JhSD7bFWI7KS4I8Nk13eptH4b = gus23JhSD7bFWI7KS4I8Nk13eptH4b / z8C5sKNJmSHbPeqQxpNt1tg1PMU; xeyPZ7njkmAxrZAVD5rGf3WwqkQtQBldI = FbIh4vUlx6CtVh73GPz7JHLFnIIAubnlO6 * aGmyaUpOVcqFqj2_mImpb3QhZQUZdlwRKPReV4; m4ZozbFGLIqZwo22KU0lnobwdO7sw7N6 = Eq24Ija70Oh62enZ7AnOXsB2i4ZWAlluE7CPd; xPqzMpv1yoF6Z = Eq24Ija70Oh62enZ7AnOXsB2i4ZWAlluE7CPd; m4ZozbFGLIqZwo22KU0lnobwdO7sw7N6 = string.Format(uRHCIUjLpsRa2OBf6XkClzkMk,uRHCIUjLpsRa2OBf6XkClzkMk); if(frXtgUx5HCA9DuuUJN && iLswNIzLFCbdlXkoxp5z4Sq) { pEsz4lFPrflfUVMUD = !pEsz4lFPrflfUVMUD; } } public void PW0KPT2rc6oWakqV0R8MB6RXVqb() { QDSj8SPdvxSvmHTc7HBJB5pNV = xPpWCqSTmjDIxzc3da && iLswNIzLFCbdlXkoxp5z4Sq; f3LN2XWlKqnN0H4UjZqjQCnJ30IvQIYjP5X = string.Format(uRHCIUjLpsRa2OBf6XkClzkMk,f3LN2XWlKqnN0H4UjZqjQCnJ30IvQIYjP5X); gfT_63glIERMn6 = kvMi0T4h1uTJWktX / iQpi1VwsKtl2otAQw9PcI9QgQRfQSFL; xOesbbHkmJVlJzRXtXBhIrNwYZ9UE7oo = EwD1WhaLBTBmw6_2bRWfuGIv2EM9XNmuaeu; EwD1WhaLBTBmw6_2bRWfuGIv2EM9XNmuaeu = EwD1WhaLBTBmw6_2bRWfuGIv2EM9XNmuaeu; if(iLswNIzLFCbdlXkoxp5z4Sq) { p_9x2jmechn8 = !p_9x2jmechn8; } ClBLdl1OTEruWf13QIPVHWWOPFUjiKVHLHZmP = ClBLdl1OTEruWf13QIPVHWWOPFUjiKVHLHZmP; NI4qViu5IB3gH = ClBLdl1OTEruWf13QIPVHWWOPFUjiKVHLHZmP; if(TtgUvBvAgyC7JV97HJCcR || QDSj8SPdvxSvmHTc7HBJB5pNV) { QDSj8SPdvxSvmHTc7HBJB5pNV = !QDSj8SPdvxSvmHTc7HBJB5pNV; } wIt2R6pckchaDqcG3_JHb13g = kvMi0T4h1uTJWktX + vExjbiMQ7OLE; FbIh4vUlx6CtVh73GPz7JHLFnIIAubnlO6 = xeyPZ7njkmAxrZAVD5rGf3WwqkQtQBldI / xeyPZ7njkmAxrZAVD5rGf3WwqkQtQBldI; DnolqLBIcjWFfTttG1Z1dVC = xPqzMpv1yoF6Z + DnolqLBIcjWFfTttG1Z1dVC; } public void DDX91xRXBnXHYTVcCUY02sOjvWOW3rkF() { aGmyaUpOVcqFqj2_mImpb3QhZQUZdlwRKPReV4 = xeyPZ7njkmAxrZAVD5rGf3WwqkQtQBldI - aGmyaUpOVcqFqj2_mImpb3QhZQUZdlwRKPReV4; xOesbbHkmJVlJzRXtXBhIrNwYZ9UE7oo = xOesbbHkmJVlJzRXtXBhIrNwYZ9UE7oo + EwD1WhaLBTBmw6_2bRWfuGIv2EM9XNmuaeu; z8C5sKNJmSHbPeqQxpNt1tg1PMU = 1828.0f; NI4qViu5IB3gH = 4874.0f; z8C5sKNJmSHbPeqQxpNt1tg1PMU = 3951.0f; xWjryPbKNYChlhNiZxuTyxyP1vHgb = xPpWCqSTmjDIxzc3da && xWjryPbKNYChlhNiZxuTyxyP1vHgb; FbIh4vUlx6CtVh73GPz7JHLFnIIAubnlO6 = GuvZMfRV_rfXgGwyRj41V_L1BBi - FbIh4vUlx6CtVh73GPz7JHLFnIIAubnlO6; M2MCG_7QZZUz3wpNYeJHTOQVXrkjuKNt_R = FbIh4vUlx6CtVh73GPz7JHLFnIIAubnlO6 / xOesbbHkmJVlJzRXtXBhIrNwYZ9UE7oo; WB7pAbBOTrOaOtouUVCxV72BR9yZeSHT_wyg = 3639.0f; WB7pAbBOTrOaOtouUVCxV72BR9yZeSHT_wyg = 4189.0f; ClBLdl1OTEruWf13QIPVHWWOPFUjiKVHLHZmP = 3411.0f; pEsz4lFPrflfUVMUD = p_9x2jmechn8 && xPpWCqSTmjDIxzc3da; sJHa71hhldjBGvCQZFfF3Nm7h = I0T_516uWt5PJg_wgtb6KDql0sqYdr6e; NI4qViu5IB3gH = I0T_516uWt5PJg_wgtb6KDql0sqYdr6e; uRHCIUjLpsRa2OBf6XkClzkMk = uRHCIUjLpsRa2OBf6XkClzkMk + xPqzMpv1yoF6Z; } public void AmTiY6zcbiiOUoa01fClkjs1yMiF() { D6T2kOivHJ5CQt5aIWqBjQ = gfT_63glIERMn6 * mjwQ_6_XfWgGsgzmFpgCVyzsfdsS2FkXORv; if(xPpWCqSTmjDIxzc3da || TtgUvBvAgyC7JV97HJCcR) { TtgUvBvAgyC7JV97HJCcR = !TtgUvBvAgyC7JV97HJCcR; } ERlM2mI1dXw = Lvqo0h70VkcrP1uCa1Kbj; wIt2R6pckchaDqcG3_JHb13g = Lvqo0h70VkcrP1uCa1Kbj; f3LN2XWlKqnN0H4UjZqjQCnJ30IvQIYjP5X = xPqzMpv1yoF6Z; yJ7vQ7keGA = xPqzMpv1yoF6Z; pEsz4lFPrflfUVMUD = TtgUvBvAgyC7JV97HJCcR || p_9x2jmechn8; DnolqLBIcjWFfTttG1Z1dVC = DnolqLBIcjWFfTttG1Z1dVC; DnolqLBIcjWFfTttG1Z1dVC = DnolqLBIcjWFfTttG1Z1dVC; f3LN2XWlKqnN0H4UjZqjQCnJ30IvQIYjP5X = m4ZozbFGLIqZwo22KU0lnobwdO7sw7N6 + xPqzMpv1yoF6Z; DrAvBj3HoUfnuJTTR4GLePwuu9HM_F4BHcp8RVw = hmQSuuVeZTybnONZJ3m01v_HNIfX - Lvqo0h70VkcrP1uCa1Kbj; for(int i=0;i<gfT_63glIERMn6;++i) { wIt2R6pckchaDqcG3_JHb13g+=1; zqPixcS1rI5fB3Qezm4jVGUKYIC+=wIt2R6pckchaDqcG3_JHb13g; } aGmyaUpOVcqFqj2_mImpb3QhZQUZdlwRKPReV4 = GuvZMfRV_rfXgGwyRj41V_L1BBi + EwD1WhaLBTBmw6_2bRWfuGIv2EM9XNmuaeu; } }
using System; using System.Collections.Generic; using System.Text; using System.Threading.Tasks; using ETModel; using Google.Protobuf.Collections; namespace ETHotfix { public static class FriendsCircleSystem { //申请加入亲友圈 public static async Task ApplyJoinFriendsCircle(this FriendsCircle friendsCircle, long userId, IResponse iResponse) { FriendsCirleMemberInfo memberInfo = await FriendsCircleComponent.Ins.QueryFriendsCircleMember(friendsCircle.FriendsCircleId); if (memberInfo.MemberList.Contains(userId)) { iResponse.Message = "你已经在该亲友圈中"; return; } ApplyFriendsCirleInfo applyFriendsCirleInfo=await FriendsCircleComponent.Ins.QueryFriendsCircleApply(friendsCircle.FriendsCircleId); if (applyFriendsCirleInfo.ApplyList.Contains(userId)) { iResponse.Message = "已经在申请列表中"; return; } applyFriendsCirleInfo.ApplyList.Add(userId); await FriendsCircleComponent.Ins.SaveDB(applyFriendsCirleInfo); } //处理申请加入亲友圈 public static async Task DisposeApplyResult(this FriendsCircle friendsCircle, long applyUserId, bool isConsent, IResponse iResponse) { ApplyFriendsCirleInfo applyFriendsCirleInfo = await FriendsCircleComponent.Ins.QueryFriendsCircleApply(friendsCircle.FriendsCircleId); if (!applyFriendsCirleInfo.ApplyList.Contains(applyUserId)) { iResponse.Message = "该玩家不在申请列表里面 或被其他管理处理"; return; } applyFriendsCirleInfo.ApplyList.Remove(applyUserId); await FriendsCircleComponent.Ins.SaveDB(applyFriendsCirleInfo); if (isConsent) { await friendsCircle.SucceedJoinFriendsCircle(applyUserId);//成功加入亲友圈 } } //玩家成功加入亲友圈 public static async Task SucceedJoinFriendsCircle(this FriendsCircle friendsCircle, long userId) { UserInFriendsCircle userInFriendsCircle = await FriendsCircleComponent.Ins.QueryUserInFriendsCircle(userId); userInFriendsCircle.FriendsCircleIdList.Add(friendsCircle.FriendsCircleId); await FriendsCircleComponent.Ins.SaveDB(userInFriendsCircle); FriendsCirleMemberInfo friendsCirleMemberInfo = await FriendsCircleComponent.Ins.QueryFriendsCircleMember(friendsCircle.FriendsCircleId); friendsCirleMemberInfo.MemberList.Add(userId); await FriendsCircleComponent.Ins.SaveDB(friendsCirleMemberInfo); friendsCircle.TotalNumber++; await FriendsCircleComponent.Ins.SaveDB(friendsCircle); } //把人踢出亲友圈 public static async Task KickOutFriendsCircle(this FriendsCircle friendsCircle, long operateUserId, long byOperateUserId, IResponse iResponse) { if (friendsCircle.ManageUserIds.Contains(byOperateUserId)) { iResponse.Message = "不能踢管理出亲友圈"; return; } FriendsCirleMemberInfo applyFriendsCirleInfo = await FriendsCircleComponent.Ins.QueryFriendsCircleMember(friendsCircle.FriendsCircleId); if (!applyFriendsCirleInfo.MemberList.Contains(byOperateUserId)) { iResponse.Message = "玩家已经不再亲友圈中"; return; } friendsCircle.SucceedOutriendsCircle(byOperateUserId);//成功退出亲友圈 } //玩家退出亲友圈 被管理踢 或者自己退都走这 public static async void SucceedOutriendsCircle(this FriendsCircle friendsCircle, long userId) { if (friendsCircle.CreateUserId== userId) { return; } UserInFriendsCircle userInFriendsCircle = await FriendsCircleComponent.Ins.QueryUserInFriendsCircle(userId); if (userInFriendsCircle.FriendsCircleIdList.Contains(friendsCircle.FriendsCircleId)) { userInFriendsCircle.FriendsCircleIdList.Remove(friendsCircle.FriendsCircleId); } await FriendsCircleComponent.Ins.SaveDB(userInFriendsCircle); FriendsCirleMemberInfo friendsCirleMemberInfo = await FriendsCircleComponent.Ins.QueryFriendsCircleMember(friendsCircle.FriendsCircleId); if (friendsCirleMemberInfo.MemberList.Contains(userId)) { friendsCirleMemberInfo.MemberList.Remove(userId); } await FriendsCircleComponent.Ins.SaveDB(friendsCirleMemberInfo); friendsCircle.TotalNumber--; await FriendsCircleComponent.Ins.SaveDB(friendsCircle); } //修改公告 public static async void AlterAnnouncement(this FriendsCircle friendsCircle, string announcement) { friendsCircle.Announcement = announcement; await FriendsCircleComponent.Ins.SaveDB(friendsCircle); } //修改玩法 public static async Task AlterWanFa(this FriendsCircle friendsCircle, RepeatedField<int> roomConfigs,long toyGameId, IResponse iResponse) { //效验配置 如果配置错误 会使用默认配置 if (!RoomConfigIntended.IntendedRoomConfigParameter(roomConfigs, toyGameId)) { //效验不通过 不会修改 iResponse.Message = "玩法参数有误 无法修改"; return; } friendsCircle.DefaultWanFaCofigs = roomConfigs; await FriendsCircleComponent.Ins.SaveDB(friendsCircle); } //修改是否推荐给陌生人 public static async void AlterIsRecommend(this FriendsCircle friendsCircle, bool isRecommend) { friendsCircle.IsRecommend = isRecommend; FriendsCircleComponent.Ins.AlterRecommend(friendsCircle, isRecommend); await FriendsCircleComponent.Ins.SaveDB(friendsCircle); } //设置或取消管理 操作管理权限 public static async Task OperateManageJurisdiction(this FriendsCircle friendsCircle,long oprateMageJuridictionUserId, bool isSetManage, IResponse iResponse) { if (oprateMageJuridictionUserId == friendsCircle.CreateUserId) { iResponse.Message = "不能设置自己"; return; } if (isSetManage) { if (!friendsCircle.ManageUserIds.Contains(oprateMageJuridictionUserId)) { friendsCircle.ManageUserIds.Add(oprateMageJuridictionUserId); } } else { if (friendsCircle.ManageUserIds.Contains(oprateMageJuridictionUserId)) { friendsCircle.ManageUserIds.Remove(oprateMageJuridictionUserId); } } await FriendsCircleComponent.Ins.SaveDB(friendsCircle); } //游戏服玩家打完一大局 发送过来的结算信息 用于排行榜信息 public static async void RankingGameReult(this FriendsCircle friendsCircle,RepeatedField<TotalPlayerInfo> totalPlayerInfos) { for (int i = 0; i < totalPlayerInfos.Count; i++) { RanKingPlayerInfo ranKingPlayerInfo=await friendsCircle.QueryRankingInfo(totalPlayerInfos[i].UserId); ranKingPlayerInfo.TotalScore += totalPlayerInfos[i].TotalScore; ranKingPlayerInfo.TotalNumber++; await FriendsCircleComponent.Ins.SaveDB(ranKingPlayerInfo); } } //查询本亲友圈排行榜信息 public static async Task<RanKingPlayerInfo> QueryRankingInfo(this FriendsCircle friendsCircle,long userId) { List<RanKingPlayerInfo> ranKingPlayerInfos=await FriendsCircleComponent.Ins.dbProxyComponent.Query<RanKingPlayerInfo>( ranking => ranking.UserId == userId && ranking.FriendsCircleId == friendsCircle.FriendsCircleId); if (ranKingPlayerInfos.Count == 0) { ranKingPlayerInfos.Add(RanKingPlayerInfoFactory.Create(friendsCircle.FriendsCircleId, userId)); } return ranKingPlayerInfos[0]; } //获取亲友圈的成员列表 public static async Task<RepeatedField<long>> GetMemberList(this FriendsCircle friendsCircle) { FriendsCirleMemberInfo friendsCirleMemberInfo =await FriendsCircleComponent.Ins.QueryFriendsCircleMember(friendsCircle.FriendsCircleId); return friendsCirleMemberInfo.MemberList; } } }
using BasicClassLibrary.BaseClasses; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Diagnostics; using System.Reflection; namespace WPFTestApp.ViewModel { public class StatusBarViewModel : NotifyDataErrorInfoDataAnnotations { static StatusBarViewModel() { propertyNames = new List<string> { nameof(ProjectNameAndVersion) }; } private StatusBarViewModel() : base() { ValidateAsync(); } #region Properties and events private static object classLock = typeof(StatusBarViewModel); private static StatusBarViewModel singelton; public static StatusBarViewModel ViewModel { get { lock (classLock) { if (singelton == null) { singelton = new StatusBarViewModel(); } return singelton; } } } private static List<string> propertyNames; /// <summary> /// Properties names that need to be validated /// </summary> protected override List<string> PropertyNames { get => propertyNames; set => propertyNames = value; } /// <summary> /// Current application name and version /// </summary> [Required(ErrorMessage = "The property {0} cannot be empty")] public static string ProjectNameAndVersion { get { FileVersionInfo fileInfo = FileVersionInfo.GetVersionInfo(Assembly.GetExecutingAssembly().Location); return fileInfo.ProductName + ": " + fileInfo.ProductVersion; } } private static string message; /// <summary> /// Current application status message /// </summary> public string Message { get { return message; } set { SetProperty(ref message, value as string); } } #endregion } }
using Microsoft.Xna.Framework; namespace MonoGame.Extended.Particles.Profiles { public abstract class Profile //: ICloneable { public enum CircleRadiation { None, In, Out } protected FastRandom Random { get; } = new FastRandom(); public abstract void GetOffsetAndHeading(out Vector2 offset, out Vector2 heading); public object Clone() { return MemberwiseClone(); } public static Profile Point() { return new PointProfile(); } public static Profile Line(Vector2 axis, float length) { return new LineProfile {Axis = axis, Length = length}; } public static Profile Ring(float radius, CircleRadiation radiate) { return new RingProfile {Radius = radius, Radiate = radiate}; } public static Profile Box(float width, float height) { return new BoxProfile {Width = width, Height = height}; } public static Profile BoxFill(float width, float height) { return new BoxFillProfile {Width = width, Height = height}; } public static Profile BoxUniform(float width, float height) { return new BoxUniformProfile {Width = width, Height = height}; } public static Profile Circle(float radius, CircleRadiation radiate) { return new CircleProfile {Radius = radius, Radiate = radiate}; } public static Profile Spray(Vector2 direction, float spread) { return new SprayProfile {Direction = direction, Spread = spread}; } public override string ToString() { return GetType().ToString(); } } }
namespace Millarow.Arithmetic.Internal { internal sealed class DecimalArithmetic : Arithmetic<decimal> { public override decimal Add(decimal a, decimal b) => a + b; public override decimal Subtract(decimal a, decimal b) => a - b; public override decimal Divide(decimal value, decimal divider) => value / divider; public override decimal Multiply(decimal a, decimal b) => a * b; public override decimal Min(decimal a, decimal b) => a < b ? a : b; public override decimal Max(decimal a, decimal b) => a > b ? a : b; public override double ToDouble(decimal value) => (double)value; public override decimal FromDouble(double value) => (decimal)value; public override decimal MinValue => decimal.MinValue; public override decimal MaxValue => decimal.MaxValue; public override decimal Zero => 0; public override decimal One => 1; public override decimal NegativeOne => -1.0M; } }
namespace Producer.Domain { public enum UserRoles { General, Insider, Producer, Admin } public static class UserRolesExtensions { public static string Claim (this UserRoles role) => role.ToString ().ToLower (); public static UserRoles FromClaim (string claim) { if (!string.IsNullOrEmpty (claim)) { if (claim == UserRoles.Admin.Claim ()) { return UserRoles.Admin; } if (claim == UserRoles.Producer.Claim ()) { return UserRoles.Producer; } if (claim == UserRoles.Insider.Claim ()) { return UserRoles.Insider; } } return UserRoles.General; } public static bool CanWrite (this UserRoles role) => (role == UserRoles.Admin || role == UserRoles.Producer); } }
using System; using UnityEngine; using System.Collections.Generic; #if UNITY_EDITOR [ExecuteInEditMode()] #endif public class AutoLayoutElement:MonoBehaviour { // Delegates protected delegate void SimpleAction(); // Events protected event SimpleAction OnShouldApplyLayout; // Properties private List<GameObject> dependents = new List<GameObject>(); private List<GameObject> parents = new List<GameObject>(); private float lastCameraHeight; private float lastCameraWidth; protected bool shouldAutoUpdate; // If true, this instance should self-update when a change was detected (otherwise, it only updates when told so by parents) private bool needsAdditionalUpdate; // ================================================================================================================ // MAIN EVENT INTERFACE ------------------------------------------------------------------------------------------- void Awake() { } void Start() { applyLayoutRules(); } void Update() { if (needsAdditionalUpdate) { // This should not be needed, but it's always missing 1 frame at the end applyLayoutRules(); needsAdditionalUpdate = false; } } void LateUpdate() { if (shouldAutoUpdate) { // Should auto update: checks if necessary if (Camera.main.pixelHeight != lastCameraHeight || Camera.main.pixelWidth != lastCameraWidth) { // Needs to update //Debug.Log("=============> Updating starting @ " + transform.parent.gameObject.name + "." + gameObject.name); lastCameraHeight = Camera.main.pixelHeight; lastCameraWidth = Camera.main.pixelWidth; applyLayoutRules(); needsAdditionalUpdate = true; } } } /* void OnEnable() { if (shouldAutoUpdate) needsUpdate = true; } */ // ================================================================================================================ // PUBLIC INTERFACE ----------------------------------------------------------------------------------------------- public void requestUpdate() { applyLayoutRules(); } public void addDependent(GameObject dependent) { if (!dependents.Contains(dependent)) dependents.Add(dependent); } public void removeDependent(GameObject dependent) { if (dependents.Contains(dependent)) dependents.Remove(dependent); } // ================================================================================================================ // INTERNAL INTERFACE --------------------------------------------------------------------------------------------- protected void checkParents(params GameObject[] parentsToCheck) { // Checks if a parent has changed, adding or removing itself from the parent as a dependent var addedParents = new List<GameObject>(); var removedParents = new List<GameObject>(); // Checks differences // Checks for new parents foreach (var parentToCheck in parentsToCheck) { if (parentToCheck == gameObject) { Debug.LogWarning("Trying to add itself as a parent!"); continue; } if (parentToCheck == null) continue; if (!parents.Contains(parentToCheck) && !addedParents.Contains(parentToCheck)) { addedParents.Add(parentToCheck); } } // Checks for removed parents foreach (var parent in parents) { if (Array.IndexOf(parentsToCheck, parent) < 0 && !removedParents.Contains(parent)) { removedParents.Add(parent); } } // Finally, adds and removes all parent foreach (var parent in addedParents) { addToParent(parent); parents.Add(parent); } foreach (var parent in removedParents) { removeFromParent(parent); parents.Remove(parent); } } protected Bounds getBoundsOrPoint(GameObject gameObject) { // Gets the best bounding box from a game object, using a placeholder box if none can be found var bounds = getBounds(gameObject); return bounds == null ? new Bounds(gameObject.transform.position, new Vector3(0.0001f, 0.0001f, 0.0001f)) : (Bounds)bounds; } protected Bounds? getBounds(GameObject gameObject) { // Gets the best bounding box from a game object if (gameObject == null) { // No object, use the screen size instead var tl = Camera.main.ScreenToWorldPoint(new Vector3(0, Camera.main.pixelHeight, 0.1f)); var br = Camera.main.ScreenToWorldPoint(new Vector3(Camera.main.pixelWidth, 0, 0.1f)); return new Bounds((tl+br)/2, br-tl); } else if (gameObject.GetComponent<Collider>() != null) { // Use collider return gameObject.GetComponent<Collider>().bounds; } else if (gameObject.GetComponent<Renderer>() != null) { // Use renderer return gameObject.GetComponent<Renderer>().bounds; } // None found! return null; } // ================================================================================================================ // INTERNAL INTERFACE --------------------------------------------------------------------------------------------- private void removeFromParent(GameObject parent) { if (parent != null && parent.GetComponent<AutoLayoutElement>() != null) { var autoLayoutElements = parent.GetComponents<AutoLayoutElement>(); foreach (var autoLayoutElement in autoLayoutElements) autoLayoutElement.removeDependent(gameObject); } } private void addToParent(GameObject parent) { if (parent != null && parent.GetComponent<AutoLayoutElement>() != null) { var autoLayoutElements = parent.GetComponents<AutoLayoutElement>(); foreach (var autoLayoutElement in autoLayoutElements) autoLayoutElement.addDependent(gameObject); } } private void applyLayoutRules() { //needsUpdate = false; //Debug.Log("Applying update @ frame " + Time.frameCount + ", " + transform.parent.gameObject.name + "." + gameObject.name + ", with " + dependents.Count + " dependents"); // Applies layout to self if (OnShouldApplyLayout != null) { OnShouldApplyLayout(); } // Propagates to dependents var destroyedDependents = new List<GameObject>(); foreach (var dependent in dependents) { if (dependent != null && dependent.activeInHierarchy) { var autoLayoutElements = dependent.GetComponents<AutoLayoutElement>(); foreach (var autoLayoutElement in autoLayoutElements) autoLayoutElement.requestUpdate(); } else { // Object has been destroyed! Debug.LogWarning("Dependent object was destroyed during gameplay, will remove it from list of dependents"); destroyedDependents.Add(dependent); } } foreach (var dependent in destroyedDependents) { dependents.Remove(dependent); } } }
/* * Copyright Amazon.com, Inc. or its affiliates. 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. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file 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. */ /* * Do not modify this file. This file is generated from the migrationhubstrategy-2020-02-19.normal.json service model. */ using System; using System.Collections.Generic; using System.Xml.Serialization; using System.Text; using System.IO; using System.Net; using Amazon.Runtime; using Amazon.Runtime.Internal; namespace Amazon.MigrationHubStrategyRecommendations.Model { /// <summary> /// Information about all the available strategy options for migrating and modernizing /// an application component. /// </summary> public partial class StrategyOption { private bool? _isPreferred; private Strategy _strategy; private TargetDestination _targetDestination; private TransformationToolName _toolName; /// <summary> /// Gets and sets the property IsPreferred. /// <para> /// Indicates if a specific strategy is preferred for the application component. /// </para> /// </summary> public bool IsPreferred { get { return this._isPreferred.GetValueOrDefault(); } set { this._isPreferred = value; } } // Check to see if IsPreferred property is set internal bool IsSetIsPreferred() { return this._isPreferred.HasValue; } /// <summary> /// Gets and sets the property Strategy. /// <para> /// Type of transformation. For example, Rehost, Replatform, and so on. /// </para> /// </summary> public Strategy Strategy { get { return this._strategy; } set { this._strategy = value; } } // Check to see if Strategy property is set internal bool IsSetStrategy() { return this._strategy != null; } /// <summary> /// Gets and sets the property TargetDestination. /// <para> /// Destination information about where the application component can migrate to. For /// example, <code>EC2</code>, <code>ECS</code>, and so on. /// </para> /// </summary> public TargetDestination TargetDestination { get { return this._targetDestination; } set { this._targetDestination = value; } } // Check to see if TargetDestination property is set internal bool IsSetTargetDestination() { return this._targetDestination != null; } /// <summary> /// Gets and sets the property ToolName. /// <para> /// The name of the tool that can be used to transform an application component using /// this strategy. /// </para> /// </summary> public TransformationToolName ToolName { get { return this._toolName; } set { this._toolName = value; } } // Check to see if ToolName property is set internal bool IsSetToolName() { return this._toolName != null; } } }
using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel.DataAnnotations; using System.Linq; using System.Web; using System.Web.Mvc; namespace DeanAndSons.Models.IMS.ViewModels { public class StaffManagerEditViewModel { public string Id { get; set; } public string Forename { get; set; } [Required] public Rank Rank { get; set; } public string SuperiorID { get; set; } public Staff Superior { get; set; } public List<string> SubordinateIds { get; set; } = new List<string>(); [Display(Name = "Subordinates")] public MultiSelectList Subordinates { get; set; } public StaffManagerEditViewModel(Staff vm) { Id = vm.Id; Forename = vm.Forename; Rank = vm.Rank; SuperiorID = vm.SuperiorID; Superior = vm.Superior; getSubordinateIDs(vm.Subordinates); } public StaffManagerEditViewModel() { } private void getSubordinateIDs(ICollection<Staff> subordinates) { foreach (var item in subordinates) { SubordinateIds.Add(item.Id); } } } }
using Microsoft.Azure.Synapse.Models; namespace Microsoft.Azure.Commands.Synapse.Models { public class PSSparkServicePluginInformation { public PSSparkServicePluginInformation(SparkServicePluginInformation pluginInfo) { this.PreparationStartedAt = pluginInfo?.PreparationStartedAt; this.ResourceAcquisitionStartedAt = pluginInfo?.ResourceAcquisitionStartedAt; this.SubmissionStartedAt = pluginInfo?.SubmissionStartedAt; this.MonitoringStartedAt = pluginInfo?.MonitoringStartedAt; this.CleanupStartedAt = pluginInfo?.CleanupStartedAt; this.CurrentState = pluginInfo?.CurrentState; } /// <summary> /// </summary> public System.DateTimeOffset? PreparationStartedAt { get; set; } /// <summary> /// </summary> public System.DateTimeOffset? ResourceAcquisitionStartedAt { get; set; } /// <summary> /// </summary> public System.DateTimeOffset? SubmissionStartedAt { get; set; } /// <summary> /// </summary> public System.DateTimeOffset? MonitoringStartedAt { get; set; } /// <summary> /// </summary> public System.DateTimeOffset? CleanupStartedAt { get; set; } /// <summary> /// Gets or sets possible values include: 'Preparation', /// 'ResourceAcquisition', 'Queued', 'Submission', 'Monitoring', /// 'Cleanup', 'Ended' /// </summary> public string CurrentState { get; set; } } }
/** * $File: JCS_TweenPathAction.cs $ * $Date: 2020-04-02 19:06:04 $ * $Revision: $ * $Creator: Jen-Chieh Shen $ * $Notice: See LICENSE.txt for modification and distribution information * Copyright © 2020 by Shen, Jen-Chieh $ */ using System.Collections.Generic; using UnityEngine; namespace JCSUnity { /// <summary> /// The point to point simple path action that uses tween to move. /// </summary> [RequireComponent(typeof(JCS_TransformTweener))] [RequireComponent(typeof(JCS_AdjustTimeTrigger))] public class JCS_TweenPathAction : MonoBehaviour { /* Variables */ private JCS_TransformTweener mTransformTweener = null; private JCS_AdjustTimeTrigger mAdjustTimerTrigger = null; [Header("** Check Variables (JCS_TweenPathAction) **")] [Tooltip("Current target point index that this object to going approach.")] [SerializeField] private int mTargetPointIndex = -1; [Header("** Runtime Variables (JCS_TweenPathAction) **")] [Tooltip("List of points for setting up the path.")] [SerializeField] private List<Transform> mPoints = null; [Tooltip("Random the path by randomizing the target point.")] [SerializeField] private bool mRandom = false; [Tooltip("Do continue tween instead of just tween.")] [SerializeField] private bool mContinueTween = false; /* Setter & Getter */ public List<Transform> Points { get { return this.mPoints; } } public bool Random { get { return this.mRandom; } set { this.mRandom = value; } } public bool ContinueTween { get { return this.mContinueTween; } set { this.mContinueTween = value; } } /* Functions */ private void Awake() { this.mTransformTweener = this.GetComponent<JCS_TransformTweener>(); this.mAdjustTimerTrigger = this.GetComponent<JCS_AdjustTimeTrigger>(); #if UNITY_EDITOR if (mPoints.Count == 0) JCS_Debug.LogWarning("Path action with 0 path point is not valid"); #endif mAdjustTimerTrigger.actions = DoPath; } /// <summary> /// Generate the next new point but not the same as last point. /// </summary> private void GetNextPoint() { if (mRandom) { int len = mPoints.Count; int newIndex = JCS_Random.RangeInclude(0, len - 1); if (newIndex == mTargetPointIndex && len != 1) GetNextPoint(); else mTargetPointIndex = newIndex; } else { ++mTargetPointIndex; if (mTargetPointIndex >= mPoints.Count) mTargetPointIndex = 0; } } private void DoPath() { GetNextPoint(); if (mContinueTween) mTransformTweener.DoTweenContinue(mPoints[mTargetPointIndex]); else mTransformTweener.DoTween(mPoints[mTargetPointIndex].position); } } }
using System; using System.Collections.Generic; using Microsoft.Extensions.Logging; using MongoDB.Driver; using VenmoForSlack.Database.Models; namespace VenmoForSlack.Database { public class MongoDatabase { private readonly ILogger logger; private IMongoDatabase database; private IMongoCollection<VenmoUser> usersCollection; public MongoDatabase(string workspaceId, ILogger<MongoDatabase> logger) { this.logger = logger; database = Program.Mongo.GetDatabase($"yhackslackpack_{workspaceId}"); try { database.CreateCollection("users"); } catch (MongoCommandException) { // collection already exists } usersCollection = database.GetCollection<VenmoUser>("users"); } public List<VenmoUser> GetAllUsers() { return usersCollection.Find(_ => true).ToList(); } public VenmoUser? GetUser(string userId) { var filter = Builders<VenmoUser>.Filter.Eq("_id", userId); VenmoUser? venmoUser = usersCollection.Find(filter).FirstOrDefault(); return venmoUser; } public void SaveUser(VenmoUser venmoUser) { venmoUser.LastModified = DateTime.UtcNow; usersCollection.ReplaceOne(Builders<VenmoUser>.Filter.Eq<string>("_id", venmoUser.UserId), venmoUser, new ReplaceOptions() { IsUpsert = true }); } public bool? DeleteUser(string userId) { var filter = Builders<VenmoUser>.Filter.Eq("_id", userId); var deleteResult = usersCollection.DeleteOne(filter); if (deleteResult.IsAcknowledged) { var deleted = deleteResult.DeletedCount == 1; if (!deleted) { logger.LogWarning($"Did not find {userId} to delete in {database.DatabaseNamespace.DatabaseName}"); } return deleted; } else { logger.LogWarning($"Could not delete {userId} in {database.DatabaseNamespace.DatabaseName}"); return null; } } } }
<ul id="nav"> <li class="nav-section"> <div class="nav-section-header empty"><a href="<?cs var:toroot ?>preview/overview.html" es-lang="Información general del programa" in-lang="Ikhtisar Program" ja-lang="プログラム概要" ko-lang="프로그램 개요" pt-br-lang="Visão geral do programa" ru-lang="Обзор программы" vi-lang="Tổng quan về Chương trình" zh-cn-lang="计划概览" zh-tw-lang="程式總覽"> Program Overview</a></div> </li> <li class="nav-section"> <div class="nav-section-header empty"><a href="<?cs var:toroot ?>preview/support.html"> Support and Release Notes</a></div> </li> <li class="nav-section"> <div class="nav-section-header empty"><a href="<?cs var:toroot ?>preview/setup-sdk.html" es-lang="Configurar el SDK de la versión preliminar" in-lang="Menyiapkan Preview" ja-lang="Preview SDK のセットアップ" ko-lang="미리 보기 SDK 설정하기" pt-br-lang="Configuração do Preview SDK" ru-lang="Настройка пакета SDK Preview" vi-lang="Kiểm thử trên Thiết bị" zh-cn-lang="设置预览版 SDK" zh-tw-lang="設定預覽版 SDK"> Set Up the Preview</a></div> </li> <li class="nav-section"> <div class="nav-section-header empty"><a href="<?cs var:toroot ?>preview/download.html" es-lang="Pruebe en un dispositivo" in-lang="Menguji pada Perangkat" ja-lang="デバイス上でテストする" ko-lang="기기에서 테스트" pt-br-lang="Testar em um dispositivo" ru-lang="Тестирование на устройстве" vi-lang="Kiểm thử trên Thiết bị" zh-cn-lang="在设备上测试" zh-tw-lang="在裝置上測試"> Test on a Device</a></div> </li> <li class="nav-section"> <div class="nav-section-header"><a href="<?cs var:toroot ?>preview/behavior-changes.html" es-lang="Cambios en los comportamientos" in-lang="Perubahan Perilaku" ja-lang="動作の変更点" ko-lang="동작 변경" pt-br-lang="Mudanças de comportamento" ru-lang="Изменения в работе" vi-lang="Các thay đổi Hành vi" zh-cn-lang="行为变更" zh-tw-lang="行為變更">Behavior Changes </a></div> <ul> <li><a href="<?cs var:toroot ?>preview/features/background-optimization.html" es-lang="Optimizaciones en segundo plano" in-lang="Optimisasi Latar Belakang" ja-lang="バックグラウンド処理の最適化" ko-lang="백그라운드 최적화" pt-br-lang="Otimizações em segundo plano" ru-lang="Оптимизация фоновых процессов" vi-lang="Tối ưu hóa Chạy ngầm" zh-cn-lang="后台优化" zh-tw-lang="背景最佳化">Background Optimizations </a></li> <li><a href="<?cs var:toroot ?>preview/features/multilingual-support.html" es-lang="Idioma y configuración regional" in-lang="Bahasa dan Lokal" ja-lang="言語とロケール" ko-lang="언어 및 로케일" pt-br-lang="Idioma e localidade" ru-lang="Язык и языковой стандарт" vi-lang="Ngôn ngữ và Bản địa" zh-cn-lang="语言和区域设置" zh-tw-lang="語言和地區設定">Language and Locale </a></li> </ul> </li> <li class="nav-section"> <div class="nav-section-header"><a href="<?cs var:toroot ?>preview/api-overview.html" es-lang="Información general de la API" in-lang="Android N untuk Pengembang" ja-lang="API の概要" ko-lang="API 개요" pt-br-lang="Visão geral da API" ru-lang="Обзор API-интерфейсов" vi-lang="Android N cho Nhà phát triển" zh-cn-lang="API 概览" zh-tw-lang="API 總覽">Android N for Developers </a></div> <ul> <li><a href="<?cs var:toroot ?>preview/features/multi-window.html" es-lang="Compatibilidad con ventanas múltiples" in-lang="Dukungan Multi-Jendela" ja-lang="マルチ ウィンドウのサポート" ko-lang="다중 창 지원" pt-br-lang="Suporte a várias janelas" ru-lang="Поддержка многооконного режима" vi-lang="Hỗ trợ đa cửa sổ" zh-cn-lang="多窗口支持" zh-tw-lang="多視窗支援"> Multi-Window Support</a></li> <li><a href="<?cs var:toroot ?>preview/features/notification-updates.html" es-lang="Notificaciones" in-lang="Pemberitahuan" ja-lang="通知" ko-lang="알림" pt-br-lang="Notificações" ru-lang="Уведомления" vi-lang="Thông báo" zh-cn-lang="通知" zh-tw-lang="通知"> Notifications</a></li> <li><a href="<?cs var:toroot ?>preview/features/data-saver.html"> Data Saver</a></li> <li><a href="<?cs var:toroot ?>preview/features/tv-recording-api.html" es-lang="Grabación de TV" in-lang="Perekaman TV" ja-lang="TV の録画" ko-lang="TV 녹화" pt-br-lang="Gravação para TV" ru-lang="Запись ТВ" vi-lang="Ghi lại TV" zh-cn-lang="TV 录制" zh-tw-lang="電視錄製"> TV Recording</a></li> <li><a href="<?cs var:toroot ?>preview/features/security-config.html" es-lang="Configuración de seguridad de la red" in-lang="Network Security Configuration" ja-lang="ネットワーク セキュリティ構成" ko-lang="네트워크 보안 구성" pt-br-lang="Configurações de segurança de rede" ru-lang="Конфигурация сетевой безопасности" vi-lang="Cấu hình Bảo mật mạng" zh-cn-lang="网络安全配置" zh-tw-lang="網路安全性設定"> Network Security Configuration</a></li> <li><a href="<?cs var:toroot ?>preview/features/icu4j-framework.html" es-lang="API de ICU4J del framework de Android" in-lang="ICU4J Android Framework API" ja-lang="ICU4J Android フレームワーク API" ko-lang="ICU4J Android 프레임워크 API" pt-br-lang="APIs de estrutura do Android para ICU4J" ru-lang="API-интерфейсы ICU4J в платформе Android" vi-lang="API Khuôn khổ Android ICU4J" zh-cn-lang="ICU4J Android 框架 API" zh-tw-lang="ICU4J Android 架構 API"> ICU4J Support</a></li> <li><a href="<?cs var:toroot ?>preview/j8-jack.html" es-lang="Funciones del lenguaje Java 8" in-lang="Fitur Bahasa Java 8" ja-lang="Java 8 の機能" ko-lang="Java 8 언어 기능" pt-br-lang="Recursos de linguagem do Java 8" ru-lang="Возможности языка Java 8" vi-lang="Tính năng của Ngôn ngữ Java 8" zh-cn-lang="Java 8 语言功能" zh-tw-lang="Java 8 語言功能"> Java 8 Language Features</a></li> <li><a href="<?cs var:toroot ?>preview/features/afw.html"> Android for Work Updates</a></li> <li><a href="<?cs var:toroot ?>preview/features/scoped-folder-access.html" es-lang="Acceso a directorios determinados" in-lang="Scoped Directory Access" ja-lang="特定のディレクトリへのアクセス" ko-lang="범위가 지정된 디렉터리 액세스" pt-br-lang="Acesso a diretórios com escopo" ru-lang="Доступ к выделенным каталогам" vi-lang="Truy cập Thư mục theo Phạm vi" zh-cn-lang="作用域目录访问" zh-tw-lang="限定範圍目錄存取"> Scoped Directory Access</a></li> </ul> </li> <li class="nav-section"> <div class="nav-section-header empty"><a href="<?cs var:toroot ?>preview/samples.html" es-lang="Ejemplos" in-lang="Contoh" ja-lang="サンプル" ko-lang="샘플" pt-br-lang="Exemplos" ru-lang="Примеры" zh-cn-lang="示例" zh-tw-lang="範例"> Samples</a></div> </li> <li class="nav-section"> <div class="nav-section-header empty"><a href="<?cs var:toroot ?>preview/license.html" es-lang="Contrato de licencia" ja-lang="使用許諾契約" ko-lang="라이선스 계약" pt-br-lang="Contrato de licença" ru-lang="Лицензионное соглашение" zh-cn-lang="许可协议" zh-tw-lang="授權協議"> License Agreement</a></div> </li> </ul>
using System.Data; namespace WebJobDemo.Core.Data { public interface ITransactionFactory { IDbTransaction Create(IDbConnection connection); IDbTransaction Create(IDbConnection connection, IsolationLevel isolationLevel); } }
using System; namespace MyToolkit.MachineLearning.WinRT.Utilities { class BoundNumbers { public const double MinValue = -1.0E20; public const double MaxValue = 1.0E20; public static double Bound(double d) { if (d < MinValue) return MinValue; if (d > MaxValue) return MaxValue; return d; } public static double Exp(double d) { return Bound(Math.Exp(d)); } } }
 namespace Microsoft.Azure.Management.ApiManagement.ArmTemplates.Common { public class SchemaTemplateResource : APITemplateSubResource { public SchemaTemplateProperties properties { get; set; } } public class SchemaTemplateProperties { public string contentType { get; set; } public SchemaTemplateDocument document { get; set; } } public class SchemaTemplateDocument { public string value { get; set; } } public class RESTReturnedSchemaTemplate : APITemplateSubResource { public RESTReturnedSchemaTemplateProperties properties { get; set; } } public class RESTReturnedSchemaTemplateProperties { public string contentType { get; set; } public object document { get; set; } } }