Programming

Working With JavaScript Variable Type Errors

I was struggling to get some code working in JavaScript and realised that I’d made a small variable type error. This is one of the problems in working with a loosely typed language like JavaScript. When I work in C# it is strongly typed meaning that I have to declare a variable and its type at the same time. This saves a multitude of errors in my code. Unfortunately I don’t have this luxury with JavaScript and I have to be more careful with my variables.

Javascript Training

I have recently completed the Udemy Modern JavaScript Bootcamp 2019 course run by Andrew Mead. It has been one of the most professional courses I have taken in video training. The quality and depth of training would be enough to give a learner a solid understanding of javascript. There is enough content to keep a user going for a couple of months. I did all of the training exercises and have built up a wealth of knowledge and some best practices in JavaScript.

Using Git

I have spent the past week re-investigating Git for source control in my programming projects. Previously I used Azure DevOps (formerly Team Foundation Server or TFS) for source control. I am happy with TFS but wanted to use Git as there are millions of other users posting their projects on Github. The thing that put me off putting my projects on Github is that they are public and anyone can see them.

Creating A JSON File From My Record List - RecordDBToJSON

Using SQL Server for generating JSON wasn’t totally successful so I created a program to reformat my record list into JSON for use in my JavaScript projects. I wanted to load it into my local storage and use it as a data source. See my previous article. The program I created runs in the console and has no arguments. It just grabs a dump of my Artist and Record tables and merges the two sources as a 1 artist to many records JSON file.

JSON Tools for Validating Content

I have a Google Chrome extension named JSON viewer Awesome and was using this for testing. The problem with this extension is that it doesn’t load JSON if it has validation issues. The other issue is that it doesn’t show where the errors have occurred. The following view is validated JSON. I then changed over to using the online JSONFormatter.org website and was able to upload my JSON and get an error message for each place I had an issue.

Using Powershell to Create JSON From SQL Server

While searching for ways to generate JSON from SQL Server I found a video on using Powershell to generate JSON using calls to SQL Server. This looked interesting so I tried it out and it worked. Unfortunately it still didn’t validate and just generated rubbish. I loaded the data into a text editor and found that when it hit the line return point it chopped data and added three dots to the end of each line.

Using SQL Server to Create JSON

I am currently creating a JavaScript based website to display a version of my RecordDB database. The data will need to be consumed from a JSON file that will be stored in a web browser using local storage. The advantage of using local storage is that it is persistent and will still be available once you close and reopen your web browser. The first part of this process will be to export my data from a SQL Server database to a JSON formatted file.

How to Mount ExFAT Drive on Ubuntu Linux

To be able to mount exFAT filesystem on Ubuntu you’ll need to install the free FUSE exFAT module and tools which provide a full-featured exFAT file system implementation for Unix-like systems. Before installing the packages make sure the Universe repository is enabled on your system. Open your terminal either by using the Ctrl+Alt+T keyboard shortcut or by clicking on the terminal icon and type: sudo add-apt-repository universe Once the repository is enabled update the packages index and install the exfat-fuse and exfat-utils packages using the following commands:

Changing Link Program to Web Request

Changing the Link program to download a Web Request My Link, Packt and Plural programs have been set up to manually get a webpage and this is a slow process. I have updated the Link program to pass in a URL as an argument and then download and create the page automatically. This saves me a boring task. The program update was more complex than I originally thought because the pages I was trying to download used a network security protocol so I was getting TLS security failure exceptions.

Renumbering Training and Music Files - Num

Following on from my directory renaming program I have written some more code to renumber my video training and music files. Once again this is something that I have been doing for years and should have automated as some of the training materials can take around 10 to 45 minutes of manual work. I have a backlog of files that I wasn’t going to finish so I had to come up with a better way of doing the task.