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 of the map apis but not the GeoCoding one.
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
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 db, DiscussionCreateWebRequest payload) in DiscussionsControllerIntegrationTests.cs line: 56
at DiscussionsControllerIntegrationTests.b__1_0(ApplicationDbContext db) in DiscussionsControllerIntegrationTests.cs line: 27
at IntegrationTestBase.RunTest(Func`2 testToExecute) in IntegrationTestBase.cs line: 54
at DiscussionsControllerIntegrationTests.CreateDiscussionIsSuccessful() in DiscussionsControllerIntegrationTests.cs line: 25
at — End of stack trace from previous location where exception was thrown —
Thankfully the solution is pretty straight forward. Install GeoJSON:
Then merge the following with your existing addMvc call in startup.cs:
// Prevent the following exception: 'This method does not support GeometryCollection arguments'
// See: https://github.com/npgsql/Npgsql.EntityFrameworkCore.PostgreSQL/issues/585
foreach (var converter in NetTopologySuite.IO.GeoJsonSerializer.Create(new GeometryFactory(new PrecisionModel(), 4326)).Converters)
A quick post on how to set a date value for twelve hours ago using SQL Server:
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 the function: https://docs.microsoft.com/en-us/sql/t-sql/functions/dateadd-transact-sql?view=sql-server-2017
Also, thanks to this stackoverflow post for the info: https://stackoverflow.com/a/18518412/522859
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 the following:
This revealed the fact that there was an issue with adding my config line. The error stated that I had to have an empty constructor which led me on a bit of a wild goose chase.
The solution was simply a missed entry in application.json. In my case it was an omitted “assembly” section. Having said that, I did come across a few instances where people had the same problem when omitting commas etc.
Hopefully that’s able to get you on the right track!
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 the form element instead of below:
I wanted to use ina219 with pca9685 but they shared the same i2c address 0x4:
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 sudo i2cdetect -y 1 pm the raspberry pi:
After soldering it becomes:
You can solder a combination of pins for different addresses:
None = 0x40 (default)
A0 = 0x41
A1 = 0x44 (the one I’ve soldered to get 44)
A0 + A1 = 0x45