From 9242ea4a869b5060563284080b65c5553df3039a Mon Sep 17 00:00:00 2001 From: smack0007 Date: Mon, 16 Sep 2024 13:40:30 +0000 Subject: [PATCH] Add debian-12-update-wifi-missing.md --- blog/2024/debian-12-update-wifi-missing.html | 8 + blog/page10.html | 6 +- blog/page11.html | 10 +- blog/page12.html | 22 +-- blog/page13.html | 19 +- blog/page14.html | 8 +- blog/page15.html | 25 +-- blog/page16.html | 78 +++----- blog/page17.html | 60 +++++- blog/page18.html | 10 +- blog/page19.html | 177 +---------------- blog/page2.html | 50 +++-- blog/page20.html | 174 ++++++++++++++++- blog/page3.html | 17 +- blog/page4.html | 9 +- blog/page5.html | 11 +- blog/page6.html | 7 +- blog/page7.html | 6 +- blog/page8.html | 25 +-- blog/page9.html | 24 ++- feed.rss | 25 +-- index.html | 43 +---- sitemap.xml | 191 ++++++++++--------- tags/debian-12/index.html | 8 + tags/debian/index.html | 9 +- tags/index.html | 2 +- tags/net/page7.html | 4 +- tags/network-manager/index.html | 8 + tags/opengl/index.html | 4 +- tags/wifi/index.html | 8 + 30 files changed, 550 insertions(+), 498 deletions(-) create mode 100644 blog/2024/debian-12-update-wifi-missing.html create mode 100644 tags/debian-12/index.html create mode 100644 tags/network-manager/index.html create mode 100644 tags/wifi/index.html diff --git a/blog/2024/debian-12-update-wifi-missing.html b/blog/2024/debian-12-update-wifi-missing.html new file mode 100644 index 0000000..3a2d564 --- /dev/null +++ b/blog/2024/debian-12-update-wifi-missing.html @@ -0,0 +1,8 @@ +Debian 12: WiFi missing after installing update

Debian 12: WiFi missing after installing update

It finally happened to me. The other night after installing an update from debain +bookworm and restarting my WiFi was no longer working. On the desktop +there was no longer a signal strength indicator and my browser informed me I was disconnected from the internet.

+

So I plugged in an ethernet cable and got started researching. After 2 minutes of searching I +had the answer. I used nmcli (network manager cli) to see the state of my network devices. On my WiFi adapter there +was an error plugin missing. Simply reinstalling network-manager with sudo apt reinstall network-manager fixed the +problem and I could use my WiFi again.

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

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 Blog of Zachary Snow

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, @@ -10,5 +11,4 @@ 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"
\ No newline at end of file +use a LINQ extension method which takes an instance of IEqualityComaparer.

Continue reading "LINQ calls IEqualityComparer<T>.GetHashCode() before Equals()"
\ No newline at end of file diff --git a/blog/page11.html b/blog/page11.html index 314bbff..244a970 100644 --- a/blog/page11.html +++ b/blog/page11.html @@ -1,4 +1,5 @@ -The Blog of Zachary Snow

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. +The Blog of Zachary Snow

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"))
@@ -29,11 +30,4 @@
 
 

In After.cs, you can see that Component Glue is able to build the entire object graph for us. This will include all future dependencies as well so long as interfaces don't come into play. Should an interface be needed, you can just bind that single component.

This is a very powerful thing. If one component needs to take on a dependency, just ask for it in the constructor and Component Glue will handle it for you.

-

Component Glue v1.0

I finally brought Component Glue up to a state where I felt like the product was finished. You can get it via NuGet:

-
-`PM> Install-Package ComponentGlue` -
- -

or you can get the source from GitHub. The documentation is definitely sparse I know but I recommend taking a look at the unit tests to get a feel for what you can do with Component Glue.

-

Credit for the NuGet CSS here.

\ No newline at end of file diff --git a/blog/page12.html b/blog/page12.html index 37d1409..3c18f61 100644 --- a/blog/page12.html +++ b/blog/page12.html @@ -1,4 +1,11 @@ -The Blog of Zachary Snow

GLDotNet Version 0.6.0

February 19, 2013c#opengl.net

I just released GLDotNet Version 0.6.0.

+The Blog of Zachary Snow

Component Glue v1.0

I finally brought Component Glue up to a state where I felt like the product was finished. You can get it via NuGet:

+
+`PM> Install-Package ComponentGlue` +
+ +

or you can get the source from GitHub. The documentation is definitely sparse I know but I recommend taking a look at the unit tests to get a feel for what you can do with Component Glue.

+

Credit for the NuGet CSS here.

+

GLDotNet Version 0.6.0

February 19, 2013c#opengl.net

I just released GLDotNet Version 0.6.0.

Changelog:

  • **GLDotNet.Toolkit**: Assembly containing simple app framework.
  • @@ -37,17 +44,4 @@

    Changelog:

    I can't deal with this anymore.

Snowball is now modular

November 6, 2012.netgame-programming

The version of Snowball currently on GitHub under the "develop" branch has been split into multiple projects. There is now an assembly for each major piece of Snowball, such as Graphics, Input, Sound. Although this means having to reference more assemblies, the amount of code your project depends on is now smaller. This also makes code maintenance a bit easier as it's more clear now what parts of the library depend on other parts of the library.

The parts of the library which really make up a Game Framework has also been split out into their own library. This allows for using Snowball as a just a simple set of libraries or a full blown game framework, depending on what your situation calls for.

-

Using Themes in Visual Studio Express for Windows Desktop

September 15, 2012vsvs2012

I just want to post some information that took me while to find. Check out the original article here with pictures and more information.

-
-1) First, download the zip file http://www.alinconstantin.net/download/VS2012Themes.zip – it contains the 7 pkgdef files defining the colors of the default themes from Matt’s extension. - -
    -
  1. Now, create a folder under "%ProgramFiles%\Microsoft Visual Studio 11.0\Common7\IDE\WDExpressExtensions”, and lets name it “Themes”. Unpack the zip file in that folder.

    -
  2. -
  3. Open a ‘Developer Command Prompt for VS2012” window. In the command line, type “wdexpress.exe /updateconfiguration”. This will make Visual Studio to read the pkgdef files on next restart, and import the color themes into registry.

    -
  4. -
  5. Launch Visual Studio Express, and now you should be able to see the new themes and switch them in Tools/Options dialog, Environment/General tab

    -
- -

Source

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

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 Blog of Zachary Snow

Using Themes in Visual Studio Express for Windows Desktop

September 15, 2012vsvs2012

I just want to post some information that took me while to find. Check out the original article here with pictures and more information.

+
+1) First, download the zip file http://www.alinconstantin.net/download/VS2012Themes.zip – it contains the 7 pkgdef files defining the colors of the default themes from Matt’s extension. + +
    +
  1. Now, create a folder under "%ProgramFiles%\Microsoft Visual Studio 11.0\Common7\IDE\WDExpressExtensions”, and lets name it “Themes”. Unpack the zip file in that folder.

    +
  2. +
  3. Open a ‘Developer Command Prompt for VS2012” window. In the command line, type “wdexpress.exe /updateconfiguration”. This will make Visual Studio to read the pkgdef files on next restart, and import the color themes into registry.

    +
  4. +
  5. Launch Visual Studio Express, and now you should be able to see the new themes and switch them in Tools/Options dialog, Environment/General tab

    +
+ +

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.

@@ -9,6 +22,4 @@

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.

I plan to set a road map soon for what I want to include the first release of Snowball. Music and Pixel Shaders are high the list. I've experimented with implementing a UI library but I think I want to push that back for a later release.

-

Getting Started with Snowball

My game framework Snowball is far enough along that small games can be developed with it by now. The basic overall design is now laid out and not too much is likely to change as I'm now developing my own small games with it.

-

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.

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

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.

+The Blog of Zachary Snow

Getting Started with Snowball

My game framework Snowball is far enough along that small games can be developed with it by now. The basic overall design is now laid out and not too much is likely to change as I'm now developing my own small games with it.

+

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:

    @@ -17,8 +19,4 @@

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.

I've decided to move away from that and let Snowball purely focus on the subsystems of a game, such as Graphics, Sound, Input, etc. Extending from the Game class completely sets up these aspects of your game for you. I think I will include helper components, such as a collision detection system, but I will not force you to use them.

