diff --git a/blog/2024/linux-mint-cinnamon-theme-on-debian.html b/blog/2024/linux-mint-cinnamon-theme-on-debian.html new file mode 100644 index 0000000..198fb05 --- /dev/null +++ b/blog/2024/linux-mint-cinnamon-theme-on-debian.html @@ -0,0 +1,40 @@ +Install Linux Mint Cinnamon Themes on Debian

Install Linux Mint Cinnamon Themes on Debian

As a long time Windows user it probably is no surprise that I enjoy using the Cinnamon Desktop +Environment. Although I have used and enjoyed using Linux Mint one goal I had when I started replacing Windows +throughout my house was to be the same distribution on differnt machines. So I settled on installing Debian +everywhere and customizing it to each systems individual needs.

+

I wanted to run Cinnamon on my Thinkpad Laptop and Debian can install +it out of the box. The only problem is the defaykt theme leaves a lot to be deisred. Luckily the theme from Linux Mint +can installed using a few commands from the terminal.

+ + +
cd ~/Downloads # Could also be /tmp
+
+git clone --depth=1 --branch 2.1.8 git@github.com:linuxmint/mint-themes.git
+cd mint-themes
+sudo apt install -y pysassc # Needed by generate.py
+./generate.py
+sudo cp -r ./usr/share/themes/* /usr/share/themes
+cd ..
+rm -rf mint-themes
+
+git clone --depth=1 --branch 1.7.1 git@github.com:linuxmint/mint-x-icons.git
+cd mint-x-icons
+sudo cp -r ./usr/share/icons/* /usr/share/icons
+cd ..
+rm -rf mint-x-icosn
+
+git clone --depth=1 --branch 1.7.7 git@github.com:linuxmint/mint-y-icons.git
+cd mint-y-icons
+sudo cp -r ./usr/share/icons/* /usr/share/icons
+cd ..
+rm -rf mint-y-icons
+
+git clone --depth=1 git@github.com:linuxmint/mint-cursor-themes.git
+cd mint-cursor-theme
+sudo cp -r ./usr/share/icons/* /usr/share/icons
+cd ..
+rm -rf mint-cursor-themes
+
+

After running these commands the Linux Mint will be available for selection in the Themes application. The current versions +of the individual repositories can be checked on GitHub.

+
\ No newline at end of file diff --git a/blog/page10.html b/blog/page10.html index b149167..e40f146 100644 --- a/blog/page10.html +++ b/blog/page10.html @@ -1,27 +1,14 @@ -The Blog of Zachary Snow

Using batch files as the task runner in Visual Studio Code

July 9, 2015vsvscodebatch

Visual Studio Code allows you specify tasks which can be in a task runner. Most examples +The Blog of Zachary Snow

Snowball V2.0

February 23, 2018.netsnowballc#

I haven't written anything new here in a very long time and a lot has happened since then. I started a new job at +BeumerGroup this year and now work mostly in TypeScript writing an html5 spa app.

+

In my spare time I've decided to working on version 2.0 of my Snowball, +my 2D game framework. I've been playing around with the idea for a while now. This version will be developed directly +for .net core and will be developed with cross platform capability in mind. The api will look similar but will have +some changes.

+

The old repo is still available on my github at https://github.com/smack0007/Snowball_v1.

+

Using batch files as the task runner in Visual Studio Code

July 9, 2015vsvscodebatch

Visual Studio Code allows you specify tasks which can be in a task runner. Most examples I've seen show how to integrate with Javascript task runners such as Gulp. There is no reason why you can't simpley use batch files though.

Continue reading "Using batch files as the task runner in Visual Studio Code"

LINQ calls IEqualityComparer<T>.GetHashCode() before Equals()

November 24, 2014.netlinq

This is a problem that has bitten me more than a few times so I thought it was about time to write a blog post about it. It's one of those problems that makes you scratch your head for a bit and then the light bulb goes on and you remember you've solved this one before. It occurs whenever you use a LINQ extension method which takes an instance of IEqualityComaparer.

Continue reading "LINQ calls IEqualityComparer<T>.GetHashCode() before Equals()"

My Experience with OpenGL vs Direct3D

November 18, 2014graphicsopengldirect3D

I've struggled a lot with myself over whether I should use OpenGL or Direct3D. There is no blanket answer to this question that anyone can tell you. Both APIs have a very different feel and which one you prefer can only be decided on your own.

Continue reading "My Experience with OpenGL vs Direct3D"

Code from when I was young and stupid and needed the money

June 18, 2014old-codec++

We have had 2 interns at work for the past few weeks and one of the tasks we gave them was to implement Quicksort. -This got me to thinking about my youth and some of the code I wrote back then. I've decided to post it.

Continue reading "Code from when I was young and stupid and needed the money"

Adding assembly references in Roslyn

April 15, 2014.netc#roslyn

In the Roslyn preview that was released at Build 2014 the way references to global assmeblies are added was changed. Before the preview I could use code like this:

-
var compilation = Compilation.Create(assemblyName, new CompilationOptions(OutputKind.DynamicallyLinkedLibrary))
-    .AddReferences(MetadataReference.CreateAssemblyReference("mscorlib"))
-    .AddReferences(MetadataReference.CreateAssemblyReference("System"))
-    .AddReferences(MetadataReference.CreateAssemblyReference("System.Core"))
-    .AddReferences(new MetadataFileReference(this.GetType().Assembly.Location))
-    .AddSyntaxTrees(syntaxTree);
-
-

The static factory method "MetadataReference.CreateAssemblyReference" added a reference to global assemblies such as "mscorlib.dll" or "System.dll". In the Roslyn preview, -the same be achieved like so:

-
var assemblyPath = Path.GetDirectoryName(typeof(object).Assembly.Location);
-
-var compilation = CSharpCompilation.Create(assemblyName)
-    .WithOptions(new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary))
-    .AddReferences(new MetadataFileReference(Path.Combine(assemblyPath, "mscorlib.dll")))
-    .AddReferences(new MetadataFileReference(Path.Combine(assemblyPath, "System.dll")))
-    .AddReferences(new MetadataFileReference(Path.Combine(assemblyPath, "System.Core.dll")))
-    .AddReferences(new MetadataFileReference(Assembly.GetEntryAssembly().Location))
-    .AddSyntaxTrees(syntaxTree);
-
-
\ No newline at end of file +This got me to thinking about my youth and some of the code I wrote back then. I've decided to post it.

Continue reading "Code from when I was young and stupid and needed the money"
\ No newline at end of file diff --git a/blog/page11.html b/blog/page11.html index a7cbfbf..e181154 100644 --- a/blog/page11.html +++ b/blog/page11.html @@ -1,4 +1,24 @@ -The Blog of Zachary Snow

All the cool kids are static

March 9, 2014static-websites

Seems like all the cool kids these days have converted their websites to completely static ones. I'm looking at you Mr. Haacked. I thought this was a pretty cool idea and a chance +The Blog of Zachary Snow

Adding assembly references in Roslyn

April 15, 2014.netc#roslyn

In the Roslyn preview that was released at Build 2014 the way references to global assmeblies are added was changed. Before the preview I could use code like this:

+
var compilation = Compilation.Create(assemblyName, new CompilationOptions(OutputKind.DynamicallyLinkedLibrary))
+    .AddReferences(MetadataReference.CreateAssemblyReference("mscorlib"))
+    .AddReferences(MetadataReference.CreateAssemblyReference("System"))
+    .AddReferences(MetadataReference.CreateAssemblyReference("System.Core"))
+    .AddReferences(new MetadataFileReference(this.GetType().Assembly.Location))
+    .AddSyntaxTrees(syntaxTree);
+
+

The static factory method "MetadataReference.CreateAssemblyReference" added a reference to global assemblies such as "mscorlib.dll" or "System.dll". In the Roslyn preview, +the same be achieved like so:

+
var assemblyPath = Path.GetDirectoryName(typeof(object).Assembly.Location);
+
+var compilation = CSharpCompilation.Create(assemblyName)
+    .WithOptions(new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary))
+    .AddReferences(new MetadataFileReference(Path.Combine(assemblyPath, "mscorlib.dll")))
+    .AddReferences(new MetadataFileReference(Path.Combine(assemblyPath, "System.dll")))
+    .AddReferences(new MetadataFileReference(Path.Combine(assemblyPath, "System.Core.dll")))
+    .AddReferences(new MetadataFileReference(Assembly.GetEntryAssembly().Location))
+    .AddSyntaxTrees(syntaxTree);
+
+

All the cool kids are static

March 9, 2014static-websites

Seems like all the cool kids these days have converted their websites to completely static ones. I'm looking at you Mr. Haacked. I thought this was a pretty cool idea and a chance to really refresh my website so I decided to take a stab at it. It's currently a work in progress.

I ended up writing my own tool I call Gatsby to do it. I also set up the whole deploy process myself involving pushing to Github which then informs my website to pull from the Github repository. Hopefully that will be a blog post in the not too distance future.

@@ -24,7 +44,4 @@

Changelog:

  • byte and sbyte are now mapped correctly in generated code.
  • Fixed the naming of some functions so as not to include type notation, i.e. Color4u.
  • Decreased the number of enum values output.
  • -

    Introducing GLDotNet

    Today I released a project I've been playing around with for a year or so on Codeplex. It's called GLDotNet. From the project description:

    -

    C# wrapper for OpenGL. Partially generated from the OpenGL spec and partially written by hand, the aim is to have a flexible and native feeling C# binding.

    -

    I have generated functions from the OpenGL spec excluding 1 or 2 but unfortunately of the generated code is untested. There is a demo project included in the source code. The Github repository is located here: https://github.com/smack0007/GLDotNet

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/blog/page12.html b/blog/page12.html index c2143c6..ac5b246 100644 --- a/blog/page12.html +++ b/blog/page12.html @@ -1,4 +1,7 @@ -The Blog of Zachary Snow

    HTTP Status Codes as Telephone Calls

    December 18, 2012http

    I had a funny idea to describe HTTP Status Codes as telephone conversations so I thought I'd write it in a blog post.

    +The Blog of Zachary Snow

    Introducing GLDotNet

    Today I released a project I've been playing around with for a year or so on Codeplex. It's called GLDotNet. From the project description:

    +

    C# wrapper for OpenGL. Partially generated from the OpenGL spec and partially written by hand, the aim is to have a flexible and native feeling C# binding.

    +

    I have generated functions from the OpenGL spec excluding 1 or 2 but unfortunately of the generated code is untested. There is a demo project included in the source code. The Github repository is located here: https://github.com/smack0007/GLDotNet

    +

    HTTP Status Codes as Telephone Calls

    December 18, 2012http

    I had a funny idea to describe HTTP Status Codes as telephone conversations so I thought I'd write it in a blog post.

    301
    She's not here right now but she'll be back later.
    @@ -40,8 +43,4 @@

    Source

    ID3DXEffect::OnLostDevice()

    I fixed a bug yesterday in Snowball related to a lost graphics device. I noticed that when I would use CTRL + ALT + DELETE, my apps were crashing. Turned out it was due to not recovering properly from a lost device.

    The root of the problem was that I needed to call the ID3DXEffect::OnLostDevice() method when the device was being lost. This allows the effect to recover from the lost device. I've made the Effect class in Snowball now do this automatically.

    -

    Snowball - Now based on shaders

    I've now merged the "Shaders" branch back into the "master" branch. All rendering is now based on shaders and no longer on the fixed function pipeline.

    -

    The function of the Renderer class was essentially been reduced to pushing data to the GPU and therefore I decided to rename the class to GraphicsBatch. The Begin() overload which would allow you to specify RendererSettings has been removed and been replaced with an overload which allows you to specify an Effect file to use. Also, the DrawLine() method has been removed, although vertical and horizontal lines can still be drawn using the DrawFilledRectangle() method. Better line drawing should be possible through shaders and I hope to eventually make a sample which provides an example.

    -

    I've added a sample (pictured above) which demonstrates using a custom shader. By default, GraphicsBatch uses a BasicEffect class which is basically the old way of rendering implemented in a shader.

    -

    In order for shaders to work properly when using GraphicsBatch, the GraphicsBatch class must pass a few parameters to the shader. At the moment, this only includes a transform matrix but may include more parameters in the future. The GraphicsBatchEffectWrapper can be used to wrap custom effects which you write in order to work with GraphicsBatch correctly. GraphicsBatchEffectWrapper will pass the parameters to your shader by following a standard naming convention. For example, the transform matrix is passed to your shader through a parameter named "TransformMatrix". You can also write you own class which implements IGraphicsBatchEffect. See the sample for an example of using the wrapper class.

    \ No newline at end of file diff --git a/blog/page13.html b/blog/page13.html index eb76523..e0c3b07 100644 --- a/blog/page13.html +++ b/blog/page13.html @@ -1,4 +1,8 @@ -The Blog of Zachary Snow

    Snowball - Shaders in progress

    June 22, 2012.netopen-source

    It's been a long couple of months. I'm in the middle of switching jobs, been on vacation a bit, and have been playing around with OpenGL a bit to get a feel for how that API works compared to Direct3D. As of yesterday I started working on implementing shaders in Snowball.

    +The Blog of Zachary Snow

    Snowball - Now based on shaders

    I've now merged the "Shaders" branch back into the "master" branch. All rendering is now based on shaders and no longer on the fixed function pipeline.

    +

    The function of the Renderer class was essentially been reduced to pushing data to the GPU and therefore I decided to rename the class to GraphicsBatch. The Begin() overload which would allow you to specify RendererSettings has been removed and been replaced with an overload which allows you to specify an Effect file to use. Also, the DrawLine() method has been removed, although vertical and horizontal lines can still be drawn using the DrawFilledRectangle() method. Better line drawing should be possible through shaders and I hope to eventually make a sample which provides an example.

    +

    I've added a sample (pictured above) which demonstrates using a custom shader. By default, GraphicsBatch uses a BasicEffect class which is basically the old way of rendering implemented in a shader.

    +

    In order for shaders to work properly when using GraphicsBatch, the GraphicsBatch class must pass a few parameters to the shader. At the moment, this only includes a transform matrix but may include more parameters in the future. The GraphicsBatchEffectWrapper can be used to wrap custom effects which you write in order to work with GraphicsBatch correctly. GraphicsBatchEffectWrapper will pass the parameters to your shader by following a standard naming convention. For example, the transform matrix is passed to your shader through a parameter named "TransformMatrix". You can also write you own class which implements IGraphicsBatchEffect. See the sample for an example of using the wrapper class.

    +

    Snowball - Shaders in progress

    June 22, 2012.netopen-source

    It's been a long couple of months. I'm in the middle of switching jobs, been on vacation a bit, and have been playing around with OpenGL a bit to get a feel for how that API works compared to Direct3D. As of yesterday I started working on implementing shaders in Snowball.

    In order to implement shaders or Effect(s), there may have to be a few changes to the API / interface of the Renderer class. Nothing significant I don't think but mainly changes to the Begin() method overloads. Today I pushed the branch which contains my initial implementation.

    Snowball now using SharpDX

    For a little while, I was thinking about giving up on Snowball. When you're one guy working on a project that gets to a certain size, it can start to feel a little daunting. You find a bug, and you feel like you need to fix it asap. I don't know if anyone reading this has actually tried Snowball, but if you have, please comment to let me know. It would encourage me.

    I decided to switch Snowball over to SharpDX. It's not that I was unhappy with SlimDX, it just seems like there is a lot more innovation happening on the SharpDX side. I also like the fact that I can include the DLLs in the repository so end users don't have to download another dependency in order to compile it. The Win8 stuff is also quite interesting, although the SlimDX guys say they are working on that.

    @@ -7,16 +11,4 @@

    In order to create some kind of documentation on how to use Snowball, I created a Samples folder in the source. In the Samples folder is a WalkingWizard sample. I'm posting this source code here but it can also be viewed on GitHub here.

    WinQuakeCon

    I've always wanted a program that would allow me have a command line that I could slide in and out of view as needed like the console from Quake. I never could find one and so I finally got decided to write a tool myself. A picture is below and the source code is on GitHub.

    I'm not putting a download here as I don't consider this finished just yet.

    -

    What is Snowball and what do I want to do with it?

    I originally got the idea for Snowball after working with the Xna Framework. The Xna Framework is a good piece of software for what it is but there are some things about which I just do not agree with:

    -
      -
    • The content pipeline only works with content in the serialized .xnb format.
    • -
    • There are certain content types which can only be loaded via the content pipeline.
    • -
    • Certain features don't exist on the PC because they don't exist on the XBox or Windows Phone 7.
    • -
    - -

    Xna was designed as an abstraction layer for all the 3 platforms mentioned in the last point, so that one is somewhat understandable. I don't want to write games for my XBox right now though, so why should things like drawing lines not be available to me?

    -

    With these points in mind I started working on Snowball. It's designed to be an Xna like framework for making 2D games. It uses SlimDX on the backend, but that is completely abstracted away from consumers of the framework. What I want to do is design the API so that the backend can be swapped out somewhat painlessly.

    -

    I still have a ways to go before I will consider it a version 1.0 release. As of this writing, I'm transitioning to more of a ContentLoader class style for loading your game's content. Any resource type from within the framework can be loaded by hand if you want, the ContentLoader class will just make it easier. After that I have a few other features like GamePad and Music which I would like to implement before saying I have a Beta type release.

    -

    The future after that is up in the air. I would love to try and have different implementations of the API for Xna and/or OpenTK.

    -

    I recommend for anyone who is interested as to why an API designer choose to implement the API in the way they did to try it for themselves. I have learned many things from this project including why certain design decisions were made by the Xna Framework team.

    \ No newline at end of file diff --git a/blog/page14.html b/blog/page14.html index 6b9aa18..e780e9e 100644 --- a/blog/page14.html +++ b/blog/page14.html @@ -1,4 +1,16 @@ -The Blog of Zachary Snow

    WMI - Converting datetime values to DateTime objects

    July 12, 2011.netwmi

    Just a quick post to hopefully save anyone who finds this some time. If you need to convert a datetime value from a WMI query to a native DateTime object in C#, you can use the method ToDateTime() on the ManagementDateTimeConverter class.

    +The Blog of Zachary Snow

    What is Snowball and what do I want to do with it?

    I originally got the idea for Snowball after working with the Xna Framework. The Xna Framework is a good piece of software for what it is but there are some things about which I just do not agree with:

    +
      +
    • The content pipeline only works with content in the serialized .xnb format.
    • +
    • There are certain content types which can only be loaded via the content pipeline.
    • +
    • Certain features don't exist on the PC because they don't exist on the XBox or Windows Phone 7.
    • +
    + +

    Xna was designed as an abstraction layer for all the 3 platforms mentioned in the last point, so that one is somewhat understandable. I don't want to write games for my XBox right now though, so why should things like drawing lines not be available to me?

    +

    With these points in mind I started working on Snowball. It's designed to be an Xna like framework for making 2D games. It uses SlimDX on the backend, but that is completely abstracted away from consumers of the framework. What I want to do is design the API so that the backend can be swapped out somewhat painlessly.

    +

    I still have a ways to go before I will consider it a version 1.0 release. As of this writing, I'm transitioning to more of a ContentLoader class style for loading your game's content. Any resource type from within the framework can be loaded by hand if you want, the ContentLoader class will just make it easier. After that I have a few other features like GamePad and Music which I would like to implement before saying I have a Beta type release.

    +

    The future after that is up in the air. I would love to try and have different implementations of the API for Xna and/or OpenTK.

    +

    I recommend for anyone who is interested as to why an API designer choose to implement the API in the way they did to try it for themselves. I have learned many things from this project including why certain design decisions were made by the Xna Framework team.

    +

    WMI - Converting datetime values to DateTime objects

    July 12, 2011.netwmi

    Just a quick post to hopefully save anyone who finds this some time. If you need to convert a datetime value from a WMI query to a native DateTime object in C#, you can use the method ToDateTime() on the ManagementDateTimeConverter class.

    ManagementDateTimeConverter.ToDateTime(dmtfDate);
     

    Snowball: A Slightly Different Direction

    July 2, 2011.netcodeplex

    At first, I had imagined Snowball, now located on Codeplex, to be a framework which would define how your game objects look. I.E. I had a class called GameEntity which I imagined would handle a lot of boiler plate code for you such as setting up Initialize(), Update(), Draw(), etc.

    @@ -9,5 +21,4 @@

    Switching from Git to Mercurial

    June 3, 2011gitmercurial

    I've decided to make the switch from using git to Mercurial. Git's syntax to me is much more complicated than it needs to be and Mercurial seems to be more my style. I find it's much easier to find out how to do things with Mercurial and to be honest, I use about 10% of the functionality in either git or Mercurial.

    This also means I'll be transitioning Snowball to Codeplex I think. I'll be moving it away from GitHub for sure just not 100% sure where.

    -

    Marker Interfaces

    May 24, 2011design-patterns

    In Snowball I was debating adding an empty interface to identify certain classes in my framework as components. I wasn't sure if this was code smell or not so I did some searching on Stackoverflow and found out this concept is actually called "Marker Interfaces". Learn something new every day.

    \ No newline at end of file diff --git a/blog/page15.html b/blog/page15.html index 5ff62c7..10f7669 100644 --- a/blog/page15.html +++ b/blog/page15.html @@ -1,4 +1,5 @@ -The Blog of Zachary Snow

    ComponentGlue on GitHub

    I moved the ComponentGlue repository to GitHub. I updated the example slightly and cleaned up some of the source code a little. Need to build a full blown app with it eventually.

    +The Blog of Zachary Snow

    Marker Interfaces

    May 24, 2011design-patterns

    In Snowball I was debating adding an empty interface to identify certain classes in my framework as components. I wasn't sure if this was code smell or not so I did some searching on Stackoverflow and found out this concept is actually called "Marker Interfaces". Learn something new every day.

    +

    ComponentGlue on GitHub

    I moved the ComponentGlue repository to GitHub. I updated the example slightly and cleaned up some of the source code a little. Need to build a full blown app with it eventually.

    Snowball and GitHub

    April 12, 2011.netgithubsnowball

    I started writing a 2D Game Engine on GitHub. I call it Snowball because I'm original like that.

    Using git-gui with Cygwin on Windows 7

    April 7, 2011cygwingitwindows-7

    I've started using git via cygwin and was running into trouble trying to pin it to my taskbar in Windows 7.

    First I created a .bat file in the c:\cygwin folder which launches the app standalone:

    @@ -92,4 +93,4 @@ } } -

    OpenTK - Simple Movable Sprite

    March 29, 2011.netopengl

    I wrote my second OpenTK app. This time I'm drawing a sprite which you can move around the screen using the keyboard. I've included the source code after the jump or you can download it.

    Continue reading "OpenTK - Simple Movable Sprite"
    \ No newline at end of file +
    \ No newline at end of file diff --git a/blog/page16.html b/blog/page16.html index b8b0eb6..4cde6a7 100644 --- a/blog/page16.html +++ b/blog/page16.html @@ -1,4 +1,4 @@ -The Blog of Zachary Snow

    Getting started with OpenTK

    March 29, 2011.netopengl

    I started experimenting with OpenTK and I had to look in a few places to put this code together, so I'm posting it here for anyone who might be looking for an easy getting started lesson.

    +The Blog of Zachary Snow

    OpenTK - Simple Movable Sprite

    March 29, 2011.netopengl

    I wrote my second OpenTK app. This time I'm drawing a sprite which you can move around the screen using the keyboard. I've included the source code after the jump or you can download it.

    Continue reading "OpenTK - Simple Movable Sprite"

    Getting started with OpenTK

    March 29, 2011.netopengl

    I started experimenting with OpenTK and I had to look in a few places to put this code together, so I'm posting it here for anyone who might be looking for an easy getting started lesson.

    I've set up a window similar to what I've been used to in Xna (CornflowerBlue 4 life). I've also set up a 2D projection matrix and drawn a triangle in a 2D fashion. You'll need to add a reference to the OpenTK assembly for your project in Visual Studio.

    using System;
     using System.Drawing;
    @@ -110,8 +110,4 @@
     

    Now we can compose many car types, with any combination of colors and engines and we've only defined one class.

    Component Glue

    The other day I started an open source project for an IoC Container I call Component Glue. It's in a toy / learning tool status right now and I don't know how far I actually want to take the project. More to come though.

    Component Glue on Codeplex

    -

    Visual Studio - Move referenced DLL to different directory after Build

    July 20, 2010.netmsbuild

    If you need to move a referenced DLL to a different directory after build, add these commands to the "Post Build event command line" box in the "Build Events" tab of the project properties:

    -
    mkdir $(TargetDir)dir
    -move $(TargetDir)myDLL.dll $(TargetDir)dir\myDLL.dll
    -
    \ No newline at end of file diff --git a/blog/page17.html b/blog/page17.html index 9965bf0..d65d3ec 100644 --- a/blog/page17.html +++ b/blog/page17.html @@ -1,4 +1,8 @@ -The Blog of Zachary Snow

    Xna: Load Texture2D from Embedded Resource

    If you're writing an app which uses Xna, you may need to load a texture from an embedded resource. Here's how:

    +The Blog of Zachary Snow

    Visual Studio - Move referenced DLL to different directory after Build

    July 20, 2010.netmsbuild

    If you need to move a referenced DLL to a different directory after build, add these commands to the "Post Build event command line" box in the "Build Events" tab of the project properties:

    +
    mkdir $(TargetDir)dir
    +move $(TargetDir)myDLL.dll $(TargetDir)dir\myDLL.dll
    +
    +

    Xna: Load Texture2D from Embedded Resource

    If you're writing an app which uses Xna, you may need to load a texture from an embedded resource. Here's how:

    First embed the resource in your app. Do so by choosing Embedded Resource as the Build Action in the properties of the resource.

    After that you can load the Texture2D using a stream handle to the embedded file.

    Stream stream = Assembly.GetCallingAssembly().GetManifestResourceStream("AppNamespace.Folder.font.bmp");
    @@ -30,9 +34,4 @@
     if(TaskbarManager.IsPlatformSupported)
         TaskbarManager.Instance.SetProgressValue((int)this.totalTime.TotalSeconds - (int)this.time.TotalSeconds, (int)this.totalTime.TotalSeconds, this.Handle);
     
    -

    WinForms and MVC

    May 26, 2010.netmvcwinforms

    I recently became interested in doing MVC inside of a Windows Forms app. I found a few MVC frameworks which work with WinForms (see here) but they didn't really interest me. Too heavy I felt for what I was looking to do. I ended up with a solution looking something like this:

    -

    There is really only one controller and that is the "Application" class. It contains all the methods your app can call to manipulate your models, which are in the "Data" folder / namespace. The "WinFormsApplication" class inherits from the "Application" class and just sets the view to an instance of "WinFormsView". The "Application" class communicates with the view through the "IView" interface. The "WinFormsView" class is a Windows Forms implementation of that view. The "Application" class and your models are not coupled in any way to your Windows Forms implementation of the view.

    -

    If you want you view to be as dumb as possible, your view can communicate with the "Application" class only through events. In my case though, I choose to go with a smart view and have the view call back to methods in the "Application" class. The "Application" class tells the view when models are loaded and unloaded. The view subscribes to events on the models and reacts to the events.

    -

    All of my forms and controls communicate with each other through the "WinFormsView" class. One control might change the value of a property in the "WinFormsView" class and another control might subscribe to a change event and update as necessary. This keeps the controls and forms slightly less coupled.

    -

    It's not a perfect implementation of MVC but it keeps my model logic decoupled enough from my view logic that I can later implement a WPF version of the view I think.

    \ No newline at end of file diff --git a/blog/page18.html b/blog/page18.html index d7c1cb1..649088d 100644 --- a/blog/page18.html +++ b/blog/page18.html @@ -1,4 +1,9 @@ -The Blog of Zachary Snow

    Drawing Rectangles with SpriteBatch

    Just a quick code snippet which adds an extension method for drawing Rectangles to SpriteBatch:

    +The Blog of Zachary Snow

    WinForms and MVC

    May 26, 2010.netmvcwinforms

    I recently became interested in doing MVC inside of a Windows Forms app. I found a few MVC frameworks which work with WinForms (see here) but they didn't really interest me. Too heavy I felt for what I was looking to do. I ended up with a solution looking something like this:

    +

    There is really only one controller and that is the "Application" class. It contains all the methods your app can call to manipulate your models, which are in the "Data" folder / namespace. The "WinFormsApplication" class inherits from the "Application" class and just sets the view to an instance of "WinFormsView". The "Application" class communicates with the view through the "IView" interface. The "WinFormsView" class is a Windows Forms implementation of that view. The "Application" class and your models are not coupled in any way to your Windows Forms implementation of the view.

    +

    If you want you view to be as dumb as possible, your view can communicate with the "Application" class only through events. In my case though, I choose to go with a smart view and have the view call back to methods in the "Application" class. The "Application" class tells the view when models are loaded and unloaded. The view subscribes to events on the models and reacts to the events.

    +

    All of my forms and controls communicate with each other through the "WinFormsView" class. One control might change the value of a property in the "WinFormsView" class and another control might subscribe to a change event and update as necessary. This keeps the controls and forms slightly less coupled.

    +

    It's not a perfect implementation of MVC but it keeps my model logic decoupled enough from my view logic that I can later implement a WPF version of the view I think.

    +

    Drawing Rectangles with SpriteBatch

    Just a quick code snippet which adds an extension method for drawing Rectangles to SpriteBatch:

    public static class SpriteBatchHelper
     {
         static Texture2D pixel;
    @@ -74,27 +79,4 @@
         </PropertyGroup>
     

    Save the file and open your project back up. Your project's output should now target only x86.

    -

    Calculating an angle from a Vector2

    February 28, 2009.netvectorsxna

    When you need to calculate an angle from a Vector2 structure, you can use this piece of code:

    -
    public static class Vector2Helper
    -{
    -    public static float CalculateAngle(Vector2 v)
    -    {
    -        float angle = 0.0f;
    -
    -        if(v != Vector2.Zero)
    -        {
    -            v.Normalize();
    -
    -            angle = (float)Math.Acos(v.Y);
    -
    -            if(v.X &lt; 0.0f)
    -            angle = -angle;
    -        }
    -
    -        return angle;
    -    }
    -}
    -
    -

    I used this to calculate an angle from the Vector2 of the Left Stick.

    -

    The original credit for this source code comes from here.

    \ No newline at end of file diff --git a/blog/page19.html b/blog/page19.html index 41c8217..c8b5927 100644 --- a/blog/page19.html +++ b/blog/page19.html @@ -1,4 +1,27 @@ -The Blog of Zachary Snow

    The Game Show Host Problem, aka The Monty Hall Problem

    February 12, 2009random

    NOTE: This is a repost from my old blog.

    +The Blog of Zachary Snow

    Calculating an angle from a Vector2

    February 28, 2009.netvectorsxna

    When you need to calculate an angle from a Vector2 structure, you can use this piece of code:

    +
    public static class Vector2Helper
    +{
    +    public static float CalculateAngle(Vector2 v)
    +    {
    +        float angle = 0.0f;
    +
    +        if(v != Vector2.Zero)
    +        {
    +            v.Normalize();
    +
    +            angle = (float)Math.Acos(v.Y);
    +
    +            if(v.X &lt; 0.0f)
    +            angle = -angle;
    +        }
    +
    +        return angle;
    +    }
    +}
    +
    +

    I used this to calculate an angle from the Vector2 of the Left Stick.

    +

    The original credit for this source code comes from here.

    +

    The Game Show Host Problem, aka The Monty Hall Problem

    February 12, 2009random

    NOTE: This is a repost from my old blog.

    So, me and my girlfriend went to see 21 last night and in the movie they make mention of The Game Show Host problem, aka The Monty Hall Problem.

    The jist of the problem is this: You are on a game show. The host presents you with 3 doors, 1 of which has a car behind it, the other 2 have goats. The game show host tells you to pick a door. You do so, at which point the game show host opens up a door to show you a goat behind the door and then asks you if you would like to switch your choice to the other closed door. The question is then, should you switch your choice?

    The correct answer is yes. More on why after the jump.

    Continue reading "The Game Show Host Problem, aka The Monty Hall Problem"

    Drawing 2D Lines as Rotated Quads

    February 7, 2009.net

    I haven't had much time lately with work but one question I've seen asked many many times is how to draw lines of different widths. So, to cut to the chase I'll share the code I've used to do it.

    @@ -207,5 +230,4 @@

    Which loads a spritesheet with sprites of size 64x64. It then draws the first Sprite in the SpriteSheet. You of course wouldn't want to load the spritesheet every frame as well.

    Feel free to use this code without restriction.

    Edit: I copied and pasted the second piece of code from somewhere else so I fixed two typos.

    -

    Colors and Hex

    December 21, 2008.netxna

    I recently needed to write out Color(s) as an xml attribute. I wrote 2 methods to read and write the Color(s) as Hex strings. Here ya go:

    Continue reading "Colors and Hex"

    Zend_Db_Table as a Model

    June 20, 2008php

    In the Zend Framework, using Zend_Db_Table as your model class is not well advised. This practice can force you to put business logic in other places besides your model class. This may not be a big deal if your logic is simple but imagine the logic is fairly complicated. Now also imagine that the logic changes at some point. This can be a problem if you have this logic written in many different places.

    -

    There's a solution to this problem though. You could write a Model class that uses Zend_Db_Table as a storage medium. Or, you can extend Zend_Db_Table to add your logic to the class. There is a way to simplify this process and that's what this blog post is about.

    Continue reading "Zend_Db_Table as a Model"
    \ No newline at end of file +

    Colors and Hex

    December 21, 2008.netxna

    I recently needed to write out Color(s) as an xml attribute. I wrote 2 methods to read and write the Color(s) as Hex strings. Here ya go:

    Continue reading "Colors and Hex"
    \ No newline at end of file diff --git a/blog/page2.html b/blog/page2.html index 9da055f..ab8367a 100644 --- a/blog/page2.html +++ b/blog/page2.html @@ -1,4 +1,6 @@ -The Blog of Zachary Snow

    deno: Get the path of the current script in

    In deno obtaining the path of the current script is done via the +The Blog of Zachary Snow

    Now powered by deno

    December 23, 2022deno

    I finally sat down and got my blog compiling with deno. Now that there +is official npm support I didn't need to completely rewrite the compiler which was what was +stopping me before.

    Continue reading "Now powered by deno"

    deno: Get the path of the current script in

    In deno obtaining the path of the current script is done via the import.meta.url api:

    const scriptPath = new URL(import.meta.url).pathname;
     
    @@ -32,6 +34,4 @@

    Practical WebAssembly

    December 17, 2021javascriptwasmconciso

    I wrote an article for my company conciso that attempts to show a practical usage of WebAssembly: https://conciso.de/practical-webassembly/.

    -

    Use bash.exe to run bash scripts in Windows

    September 1, 2021windowswslbash

    If you have the Windows Subsystem for Linux (WSL) installed then you can use wsl.exe to start -any linux distribution you have installed from the command prompt. What I recently learned about -though is that there is a bash.exe as well which can be used to execute a bash script directly.

    Continue reading "Use bash.exe to run bash scripts in Windows"
    \ No newline at end of file +
    \ No newline at end of file diff --git a/blog/page20.html b/blog/page20.html new file mode 100644 index 0000000..8191adc --- /dev/null +++ b/blog/page20.html @@ -0,0 +1,2 @@ +The Blog of Zachary Snow

    Zend_Db_Table as a Model

    June 20, 2008php

    In the Zend Framework, using Zend_Db_Table as your model class is not well advised. This practice can force you to put business logic in other places besides your model class. This may not be a big deal if your logic is simple but imagine the logic is fairly complicated. Now also imagine that the logic changes at some point. This can be a problem if you have this logic written in many different places.

    +

    There's a solution to this problem though. You could write a Model class that uses Zend_Db_Table as a storage medium. Or, you can extend Zend_Db_Table to add your logic to the class. There is a way to simplify this process and that's what this blog post is about.

    Continue reading "Zend_Db_Table as a Model"
    \ No newline at end of file diff --git a/blog/page3.html b/blog/page3.html index 63ddfd0..7a006c4 100644 --- a/blog/page3.html +++ b/blog/page3.html @@ -1,4 +1,6 @@ -The Blog of Zachary Snow

    Powered by TypeScript

    June 4, 2021typescript

    Over the past couple of years my career has moved more and more torwards me becoming +The Blog of Zachary Snow

    Use bash.exe to run bash scripts in Windows

    September 1, 2021windowswslbash

    If you have the Windows Subsystem for Linux (WSL) installed then you can use wsl.exe to start +any linux distribution you have installed from the command prompt. What I recently learned about +though is that there is a bash.exe as well which can be used to execute a bash script directly.

    Continue reading "Use bash.exe to run bash scripts in Windows"

    Powered by TypeScript

    June 4, 2021typescript

    Over the past couple of years my career has moved more and more torwards me becoming a frontend developer. Since 2018 I've basically been a TypeScript programmer professionally and the language has really grown on me. Over the last couple of days I've had some down time so I decided now was the time to reprogram the blog in TypeScript.

    @@ -10,5 +12,4 @@
    function fork { wt -w 0 -d "$(Get-Location)" }
     

    Convert TypeScript AST to JSON

    January 13, 2021nodetypescript

    I needed to convert a TypeScript AST (Abstract Syntax Tree) to json so that I can consume it in -a C# application so I wrote a tiny node script to convert the AST to json.

    Continue reading "Convert TypeScript AST to JSON"

    Starting Redis and the Redis CLI with Docker

    January 8, 2021dockerredis

    If you'd like to get a Redis instance up and running to play with it's fairly easy via Docker.

    Continue reading "Starting Redis and the Redis CLI with Docker"

    NativeLibraryLoader for Assembly with ModuleInitializer

    December 18, 2020c#c#9

    In C# 9 the ModuleInitializer -atrribute was introduced which makes it easy to implement loading of native assemblies in your library.

    Continue reading "NativeLibraryLoader for Assembly with ModuleInitializer"
    \ No newline at end of file +a C# application so I wrote a tiny node script to convert the AST to json.

    Continue reading "Convert TypeScript AST to JSON"

    Starting Redis and the Redis CLI with Docker

    January 8, 2021dockerredis

    If you'd like to get a Redis instance up and running to play with it's fairly easy via Docker.

    Continue reading "Starting Redis and the Redis CLI with Docker"
    \ No newline at end of file diff --git a/blog/page4.html b/blog/page4.html index 34020ed..fbbc61b 100644 --- a/blog/page4.html +++ b/blog/page4.html @@ -1,8 +1,9 @@ -The Blog of Zachary Snow

    GitHub Actions

    December 6, 2020github

    My blog is now being generated via GitHub actions in ubuntu-latest. This allows me to rebuild my +The Blog of Zachary Snow

    NativeLibraryLoader for Assembly with ModuleInitializer

    December 18, 2020c#c#9

    In C# 9 the ModuleInitializer +atrribute was introduced which makes it easy to implement loading of native assemblies in your library.

    Continue reading "NativeLibraryLoader for Assembly with ModuleInitializer"

    GitHub Actions

    December 6, 2020github

    My blog is now being generated via GitHub actions in ubuntu-latest. This allows me to rebuild my blog everytime there is a pushed commit.

    Continue reading "GitHub Actions"

    Use nginx in docker to serve static files

    December 1, 2020dockernginx

    Not sure how practical this really is but I thought it was neat. Run nginx and tell it to serve some static content on your system.

    Continue reading "Use nginx in docker to serve static files"

    Add the current time to your command prompt

    November 26, 2020cmd

    I am someone who never made the jump to Powershell and to this day still use my cmd shell with pride. My cmd is very personalized at this point and is available on GitHub though I'm not sure how useful it is for anyone but me. I use git and GitHub to synchronize my cmd between my different machines.

    Continue reading "Add the current time to your command prompt"

    Execute different commands in MSBuild depending on platform

    November 20, 2020msbuild

    Another quick snippet that shows how to change what command will be executed in MSBuild -based on the OS the script is running on.

    Continue reading "Execute different commands in MSBuild depending on platform"

    Filter ItemGroup by extension in MSBuild

    November 4, 2020msbuild

    Just a quick snippet that shows how to filter an exiting ItemGroup by an extension.

    Continue reading "Filter ItemGroup by extension in MSBuild"
    \ No newline at end of file +based on the OS the script is running on.

    Continue reading "Execute different commands in MSBuild depending on platform"
    \ No newline at end of file diff --git a/blog/page5.html b/blog/page5.html index 8973c86..c0a9ea9 100644 --- a/blog/page5.html +++ b/blog/page5.html @@ -1,4 +1,4 @@ -The Blog of Zachary Snow

    Use Newtonsoft.Json in .NET Core 3 Web Api

    October 22, 2020.net.netcoreasp.net

    This post is mostly just distilling information I got from +The Blog of Zachary Snow

    Filter ItemGroup by extension in MSBuild

    November 4, 2020msbuild

    Just a quick snippet that shows how to filter an exiting ItemGroup by an extension.

    Continue reading "Filter ItemGroup by extension in MSBuild"

    Use Newtonsoft.Json in .NET Core 3 Web Api

    October 22, 2020.net.netcoreasp.net

    This post is mostly just distilling information I got from .NET Core Tutorials to revert back to Newtonsoft.Json in asp.net core WebApi.

    Continue reading "Use Newtonsoft.Json in .NET Core 3 Web Api"

    Node script for syntax highlighting

    I decided to switch my blog to use highlightjs instead of the mixture of my own library and ColorCode. I still wanted everything to rendered statically @@ -7,10 +7,4 @@ is available for Visual Studio working on Angular projects from inside Visual Studio is a viable option. The linked blog post mentions a couple of ways of adding the Angular project to Visual Studio but I felt the suggestions left something to be desired here is what I came up with.

    Continue reading "Angular in Visual Studio"

    Creating a asp.net web app with an Angular frontend

    WebShell

    We're going to create a what I call a "WebShell" application with asp.net core on the backend and Angular on the -frontend.

    Continue reading "Creating a asp.net web app with an Angular frontend"

    Predictable Random Number Generation in TypeScript

    Lehmer

    August 25, 2020typescriptrng

    I got the idea for using this type of RNG from the javidx9 video -Procedural Generation: Programming The Universe. -It's a really good video as are most of the videos he produces so -I recommend you give it a watch. The algorithm he talks about in -the video is the Lehmer random number generator.

    -

    I'm implementing a simple match the blocks game in TypeScript and I wanted to implement the algorithm -mentioned there in TypeScript.

    Continue reading "Predictable Random Number Generation in TypeScript"
    \ No newline at end of file +frontend.

    Continue reading "Creating a asp.net web app with an Angular frontend"
    \ No newline at end of file diff --git a/blog/page6.html b/blog/page6.html index 7b27a75..be31d17 100644 --- a/blog/page6.html +++ b/blog/page6.html @@ -1,4 +1,10 @@ -The Blog of Zachary Snow

    Creating a tsexec command

    August 21, 2020typscriptbatch

    I want to use TypeScript as a scripting language for my machine and +The Blog of Zachary Snow

    Predictable Random Number Generation in TypeScript

    Lehmer

    August 25, 2020typescriptrng

    I got the idea for using this type of RNG from the javidx9 video +Procedural Generation: Programming The Universe. +It's a really good video as are most of the videos he produces so +I recommend you give it a watch. The algorithm he talks about in +the video is the Lehmer random number generator.

    +

    I'm implementing a simple match the blocks game in TypeScript and I wanted to implement the algorithm +mentioned there in TypeScript.

    Continue reading "Predictable Random Number Generation in TypeScript"

    Creating a tsexec command

    August 21, 2020typscriptbatch

    I want to use TypeScript as a scripting language for my machine and so I want to be able just to execute TypeScript files directly. There are npm packages like ts-node that do this already but I wanted to have a crack at implementing it @@ -24,14 +30,4 @@ POPD

    Enum Extension Methods

    Did you know you can create extension methods for enums?

    Continue reading "Enum Extension Methods"

    Disable C# null checks for a field or property

    January 2, 2020.netc#nrtnullable

    The new nullable reference types in C# are great but sometimes you might need to disable it for a -single field or property. You can do that by assigning the value to null and using the ! operator.

    Continue reading "Disable C# null checks for a field or property"

    Use nameof() to set a string variable to its name

    December 17, 2019.netc#

    This is one of those things that should have just been obvious to me -but once I saw it I wondered why I had never thought to use it myself. -nameof() can be used when declaring a variable to set the value of the -variable to the name of the variable:

    -
    public const string MyVariable1 = nameof(MyVariable1);
    -
    -public static void Main()
    -{
    -    Console.WriteLine(MyVariable1);
    -}
    -
    Continue reading "Use nameof() to set a string variable to its name"
    \ No newline at end of file +single field or property. You can do that by assigning the value to null and using the ! operator.

    Continue reading "Disable C# null checks for a field or property"
    \ No newline at end of file diff --git a/blog/page7.html b/blog/page7.html index d820540..5c6ccd5 100644 --- a/blog/page7.html +++ b/blog/page7.html @@ -1,4 +1,14 @@ -The Blog of Zachary Snow

    Dynamically loaded DLL thows AccessViolationException on first function call

    October 22, 2019.netc#

    In my library GLESDotNet I load +The Blog of Zachary Snow

    Use nameof() to set a string variable to its name

    December 17, 2019.netc#

    This is one of those things that should have just been obvious to me +but once I saw it I wondered why I had never thought to use it myself. +nameof() can be used when declaring a variable to set the value of the +variable to the name of the variable:

    +
    public const string MyVariable1 = nameof(MyVariable1);
    +
    +public static void Main()
    +{
    +    Console.WriteLine(MyVariable1);
    +}
    +
    Continue reading "Use nameof() to set a string variable to its name"

    Dynamically loaded DLL thows AccessViolationException on first function call

    October 22, 2019.netc#

    In my library GLESDotNet I load the libegl.dll and libglesv2.dll DLLs dynamically via the Win32 functions LoadLibrary and GetProcAddress. @@ -25,15 +35,4 @@ be one of 3 possibilities: '?' for null, '0' for false or '1' for true. The problem sounded easy enough to generate a whole bunch of unit tests for.

    Continue reading "Generating string permutations for unit testing"

    Functional Card Deck in C#

    October 11, 2018c#fp

    I've been inspired lately by Mark Seemann's series of posts about Applicative Functors. One of the latest posts is an example about creating a full deck of cards. Most of posts up to this -point have contained a C# example but for some reason this one didn't. This inspired me to take a shot at it.

    Continue reading "Functional Card Deck in C#"

    Enabling the latest version of C#

    June 21, 2018c#msbuild

    As of this writing when creating a new console project via dotnet new console the version of C# used in the project -is version 7.0. This means you're missing out cool features like Default Literal Expressions. The language version -can be changed via Visual Studio though I prefer to enable it via MSBuild. This can be done in the csproj file -or globally via a Build.Directory.props file. Changing the C# language version is done via a property known as LangVersion.

    -
    <PropertyGroup>
    -    <LangVersion>latest</LangVersion>
    -</PropertyGroup>
    -
    -

    This property can set to any of the values listed here. As of -this writing VS Code doesn't seem to like it when you use 7.3 instead of latest. VS Code will show errors in your code -although the code will compile without any problems.

    -
    \ No newline at end of file +point have contained a C# example but for some reason this one didn't. This inspired me to take a shot at it.

    Continue reading "Functional Card Deck in C#"
    \ No newline at end of file diff --git a/blog/page8.html b/blog/page8.html index 472c684..fbe18df 100644 --- a/blog/page8.html +++ b/blog/page8.html @@ -1,4 +1,15 @@ -The Blog of Zachary Snow

    A neat way to curry in C#

    May 25, 2018c#fp

    I was reading an older blogpost from Mike Hadlow about +The Blog of Zachary Snow

    Enabling the latest version of C#

    June 21, 2018c#msbuild

    As of this writing when creating a new console project via dotnet new console the version of C# used in the project +is version 7.0. This means you're missing out cool features like Default Literal Expressions. The language version +can be changed via Visual Studio though I prefer to enable it via MSBuild. This can be done in the csproj file +or globally via a Build.Directory.props file. Changing the C# language version is done via a property known as LangVersion.

    +
    <PropertyGroup>
    +    <LangVersion>latest</LangVersion>
    +</PropertyGroup>
    +
    +

    This property can set to any of the values listed here. As of +this writing VS Code doesn't seem to like it when you use 7.3 instead of latest. VS Code will show errors in your code +although the code will compile without any problems.

    +

    A neat way to curry in C#

    May 25, 2018c#fp

    I was reading an older blogpost from Mike Hadlow about Partial Application in C# in which he discusses how Partial Application can be implemented in C# via Currying. Although I appreciate his example of implementing currying via extsion @@ -43,20 +54,4 @@

    Run a program directly after building in VS Code

    Whenever I have a program that is just a generator of some kind I like to have that program execute directly after having built the program successfully. I'm going to show how to run the program via the dotnet cli but this trick can easily be applied to regular -.NET programs or any program which is built using MSBuild.

    Continue reading "Run a program directly after building in VS Code"

    Merging Build.Directory.props

    April 4, 2018msbuild.net

    MSBuild version 15 introduced the concept of "Directory.Build.props" files. From the docs:

    -
      -
    • Directory.Build.props is a user-defined file that provides customizations to projects under a directory. This - file is automatically imported from Microsoft.Common.props unless the property ImportDirectoryBuildTargets is - set to false.
    • -
    -

    What is not stated here is that only one Directory.Build.props will be imported automatically. Imagine your project -exists in the directory C:\repo\src\foo\foo.csproj and there exists a file in both C:\repo\src\Directory.Build.props and -C:\repo\Directory.Build.props then only C:\repo\src\Directory.Build.props will be automatically included when building -C:\repo\src\foo\foo.csproj. If you would like C:\repo\Directory.Build.props to be included as well, then -C:\repo\src\Directory.Build.props will have to include C:\repo\Directory.Build.props like so:

    -
    <Project>
    -    <Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.props', '$(MSBuildThisFileDirectory)../'))" />
    -</Project>
    -
    -

    This is documented here.

    -
    \ No newline at end of file +.NET programs or any program which is built using MSBuild.

    Continue reading "Run a program directly after building in VS Code"
    \ No newline at end of file diff --git a/blog/page9.html b/blog/page9.html index 245939c..da67956 100644 --- a/blog/page9.html +++ b/blog/page9.html @@ -1,12 +1,21 @@ -The Blog of Zachary Snow

    Git Quick Push

    March 29, 2018gitbatch

    Here's a quick one liner to quickly stage all your changes in the current git repo, commit them and then push +The Blog of Zachary Snow

    Merging Build.Directory.props

    April 4, 2018msbuild.net

    MSBuild version 15 introduced the concept of "Directory.Build.props" files. From the docs:

    +
      +
    • Directory.Build.props is a user-defined file that provides customizations to projects under a directory. This + file is automatically imported from Microsoft.Common.props unless the property ImportDirectoryBuildTargets is + set to false.
    • +
    +

    What is not stated here is that only one Directory.Build.props will be imported automatically. Imagine your project +exists in the directory C:\repo\src\foo\foo.csproj and there exists a file in both C:\repo\src\Directory.Build.props and +C:\repo\Directory.Build.props then only C:\repo\src\Directory.Build.props will be automatically included when building +C:\repo\src\foo\foo.csproj. If you would like C:\repo\Directory.Build.props to be included as well, then +C:\repo\src\Directory.Build.props will have to include C:\repo\Directory.Build.props like so:

    +
    <Project>
    +    <Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.props', '$(MSBuildThisFileDirectory)../'))" />
    +</Project>
    +
    +

    This is documented here.

    +

    Git Quick Push

    March 29, 2018gitbatch

    Here's a quick one liner to quickly stage all your changes in the current git repo, commit them and then push the commit to origin master branch.

    Continue reading "Git Quick Push"

    Poor Man's Template Engine in C# Part 3

    Include

    In our last episode we implemeted the first two helper funcitons HtmlEncode and If. Today we want to implement Include.

    Continue reading "Poor Man's Template Engine in C# Part 3"

    Poor Man's Template Engine in C# Part 2

    HtmlEncode and If

    In our last episode we laid the groundwork for our simple template engine. In this episode we'll introduce our first 2 helper functions.

    Continue reading "Poor Man's Template Engine in C# Part 2"

    Poor Man's Template Engine in C# Part 1

    Groundwork

    If you're looking for a poor man's solution to a templating engine for .net and don't really need -the overhead a complete template engine brings with it, I've come up with the following solution.

    Continue reading "Poor Man's Template Engine in C# Part 1"

    Snowball V2.0

    February 23, 2018.netsnowballc#

    I haven't written anything new here in a very long time and a lot has happened since then. I started a new job at -BeumerGroup this year and now work mostly in TypeScript writing an html5 spa app.

    -

    In my spare time I've decided to working on version 2.0 of my Snowball, -my 2D game framework. I've been playing around with the idea for a while now. This version will be developed directly -for .net core and will be developed with cross platform capability in mind. The api will look similar but will have -some changes.

    -

    The old repo is still available on my github at https://github.com/smack0007/Snowball_v1.

    -
    \ No newline at end of file +the overhead a complete template engine brings with it, I've come up with the following solution.

    Continue reading "Poor Man's Template Engine in C# Part 1"
    \ No newline at end of file diff --git a/feed.rss b/feed.rss index a6834b9..f261747 100644 --- a/feed.rss +++ b/feed.rss @@ -5,9 +5,22 @@ The Blog of Zachary Snow The Blog of Zachary Snow https://smack0007.github.io/ - Tue, 06 Aug 2024 00:00:00 GMT - Tue, 06 Aug 2024 00:00:00 GMT + Fri, 23 Aug 2024 00:00:00 GMT + Fri, 23 Aug 2024 00:00:00 GMT 1800 + + <![CDATA[Install Linux Mint Cinnamon Themes on Debian]]> + As a long time Windows user it probably is no surprise that I enjoy using the Cinnamon Desktop +Environment. Although I have used and enjoyed using Linux Mint one goal I had when I started replacing Windows +throughout my house was to be the same distribution on differnt machines. So I settled on installing Debian +everywhere and customizing it to each systems individual needs.

    +

    I wanted to run Cinnamon on my Thinkpad Laptop and Debian can install +it out of the box. The only problem is the defaykt theme leaves a lot to be deisred. Luckily the theme from Linux Mint +can installed using a few commands from the terminal.

    ]]>
    + https://smack0007.github.io/blog/2024/linux-mint-cinnamon-theme-on-debian.html + https://smack0007.github.io/blog/2024/linux-mint-cinnamon-theme-on-debian.html + Fri, 23 Aug 2024 00:00:00 GMT +
    <![CDATA[Goodbye Windows]]> I finally did it. All the computers in my house are now running debian except for the office PC. I've @@ -249,13 +262,6 @@ based on the OS the script is running on.

    ]]>
    https://smack0007.github.io/blog/2020/execute-different-commands-in-msbuild-depending-on-platform.html Fri, 20 Nov 2020 00:00:00 GMT
    - - <![CDATA[Filter ItemGroup by extension in MSBuild]]> - Just a quick snippet that shows how to filter an exiting ItemGroup by an extension.

    ]]>
    - https://smack0007.github.io/blog/2020/filter-itemgroup-by-extension-in-msbuild.html - https://smack0007.github.io/blog/2020/filter-itemgroup-by-extension-in-msbuild.html - Wed, 04 Nov 2020 00:00:00 GMT -
    diff --git a/index.html b/index.html index 6d14b30..4505b95 100644 --- a/index.html +++ b/index.html @@ -1,4 +1,10 @@ -The Blog of Zachary Snow

    Goodbye Windows

    It's you, not me.

    August 6, 2024windowslinuxdebian

    I finally did it. All the computers in my house are now running debian except for the office PC. I've +The Blog of Zachary Snow

    Install Linux Mint Cinnamon Themes on Debian

    As a long time Windows user it probably is no surprise that I enjoy using the Cinnamon Desktop +Environment. Although I have used and enjoyed using Linux Mint one goal I had when I started replacing Windows +throughout my house was to be the same distribution on differnt machines. So I settled on installing Debian +everywhere and customizing it to each systems individual needs.

    +

    I wanted to run Cinnamon on my Thinkpad Laptop and Debian can install +it out of the box. The only problem is the defaykt theme leaves a lot to be deisred. Luckily the theme from Linux Mint +can installed using a few commands from the terminal.

    Continue reading "Install Linux Mint Cinnamon Themes on Debian"

    Goodbye Windows

    It's you, not me.

    August 6, 2024windowslinuxdebian

    I finally did it. All the computers in my house are now running debian except for the office PC. I've used Windows for at least 30 years but over the last few years it's become more and more user hostile. After the latest Windows Recall push and the security implications surrounding it, I decided I could no longer keep running Windows on all the machines in my house.

    Continue reading "Goodbye Windows"

    Start Syncthing in the Background on Windows

    April 28, 2024syncthingwindows

    Just a quick tip for myself (and anyone who is reading this) for the future. To start syncthing in @@ -48,6 +54,4 @@ presented often only deal with String enums. For my work on SDL_ts I really need a solution for Numeric enums -as SDL is full of them.

    Continue reading "Enums considered harmful"

    Now powered by deno

    December 23, 2022deno

    I finally sat down and got my blog compiling with deno. Now that there -is official npm support I didn't need to completely rewrite the compiler which was what was -stopping me before.

    Continue reading "Now powered by deno"
    \ No newline at end of file +as SDL is full of them.

    Continue reading "Enums considered harmful"
    \ No newline at end of file diff --git a/sitemap.xml b/sitemap.xml index cb2c959..b6f675d 100644 --- a/sitemap.xml +++ b/sitemap.xml @@ -252,6 +252,9 @@ https://smack0007.github.io/blog/2021/windows-terminal-fork-command.html + + https://smack0007.github.io/blog/2024/linux-mint-cinnamon-theme-on-debian.html + https://smack0007.github.io/blog/2024/goodbye-windows.html diff --git a/tags/cinnamon/index.html b/tags/cinnamon/index.html new file mode 100644 index 0000000..ea26b5b --- /dev/null +++ b/tags/cinnamon/index.html @@ -0,0 +1,7 @@ +cinnamon

    Install Linux Mint Cinnamon Themes on Debian

    As a long time Windows user it probably is no surprise that I enjoy using the Cinnamon Desktop +Environment. Although I have used and enjoyed using Linux Mint one goal I had when I started replacing Windows +throughout my house was to be the same distribution on differnt machines. So I settled on installing Debian +everywhere and customizing it to each systems individual needs.

    +

    I wanted to run Cinnamon on my Thinkpad Laptop and Debian can install +it out of the box. The only problem is the defaykt theme leaves a lot to be deisred. Luckily the theme from Linux Mint +can installed using a few commands from the terminal.

    Continue reading "Install Linux Mint Cinnamon Themes on Debian"
    \ No newline at end of file diff --git a/tags/debian/index.html b/tags/debian/index.html index 87c9f76..e3333da 100644 --- a/tags/debian/index.html +++ b/tags/debian/index.html @@ -1,4 +1,10 @@ -debian

    Goodbye Windows

    It's you, not me.

    August 6, 2024windowslinuxdebian

    I finally did it. All the computers in my house are now running debian except for the office PC. I've +debian

    Install Linux Mint Cinnamon Themes on Debian

    As a long time Windows user it probably is no surprise that I enjoy using the Cinnamon Desktop +Environment. Although I have used and enjoyed using Linux Mint one goal I had when I started replacing Windows +throughout my house was to be the same distribution on differnt machines. So I settled on installing Debian +everywhere and customizing it to each systems individual needs.

    +

    I wanted to run Cinnamon on my Thinkpad Laptop and Debian can install +it out of the box. The only problem is the defaykt theme leaves a lot to be deisred. Luckily the theme from Linux Mint +can installed using a few commands from the terminal.

    Continue reading "Install Linux Mint Cinnamon Themes on Debian"

    Goodbye Windows

    It's you, not me.

    August 6, 2024windowslinuxdebian

    I finally did it. All the computers in my house are now running debian except for the office PC. I've used Windows for at least 30 years but over the last few years it's become more and more user hostile. After the latest Windows Recall push and the security implications surrounding it, I decided I could no longer keep running Windows on all the machines in my house.

    Continue reading "Goodbye Windows"
    \ No newline at end of file diff --git a/tags/index.html b/tags/index.html index 655a457..2643950 100644 --- a/tags/index.html +++ b/tags/index.html @@ -1 +1 @@ -The Blog of Zachary Snow \ No newline at end of file +The Blog of Zachary Snow \ No newline at end of file diff --git a/tags/linux-mint/index.html b/tags/linux-mint/index.html new file mode 100644 index 0000000..49c47a0 --- /dev/null +++ b/tags/linux-mint/index.html @@ -0,0 +1,7 @@ +linux-mint

    Install Linux Mint Cinnamon Themes on Debian

    As a long time Windows user it probably is no surprise that I enjoy using the Cinnamon Desktop +Environment. Although I have used and enjoyed using Linux Mint one goal I had when I started replacing Windows +throughout my house was to be the same distribution on differnt machines. So I settled on installing Debian +everywhere and customizing it to each systems individual needs.

    +

    I wanted to run Cinnamon on my Thinkpad Laptop and Debian can install +it out of the box. The only problem is the defaykt theme leaves a lot to be deisred. Luckily the theme from Linux Mint +can installed using a few commands from the terminal.

    Continue reading "Install Linux Mint Cinnamon Themes on Debian"
    \ No newline at end of file diff --git a/tags/linux/index.html b/tags/linux/index.html index 24bdede..46cf75f 100644 --- a/tags/linux/index.html +++ b/tags/linux/index.html @@ -1,4 +1,10 @@ -linux

    Goodbye Windows

    It's you, not me.

    August 6, 2024windowslinuxdebian

    I finally did it. All the computers in my house are now running debian except for the office PC. I've +linux

    Install Linux Mint Cinnamon Themes on Debian

    As a long time Windows user it probably is no surprise that I enjoy using the Cinnamon Desktop +Environment. Although I have used and enjoyed using Linux Mint one goal I had when I started replacing Windows +throughout my house was to be the same distribution on differnt machines. So I settled on installing Debian +everywhere and customizing it to each systems individual needs.

    +

    I wanted to run Cinnamon on my Thinkpad Laptop and Debian can install +it out of the box. The only problem is the defaykt theme leaves a lot to be deisred. Luckily the theme from Linux Mint +can installed using a few commands from the terminal.

    Continue reading "Install Linux Mint Cinnamon Themes on Debian"

    Goodbye Windows

    It's you, not me.

    August 6, 2024windowslinuxdebian

    I finally did it. All the computers in my house are now running debian except for the office PC. I've used Windows for at least 30 years but over the last few years it's become more and more user hostile. After the latest Windows Recall push and the security implications surrounding it, I decided I could no longer keep running Windows on all the machines in my house.

    Continue reading "Goodbye Windows"
    \ No newline at end of file