Category Archives: Projects

Personal projects that I am either working on or thinking of working on.

Did a Little More Research on Interop During Lunch

I did a bit more research on interop topics during lunch today. I’m going to try to write up some samples using interop to work with the file information and volume information APIs that aren’t available in C# tonight.

If all goes well, I should have something to push up to github as a set of code samples. I don’t expect this to be a finished product, but should be interesting in any case.

I also want to fix the Wix issues with my service sample and get that pushed with a working installer. Probably won’t get the guts finished but should be able to install and uninstall the thing without dev tools.

Windows services with single page web apps

I’m getting things going on some sandbox software projects that have been sitting on the shelf for some time. Perhaps a bit spread out but should be interesting.

I want to be able to put together free-standing service applications that expose both RESTful programmatic control and single page interactive GUIs without involving an external web server.

Looking like C# and either OWIN or .NET core as the sweet spot here. Need to choose a javascript library for the client side bits…Angular2 seems interesting but may be more involved for first attempts than I want.

I’ve also signed up for several of the sale Udemy courses…started out with an impulse buy of the Unreal Engine Programming course and an associated Blender course. Added in some Angular, Node and web programming stuff. Probably more in there than I’ll have time to get to,  but at $10 each I can deal.

Definitely need to come up to speed more on the various web programming environments and tools as they’re looking like the right way to do UI at this point. Leaves me with ASP.NET, Node and Apache with PHP, Javascript, C# and Typescript on the plate 🙂 Each of these shows up somewhere in my environments of interest. Should be fun…

Web Implementation Options for SandBox Projects

Looking at some sandbox projects that need web interfaces.

Winding up with a big split here

  • PHP/Apache (LAMP) for real site work.
    Anything that needs to run up here on my hosting will be something LAMP-like. Code needs to be PHP (at least locally) with back end persistence in MySQL.
    Front end should be more flexible. As long as the back ends can provide what the browser side code needs all should be good.
  • IIS/ASP.NET looks like the easiest choice (with .net core MVC as the tool set) for windows integrated work. I have a few things that want to run locally on a system but present a web interface externally. These tools should provide lots of ‘traction’ with close windows integration. Probably an Angular front end and perhaps a full service on the back-end.
  • Node.js shows up in many places. It provides a fast to deploy web server that is flexible and easy to code for. It is on my list in part because it has been showing up in places that are interesting and it part because it promises to support light-weight tasks where IIS would seem like over-kill.

For the front ends there are a huge number of choices out there. Of the ones I’ve seen

  • Angular 2 seems to be pretty capable and well respected. I expect to do at least some work with Angular and if it proves easy to work with I may focus on it.
  • Bootstrap is older (I think) but appears to provide a similar set of tools and infrastructure. If I run into issues with Angular, I may give this a try for something small and see how well it works.

I am also looking at free-standing, light weight web server options that run in C#. This is primarily aimed at RESTful interfaces to back-end code. OWIN and Katana seem to promise something like this while on the C++ side (and I expect C++ will show up now and then) microhttpd looks promising (with GPL restrictions, but these are sandbox projects).

Currently doing quite a bit of reading. Soon I’ve got to kick off from reading and get to some doing. Not sure what I’ll tackle first but I will probably try to list the things I’d like to kick around before I pick one…stay tuned.

 

A Little bit of python…

Someone at work asked about shuffling cards in software (or similar type problems) so I write a small bit of python for them. Python isn’t a language that I’ve had much need for in the past but it was the language they are familiar with:

#! /usr/bin/env python3
import random

# Cards in each suit
cards = ['Ace', '2', '3', '4', '5', '6', '7', '8', '9', '10', 'Jack', 'Queen', 'King']

# Suits of cards
suits = ['Clubs', 'Hearts', 'Diamonds', 'Spades']

# Start with an empty deck and fill it with on card of each type in each suit
deck = []
for card in cards:
 for suit in suits:
 deck.append(card + " of " + suit)

# Make sure we got the right number of cards in the deck
decksize = len(deck)
print (str(decksize) + " cards in a deck")

# Shuffle the cards by walking through each location and swapping it with a
# randomly chosen location in the deck.
for item in range(0, decksize):
 dest = random.randint(0, decksize - 1)
 # Swap by saving the contents of the destination spot, copying the source
 # spot there and then placing our saved card in the source location.
 temp = deck[dest]
 deck[dest] = deck[item]
 deck[item] = temp
 
print(deck);

Classic bit of swap based shuffle.

I was a bit surprised to see that python has split into two largely incompatible languages with the transition from 2.x to 3.x being drawn out and there seems to be some question whether there will ever be a full transition.

It does appear that with a bit of care it is possible to have both versions on one system with distinct names. Makes things workable if not exactly pleasant.

JSON options in C#…too many options

I’m getting back to sandbox projects on the home front (plenty that got shelved when things got busy) and have been looking at JSON handling in C#.

So far a quick scan of what is out there leaves me with the impression that there are many choices and no clearly dominant one.

So far the open source http://www.newtonsoft.com/json seems to be the best choice. I think I’m going that way for the time being and will look into other options down the road.

Thinking that MongoDB may be a good back end for the data storage I need for the current work at hand. JSON-centric as well so likely a good overall match.

 

I Still Need to fix my Landing Page Redirect.

Mod_rewrite seems to cause me no end of problems so far. I’ve got two URLs pointed at this hosting (one dormant but I’d like to keep it alive). I want apache to redirect my base url to my landing page while preserving access to the other site.

