Bastian Molkenthin - Sunshine2k

arrow C#


JSON parser

Generic tokenizer Date : December 2022
Version : 1.0.0

Source available : YES

Description :
This is my implementation of a JSON parser, developed from scratch, based on my Generic Tokenizer library.
It can parse JSON files and provide the contents via a tree-based data model.
Also read the correspondig article which explains the implementation in detail:
Tutorial: A practical approach to write a simple JSON parser yourself
The package contains beside the whole source code a test application with example JSON files (based on my Simple Test Environment) and a demo application which parses a provided JSON file and prints the content of the data model to console.

Download Sunshine's Simple JSON parser library and demo applications (source code and executable; Visual C# project, 103 kb)



Pan & Zoom Demo

Generic tokenizer Date : June 2022
Version : 1.0.0

Source available : YES

Description :
This is a demonstration of panning (moving a small view port in a larger world) and zooming (scaling the view port window).
The demo constructs a global 2D world (having lines, rectangles and circles) that is far larger than the window for display, so only a cutout (called "view port") of the global space is visible.
The view port can be move around the world (called panning) via mouse by pressing the left mouse button and move the cursor in the view port window while the mouse button is being pressed. The size of the view port can be increated and decreased (called scaling or zooming).
Also read the correspondig article which explains the math behind in more detail: Panning and zooming article

Download Sunshine's Pan And Zoom Demo (source code and executable; Visual C# project, 28 kb)



Generic Tokenizer

Generic tokenizer Date : April 2024
Version : 1.0.0

Source available : YES

Description :
This is my own implementation of a tokenizer in C#.
It provides a generic, versatile tokenizer that can be used as base for development of own tokenizers and parsers.
Also read the correspondig article which explains the implementation of the generic tokenizer library as well as its usage in detail: Writing a simple generic tokenizer article

History / Updates:
- 2024/04/19: Version 1.1.0:
   Add support to create the input source directly from a string
   Add support to default extract method of Token class to handle token with more than one character
   Renamed functions to have a common style
   NOTE: The changes are not compatible to previous versions!
- 2022/12/22: Version 1.0.1 - Added GetCurrentToken() method
- 2022/01/01: Version 1.0.0 - Initial version

Download Sunshine's Simple Generic Tokenizer library and demo applications 1.1.0 (source code and executable; Visual C# project, 100 kb)

Old versions:
Download 1.0.1
Download 1.0.0



Simple Test Environment

Matrix / Vector playground Date : November 2021
Version : 1.0.2

Source available : YES

Description :
This is my own simplistic solution how to implement a basic unit test environment in C#.
It provides a default behavior for console mode applications, but is configurable by providing your own interface implementations.

Of course, I could have used NUnit or any other of the million (much more sophisticated, better, faster, more usable, more comprehensive, ...) frameworks, but I did not want any dependency to a foreign framework.
So here you have the result of my minimalistic approach.

History / Updates:
- 2022/12/22: Version 1.0.2 - add AssertEqualEnum(), AssertNotEqualEnum() and AssertException()
- 2021/12/23: Version 1.0.1 - add support to retrieve test case name inside test case context
- 2021/11/15: Version 1.0.0 - initial version

Download Sunshine's Simple Test Environment demo application and library 1.0.2 (source code and executable; Visual C# project, 24 kb)

Old versions:
Download 1.0.1
Download 1.0.0



Matrix / Vector playground

Matrix / Vector playground Date : February 2021
Version : 1.0

Source available : YES

Description :
This is an example implementation of Vector and Matrix classes for 2D and 3D in C#, along with tests for all provided functions.
It served me as my own playground to understand certain aspects of the common vector and matrix operations much better.

