void Start() { label = gameObject.GetComponent<GUIText>(); if (collector == null) { collector = GameObject.Find("DataCollector").GetComponent<DataCollector>(); } }
void OnTriggerEnter2D(Collider2D ice) { if (!dead) { if (ice.gameObject.tag == "IceAttack") { dataMetric.howItDied = "Ice"; dataMetric.defeatedTime = Time.timeSinceLevelLoad; DataCollector datacoll = DataCollector.getInstance(); datacoll.createObstacle(dataMetric); dead = true; } } }
public MainWindow(ServerPackage package) { InitializeComponent(); background = new DataCollector(); toolStripStatusInfo.Text = Resources.Ready; dataGridView1.AllowUserToAddRows = false; dataGridView1.ColumnHeadersVisible = false; dataGridView1.Visible = false; LoadOptions(); InitTimerValidation(); UpdateSettings(); UpdateCurrencies(); UpdateToolStripUpdates(package); }
public void PopulateTotal() { List <KeyValuePair <string, int> > result = DataCollector.GetScoreTotal(); int count = 1; foreach (KeyValuePair <string, int> entry in result) { GameObject entryName = Instantiate(nameText, grid.transform); entryName.GetComponent <TMP_Text>().text = string.Concat(count.ToString(), ". ", entry.Key); GameObject entryValue = Instantiate(valueText, grid.transform); entryValue.GetComponent <TMP_Text>().text = entry.Value.ToString(); count++; } }
public async Task <PopulationResult> PopulateAsync <TInput>(TInput input) where TInput : IServiceInput { if (MessageMap == null) { MessageMap = new MessageProperties("NONE", "Id"); } PopulationResultCollection rs = await DataCollector.CollectData(this, input); PopulationResult merged = MergeIntoAggregate(rs); return(merged); }
private void GameFinished() { if (SceneHandler.GetSceneName() == "PP_GameLV_00") { tutorialEndMenu.SetActive(true); return; } DataCollector.UpdateScore(CalculateScore()); if (scoreMenu != null) { scoreMenu.BuildLevelEndMenu(); mouseFollowHelper.SetActive(false); } }
public Board StartGame(int playerAmount, int roundAmount, DataCollector dataCollector) { var board = new Board(new ConsolePlayerInteracter(), playerAmount, roundAmount, dataCollector); board.Setup(); while (true) { int value = board.DoTurn(); if (value == -1) { break; } } return(board); }
public void ValidateRemovePublishedDataSet() { //Arrange DataCollector dataCollector = new DataCollector(new UaPubSubDataStore()); PublishedDataSetDataType publishedDataSet = new PublishedDataSetDataType(); publishedDataSet.Name = "Name"; //Act dataCollector.AddPublishedDataSet(publishedDataSet); dataCollector.RemovePublishedDataSet(publishedDataSet); DataSet collectedDataSet = dataCollector.CollectData(publishedDataSet.Name); //Assert Assert.IsNull(collectedDataSet, "The '{0}' publishedDataSet was not removed correctly.", publishedDataSet.Name); }
void OnBecameInvisible() { //metric data set to thrown behind blind guy if (transform != null && blindGuyTransform != null) { if (transform.position.x < blindGuyTransform.position.x) { dataMetric.defeatedTime = Time.time; dataMetric.howItDied = "Telekinesis"; DataCollector datacoll = DataCollector.getInstance(); datacoll.createObstacle(dataMetric); Destroy(gameObject); } } }
public MainWindow() { InitializeComponent(); Collector = new DataCollector(new Config() { ProcessFilters = new String[] { "notepad.exe", "calc.exe", "CL.exe", "link.exe", "MSBuild.exe", "BrofilerWindowsTest.exe" } //ProcessFilters = new String[] { "link.exe" } }); Collector.Start(); ProcessList.DataContext = Collector; ProcessList.ProcessDataGrid.SelectionChanged += ProcessDataGrid_SelectionChanged; }
public DevVm() { CommandSelectItem = new Command(ActionSelectedItem); CommandLongTap = new Command(ActionLongTap); CommandOpenWare = new Command(ActionOpenWare); CommandAddItem = new Command(ActionAddItem); CommandInsertItem = new Command(ActionInsertItem); CommandAddItems = new Command(ActionAddItems); CommandRemoveItem = new Command(ActionRemoveItem); CommandAddWeight = new Command(ActionAddWeight); CommandRemoveWeight = new Command(ActionRemoveWeight); Items = DataCollector.GetWares(); SelectedItem = Items.FirstOrDefault(); }
public ActionResult SigninOrEdit(SigninUser user) { bool isSignin = Request.Cookies["user"] == null; if (isSignin && DataAccessor.Exists(user.Username, ExistenceCheckOption.ByUsername)) { ModelState.AddModelError("username", "This username is taken. choose an other one."); } if (isSignin && DataAccessor.Exists(user.Email, ExistenceCheckOption.ByEmail)) { ModelState.AddModelError("email", "This email is already signed in."); } if (ModelState.IsValid) { if (isSignin) { DataCollector.AddUser(user); } else { DataCollector.UpdateUser(user); } var u = DataAccessor.GetUser(user.Username, user.Password); Response.Cookies["user"]["username"] = u.Username; Response.Cookies["user"]["userId"] = u.Id.Value.ToString(); Response.Cookies["user"]["firstName"] = u.FirstName; Response.Cookies["user"]["lastname"] = u.LastNmae; Response.Cookies["user"].Expires = DateTime.Now.AddDays(1); var ids = DataAccessor.GetProductsIds(u.Id.Value).Select(p => p.ToString()); var Ids = new StringBuilder(); foreach (var item in ids) { Ids.Append(item + ","); } Response.Cookies["cart"]["productsIds"] = Ids.ToString(); Response.Cookies["cart"].Expires = DateTime.Now.AddDays(-1); return(RedirectToRoute(new { Controller = "Home" })); } ViewBag.IsSignin = isSignin; return(View(user)); }
public void EndOfSong(LevelCompletionResults results, SongData data) { DataCollector collector = data.GetDataCollector(); maxCombo = collector.maxCombo; bombHit = collector.bombHit; nbOfWallHit = collector.nbOfWallHit; foreach (Note n in collector.notes) { if (n.IsAMiss()) { miss++; if (n.cutType == CutType.miss) { missedNotes++; if (n.noteType == BSDNoteType.left) { leftMiss++; } else { rightMiss++; } } else if (n.cutType == CutType.badCut) { badCuts++; if (n.GetInfo().saberType == SaberType.SaberA) { leftBadCuts++; } else { rightBadCuts++; } } } else if (n.noteType == BSDNoteType.left) { leftNoteHit++; } else if (n.noteType == BSDNoteType.right) { rightNoteHit++; } } }
public void ValidateAddPublishedDataSet() { //Arrange string configurationFile = Utils.GetAbsoluteFilePath(m_configurationFileName, true, true, false); var pubSubConfiguration = UaPubSubConfigurationHelper.LoadConfiguration(configurationFile); DataCollector dataCollector = new DataCollector(new UaPubSubDataStore()); //Act dataCollector.AddPublishedDataSet(pubSubConfiguration.PublishedDataSets.First()); DataSet collectedDataSet = dataCollector.CollectData(pubSubConfiguration.PublishedDataSets.First().Name); //Assert Assert.IsNotNull(collectedDataSet, "Cannot collect data therefore the '{0}' publishedDataSet was not registered correctly.", pubSubConfiguration.PublishedDataSets[0].Name); }
public ActionResult Buy(int productId) { DataCollector.BuyProduct(productId); var ids = Request.Cookies["cart"]["productsIds"]; var idsArr = ids.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries); Response.Cookies["cart"]["productsIds"] = string.Empty; foreach (var id in idsArr) { if (id != productId.ToString()) { Response.Cookies["cart"]["productsIds"] += id + ","; } } return(Redirect(Request.UrlReferrer.ToString())); }
static void CaptureVariableDeclaratorOperation(DataCollector dataCollector, ITypeSymbol createdType, IVariableInitializerOperation variableInitializerOperation) { switch (variableInitializerOperation.Parent) { case IVariableDeclaratorOperation declaratorOperation: dataCollector.CollectVariableDeclaratorOperation(declaratorOperation.Symbol, variableInitializerOperation, createdType); break; case IVariableDeclarationOperation declarationOperation when declarationOperation.Declarators.Length == 1: { var declaratorOperationAlt = declarationOperation.Declarators[0]; dataCollector.CollectVariableDeclaratorOperation(declaratorOperationAlt.Symbol, variableInitializerOperation, createdType); break; } } }
void Update() { if (GetComponent <Rigidbody2D>().isKinematic) { kill = true; } timeToLive -= Time.deltaTime; if (timeToLive <= 0) { dataMetric.howItDied = "Timer"; dataMetric.defeatedTime = Time.timeSinceLevelLoad; DataCollector datacoll = DataCollector.getInstance(); datacoll.createObstacle(dataMetric); Destroy(gameObject); } }
void OnCollisionEnter2D(Collision2D col) { if (col.gameObject.tag == "Blindguy") { AudioSource.PlayClipAtPoint(snowballHit, transform.position); Destroy(gameObject); } if (col.gameObject.tag == "Ground") { dataMetric.howItDied = "Telekinesis"; dataMetric.defeatedTime = Time.timeSinceLevelLoad; DataCollector datacoll = DataCollector.getInstance(); datacoll.createObstacle(dataMetric); Destroy(gameObject); } }
/// <summary> /// Processes this response /// </summary> public override Task <ControllerResponseResult> Process() { Context.Response.StatusCode = StatusCode; DataCollector.Add(TemplateFactory .Load(TemplateFileName) .Model(Model) .Set()); if (!string.IsNullOrEmpty(Title)) { DataCollector.AddTitle(Title); } return(Task.FromResult(ControllerResponseResult.Default)); }
public static void Main() { List <IDataRecievable> sensors = new List <IDataRecievable> { new PiSensor(), new StringSensor() }; DataCollector dc = new DataCollector(sensors); dc.CollectData(); decimal pi = dc.GetResultFromSensor <decimal>(typeof(PiSensor)); string greeting = dc.GetResultFromSensor <string>(typeof(StringSensor)); Console.WriteLine(2 * pi); Console.WriteLine(greeting); }
static void Main(string[] args) { try { BL.DataCollector dc = new DataCollector(); //dc.ProcessFile(); DAL.Models.User user = new DAL.Models.User() { UserName = "******" }; dc.AddUser(user); } catch (ArgumentException e) { } }
private void GenerateDataCollectors(List <Guid> dataCollectorIds) { Random rnd = new Random(); var regions = new List <string> { "St. Louis", "Saly", "Touba", "Thies", "Dakar", "Kaolak" }; foreach (var dataCollectorId in dataCollectorIds) { var dataCollector = new DataCollector(dataCollectorId) { Region = regions.ElementAt(rnd.Next(0, regions.Count - 1)) }; _dataCollectorsEventHandler.Handle(dataCollector); } }
static void Main(string[] args) { var parameterParser = new ParameterParser(); var parameters = parameterParser.ParseParameters(args); if (parameters == null) { WriteUsage(); return; } try { List <Lender> lenders = null; using (IReader reader = new CsvReader()) { var collector = new DataCollector(reader); lenders = collector.Collect(parameters.FileName); } var loanCalculator = new LoanCalculator(); var result = loanCalculator.CalculateLoan(lenders, parameters.TargetAmount, 3); if (result == null) { Console.WriteLine("It's not possible to provide a quote"); } else { PrintLending(result); } } catch (ReaderException rEx) { Console.WriteLine("Error during reading input: {0}", rEx.Message); } catch (DataParsingException dpEx) { Console.WriteLine("Error during parsing data: {0}", dpEx.Message); } catch (CalculatorException cEx) { Console.WriteLine("Error during calculation: {0}", cEx.Message); } catch (Exception ex) { Console.WriteLine("Uncategorized error: {0}", ex.Message); } }
void ReadPlayerData() { powerData[0].type = DataMetricAttack.Type.Fire; powerData[1].type = DataMetricAttack.Type.Ice; powerData[2].type = DataMetricAttack.Type.Telekinesis; powerData[3].type = DataMetricAttack.Type.Destruction; DataCollector datacoll = DataCollector.getInstance(); DataMetricLevel prevLevel = datacoll.getLastLevel(); powerData[0].usage = prevLevel.qtyFireAttacks; powerData[1].usage = prevLevel.qtyIceAttacks; powerData[2].usage = prevLevel.qtyFireAttacks; powerData[3].usage = prevLevel.qtyFireAttacks; playerDeaths = 0; // datacoll.playerDeadsInLevel(DataMetricLevel.Levels.); }
public LabeledReportGroup AddReport(ReportStatus status, ProjectHealthRisk projectHealthRisk, DataCollector dataCollector, bool isTraining = false, Point location = null, DateTime?receivedAt = null, Village village = null) { Reports.Add(new Report { Id = _reportNumerator.Next, ReportGroupLabel = _label, Status = status, ProjectHealthRisk = projectHealthRisk, DataCollector = dataCollector, IsTraining = isTraining, ReceivedAt = receivedAt ?? default, Location = location, RawReport = new RawReport { Village = village ?? default } });
public void CollectStoreDataTest() { DataCollector target = new DataCollector(); Store store = new Store() { MainPageUrl = "http://www.verkkokauppa.com", Name = "Verkkokauppa" }; target.CollectStoreData(store); foreach (var product in target.Products) { Trace.WriteLine(product.ToString()); } }
public void SetPlayerName() { DataCollector.currentPlayer = nameInput.text; if (DataCollector.currentPlayer != "NONE" && DataCollector.currentPlayer.Length > 1) { DataCollector.CheckForSaveFile(); BackToMainMenu(); } else { ///put focus back to input field nameInput.ActivateInputField(); Debug.LogWarning("You need to enter a name"); return; } }
private IEnumerator humanReachedGoal() { HumanCollider[] humanColliders = GetComponentsInChildren <HumanCollider> (); foreach (HumanCollider collider in humanColliders) { collider.GetComponent <BoxCollider> ().center = new Vector3(0f, 0f, 1000f); } yield return(null); Destroy(this.gameObject); // if (health > 0f) { PubSub.publish("points:inc", PointCalculator.humanDestinationPoints); DataCollector.Add("Humans reached goal", 1f); // } numberOfHumans--; GenericHumanSounds.HumanCountChange(); }
/// <summary> /// Initializes a new instance of the <see cref="UaPubSubApplication"/> class. /// </summary> /// <param name="dataStore"> The current implementation of <see cref="IUaPubSubDataStore"/> used by this instance of pub sub application</param> private UaPubSubApplication(IUaPubSubDataStore dataStore = null) { m_uaPubSubConnections = new List <IUaPubSubConnection>(); if (dataStore != null) { m_dataStore = dataStore; } else { m_dataStore = new UaPubSubDataStore(); } m_dataCollector = new DataCollector(m_dataStore); m_uaPubSubConfigurator = new UaPubSubConfigurator(); m_uaPubSubConfigurator.ConnectionAdded += UaPubSubConfigurator_ConnectionAdded; m_uaPubSubConfigurator.ConnectionRemoved += UaPubSubConfigurator_ConnectionRemoved; m_uaPubSubConfigurator.PublishedDataSetAdded += UaPubSubConfigurator_PublishedDataSetAdded; m_uaPubSubConfigurator.PublishedDataSetRemoved += UaPubSubConfigurator_PublishedDataSetRemoved; }
public void CollectData() { var dataCollector = new DataCollector(); dataCollector.ObjectFinished += container => collectedDataObjects.Add(container); Assert.IsEmpty(collectedDataObjects); var byteList = new List<byte>(); byteList.AddRange(dataCollector.GetTestBytesWithLengthHeader(6)); byteList.AddRange(dataCollector.GetTestBytesWithLengthHeader(4)); byteList.AddRange(dataCollector.GetTestBytesWithLengthHeader(10)); Assert.AreEqual(32, byteList.Count); var bytePackages = SplitDataStream(byteList, 10, 10, 11, 1); foreach (byte[] package in bytePackages) dataCollector.ReadBytes(package, 0, package.Length); Assert.AreEqual(3, collectedDataObjects.Count); }
void Start() { playerArrow.disablePlayerControls(); powerFailureSound = Resources.Load <AudioClip>("Audio/msfx_chrono_latency_hammer"); countdownSound = Resources.Load <AudioClip>("Audio/Select02"); finalCountSound = Resources.Load <AudioClip>("Audio/Select04"); timer = waitTime; GameObject collectorObj = GameObject.Find("DataCollector"); if (collectorObj != null) { dataCollector = collectorObj.GetComponent <DataCollector>(); dataCollector.gameQuit.AddListener(gameQuit); } startIntroAndCountdown(); }
public async void GetFilteredNews(object sender, EventArgs e) { var collector = new DataCollector(); var authorName = textBox1.Text; if (authorName == null) { var data = await collector.GetData(); dataGridView1.DataSource = data; } else { var data = await collector.GetFilteredNews(authorName); dataGridView1.DataSource = data; } }
private void CollectDealershipData(List<string[]> dealershipList, DataHub dataHub) { dealershipDataSet = new List<DealershipData>(); var workerThreads = 99; using (var worker = new BackgroundWorkerQueue(workerThreads)) { foreach (var dealership in dealershipList) { var work = new DataCollector(dealership[0], new Uri(dealership[1])); worker.Enqueue(work); } dataHub.SendTotal(dealershipList.Count); var completed = 0; var status = worker.Status(); do { if (status.Failed.Any()) worker.ReAddFailed(status.Failed); Thread.Sleep(1000); status = worker.Status(); if (Monitor.TryEnter(theLock, 100)) { try { completed = dealershipDataSet.Count; } finally { Monitor.Exit(theLock); } } dataHub.SendProgress(completed, status.Processing.Count(), status.Failed.Count()); } while (status.Backlog.Any() || status.Processing.Any() || status.Failed.Any()); worker.Stop(); worker.ClearErrors(); dataHub.CompleteDataCollection(); } }
public DataCollectorWebDriver(IWebDriver originalWebDriver, DataCollector dataCollector) { this.originalWebDriver = originalWebDriver; this.dataCollector = dataCollector; }
public DataCollectorWebElement(IWebElement originalWebElement, IWebDriver webDriver, DataCollector dataCollector) { this.originalWebElement = originalWebElement; this.webDriver = webDriver; this.dataCollector = dataCollector; }
internal void Disable() { this = new DataCollector(); }
public DataCollectorNavigation(INavigation originalNavigation, IWebDriver webDriver, DataCollector dataCollector) { this.originalNavigation = originalNavigation; this.webDriver = webDriver; this.dataCollector = dataCollector; }