Month: August 2019

  • Geography: one of the identified items was in an invalid format – Entity Framework

    Hey everyone, I’m currently working on a prototype using .net core, sql server, ef and NetTopologySuite to handle locations. While trying to save a location I ran into the following error: Geography: one of the identified items was in an invalid format My code was as follows: using GeoAPI.Geometries; using NetTopologySuite; using NetTopologySuite.Geometries; … var…

  • Simple React-Leaflet Location Picker Setup

    Simple React-Leaflet Location Picker Setup

    Hi everyone, Just thought I’d share a very simple react-leaflet setup in case it’s able to help anyone. Add the css and javascript for leaflet to public > index.html: https://unpkg.com/leaflet@1.5.1/dist/leaflet.js”>https://unpkg.com/leaflet@1.5.1/dist/leaflet.js Install react-leaflet via npm or yarn, also add the dependencies: npm install react-leaflet # npm npm install leaflet react react-dom # npm yarn add react-leaflet…

  • Request Denied – react-geocode

    Hi everyone, I’m currently testing react-geocode but hit a “request denied” error after providing my API key. Error: Server returned status code REQUEST_DENIED The solution was pretty simple thankfully – enable the Geocoding API for your project: https://developers.google.com/maps/documentation/geocoding/get-api-key In my case I was re-using a Google maps key from another project where I’d enabled all…

  • Module not found: Can’t resolve ‘leaflet’ in – react-leaflet error

    Hey everyone, I ran into the following error after installing react-leaflet and attempting to run an example: Module not found: Can’t resolve ‘leaflet’ in ‘…\node_modules\react-leaflet\es’ It turned out I’d simply rushed things and skipped the second step in the documentation: npm install leaflet react react-dom # npm yarn add leaflet react react-dom # Yarn Doco:…

  • NetTopologySuite Circular Reference with .net core 2.2

    Hey everyone, Testing out a spatial project with .net core and I ran into the following error: Microsoft.CSharp.RuntimeBinder.RuntimeBinderException : The best overloaded method match for ‘Xunit.Assert.Equal(string, string)’ has some invalid arguments at CallSite.Target(Closure , CallSite , Type , Nullable`1 , Object ) at UpdateDelegates.UpdateAndExecuteVoid3[T0,T1,T2](CallSite site, T0 arg0, T1 arg1, T2 arg2) at DiscussionsControllerIntegrationTests.CreateTestDiscussion(HttpClient client, ApplicationDbContext…

  • Set Date Back Twelve Hours – MSSQL

    Hey everyone, A quick post on how to set a date value for twelve hours ago using SQL Server: UPDATE MyTable SET MyDate = dateadd(HOUR, -12, CURRENT_TIMESTAMP) Simply use the dateadd function and specify the unit (hours in this case). The example above will set MyDate to twelve hours ago. Here’s the offical documentation on…

  • Unable to Migrate after Adding Config to Startup

    Hi everyone, Just a quick post on fixing up a migration error after I added new config to startup.cs via DI. The error after running add-migration was pretty unintuitive: Unable to create an object of type ‘ApplicationDbContext’. For the different patterns supported at design time, see https://go.microsoft.com/fwlink/?linkid=851728 To find out a bit more I ran…

  • Typography Component without a Line Break – Material-UI

    Hey everyone, UPDATE: In new versions you now need to add a display attribute: display=”inline” I’ve been working with Material-UI and ReactJS and had a bit of an issue with a Typography component generating an unwanted link break: To fix it, all I needed was the inline attribute. Once added the text appeared next to…

  • Change i2c address of ina219

    Change i2c address of ina219

    Hi everyone, I wanted to use ina219 with pca9685 but they shared the same i2c address 0x4: 0. Luckily, there’s a fairly easy fix for this. All we need to do is solder two pins together. We’re going to bridge a0 and this will change our address to 0x41. In order to check these run…

  • A4988 Stepper motor RaspberryPi

    A4988 Stepper motor RaspberryPi

    We’re using a 42shd0034-20B Geetech stepping motor taken from a 3d printer: We’ll be driving it with an A4988 stepper motor controller. You can pick up five packs of these for less than $2 online – definitely worth having a few extras around: The datasheet is available here: https://www.pololu.com/file/download/A4988.pdf?file_id=0J450 The following diagram illustrates what we’ll…

Create a website or blog at WordPress.com