-

XAudio2: Stop Currently Playing Sound

July 2, 2011.netslimdxxaudio2

Using SlimDX, if you want to stop a sound which is currently playing via XAudio2, use the following methods on the SourceVoice object:

-
sourceVoice.Stop();
-sourceVoice.FlushSourceBuffers();
-
\ No newline at end of file diff --git a/blog/page15.html b/blog/page15.html index a7fc5b7..61e28d9 100644 --- a/blog/page15.html +++ b/blog/page15.html @@ -1,25 +1,10 @@ -The Blog of Zachary Snow

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.

+The Blog of Zachary Snow

XAudio2: Stop Currently Playing Sound

July 2, 2011.netslimdxxaudio2

Using SlimDX, if you want to stop a sound which is currently playing via XAudio2, use the following methods on the SourceVoice object:

+
sourceVoice.Stop();
+sourceVoice.FlushSourceBuffers();
+
+

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.

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:

-
@@echo off
-
-C:
-chdir C:\cygwin\bin
-
-start run.exe git gui
-
-

You can change paths accordingly. Now run the batch file and pin the program to the taskbar. You'll notice after you close the app, the icon changes and it won't launch again.

-

Right click on the shortcut while holding shift and choose properties. Change the target to the batch file we wrote. You can change the icon to the git-gui icon by pointing the shortcut icon to "C:\cygwin\usr\share\git-gui\lib\git-gui.ico".

-

Now if you click on the icon, the git-gui app should start up. Kill your explorer.exe in task manager and restart. If the icon is still the genie lamp, you'll need to clear your icon cache to get the icon to look right. Credit for that from here. Kill your explorer.exe again and while explorer is gone, start cmd.exe. From there enter the following commands:

-
CD /d %userprofile%\AppData\Local
-
-DEL IconCache.db /a
-
-EXIT
-
-

After that your icon should be there as you want.

\ No newline at end of file diff --git a/blog/page16.html b/blog/page16.html index 1920726..d47ce13 100644 --- a/blog/page16.html +++ b/blog/page16.html @@ -1,4 +1,23 @@ -The Blog of Zachary Snow

Getting started with SlimDX

March 31, 2011.netdirectx

*Update 2013-09-29: At this point SlimDX is quite out of date and I would recommend starting with SharpDX.

+The Blog of Zachary Snow

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:

+
@@echo off
+
+C:
+chdir C:\cygwin\bin
+
+start run.exe git gui
+
+

You can change paths accordingly. Now run the batch file and pin the program to the taskbar. You'll notice after you close the app, the icon changes and it won't launch again.

+

Right click on the shortcut while holding shift and choose properties. Change the target to the batch file we wrote. You can change the icon to the git-gui icon by pointing the shortcut icon to "C:\cygwin\usr\share\git-gui\lib\git-gui.ico".

+

Now if you click on the icon, the git-gui app should start up. Kill your explorer.exe in task manager and restart. If the icon is still the genie lamp, you'll need to clear your icon cache to get the icon to look right. Credit for that from here. Kill your explorer.exe again and while explorer is gone, start cmd.exe. From there enter the following commands:

+
CD /d %userprofile%\AppData\Local
+
+DEL IconCache.db /a
+
+EXIT
+
+

After that your icon should be there as you want.

+

Getting started with SlimDX

March 31, 2011.netdirectx

*Update 2013-09-29: At this point SlimDX is quite out of date and I would recommend starting with SharpDX.

Since I tried OpenTK, I decided to give SlimDX a try as well. So, here's a simple getting started app:

using System;
 using System.Drawing;
@@ -71,7 +90,7 @@
     }
 }
 
-

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.

+

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;
@@ -124,61 +143,8 @@
     }
 }
 
-

Keeping SplitContainer SplitterDistance consistent

February 9, 2011.netwinforms

If you're having trouble keeping the SplitterDistance property of a SplitContainer consistent across app sessions, you can set the FixedPanel property of the splitter to FixedPanel.Panel1.

+

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"

Keeping SplitContainer SplitterDistance consistent

February 9, 2011.netwinforms

If you're having trouble keeping the SplitterDistance property of a SplitContainer consistent across app sessions, you can set the FixedPanel property of the splitter to FixedPanel.Panel1.

splitter.FixedPanel = FixedPanel.Panel1;
 

I guess this could also work with FixedPanel.Panel2 as well but I haven't given it a try. Credit this stackoverflow post.

-

Favoring Composition over Inheritance

You may have heard the expression before "Favor Composition over Inheritance", but do you know what it means and how to apply it? Lets take this code for example:

-
abstract class Car
-{
-    public Color Color { get; protected set; }
-    public Engine Engine { get; protected set; }
-}
-
-class ElectricCar : Car
-{
-    public ElectricCar()
-    {
-        this.Color = Color.Blue;
-        this.Engine = new ElectricEngine();
-    }
-}
-
-class SportsCar : Car
-{
-    public SportsCar()
-    {
-        this.Color = Color.Red;
-        this.Engine = new V8Engine();
-    }
-}
-
-class Truck : Car
-{
-    public Truck()
-    {
-        this.Color = Color.White;
-        this.Engine = new DieselEngine();
-    }
-}
-
-

In this contrived example, we've defined three types of cars. Each instance of each of the cars will always have the same color and same engine. What happens when we need a 4th type? We have to define another class. By refactoring this code, we can compose a car type by giving it a color and an engine:

-
class Car
-{
-    public Color Color { get; private set; }
-    public Engine Engine { get; private set; }
-    
-    public Car(Color color, Engine engine)
-    {
-        this.Color = color;
-        this.Engine = engine;
-    }
-}
-
-Car electricCar = new Car(Color.Blue, new ElectricEngine());
-Car sportsCar = new Car(Color.Red, new V8Engine());
-Car truck = new Car(Color.White, new DieselEngine());
-Car familyCar = new Car(Color.Black, new V4Engine());
-
-

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

\ No newline at end of file diff --git a/blog/page17.html b/blog/page17.html index 381fabe..c051e59 100644 --- a/blog/page17.html +++ b/blog/page17.html @@ -1,4 +1,57 @@ -The Blog of Zachary Snow

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.

+The Blog of Zachary Snow

Favoring Composition over Inheritance

You may have heard the expression before "Favor Composition over Inheritance", but do you know what it means and how to apply it? Lets take this code for example:

+
abstract class Car
+{
+    public Color Color { get; protected set; }
+    public Engine Engine { get; protected set; }
+}
+
+class ElectricCar : Car
+{
+    public ElectricCar()
+    {
+        this.Color = Color.Blue;
+        this.Engine = new ElectricEngine();
+    }
+}
+
+class SportsCar : Car
+{
+    public SportsCar()
+    {
+        this.Color = Color.Red;
+        this.Engine = new V8Engine();
+    }
+}
+
+class Truck : Car
+{
+    public Truck()
+    {
+        this.Color = Color.White;
+        this.Engine = new DieselEngine();
+    }
+}
+
+

In this contrived example, we've defined three types of cars. Each instance of each of the cars will always have the same color and same engine. What happens when we need a 4th type? We have to define another class. By refactoring this code, we can compose a car type by giving it a color and an engine:

+
class Car
+{
+    public Color Color { get; private set; }
+    public Engine Engine { get; private set; }
+    
+    public Car(Color color, Engine engine)
+    {
+        this.Color = color;
+        this.Engine = engine;
+    }
+}
+
+Car electricCar = new Car(Color.Blue, new ElectricEngine());
+Car sportsCar = new Car(Color.Red, new V8Engine());
+Car truck = new Car(Color.White, new DieselEngine());
+Car familyCar = new Car(Color.Black, new V4Engine());
+
+

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
@@ -11,7 +64,4 @@
 return Texture2D.FromFile(graphicsDevice, stream);
 

GetCallingAssembly() can be exchanged with GetExecutingAssembly() if needed. The name of the resource must be fully qualified with the app's namespace and folders. I usually keep my resources in a folder Resources so I would have: AppNamespace.Resources.font.bmp.

-

Implementing basic Dependency Injection using a Service Container

By extending your Service Container class, a very basic version of dependency injection can be implemented. We'll implement two forms of dependency injection: constructor and property injection.