So far I’ve largely managed to either nuke my sister’s wordpress site while successfully redirecting ninecrows or take out everything with a broken rewrite configuration. I thought I had it working at one point or another but it always seems to come back to a caching issue fooling me into seeing the fix working.

Not sure when I’ll get back to this but it is a bit annoying…

Dead Computer, Live Computer

Looks like the spare core-2 machine is likely down for the count. Even with the motherboard completely out of the chassis with nothing but the power supply and the power switch plugged in it seems to immediately shut down the power supply. I may give it one more shot on the possibility that it just doesn’t start properly without at least memory and video but I’m not hopeful.

I’ve started an install of Ubuntu 16.10 on ‘madhatter’ my back basement lab bench machine. This should do nicely for now. I’ll probably wind up buying some low-ish end hardware to replace the dead machine when the back lab bench area gets set up with a 3D printer. Until then this provides a decent Intel based linux machine that should meet my needs.

Once the base install is complete I need to get

  • xrdp installed for easy remote UI access
  • SSH installed (if not there out of the box) and configured for secure command line stuff.
  • tightvnc installed mostly to see if it works better than the free version of realvnc that came pre-installed on the RPi
  • samba to make files available to my windows boxes and hopefully set up for cleaner network visibility.

Hoping that this one goes smoothly. Disappointing the number of machines that have gone flaky recently.


Ubuntu install appeared to succeed. The machine was waiting at a ‘press enter to restart’ prompt when I checked on it this morning.

It is running on a WD ‘green’ drive so may be a bit slow booting. When I left it was still showing just a black screen (after dropping through a ‘how should I boot’ screen) so I’ll see tonight whether this system loaded up successfully. The machine seems ok overall as the windows 10 boot disk works fine.

I did start downloads of the Ubuntu 16 and 14 LTS releases to try tonight if the 16.10 image fails. Hoping there isn’t some incompatibility with core-2 era computers in newer Linux builds.

Time to Define Tables

I’ve worked with databases on and off for a long time but in general I’ve been accessing previously defined data tables or had very simple needs (DynamoDB kind of forces that).

I’m at the point in my sandbox work that I’m about to define a substantially more complex schema than I’ve used for anything in the past. Finding that my command of SQL DDL and the various bits involved in creating MySQL users and setting permissions is taking some doing.

I still can’t seem to get a database on a remote system (boojum, myimg_20161229_133853 little test machine). I am not getting a ‘no connection’ response but an authorization failure so I expect that the identit(ies) I created on the NUC aren’t quite right Always details to be dealt with…

I am finding that tables proliferate. Everything needs a unique ID (and auto increment columns help enormously here). Any sort of one to many relationship (keywords, validation) winds up with a new table containing the source object key and the targets. In the past I’ve used the DB as an index for more complex storage (DICOM-3 pretty much forces this with its many 1..n fields, DynamoDB encourages this as well with bulk information in S3).

In the current case I really want to keep everything in the DB rather than spilling items overboard. If I get to thumbnails I’ll see how the BLOB types work. For now I expect that I’ll be ok with the 64K per row limit on MySQL InnoDB tables. I expect that BLOB and TEXT aren’t stored in their respective tables so they should permit ‘stretch’ operations.

Current working notes are a bit chaotic 🙂

DB Initial Sketch
Chaos in the Schema

I am sticking with the MariaDB fork of MySQL to avoid Oracle entanglements. Once the basic database definitions are in place I expect to code the front end in C# as I need to polish up that language and environment a bit at the moment. Not sure whether I’ll go with WPF or some sort of web interface for the UI yet. Got to get the innards a bit better defined first.

Looks like I was just messing up my command line for remote mysql access. Once I got things straightened out, I can talk to the database instance on boojum from chaos. Should make things a bit cleaner as I can keep the data in one spot and access it from any system in the house. Now I just have to finish with the create table statements and see if they build what I need. Short digression into users and permissions first (and probably a quick look at alter table) to see what I should be doing for remote access.

Nice case for my Raspberry Pi-3

Looking very similar (but smaller and much less expensive) to my NUC this case works very well for the R-Pi that I’ll likely img_20161226_140011 use to drive my RepRap if/when I get around to finishing it.

The one issue I have with this case is the limited access to the main board interfaces. It looks as if there is a dedicated ribbon cable slot to allow access to the main external interface.img_20161226_140927 The alternate interfaces are much less accessible as they’re on the top of the board and between the board and the case when fully assembled.

The other issue I have (though for my purposes it isn’t a big deal) is that the micro-SDcard access is limited. img_20161226_141443The card does not extend beyond the case fairing and while it can be extracted with a fingernail between the case edge and the card, I’d be reluctant to use it if i were expecting to change out cards regularly.

 

The bottom of the case is vented and there’s a thermal pad that could be used to sink the CPU head to the case. I have skipped this as I expect to be taking the board out now and again for access to the hardware pins.

img_20161226_140221

Third Edition Effective C# Just Arrived…

The new edition of Effective C# just arrived in the mail. The ‘effective’ series have been consistently helpful with advice beyond the basics of language syntax. As I’m currently spending significant amounts of quality time with C# for work and also for some sandbox coding at home, this is a welcome item.

 

img_20161221_202611Looking forward to seeing what is in this new edition and seeing what it has to say about version six of the language. I’ll try to write up comments on it when I’ve had time to read through this one.