Lazy day

- Posted in Uncategorized by

I've been lazy today. I finished a sci-fi movie named 'Quanta', did a little website updating, ran some backups, started Season 3 of Colony, and made a payment on my Amazon Store card.

Learned that H's fiance's grandfather fell and broke a hip. Mother has left for the Outer Banks with S. She plans on getting back on the 6th. We got a $200 bonus at work Friday in the form of a credit card. I spent mine on a Windows 10 Pro PC-on-a-stick. Should be a handy gadget to have. I've also ordered a 10" android tablet for S, and an identical one for me. They run the latest Android OS, Pie.

E got in from the University of Kentucky last night, and slept late today. Her classes are difficult, but I think she's enjoying college life. She heated up a pizza for lunch, and Susan and I had some. It's in the 90s today through next Thursday. Then, starting next Friday we should have a few cooler days in the 70s.

I wrote a C# console app today that will wind up saving me a few minutes everyday that I had been spending to launch 7zip and manually zip multiple subdirectories of my My Documents for backup via uploading. Note: I commented-out the section that zips my DokuWiki, because I hope to replace it with localhost-hosted blog entries.

Lazy day

- Posted in Coding by

I've been lazy today. I finished a sci-fi movie named 'Quanta', did a little website updating, ran some backups, started Season 3 of Colony, and made a payment on my Amazon Store card.

Learned that Hannah's fiance's grandfather fell and broke a hip. Mother has left for the Outer Banks with Sharylon. She plans on getting back on the 6th. We got a $200 bonus at work Friday in the form of a credit card. I spent mine on a Windows 10 Pro PC-on-a-stick. Should be a handy gadget to have. I've also ordered a 10" android tablet for Susan, and an identical one for me. They run the latest Android OS, Pie.

Emma got in from the University of Kentucky last night, and slept late today. Her classes are difficult, but I think she's enjoying college life. She heated up a pizza for lunch, and Susan and I had some. It's in the 90s today through next Thursday. Then, starting next Friday we should have a few cooler days in the 70s.

I wrote a C# console app today that will wind up saving me a few minutes everyday that I had been spending to launch 7zip and manually zip multiple subdirectories of my My Documents for backup via uploading. Note: I commented-out the section that zips my DokuWiki, because I hope to replace it with localhost-hosted blog entries.

Here is the source code:

using System;
using System.IO;
using System.Diagnostics;
using System.Threading;

namespace ZipThem{

    class Program {

        static void Main(string[] args){

            ProcessStartInfo startInfo = new ProcessStartInfo();
            Console.Clear();            

            startInfo.FileName = @"C:csdevtoolsZipFolder.exe";
            if(!File.Exists(startInfo.FileName)){
                Console.WriteLine("n Couldn't find ZipFolder.exe in csdevtools... goodbye...");
                Thread.Sleep(1500);
                Environment.Exit(0);
            }

            string startPath = @"C:UserskyratDocumentspublic_html";
            string zipPath = @"C:UserskyratDocumentspublic_html.zip";
            ZipDirectory(startPath, zipPath, startInfo);

            startPath = @"C:UserskyratDocumentsTwine";
            zipPath = @"C:UserskyratDocumentsMyTwineStories.zip";
            ZipDirectory(startPath, zipPath, startInfo);

            startPath = @"C:UserskyratDocumentsMySquiffy";
            zipPath = @"C:UserskyratDocumentsMySquiffy.zip";
            ZipDirectory(startPath, zipPath, startInfo);   

            startPath = @"C:Zwamp";
            zipPath = @"C:UserskyratDocumentswebsite atop zwamp.zip";
            ZipDirectory(startPath, zipPath, startInfo);       

            startPath = @"C:csdev";
            zipPath = @"C:UserskyratDocumentscsdev.zip";
            ZipDirectory(startPath, zipPath, startInfo);            

/*             startPath = @"C:UserskyratDocumentsDokuWik";
            zipPath = @"C:UserskyratDocumentsDokuWik.zip";
            ZipDirectory(startPath, zipPath, startInfo);               */

            Console.WriteLine("nn Press any key to exit...");
            Console.ReadKey();
        }

        static void ZipDirectory(string startPath, string zipPath, ProcessStartInfo startInfo){
            if(Directory.Exists(startPath)){
                try{                                        
                    if(File.Exists(zipPath)){ File.Delete(zipPath); }
                    Console.Write("n Now zipping '{0}' folder...", startPath);
                    Console.WriteLine(" to {0}", zipPath);
                    Thread.Sleep(2000);
                    startInfo.Arguments = startPath + " " + zipPath; 
                    var proc = Process.Start(startInfo);
                    proc.WaitForExit();
                    Console.WriteLine(" Successfully zipped folder {0}", Path.GetFileName(startPath));
                }catch(Exception ex1){
                    Console.WriteLine("n Exception thrown while trying to zip folder 'public_html':n " + ex1.Message);
                }
            }            
        }


    }

}

Thankfulness

- Posted in Uncategorized by

Thank You for this day. I am out of the habit of prayer. I suppose in all honesty I had never acquired that habit. But I know that I need to. Please help me do it.