Continue reading "Implementing basic Dependency Injection using a Service Container"

500 Downloads of the Same Game

My little Xna game that I wrote nearly 2 years ago reached the 500 downloads mark (binaries and source) the other day. With that said, I'd like to say that I'm working on version 2.0.

-

In version 2.0 I'm going to make the code more event driven. The old code uses the Xna Game class and in the new version I'll be making it WinForms based. Almost a complete rewrite.

-

My work so far is available through SVN on the project's Codeplex page.

-
\ No newline at end of file +

Implementing basic Dependency Injection using a Service Container

By extending your Service Container class, a very basic version of dependency injection can be implemented. We'll implement two forms of dependency injection: constructor and property injection.

Continue reading "Implementing basic Dependency Injection using a Service Container"
\ No newline at end of file diff --git a/blog/page18.html b/blog/page18.html index eeb4bcd..ce18fcb 100644 --- a/blog/page18.html +++ b/blog/page18.html @@ -1,4 +1,7 @@ -The Blog of Zachary Snow

Progress Bar in Windows 7 Taskbars

June 1, 2010.netc#windows-7

I decided to add progress bar to the Windows 7 Taskbar in my Timer app.

+The Blog of Zachary Snow

500 Downloads of the Same Game

My little Xna game that I wrote nearly 2 years ago reached the 500 downloads mark (binaries and source) the other day. With that said, I'd like to say that I'm working on version 2.0.

+

In version 2.0 I'm going to make the code more event driven. The old code uses the Xna Game class and in the new version I'll be making it WinForms based. Almost a complete rewrite.

+

My work so far is available through SVN on the project's Codeplex page.

+

Progress Bar in Windows 7 Taskbars

June 1, 2010.netc#windows-7

I decided to add progress bar to the Windows 7 Taskbar in my Timer app.

I started by downloading and compiling the Windows API Code Pack in Release mode. I then added a reference to the Microsoft.WindowsAPICodePack.dll and Microsoft.WindowsAPICodePack.Shell.dll files to the project. After that add the lines:

using Microsoft.WindowsAPICodePack.Taskbar;
 
@@ -79,7 +82,4 @@ }

All of the methods in IServiceContainerExtensions are just helper methods for method in IServiceContainer. By making them extension methods in our own library though, we've made the barrier to entry lower. Other people can implement the interface and in a sense "inherit" the helper methods as well.

-

Creating and consuming services in your XNA Game

February 18, 2010.net

The GameServiceContainer implements the IServiceProvider interface and the MSDN documentation says about the IServiceProvider interface:

-
Defines a mechanism for retrieving a service object; that is, an object that provides custom support to other objects.
- -

This article will "attempt" to describe how can you use the GameServiceContainer in your XNA game, in both your GameComponent(s) and your game's entity objects.

Continue reading "Creating and consuming services in your XNA Game"
\ No newline at end of file +
\ No newline at end of file diff --git a/blog/page19.html b/blog/page19.html index ec6558f..c50ec2a 100644 --- a/blog/page19.html +++ b/blog/page19.html @@ -1,4 +1,7 @@ -The Blog of Zachary Snow

Changing the PlatformTarget in Visual C# Express

January 18, 2010.netmsbuild

Some project types in Visual C# Express (Empty Project) will not allow you to change the PlatformTarget from the UI. You can still change the target platform though by editing the .csproj file in a text editor. Close the project and open it up in your favorite text editor (I use Notpad++). The .csproj file is really just a XML file. You should see somewhere in the file something like:

+The Blog of Zachary Snow

Creating and consuming services in your XNA Game

February 18, 2010.net

The GameServiceContainer implements the IServiceProvider interface and the MSDN documentation says about the IServiceProvider interface:

+
Defines a mechanism for retrieving a service object; that is, an object that provides custom support to other objects.
+ +

This article will "attempt" to describe how can you use the GameServiceContainer in your XNA game, in both your GameComponent(s) and your game's entity objects.

Continue reading "Creating and consuming services in your XNA Game"

Changing the PlatformTarget in Visual C# Express

January 18, 2010.netmsbuild

Some project types in Visual C# Express (Empty Project) will not allow you to change the PlatformTarget from the UI. You can still change the target platform though by editing the .csproj file in a text editor. Close the project and open it up in your favorite text editor (I use Notpad++). The .csproj file is really just a XML file. You should see somewhere in the file something like:

    <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
         ....
     </PropertyGroup>
@@ -77,176 +80,4 @@
 }
 

I've left a lot of fluff code out. I usually check if the line is a width of 1 and draw a normal line. I also left out the code on how to draw a quad as that can be found many other places already.

-

SpriteSheet Class

January 9, 2009.netxna

I've been talking with a guy on the creator forums lately about SpriteSheets and so I decided it might be a good idea to post my SpriteSheet class.

-

It's very simple. Only reads sprites from left to right and assumes all Sprites are the same width and height.

-
#region Using
-using System;
-using Microsoft.Xna.Framework;
-using Microsoft.Xna.Framework.Graphics;
-#endregion
-
-namespace Snow.Xna.Graphics
-{
-    /// <summary>
-    /// Spritesheet class.
-    /// </summary>
-    public class SpriteSheet
-    {
-        #region Fields
-
-        string name;
-
-        Texture2D texture;
-
-        Rectangle[] rectangles;
-
-        int spriteWidth, spriteHeight;
-
-        #endregion
-
-        #region Properties
-
-        /// <summary>
-        /// The name of this SpriteSheet.
-        /// </summary>
-        public string Name
-        {
-            get { return name; }
-        }
-
-        /// <summary>
-        /// The texture for this SpriteSheet.
-        /// </summary>
-        public Texture2D Texture
-        {
-            get { return texture; }
-        }
-
-        /// <summary>
-        /// Returns a rectangle for a sprite in the SpriteSheet.
-        /// </summary>
-        /// <param name="i">index</param>
-        /// <returns></returns>
-        public Rectangle this[int i]
-        {
-            get { return rectangles[i]; }
-        }
-
-        /// <summary>
-        /// The number of sprites in this SpriteSheet.
-        /// </summary>
-        public int Count
-        {
-            get { return rectangles.Length; }
-        }
-
-        /// <summary>
-        /// The width of the texture.
-        /// </summary>
-        public int Width
-        {
-            get { return texture.Width; }
-        }
-
-        /// <summary>
-        /// The width of each sprite in the SpriteSheet.
-        /// </summary>
-        public int SpriteWidth
-        {
-            get { return spriteWidth; }
-        }
-
-        /// <summary>
-        /// The height of the texture.
-        /// </summary>
-        public int Height
-        {
-            get { return texture.Height; }
-        }
-
-        /// <summary>
-        /// The height of each sprite in the SpriteSheet.
-        /// </summary>
-        public int SpriteHeight
-        {
-            get { return spriteHeight; }
-        }
-
-        #endregion
-
-        /// <summary>
-        /// Create a new SpriteSheet and determine the number of sprites in the sheet.
-        /// </summary>
-        /// <param name="texture"></param>
-        /// <param name="spriteWidth">Width of each sprite.</param>
-        /// <param name="spriteHeight">Height of each sprite.</param>
-        public SpriteSheet(string name, Texture2D texture, int spriteWidth, int spriteHeight)
-            : this(name, texture, spriteWidth, spriteHeight, 0)
-        {
-        }
-
-        /// <summary>
-        /// Create a new SpriteSheet.
-        /// </summary>
-        /// <param name="texture"></param>
-        /// <param name="spriteWidth">Width of each sprite.</param>
-        /// <param name="spriteHeight">Height of each sprite.</param>
-        /// <param name="count">The number of sprites in the sheet.</param>
-        public SpriteSheet(string name, Texture2D texture, int spriteWidth, int spriteHeight, int count)
-        {
-            this.name = name;
-            this.texture = texture;
-            this.spriteWidth = spriteWidth;
-            this.spriteHeight = spriteHeight;
-
-            if(count == 0)
-            {
-                int numX = texture.Width / spriteWidth;
-                int numY = texture.Height / spriteHeight;
-
-                rectangles = new Rectangle[numX * numY];
-            }
-            else
-            {
-                rectangles = new Rectangle[count];
-            }
-
-            int x = 0, y = 0;
-            for(int i = 0; i < rectangles.Length; i++)
-            {
-                rectangles[i] = new Rectangle(x, y, spriteWidth, spriteHeight);
-
-                x += spriteWidth;
-                if(x >= texture.Width)
-                {
-                    x = 0;
-                    y += spriteHeight;
-                }
-            }
-        }
-
-        public static implicit operator Texture2D(SpriteSheet spriteSheet)
-        {
-            return spriteSheet.Texture;
-        }
-    }
-}
-
-

