Some of my programming creations

- Posted in Coding by
C# Programming

I've dabbled in C# since this programming language was first introduced. Here I provide links to useful tips and snippets, source code, and related thoughts. And let me assure you, these source code files represent a lot of time and learning on my part.

My C# Projects (you're welcome to use/modify the source code of any of these projects, even for commercial purposes) ↓

Found Money: A GUI for tracking piggy-bank deposits over time → | on box.com | on GDrive

Sudoku: My take on the Sudoku number grid gameon box.com | on GDrive

Proofy: My proofreading jobs / words-proofed tracker → | on box.com | on GDrive

KyrCrypt: My files and folders encrypter → | on box.com | on GDrive

<

p class="tab40">KyrHangman: a game I wrote for a donationcoder NANY → | on box.com | on GDrive

SLOC: My counter of source code lines → | on box.com | on GDrive

How Long Since?: Calculates elapsed time between any two dates → | on box.com | on GDrive

KyrPrayerMinder: Prayer journal or use as diary; searchable → | on box.com | on GDrive

Basic BlackJack; decent implementation of a card Deck class → | on box.com | on GDrive

Example of Square Proximity Algorithm: demonstrates detection of square proximity/overlap → | on box.com | on GDrive

How to install nuget on Windows

- Posted in Coding by

Open a PowerShell prompt with elevated privilege (as Administrator)

Get nuget.exe command line wget https://dist.nuget.org/win-x86-commandline/latest/nuget.exe -OutFile nuget.exe

Download the C# Roslyn compiler (just a few megs, no need to 'install') .nuget.exe install Microsoft.Net.Compilers

Note: as of date 21 Aug 2018, this installs the Roslyn compiler here:

C:WindowsSystem32Microsoft.Net.Compilers.2.9.0tools

Count top-level subdirectories

- Posted in Coding by

C# get number of top-level subdirectories in a directory.

Here's a brief program that demonstrates counting the number of top-level subdirectories that reside within a given directory:

https://gist.github.com/kyrathasoft/1dc1a1eb4d6a2a56827dcb5f43840afe

Compress to archive using c-sharp

- Posted in Coding by

I've hosted the source code on GitHub demonstrating using .NET to compress a folder and its contents into a single .zip archive. It also demonstrates decompressing such an archive into its component directory, subdirectories, and files.

To compile, you'll need response file resp.rsp in the same directory as simpleCompExt.cs. The contents of that response file should be:

/r:System.IO.Compression.dll
/r:System.IO.Compression.FileSystem.dll
/out:simple.exe
simpleCompExt.cs

To compile from the command line, execute the following from the source code directory:

csc @resp.rsp

If you want to experiment with this, be sure to add a few small files to the /start subdirectory (so that there's something to compress and extract).

Copy one directory to another

- Posted in Coding by

Introducing the CopyTo method, which faithfully copies one directory's contents to another directory. The method listing is on Github here.

And here is a sample program demonstrating its usage.

Moving a form programmatically using C#

- Posted in Coding by

Shows how we can access Form1's default TextBox (textBox1) from within another class, by passing into that other class's constructor a refence to Form1. We create public properties for the form's 'textBox1' TextBox, because the textbox is private to Form1 (see the declaration in Form1Designer.cs, which looks like this):

private System.Windows.Forms.TextBox textBox1;

By passing a reference to Form1 into the other class's constructor, and then utilizing the properties we created, we can alter Form1's textbox's .Width and .Text properties from another class:

Jogging in April of 2018

- Posted in Uncategorized by

Here is something I'd like to get back to: jogging. Not competitively, but for the health and mental health benefits. I hope that I can work my gumption to the sticking point and return to this as a New Year's resolution for 2024.

Pictures of Emma from April of 2018

- Posted in Uncategorized by

Here are some pictures of Emma from 2018 (April, I believe).







Properly capitalize proper nouns with c-sharp

- Posted in Coding by

C# properly capitalize proper nouns

Here is a method that, if passed a proper noun, such as a person's name or a street address, will return a properly formatted version of that string.

Twine and Glaive Seeker

- Posted in Coding by

I'd estimate I'm probably halfway through the development of Glaive Seeker, a play-in-your-browser game I'm authoring with Squiffy for the player in my Earth Apotheosis game on r.rpol.net.

I've not been impressed with the robustness with which Squiffy handles variables. Twine seems more robust in that regard. In fairness, though, I just wrote a very brief example source file, and variable incrementing worked as expected. So perhaps I have syntax errors in the game I'm writing. I'm not experienced using Squiffy, after all.

I'm thinking that Twine is a more mature tool, certainly in terms of its age. However, in doing some reading about the new v3.01 Harlowe story format, it seems far more complicated than what I want to fool with or need. At the time of this writing, I'm thinking future games or tutorials might best be fit by the SugarCube2 format for Twine.

Incidentally, the nodes screenshot above was taken from a layout created using Twine. That's right, I'm using Twine to help visualize the flow of my Squiffy story.

I shared the above screenshot with my player on 9/16/2019 (note that this assertion conflicts with the date shown above this post's title; that's because Flatpress uses UTC time) in msg 120 of a private message thread and will be interested in the player's reaction.

Page 1 of 2