I'm sorry for my bullheadedness. Forgive and help my unbelief, and save me not because I am in any way deserving, but because I have believed upon the risen Savior and that He alone provides access to the Father and Heaven. Forgive my sins. Make me painfully aware of them, that I may shun them.

God, make me more compassionate for others. Slower to form judgments. Faster to extend charity and kindness. Shut my lips against gossip, and bind my mind with good judgment.

Grant me greater enthusiasm and ardor at work. Help me to find ways to actually help my TR clients, and not just be a warm body filling a slot, cranking out daily notes.

In Jesus' Name,

Amen.

Twine Fray

- Posted in Coding by

I've discovered the blog of Mr. Riley, a web programmer. He has lots of great Twine code examples.

Mr. Riley is a teacher. He has a good starting point example of a combat system for a Twine game called Twine Fray.

I plan to scour his blog for learning purposes.

Lately, I've been reading some articles put out by prominent researchers in the SETI at Home project: Here is an explanation of the Drake Equation. And here is an article of what we might expect from E.T.

For a while now, I've had my desktop PC (which I don't use on a daily basis but do leave running) executing BOINC and assisting the SETI @ Home program to process telescopic data.

BOINC downloads scientific computing jobs to your computer and runs them invisibly in the background. It's easy and safe.

About 30 science projects use BOINC; examples include Einstein@Home, IBM World Community Grid, and SETI@home. These projects investigate diseases, study global warming, discover pulsars, and do many other types of scientific research.

Batch file time saver

- Posted in Coding by

Part of my morning routine is to launch three applications which I use to record my previous day's caloric intake and expenditure (per data from my FitBit device).

The following text in a batch file suffices to save me a few clicks and the better part of a minute's time:

start cmd.exe /k cd C:/csdev/utils/cal
START C:/windows/system32/calc.exe
start cmd.exe /k cd C:/Users/[user]/Documents/DokuWik

Note that I've replaced my actual username in the third line of the batch file code above with [user], for security purposes.

This batch file launches Windows' calculator, and opens command prompts at the directories containing my calorie tracking console C# app, and the launcher for my local DokuWiki. It saves me time navigating the directory structure. All I have to do after clicking this batch file is enter the requisite program name in each command prompt — in my case, cal in one prompt, run in the other.

Local website server ZWAMP

- Posted in software by

Today I made the decision to henceforth store my website locally. I chose to run it atop ZWAMP, a micro-alternative to a LAMP stack that only has about a 405 Kb footprint on disk, and uses around 100 Kb of RAM. Now that's micro!

Installed it and got Flatpress CMS running quickly on my laptop. Getting it working on my desktop PC at home required me to first disable IIS in Windows 10 Program and Features, so that ZWAMP's Apache service would run. So, now I have practically unlimited storage space for my blog, and I can mirror it across multiple PCs and removable media.

My backup scheme is to stop ZWAMP temporarily, then archive it and the contents of its subfolders (note: web houses your website/blog) in .zip format, which I upload to my NAS, Mega, pCloud, etc.

I'll use my laptop as my day-to-day machine for website maintenance, and do regular syncs to my desktop machine and one or more removable and remote media repositories.

I'll have a rather more static online website, located — at the time of this writing — here.

Asmodat folder locker

- Posted in software by

Asmodat Folder Locker is a great freeware program for protecting your files and folders with password encryption. I have a copy (link is only accessible by webmaster) of version 1.4.1. It does its job well, and is very fast.

Squiffy timeout

- Posted in Coding by

It's easy to sleep or pause or delay for x milliseconds in Squiffy. The following code makes use of the javascript setTimeout function (each Section in your Squiffy source code can call javascript code if it precedes all other Squiffy script in that passage). You can copy/paste the following code into a new Squiffy project and it will run:

[code] [[Start]]: setTimeout(function () { squiffy.story.go("next"); }, 2000);

Hello Bob!

[[next]]: setTimeout(function () { squiffy.story.go("next2"); }, 2000); Bob, are you there??

[[next2]]: Hmm, Bob's not around... [/code]

Javascript has a function called setTimeout that allows us to run a function once after the specified interval of time. For instance, this code calls sayHi() after one second:

function sayHi() {
  alert('Hello');
}

setTimeout(sayHi, 1000);

ILMerge error

- Posted in Coding by

Sometimes you'll get “Unresolved assembly reference not allowed” when attempting to use ILMerge. To avoid this, specify the full path to the framework you're targeting, like this on the command line:

ilmerge /targetplatform:v4,"C:WindowsMicrosoft.NETFramework64v4.0.30319" /out:merged.exe myprogram.exe mylib1.dll mylib2.dll

How to capture output from a process using c-sharp

- Posted in Uncategorized by

C# Capturing output from a process

namespace LaunchAndCaptureOutput{

    class Lacout{
    static void Main(){

        var proc = new Process{
                StartInfo = new ProcessStartInfo{
                    FileName = @"C:csdevlessonslessonette7hello.exe",
                    UseShellExecute = false,
                    RedirectStandardOutput = true,
                    CreateNoWindow = true
                }
        };

        proc.Start();
        string p = proc.StandardOutput.ReadToEnd();
        proc.WaitForExit();
        Console.WriteLine("Captured output: " + p);
      }
    }

} 
Page 8 of 10