You can create a new SpriteSheet and use it like this:

-

`

-
SpriteSheet spriteSheet = new SpriteSheet("tiles", Content.Load<texture2D>("tiles"), 64, 64);
-
-spriteBatch.Begin();
-
-spriteBatch.Draw(spriteSheet,
-                new Rectangle(0, 0, spriteSheet.SpriteWidth, spriteSheet.SpriteHeight),
-            spriteSheet[0],
-            Color.White);
-
-spriteBatch.End();
-
-

`

-

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.

\ No newline at end of file diff --git a/blog/page2.html b/blog/page2.html index 7e3f16e..93934b1 100644 --- a/blog/page2.html +++ b/blog/page2.html @@ -1,4 +1,38 @@ -The Blog of Zachary Snow

Enums considered harmful

January 24, 2023typescriptenum

It seems that torwards the end of 2022 the collective hivemind of the TypeScript +The Blog of Zachary Snow

Typing jest Spies

October 24, 2023typescriptjest

It often feels like TypeScript was an afterthought in jest. +Any time I need to type a variable that holds some data structure from jest it feels +like I need to dust off my old book of spells in order to find the correct incantation +to make eslint happy. A situation I finally figured +out a solution for is when you want to store the result of a call to jest.spyOn in a +shared variable:

+
let setTimeoutSpy: jest.SpyInstance;
+
+beforeEach(() => {
+  setTimeoutSpy = jest.spyOn(globalThis, 'setTimeout').mockImplementation((callback) => {
+    callback();
+    return 0 as unknown as ReturnType<typeof setTimeout>;
+  });
+});
+
+afterEach(() => {
+  setTimeoutSpy.mockRestore();
+});
+
+

Even though jest.SpyInstance is specified here as the type for randomSpy the information about exactly what +function is being spied on gets lost here. That means if elsewhere in the code if you try the following:

+
let setTimeoutCallback = () => {};
+let setTimeoutDelay: number | undefined = undefined;
+setTimeoutSpy.mockImplementation((callback, delay) => {
+  setTimeoutCallback = callback;
+  setTimeoutDelay = delay;
+  return 0 as unknown as ReturnType<typeof setTimeout>;
+});
+
+

eslint will complain that callback and delay have the type any. This is again due to the lost type information. +This problem can be resolved by using some TypeScript utility types when the spy variable is declared:

+
let setTimeoutSpy: jest.SpyInstance<ReturnType<typeof setTimeout>, Parameters<typeof setTimeout>>;
+
+

We use the built in ReturnType and Parameters utility types to perform the voodoo needed in order to make eslint happy.

+

Enums considered harmful

January 24, 2023typescriptenum

It seems that torwards the end of 2022 the collective hivemind of the TypeScript programming world decided that enums are terrible. While I mostly agree with the premise that TypeScript enums are not good the solutions that are @@ -27,16 +61,4 @@ for (const [ key, value ] of Object.entries(obj)) { console.info(key, value); } -Continue reading "Iterating thru an Object in JavaScript"

Powershell time command

March 10, 2022powershell

I commbined the best parts of this StackOverflow answer and this -Super User answer to come up with this solution for a time function -in Powershell:

-
function time {
-    $Command = "$args";
-    (Measure-Command { Invoke-Expression $Command 2>&1 | Out-Default }).ToString();
-}
-
-

Example usage:

-
# time git pull
-00:00:01.0804938
-
-
\ No newline at end of file +
Continue reading "Iterating thru an Object in JavaScript"
\ No newline at end of file diff --git a/blog/page20.html b/blog/page20.html index 98f5d2a..b21392d 100644 --- a/blog/page20.html +++ b/blog/page20.html @@ -1,2 +1,174 @@ -The Blog of Zachary Snow

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.

+The Blog of Zachary Snow

SpriteSheet Class

January 9, 2009.netxna

I've been talking with a guy on the creator forums lately about SpriteSheets and so I decided it might be a good idea to post my SpriteSheet class.

+

It's very simple. Only reads sprites from left to right and assumes all Sprites are the same width and height.

+
#region Using
+using System;
+using Microsoft.Xna.Framework;
+using Microsoft.Xna.Framework.Graphics;
+#endregion
+
+namespace Snow.Xna.Graphics
+{
+    /// <summary>
+    /// Spritesheet class.
+    /// </summary>
+    public class SpriteSheet
+    {
+        #region Fields
+
+        string name;
+
+        Texture2D texture;
+
+        Rectangle[] rectangles;
+
+        int spriteWidth, spriteHeight;
+
+        #endregion
+
+        #region Properties
+
+        /// <summary>
+        /// The name of this SpriteSheet.
+        /// </summary>
+        public string Name
+        {
+            get { return name; }
+        }
+
+        /// <summary>
+        /// The texture for this SpriteSheet.
+        /// </summary>
+        public Texture2D Texture
+        {
+            get { return texture; }
+        }
+
+        /// <summary>
+        /// Returns a rectangle for a sprite in the SpriteSheet.
+        /// </summary>
+        /// <param name="i">index</param>
+        /// <returns></returns>
+        public Rectangle this[int i]
+        {
+            get { return rectangles[i]; }
+        }
+
+        /// <summary>
+        /// The number of sprites in this SpriteSheet.
+        /// </summary>
+        public int Count
+        {
+            get { return rectangles.Length; }
+        }
+
+        /// <summary>
+        /// The width of the texture.
+        /// </summary>
+        public int Width
+        {
+            get { return texture.Width; }
+        }
+
+        /// <summary>
+        /// The width of each sprite in the SpriteSheet.
+        /// </summary>
+        public int SpriteWidth
+        {
+            get { return spriteWidth; }
+        }
+
+        /// <summary>
+        /// The height of the texture.
+        /// </summary>
+        public int Height
+        {
+            get { return texture.Height; }
+        }
+
+        /// <summary>
+        /// The height of each sprite in the SpriteSheet.
+        /// </summary>
+        public int SpriteHeight
+        {
+            get { return spriteHeight; }
+        }
+
+        #endregion
+
+        /// <summary>
+        /// Create a new SpriteSheet and determine the number of sprites in the sheet.
+        /// </summary>
+        /// <param name="texture"></param>
+        /// <param name="spriteWidth">Width of each sprite.</param>
+        /// <param name="spriteHeight">Height of each sprite.</param>
+        public SpriteSheet(string name, Texture2D texture, int spriteWidth, int spriteHeight)
+            : this(name, texture, spriteWidth, spriteHeight, 0)
+        {
+        }
+
+        /// <summary>
+        /// Create a new SpriteSheet.
+        /// </summary>
+        /// <param name="texture"></param>
+        /// <param name="spriteWidth">Width of each sprite.</param>
+        /// <param name="spriteHeight">Height of each sprite.</param>
+        /// <param name="count">The number of sprites in the sheet.</param>
+        public SpriteSheet(string name, Texture2D texture, int spriteWidth, int spriteHeight, int count)
+        {
+            this.name = name;
+            this.texture = texture;
+            this.spriteWidth = spriteWidth;
+            this.spriteHeight = spriteHeight;
+
+            if(count == 0)
+            {
+                int numX = texture.Width / spriteWidth;
+                int numY = texture.Height / spriteHeight;
+
+                rectangles = new Rectangle[numX * numY];
+            }
+            else
+            {
+                rectangles = new Rectangle[count];
+            }
+
+            int x = 0, y = 0;
+            for(int i = 0; i < rectangles.Length; i++)
+            {
+                rectangles[i] = new Rectangle(x, y, spriteWidth, spriteHeight);
+
+                x += spriteWidth;
+                if(x >= texture.Width)
+                {
+                    x = 0;
+                    y += spriteHeight;
+                }
+            }
+        }
+
+        public static implicit operator Texture2D(SpriteSheet spriteSheet)
+        {
+            return spriteSheet.Texture;
+        }
+    }
+}
+
+

