Skip to content

Instantly share code, notes, and snippets.

View rosco-y's full-sized avatar

Ross Ylitalo rosco-y

  • Ross Ylitalo Software
  • Laurium, MI 49913
View GitHub Profile
using System;
using System.ComponentModel;
using System.Runtime.CompilerServices;
using Windows.UI;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Shapes;
namespace ChessBoardQuiz.Views
<Page
x:Class="ChessBoardQuiz.Views.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
Style="{StaticResource PageStyle}"
mc:Ignorable="d">
<Page.Resources>
<Style TargetType="Rectangle">
public bool ReadData()
{
bool success = false;
using (StreamReader stread = new StreamReader(@"C:\TMP\PUZZLE1.csv"))
{
int pid = readHeader(stread);
string sline;
while((sline = stread.ReadLine()) != null)
{
parseLine(sline);
@rosco-y
rosco-y / readheader.cs
Created April 14, 2020 14:09
my readHeader is missing line 0 in my datafile
/******************************************************************
* The first call to my StreamReader.ReadLine() results in the
* second line of my data.
* here is my data
*
| PID 1
| LID,RID,c0,c1,c2,c3,c4,c5,c6,c7,c8
| 0,0,3,1,5,7,6,4,9,2,8
| 0,1,8,2,6,1,9,3,4,5,7
| 0,2,4,9,7,5,8,2,1,3,6
@rosco-y
rosco-y / rotateCube.cs
Last active April 11, 2020 02:53
My rotations are strictly supposed to be 90 degrees left / right / up or down. They are all wonky. Can anyone tell me what I should be doing?
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using static eTurnDirection;
enum eTurnDirection
{
Left,
Right,
Up,
@rosco-y
rosco-y / signature.cs
Created April 1, 2020 15:39
How do I access async methods from a
private void cmdValidate_Click(object sender, EventArgs e)
{
cDataReader rdr = new cDataReader();
for (int layer = 0; layer < 8; layer++)
{
/******************************************************
* because of this "await" directive, I need to change
* the signature to
* private async Task cmdValidate_Click(object sender, EventArgs e)
*******************************************************/
@rosco-y
rosco-y / view.sql
Last active April 1, 2020 09:58
What is wrong with my create view?
CREATE VIEW [vLastRows] AS
SELECT * FROM [SudoKubed].[dbo].ROWS R
INNER JOIN SudoKubed.DBO.PUZZLES P
ON R.PID = P.PID WHERE R.LID = 8 AND R.RID = 8;
/* Msg 4506, Level 16, State 1, Procedure vLastRows, Line 2 [Batch Start Line 0]
* Column names in each view or function must be unique. Column name 'PID' in view or function 'vLastRows'
* is specified more than once. */
@rosco-y
rosco-y / cDataTests.cs
Last active March 30, 2020 17:28
Why don't my cDataTests file and WritePuzzleData2DB NUnit test show up in my VS test explorer?
using libSudoModel.MODEL;
using NUnit.Framework;
using SUDOKUBED9X9.DataPersistence;
using System;
using System.Threading.Tasks;
namespace SudoTest
{
/// <summary>
/// cDataTests Description:
@rosco-y
rosco-y / memberwiseclone.cs
Created March 30, 2020 14:47
cPuzzle constructor to copy another cPuzzle object.
/*********************************************************
* I attempted to create a cPuzzle constructor that takes
* a cPuzzle ogject and copies its member to the new
* new cPuzzle object
********************************************************/
public cPuzzle(cPuzzle other)
{
/***********************************************
* this is readonly, so this fails
***********************************************/
/*************************************************************************
* I want to create a thread that writes a small report to my long-running
* console application roughly every 30 seconds. I've stubbed in my report
* method--what are the next steps I need to take?
**************************************************************************/
void reportThread()
{
Console.Write($"\r{_curLayer}{_curRow}{_curCol}");
Console.Clear();