Download Vector Matrix calculations demo application (source code and executable; Visual C# project, 48 kb)



Simple camera-perspective-screen transform demo

Screenshot Date : October 2020
Version : 1.0

Source available : YES

Description :
This little application is my playground to start fiddling with camera-to-perspective and perspective-to-screen transformation.
It has no real use - it's just my own try to project a single 3D point and wireframe cube from camera space to screen and investigate the transformation steps.
I guess it makes most sense to read my article Simplistic fixed camera to perspective screen transformation on my website along with playing around with this tool to gain the biggest benefit for understanding the process.>

Download Camera-perspective-screen transformation demo application (source code and executable; Visual C# project, 39 kb)



Simple big (unsigned) integer library

Program screenshot Date : August 2020
Version : 1.0

Source available : YES

Description :
Implementations of a simple big unsigned integer class with the main arithmetic operations in C#.
This was created along with my article Understanding and implementing a simple big (unsigned) integer library.

Download C# big unsigned integer library (command line project, source code and executable; Visual C# project, 59 kb)



Raycasting Demo V1

Program screenshot Date : May 2020
Version : 1.0

Source available : YES

Description :
A simple raycasting demo in C#.
Raycasting is rendering technique to create a 3D view of a 2D map and can be seen as the most basic form of raytracing.
Having started coding it somewhen in 2014/2015, I pretty soon lost interest and was also never satisfied with the result. Now, after lying around on my hard drive for around five years in which I was never again motivated to continue development, I release it "as it is".

Download C# Raycasting Demo V1 (source code and executable; Visual C# 2010 Express project, 39 kb)



Sunshine's ELF viewer console

Program screenshot Date : July 2022
Version : 1.0.1

Source available : YES

Description :
Simple console application to read the most important information from 32/64 bit ELF files.
Supports ELF header, section header table, program header table, symbol tables and note tables. Each table can be shown in short or detailed mode.

History / Updates:
- 2022/07/01: Version 1.0.1 - fixed typos
- 2018/10/01: Version 1.0.0 - initial version

Download C# ELF viewer console (1.0.1) (command line project, source code and executable; Visual C# 2010 Express project, 81 kb)
Download C# ELF viewer console (1.0.0) (command line project, source code and executable; Visual C# 2010 Express project, 81 kb)



Fixed point number class

Program screenshot Date : April 2017
Version : 1.0

Source available : YES

Description :
Implementations of a fixed point number class with the main arithmetic operations in C#.
This was created along with my article Understanding and implementing fixed point numbers.
View also javascript-based online fixed point number demonstration.

Download C# fixed point number implementation (command line project, source code and executable; Visual C# 2010 Express project, 20 kb)



Permutation generation algorithm implementations

Program screenshot Date : October 2016
Version : 1.0

Source available : YES

Description :
Implementations of eight different algorithms to generate all possible permutation of a set using C#.
This was created along with my article Calculating permutations.

Download C# permutation generation algorithms (command line project, source code and executable; Visual C# 2010 Express project, 24 kb)



Base64 algorithm implementations

Program screenshot Date : January 2016
Version : 1.0

Source available : YES

Description :
Implementations of different algorithms to encode and decode Base64 using C#.
This was created along with my article Understanding and implementing Base64.

Download C# Base64 algorithms (command line project, only source code, no executable; Visual C# 2010 Express project, 24 kb)



CRC algorithm implementations

Program screenshot Date : February 2015 (Last update: March 2023)
Version : 4.0

Source available : YES

Description :
Implementations of different algorithms to calculate CRC using C#.
This was created along with my article Understanding and implementing CRC.

History:
* Version 4.0 (03/2023) : Added implementations for all CRC sizes in range [1, 64]
* Version 3.0 (12/2017) : Added 64bit CRC support
* Version 2.0 (11/2016) : Added versions of reflected algorithms
* Version 1.0 (02/2015) : Initial release

Downloads:
Download C# CRC algorithms V4 (Library code) (Visual C# 2010 project, 47 kb)
Download C# CRC algorithms V3 (Library code) (Visual C# 2010 project, 37 kb)
Download C# CRC algorithms V2 (Library code) (Visual C# 2010 project, 25 kb)
Download C# CRC algorithms V1 (Library code) (Visual C# 2010 project, 15 kb)



SunPEView - A simple PE file viewer

Program screenshot Date : 2014-02-14
Version : 0.7.1.0

Source available : YES

Description :
SunPEView is a little PE file viewer to investigate PE32/PE64 files. It further supports a hexeditor view, a file location calculator and a hex-dec-bin converter.
SunPEView has its own site - Check it out now!



HeaderIncludeTool

Program screenshot Date : January 2013
Version : 1.02

Source available : YES

Description :
This tool creates an include dependency tree of C source files (*.c, *.h, *.cpp) and checks if there is a cycle in the hierarchy. The user has to specify all relevant source/include folders as well as a root file (normally the file which has the main() routine) which is used as root node for the include tree.

If the tool is executed without any arguments, it's a wizard-like GUI application. When providing commandline arguments, it runs as console application. Note that this is a simple tool and does not evaluate preprocessor statements and thus no conditional includes.

Package includes application, source code and some little tests to show the usage of the tool.
Download 1.02 (60KB)
New in Version 1.02:
Enlarged windows, added check button to test all found files for include cycles, corrected commandline handling.

Older Versions:
Download 1.01 (60KB) Download 1.00 (57KB)



My Simple Playlist Generator

Program screenshot Date : March 2009 (Perl port: May 2014)

Source available : YES

Description :
I 'hacked' this tiny app very quickly for personal needs. I wanted my music files sorted after file creation / modification date and none of the media players I use provided this functionality. This tool just parses a directory (with/without subdirectories) for music files and writes them to a *.m3u file (ready to be loaded with e.g. Winamp) sorted after modification date (from oldest to newest). That's it - maybe you are searching for exactly this tool. If not, as the source is easy, feel free to take it as a starting point to generate your own playlists by implementing your own sorting criterias.

Download (39KB)
Download Perl port (2KB)



Project "Sunshine's Brainfuck Studio"

Program screenshot Date : April 2007 / Version: 0.61

Source available : YES

Description :
A Brainfuck Interpreter with IDE.
Provides comfortable environment for creation, debugging (single-stepping supported) and running of Brainfuck programs. But why say another word - check the Brainfuck Studio Site.



GUI Wrapper for Huffman Compression

Program screenshot Date : June 2007

Source available : YES

Description :
A Gui-Wrapper for my huffman compression implementation.
I just put the whole functionality in a dll file and coded this GUI for easier use.
(Needs .NET Framework 2.0)

Download (97KB)





This site is part of Sunshine's Homepage