You can create a new SpriteSheet and use it like this:

+

`

+
SpriteSheet spriteSheet = new SpriteSheet("tiles", Content.Load<texture2D>("tiles"), 64, 64);
+
+spriteBatch.Begin();
+
+spriteBatch.Draw(spriteSheet,
+                new Rectangle(0, 0, spriteSheet.SpriteWidth, spriteSheet.SpriteHeight),
+            spriteSheet[0],
+            Color.White);
+
+spriteBatch.End();
+
+

`

+

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 diff --git a/blog/page3.html b/blog/page3.html index 15666e7..c06a258 100644 --- a/blog/page3.html +++ b/blog/page3.html @@ -1,4 +1,16 @@ -The Blog of Zachary Snow

Practical WebAssembly

December 17, 2021javascriptwasmconciso

I wrote an article for my company conciso that attempts to show a practical +The Blog of Zachary Snow

Powershell time command

March 10, 2022powershell

I commbined the best parts of this StackOverflow answer and this +Super User answer to come up with this solution for a time function +in Powershell:

+
function time {
+    $Command = "$args";
+    (Measure-Command { Invoke-Expression $Command 2>&1 | Out-Default }).ToString();
+}
+
+

Example usage:

+
# time git pull
+00:00:01.0804938
+
+

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 @@ -13,5 +25,4 @@ so I've come up with this PowerShell function:

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"
\ No newline at end of file +
\ No newline at end of file diff --git a/blog/page4.html b/blog/page4.html index 251f2f4..8861b9f 100644 --- a/blog/page4.html +++ b/blog/page4.html @@ -1,8 +1,5 @@ -The Blog of Zachary Snow

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 +The Blog of Zachary Snow

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"

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"
\ No newline at end of file +serve some static content on your system.

Continue reading "Use nginx in docker to serve static files"
\ No newline at end of file diff --git a/blog/page5.html b/blog/page5.html index 092aa14..8ad8c20 100644 --- a/blog/page5.html +++ b/blog/page5.html @@ -1,10 +1,11 @@ -The Blog of Zachary Snow

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 +The Blog of Zachary Snow

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"

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 though so I decided to use highlight.js as it already offered instructions on how to use the -library from node.

Continue reading "Node script for syntax highlighting"

Angular in Visual Studio

October 8, 2020angularvs

Now that the Angular Language Service -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"
\ No newline at end of file +library from node.

Continue reading "Node script for syntax highlighting"
\ No newline at end of file diff --git a/blog/page6.html b/blog/page6.html index 4b29ad1..a07fe5f 100644 --- a/blog/page6.html +++ b/blog/page6.html @@ -1,4 +1,7 @@ -The Blog of Zachary Snow

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 +The Blog of Zachary Snow

Angular in Visual Studio

October 8, 2020angularvs

Now that the Angular Language Service +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 @@ -30,4 +33,4 @@ :EXIT POPD -

Enum Extension Methods

Did you know you can create extension methods for enums?

Continue reading "Enum Extension Methods"
\ No newline at end of file +
\ No newline at end of file diff --git a/blog/page7.html b/blog/page7.html index 95ce835..f5f1ed0 100644 --- a/blog/page7.html +++ b/blog/page7.html @@ -1,4 +1,4 @@ -The Blog of Zachary Snow

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 +The Blog of Zachary Snow

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 @@ -32,6 +32,4 @@ no longer needed.

Dispose is just like any other method though and the using syntax can be used quite nicely for other use cases as well. Let's create a class we -can use to collect some actions to be "deferred" until a later time.

Continue reading "Abusing IDisposable"

Generating string permutations for unit testing

February 11, 2019.netc#nunit

I needed to parse a string containing 6 characters. Each character should only -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"
\ No newline at end of file +can use to collect some actions to be "deferred" until a later time.

Continue reading "Abusing IDisposable"
\ No newline at end of file diff --git a/blog/page8.html b/blog/page8.html index 153cc71..2d5b385 100644 --- a/blog/page8.html +++ b/blog/page8.html @@ -1,4 +1,6 @@ -The Blog of Zachary Snow

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 +The Blog of Zachary Snow

Generating string permutations for unit testing

February 11, 2019.netc#nunit

I needed to parse a string containing 6 characters. Each character should only +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 @@ -34,23 +36,4 @@

Lambda Collection Wrappers

April 26, 2018c#fp

I've been reading a lot as of late about functional programming and I try to incorperate as much as possible into my everyday programming. One trick that -I've definitely started using is wrapping collections in lambda functions.

Continue reading "Lambda Collection Wrappers"

string.Join Extension Method

April 19, 2018.netc#linq

Normally if want to do a string.Join on the result of a Linq query you end up with somthing looking like -this:

-
Console.WriteLine(string.Join(", ", numbers.Where(x => x % 2 == 0)));
-
-

The call to string.Join has to come first and then the Linq query. I've always felt this breaks the flow -of the code and would be easier to read if the string.Join was at the end of the Linq query:

-
Console.WriteLine(numbers.Where(x => x % 2 == 0).JoinString(", "));
-
-

This can be implemented with the following extension methods:

-
public static class JoinStringExtensions
-{
-    public static string JoinString<T>(this IEnumerable<T> source, string seperator) =>
-        string.Join(seperator, source.Select(x => x.ToString()));
-
-    public static string JoinString(this IEnumerable<string> source, string seperator) =>
-        string.Join(seperator, source);
-}
-
-

The specialization for IEnumerable<string> is just mirroring the implementation from string.Join.

-
\ No newline at end of file +I've definitely started using is wrapping collections in lambda functions.

Continue reading "Lambda Collection Wrappers"
\ No newline at end of file diff --git a/blog/page9.html b/blog/page9.html index 85548e5..04abd91 100644 --- a/blog/page9.html +++ b/blog/page9.html @@ -1,4 +1,23 @@ -The Blog of Zachary Snow

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 +The Blog of Zachary Snow

string.Join Extension Method

April 19, 2018.netc#linq

Normally if want to do a string.Join on the result of a Linq query you end up with somthing looking like +this:

+
Console.WriteLine(string.Join(", ", numbers.Where(x => x % 2 == 0)));
+
+

The call to string.Join has to come first and then the Linq query. I've always felt this breaks the flow +of the code and would be easier to read if the string.Join was at the end of the Linq query:

+
Console.WriteLine(numbers.Where(x => x % 2 == 0).JoinString(", "));
+
+

This can be implemented with the following extension methods:

+
public static class JoinStringExtensions
+{
+    public static string JoinString<T>(this IEnumerable<T> source, string seperator) =>
+        string.Join(seperator, source.Select(x => x.ToString()));
+
+    public static string JoinString(this IEnumerable<string> source, string seperator) =>
+        string.Join(seperator, source);
+}
+
+

The specialization for IEnumerable<string> is just mirroring the implementation from string.Join.

+

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:

@@ -19,5 +38,4 @@

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"
\ No newline at end of file +two helper funcitons HtmlEncode and If. Today we want to implement Include.

Continue reading "Poor Man's Template Engine in C# Part 3"
\ No newline at end of file diff --git a/feed.rss b/feed.rss index a51feee..794d354 100644 --- a/feed.rss +++ b/feed.rss @@ -31,6 +31,20 @@ can installed using a few commands from the terminal.

]]> https://smack0007.github.io/blog/2024/linux-mint-cinnamon-theme-on-debian.html Fri, 23 Aug 2024 00:00:00 GMT + + <![CDATA[Debian 12: WiFi missing after installing update]]> + It finally happened to me. The other night after installing an update from debain +bookworm and restarting my WiFi was no longer working. On the desktop +there was no longer a signal strength indicator and my browser informed me I was disconnected from the internet.

+

So I plugged in an ethernet cable and got started researching. After 2 minutes of searching I +had the answer. I used nmcli (network manager cli) to see the state of my network devices. On my WiFi adapter there +was an error plugin missing. Simply reinstalling network-manager with sudo apt reinstall network-manager fixed the +problem and I could use my WiFi again.

+]]>
+ https://smack0007.github.io/blog/2024/debian-12-update-wifi-missing.html + https://smack0007.github.io/blog/2024/debian-12-update-wifi-missing.html + Tue, 06 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 @@ -253,17 +267,6 @@ serve some static content on your system.

]]>
https://smack0007.github.io/blog/2020/use-nginx-in-docker-to-serve-static-files.html Tue, 01 Dec 2020 00:00:00 GMT
- - <![CDATA[Add the current time to your command prompt]]> - 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.

]]>
- https://smack0007.github.io/blog/2020/add-the-current-time-to-your-command-prompt.html - https://smack0007.github.io/blog/2020/add-the-current-time-to-your-command-prompt.html - Thu, 26 Nov 2020 00:00:00 GMT -
diff --git a/index.html b/index.html index bc729d8..9c6acb8 100644 --- a/index.html +++ b/index.html @@ -7,7 +7,14 @@ 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 +can installed using a few commands from the terminal.

Continue reading "Install Linux Mint Cinnamon Themes on Debian"

Debian 12: WiFi missing after installing update

It finally happened to me. The other night after installing an update from debain +bookworm and restarting my WiFi was no longer working. On the desktop +there was no longer a signal strength indicator and my browser informed me I was disconnected from the internet.

+

So I plugged in an ethernet cable and got started researching. After 2 minutes of searching I +had the answer. I used nmcli (network manager cli) to see the state of my network devices. On my WiFi adapter there +was an error plugin missing. Simply reinstalling network-manager with sudo apt reinstall network-manager fixed the +problem and I could use my WiFi again.

+

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 @@ -16,38 +23,4 @@

powershell.exe -c "Start-Process -FilePath 'syncthing' -ArgumentList '--no-browser' -WindowStyle Hidden"
 

This starts syncthing in the background after a short lived popup opens. --no-console doesn't seem to work for whatever reason.

-

Typing jest Spies

October 24, 2023typescriptjest

It often feels like TypeScript was an afterthought in jest. -Any time I need to type a variable that holds some data structure from jest it feels -like I need to dust off my old book of spells in order to find the correct incantation -to make eslint happy. A situation I finally figured -out a solution for is when you want to store the result of a call to jest.spyOn in a -shared variable:

-
let setTimeoutSpy: jest.SpyInstance;
-
-beforeEach(() => {
-  setTimeoutSpy = jest.spyOn(globalThis, 'setTimeout').mockImplementation((callback) => {
-    callback();
-    return 0 as unknown as ReturnType<typeof setTimeout>;
-  });
-});
-
-afterEach(() => {
-  setTimeoutSpy.mockRestore();
-});
-
-

Even though jest.SpyInstance is specified here as the type for randomSpy the information about exactly what -function is being spied on gets lost here. That means if elsewhere in the code if you try the following:

-
let setTimeoutCallback = () => {};
-let setTimeoutDelay: number | undefined = undefined;
-setTimeoutSpy.mockImplementation((callback, delay) => {
-  setTimeoutCallback = callback;
-  setTimeoutDelay = delay;
-  return 0 as unknown as ReturnType<typeof setTimeout>;
-});
-
-

eslint will complain that callback and delay have the type any. This is again due to the lost type information. -This problem can be resolved by using some TypeScript utility types when the spy variable is declared:

-
let setTimeoutSpy: jest.SpyInstance<ReturnType<typeof setTimeout>, Parameters<typeof setTimeout>>;
-
-

We use the built in ReturnType and Parameters utility types to perform the voodoo needed in order to make eslint happy.

\ No newline at end of file diff --git a/sitemap.xml b/sitemap.xml index eff36e1..b541e68 100644 --- a/sitemap.xml +++ b/sitemap.xml @@ -4,115 +4,115 @@ https://smack0007.github.io/index.html - https://smack0007.github.io/blog/2011/what-is-snowball-and-what-do-i-want-to-do-with-it.html + https://smack0007.github.io/blog/2014/code-from-when-i-was-young-and-stupid.html - https://smack0007.github.io/blog/2011/winquakecon.html + https://smack0007.github.io/blog/2014/adding-assembly-references-in-roslyn.html - https://smack0007.github.io/blog/2011/wmi-converting-datetime-values-to-datetime-objects.html + https://smack0007.github.io/blog/2014/all-the-cool-kids-are-static.html - https://smack0007.github.io/blog/2011/switching-from-git-to-mercurial.html + https://smack0007.github.io/blog/2014/linq-calls-iequalitycomparer-gethashcode-before-equals.html - https://smack0007.github.io/blog/2011/componentglue-on-github.html + https://smack0007.github.io/blog/2014/my-experience-with-opengl-vs-direct3d.html - https://smack0007.github.io/blog/2011/getting-started-with-slimdx.html + https://smack0007.github.io/blog/2011/favoring-composition-over-inheritance.html - https://smack0007.github.io/blog/2011/snowball-and-github.html + https://smack0007.github.io/blog/2011/componentglue-on-github.html - https://smack0007.github.io/blog/2011/favoring-composition-over-inheritance.html + https://smack0007.github.io/blog/2011/using-git-gui-with-cygwin-on-windows-7.html - https://smack0007.github.io/blog/2011/snowball-a-slightly-different-direction.html + https://smack0007.github.io/blog/2011/winquakecon.html - https://smack0007.github.io/blog/2011/keeping-splitcontainer-splitterdistance-consistent.html + https://smack0007.github.io/blog/2011/marker-interfaces.html - https://smack0007.github.io/blog/2011/opentk-simple-movable-sprite.html + https://smack0007.github.io/blog/2011/switching-from-git-to-mercurial.html - https://smack0007.github.io/blog/2011/xaudio2-stop-currently-playing-sound.html + https://smack0007.github.io/blog/2011/getting-started-with-opentk.html - https://smack0007.github.io/blog/2011/getting-started-with-opentk.html + https://smack0007.github.io/blog/2011/wmi-converting-datetime-values-to-datetime-objects.html - https://smack0007.github.io/blog/2011/marker-interfaces.html + https://smack0007.github.io/blog/2011/what-is-snowball-and-what-do-i-want-to-do-with-it.html - https://smack0007.github.io/blog/2011/using-git-gui-with-cygwin-on-windows-7.html + https://smack0007.github.io/blog/2011/snowball-a-slightly-different-direction.html - https://smack0007.github.io/blog/2022/deno-get-path-of-script.html + https://smack0007.github.io/blog/2011/opentk-simple-movable-sprite.html - https://smack0007.github.io/blog/2022/blog-now-runs-on-deno.html + https://smack0007.github.io/blog/2011/snowball-and-github.html - https://smack0007.github.io/blog/2022/iterating-thru-an-object-in-javascript.html + https://smack0007.github.io/blog/2011/keeping-splitcontainer-splitterdistance-consistent.html - https://smack0007.github.io/blog/2022/powershell-time-command.html + https://smack0007.github.io/blog/2011/getting-started-with-slimdx.html - https://smack0007.github.io/blog/2015/using-batch-files-as-task-runner-vs-code.html + https://smack0007.github.io/blog/2011/xaudio2-stop-currently-playing-sound.html - https://smack0007.github.io/blog/2014/adding-assembly-references-in-roslyn.html + https://smack0007.github.io/blog/2019/use-nameof-to-set-string-variable-to-its-name.html - https://smack0007.github.io/blog/2014/all-the-cool-kids-are-static.html + https://smack0007.github.io/blog/2019/generating-string-permutations-for-unit-testing.html - https://smack0007.github.io/blog/2014/code-from-when-i-was-young-and-stupid.html + https://smack0007.github.io/blog/2019/abusing-idisposable.html - https://smack0007.github.io/blog/2014/linq-calls-iequalitycomparer-gethashcode-before-equals.html + https://smack0007.github.io/blog/2019/dynamically-loaded-dll-thows-accessviolationexception-on-first-function-call.html - https://smack0007.github.io/blog/2014/my-experience-with-opengl-vs-direct3d.html + https://smack0007.github.io/blog/2022/iterating-thru-an-object-in-javascript.html - https://smack0007.github.io/blog/2009/spritesheet-class.html + https://smack0007.github.io/blog/2022/deno-get-path-of-script.html - https://smack0007.github.io/blog/2009/the-game-show-host-problem-aka-the-monty-hall-problem.html + https://smack0007.github.io/blog/2022/blog-now-runs-on-deno.html - https://smack0007.github.io/blog/2009/calculating-an-angle-from-a-vector2.html + https://smack0007.github.io/blog/2022/powershell-time-command.html - https://smack0007.github.io/blog/2009/drawing-2d-lines-as-rotated-quads.html + https://smack0007.github.io/blog/2020/add-the-current-time-to-your-command-prompt.html - https://smack0007.github.io/blog/2013/component-glue-v1-0.html + https://smack0007.github.io/blog/2020/checking-for-uncommited-git-changes-in-a-batch-program.html - https://smack0007.github.io/blog/2013/introducing-gldotnet.html + https://smack0007.github.io/blog/2020/github-actions.html - https://smack0007.github.io/blog/2013/using-component-glue-to-build-your-object-graphs-automatically.html + https://smack0007.github.io/blog/2020/node-script-for-syntax-highlighting.html - https://smack0007.github.io/blog/2013/gldotnet-version-0-6-0.html + https://smack0007.github.io/blog/2020/creating-a-asp.net-web-app-with-an-angular-frontend.html - https://smack0007.github.io/blog/2019/dynamically-loaded-dll-thows-accessviolationexception-on-first-function-call.html + https://smack0007.github.io/blog/2020/execute-different-commands-in-msbuild-depending-on-platform.html - https://smack0007.github.io/blog/2019/abusing-idisposable.html + https://smack0007.github.io/blog/2020/enum-extension-methods.html - https://smack0007.github.io/blog/2019/use-nameof-to-set-string-variable-to-its-name.html + https://smack0007.github.io/blog/2020/use-newtonsoft.json-in-.net-core-3-web-api.html - https://smack0007.github.io/blog/2019/generating-string-permutations-for-unit-testing.html + https://smack0007.github.io/blog/2020/nativelibraryloader-for-assembly-with-moduleinitializer.html https://smack0007.github.io/blog/2020/use-nginx-in-docker-to-serve-static-files.html @@ -120,179 +120,182 @@ https://smack0007.github.io/blog/2020/filter-itemgroup-by-extension-in-msbuild.html + + https://smack0007.github.io/blog/2020/disable-csharp-null-checks-for-a-field-or-property.html + https://smack0007.github.io/blog/2020/predictable-random-number-generation-in-typescript.html - https://smack0007.github.io/blog/2020/node-script-for-syntax-highlighting.html + https://smack0007.github.io/blog/2020/creating-a-tsexec-command.html - https://smack0007.github.io/blog/2020/github-actions.html + https://smack0007.github.io/blog/2020/angular-in-visual-studio.html - https://smack0007.github.io/blog/2020/use-newtonsoft.json-in-.net-core-3-web-api.html + https://smack0007.github.io/blog/2024/linux-mint-cinnamon-theme-on-debian.html - https://smack0007.github.io/blog/2020/nativelibraryloader-for-assembly-with-moduleinitializer.html + https://smack0007.github.io/blog/2024/start-syncthing-background-windows.html - https://smack0007.github.io/blog/2020/creating-a-tsexec-command.html + https://smack0007.github.io/blog/2024/install-debian-m715q.html - https://smack0007.github.io/blog/2020/add-the-current-time-to-your-command-prompt.html + https://smack0007.github.io/blog/2024/debian-12-update-wifi-missing.html - https://smack0007.github.io/blog/2020/execute-different-commands-in-msbuild-depending-on-platform.html + https://smack0007.github.io/blog/2024/goodbye-windows.html - https://smack0007.github.io/blog/2020/enum-extension-methods.html + https://smack0007.github.io/blog/2010/visual-studio-move-referenced-dll-to-different-directory-after-build.html - https://smack0007.github.io/blog/2020/angular-in-visual-studio.html + https://smack0007.github.io/blog/2010/xna-load-texture2d-from-embedded-resource.html - https://smack0007.github.io/blog/2020/creating-a-asp.net-web-app-with-an-angular-frontend.html + https://smack0007.github.io/blog/2010/component-glue.html - https://smack0007.github.io/blog/2020/checking-for-uncommited-git-changes-in-a-batch-program.html + https://smack0007.github.io/blog/2010/500-downloads-of-the-same-game.html - https://smack0007.github.io/blog/2020/disable-csharp-null-checks-for-a-field-or-property.html + https://smack0007.github.io/blog/2010/changing-the-platformtarge-in-visual-c-express.html - https://smack0007.github.io/blog/2008/colors-and-hex.html + https://smack0007.github.io/blog/2010/progress-bars-in-windows-7-taskbars.html - https://smack0007.github.io/blog/2008/zend_db_table-as-a-model.html + https://smack0007.github.io/blog/2010/creating-and-consuming-services-in-your-xna-game.html - https://smack0007.github.io/blog/2018/poor-mans-template-engine-2.html + https://smack0007.github.io/blog/2010/implementing-basic-dependency-injection-using-services-container.html - https://smack0007.github.io/blog/2018/a-neat-way-to-curry-in-csharp.html + https://smack0007.github.io/blog/2010/winforms-and-mvc.html - https://smack0007.github.io/blog/2018/poor-mans-template-engine-1.html + https://smack0007.github.io/blog/2010/csharp-extension-methods-in-your-own-library.html - https://smack0007.github.io/blog/2018/lambda-collection-wrappers.html + https://smack0007.github.io/blog/2010/drawing-rectangles-with-spritebatch.html - https://smack0007.github.io/blog/2018/merging-build-directory-props.html + https://smack0007.github.io/blog/2013/gldotnet-version-0-6-0.html - https://smack0007.github.io/blog/2018/string-join-extension-method.html + https://smack0007.github.io/blog/2013/using-component-glue-to-build-your-object-graphs-automatically.html - https://smack0007.github.io/blog/2018/poor-mans-template-engine-3.html + https://smack0007.github.io/blog/2013/component-glue-v1-0.html - https://smack0007.github.io/blog/2018/enabling-the-latest-version-of-csharp.html + https://smack0007.github.io/blog/2013/introducing-gldotnet.html - https://smack0007.github.io/blog/2018/functional-card-deck-in-csharp.html + https://smack0007.github.io/blog/2012/using-themes-in-visual-studio-express-for-windows-desktop.html - https://smack0007.github.io/blog/2018/git-quick-push.html + https://smack0007.github.io/blog/2012/getting-started-with-snowball.html - https://smack0007.github.io/blog/2018/snowball-2.html + https://smack0007.github.io/blog/2012/http-status-codes-as-telephone-calls.html - https://smack0007.github.io/blog/2018/run-program-directly-after-building-vscode.html + https://smack0007.github.io/blog/2012/id3dxeffectonlostdevice.html - https://smack0007.github.io/blog/2010/progress-bars-in-windows-7-taskbars.html + https://smack0007.github.io/blog/2012/snowball-is-now-modular.html - https://smack0007.github.io/blog/2010/changing-the-platformtarge-in-visual-c-express.html + https://smack0007.github.io/blog/2012/snowball-shaders-in-progress.html - https://smack0007.github.io/blog/2010/creating-and-consuming-services-in-your-xna-game.html + https://smack0007.github.io/blog/2012/snowball-now-using-sharpdx.html - https://smack0007.github.io/blog/2010/visual-studio-move-referenced-dll-to-different-directory-after-build.html + https://smack0007.github.io/blog/2012/snowball-now-based-on-shaders.html - https://smack0007.github.io/blog/2010/component-glue.html + https://smack0007.github.io/blog/2008/colors-and-hex.html - https://smack0007.github.io/blog/2010/winforms-and-mvc.html + https://smack0007.github.io/blog/2008/zend_db_table-as-a-model.html - https://smack0007.github.io/blog/2010/500-downloads-of-the-same-game.html + https://smack0007.github.io/blog/2015/using-batch-files-as-task-runner-vs-code.html - https://smack0007.github.io/blog/2010/xna-load-texture2d-from-embedded-resource.html + https://smack0007.github.io/blog/2018/a-neat-way-to-curry-in-csharp.html - https://smack0007.github.io/blog/2010/implementing-basic-dependency-injection-using-services-container.html + https://smack0007.github.io/blog/2018/merging-build-directory-props.html - https://smack0007.github.io/blog/2010/drawing-rectangles-with-spritebatch.html + https://smack0007.github.io/blog/2018/run-program-directly-after-building-vscode.html - https://smack0007.github.io/blog/2010/csharp-extension-methods-in-your-own-library.html + https://smack0007.github.io/blog/2018/functional-card-deck-in-csharp.html - https://smack0007.github.io/blog/2021/starting-redis-and-the-redis-cli-with-docker.html + https://smack0007.github.io/blog/2018/poor-mans-template-engine-2.html - https://smack0007.github.io/blog/2021/practical-wasm.html + https://smack0007.github.io/blog/2018/string-join-extension-method.html - https://smack0007.github.io/blog/2021/powered-by-typescript.html + https://smack0007.github.io/blog/2018/snowball-2.html - https://smack0007.github.io/blog/2021/use-bash-exe-to-run-scripts-in-windows.html + https://smack0007.github.io/blog/2018/enabling-the-latest-version-of-csharp.html - https://smack0007.github.io/blog/2021/convert-typescript-ast-to-json.html + https://smack0007.github.io/blog/2018/git-quick-push.html - https://smack0007.github.io/blog/2021/windows-terminal-fork-command.html + https://smack0007.github.io/blog/2018/poor-mans-template-engine-3.html - https://smack0007.github.io/blog/2024/linux-mint-cinnamon-theme-on-debian.html + https://smack0007.github.io/blog/2018/lambda-collection-wrappers.html - https://smack0007.github.io/blog/2024/install-debian-m715q.html + https://smack0007.github.io/blog/2018/poor-mans-template-engine-1.html - https://smack0007.github.io/blog/2024/goodbye-windows.html + https://smack0007.github.io/blog/2009/drawing-2d-lines-as-rotated-quads.html - https://smack0007.github.io/blog/2024/start-syncthing-background-windows.html + https://smack0007.github.io/blog/2009/calculating-an-angle-from-a-vector2.html - https://smack0007.github.io/blog/2023/typing-jest-spies.html + https://smack0007.github.io/blog/2009/the-game-show-host-problem-aka-the-monty-hall-problem.html - https://smack0007.github.io/blog/2023/enums-considered-harmful.html + https://smack0007.github.io/blog/2009/spritesheet-class.html - https://smack0007.github.io/blog/2012/id3dxeffectonlostdevice.html + https://smack0007.github.io/blog/2023/typing-jest-spies.html - https://smack0007.github.io/blog/2012/using-themes-in-visual-studio-express-for-windows-desktop.html + https://smack0007.github.io/blog/2023/enums-considered-harmful.html - https://smack0007.github.io/blog/2012/snowball-now-using-sharpdx.html + https://smack0007.github.io/blog/2021/powered-by-typescript.html - https://smack0007.github.io/blog/2012/snowball-is-now-modular.html + https://smack0007.github.io/blog/2021/convert-typescript-ast-to-json.html - https://smack0007.github.io/blog/2012/http-status-codes-as-telephone-calls.html + https://smack0007.github.io/blog/2021/practical-wasm.html - https://smack0007.github.io/blog/2012/snowball-now-based-on-shaders.html + https://smack0007.github.io/blog/2021/windows-terminal-fork-command.html - https://smack0007.github.io/blog/2012/snowball-shaders-in-progress.html + https://smack0007.github.io/blog/2021/use-bash-exe-to-run-scripts-in-windows.html - https://smack0007.github.io/blog/2012/getting-started-with-snowball.html + https://smack0007.github.io/blog/2021/starting-redis-and-the-redis-cli-with-docker.html https://smack0007.github.io/about.html diff --git a/tags/debian-12/index.html b/tags/debian-12/index.html new file mode 100644 index 0000000..1696880 --- /dev/null +++ b/tags/debian-12/index.html @@ -0,0 +1,8 @@ +debian-12

Debian 12: WiFi missing after installing update

It finally happened to me. The other night after installing an update from debain +bookworm and restarting my WiFi was no longer working. On the desktop +there was no longer a signal strength indicator and my browser informed me I was disconnected from the internet.

+

So I plugged in an ethernet cable and got started researching. After 2 minutes of searching I +had the answer. I used nmcli (network manager cli) to see the state of my network devices. On my WiFi adapter there +was an error plugin missing. Simply reinstalling network-manager with sudo apt reinstall network-manager fixed the +problem and I could use my WiFi again.

+
\ No newline at end of file diff --git a/tags/debian/index.html b/tags/debian/index.html index 714e89b..1dbe1c4 100644 --- a/tags/debian/index.html +++ b/tags/debian/index.html @@ -7,7 +7,14 @@ 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 +can installed using a few commands from the terminal.

Continue reading "Install Linux Mint Cinnamon Themes on Debian"

Debian 12: WiFi missing after installing update

It finally happened to me. The other night after installing an update from debain +bookworm and restarting my WiFi was no longer working. On the desktop +there was no longer a signal strength indicator and my browser informed me I was disconnected from the internet.

+

So I plugged in an ethernet cable and got started researching. After 2 minutes of searching I +had the answer. I used nmcli (network manager cli) to see the state of my network devices. On my WiFi adapter there +was an error plugin missing. Simply reinstalling network-manager with sudo apt reinstall network-manager fixed the +problem and I could use my WiFi again.

+

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 01593ae..280e0de 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/net/page7.html b/tags/net/page7.html index 448497f..902ab40 100644 --- a/tags/net/page7.html +++ b/tags/net/page7.html @@ -72,7 +72,7 @@ } } -

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.

+

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;
@@ -125,7 +125,7 @@
     }
 }
 
-

Keeping SplitContainer SplitterDistance consistent

February 9, 2011.netwinforms

If you're having trouble keeping the SplitterDistance property of a SplitContainer consistent across app sessions, you can set the FixedPanel property of the splitter to FixedPanel.Panel1.

+

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"

Keeping SplitContainer SplitterDistance consistent

February 9, 2011.netwinforms

If you're having trouble keeping the SplitterDistance property of a SplitContainer consistent across app sessions, you can set the FixedPanel property of the splitter to FixedPanel.Panel1.

splitter.FixedPanel = FixedPanel.Panel1;
 

I guess this could also work with FixedPanel.Panel2 as well but I haven't given it a try. Credit this stackoverflow post.

diff --git a/tags/network-manager/index.html b/tags/network-manager/index.html new file mode 100644 index 0000000..c6a3cf8 --- /dev/null +++ b/tags/network-manager/index.html @@ -0,0 +1,8 @@ +network-manager

Debian 12: WiFi missing after installing update

It finally happened to me. The other night after installing an update from debain +bookworm and restarting my WiFi was no longer working. On the desktop +there was no longer a signal strength indicator and my browser informed me I was disconnected from the internet.

+

So I plugged in an ethernet cable and got started researching. After 2 minutes of searching I +had the answer. I used nmcli (network manager cli) to see the state of my network devices. On my WiFi adapter there +was an error plugin missing. Simply reinstalling network-manager with sudo apt reinstall network-manager fixed the +problem and I could use my WiFi again.

+
\ No newline at end of file diff --git a/tags/opengl/index.html b/tags/opengl/index.html index edf0d78..aded7df 100644 --- a/tags/opengl/index.html +++ b/tags/opengl/index.html @@ -11,7 +11,7 @@

Changelog:

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

-

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.

+

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;
@@ -64,4 +64,4 @@ 

Changelog:

} }
-
\ No newline at end of file +

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 diff --git a/tags/wifi/index.html b/tags/wifi/index.html new file mode 100644 index 0000000..c3eab7d --- /dev/null +++ b/tags/wifi/index.html @@ -0,0 +1,8 @@ +wifi

Debian 12: WiFi missing after installing update

It finally happened to me. The other night after installing an update from debain +bookworm and restarting my WiFi was no longer working. On the desktop +there was no longer a signal strength indicator and my browser informed me I was disconnected from the internet.

+

So I plugged in an ethernet cable and got started researching. After 2 minutes of searching I +had the answer. I used nmcli (network manager cli) to see the state of my network devices. On my WiFi adapter there +was an error plugin missing. Simply reinstalling network-manager with sudo apt reinstall network-manager fixed the +problem and I could use my WiFi again.

+
\ No newline at end of file