instruction stringlengths 0 30k ⌀ |
|---|
I am trying to learn Django and have encountered a problem I can't figure out for the life of me. In this project I have an app called `projects`. In this app I have one model called `Projectinfo` and one called `Buildingtypes`.
Every project can have one or more building types. What I am trying to do is to write a ... |
React Accordion transition , |
|reactjs| |
null |
as shown in the code posted below, i am using `turf.js` to buffer a geometry in the listener callback of `modifyend` of `Modify` event.
i tried to set the buffered feature `asOLFeature` on the map via: `this.#vectorSource.addFeature(asOLFeature)`
to assure that the buffered geometry is placed on the map, i conver... |
projection and EPSG mismatch when buffer a geometry |
|openlayers|openlayers-3|openlayers-6| |
[enter image description here][1]According to the network diagram above, the connection from company A's pc0 to the server system including gmail and facebook is successful, but company B's pc6 and pc7 cannot ping the server system. I tried to give ip from dns but it didn't work.
The system works normally, all devic... |
This is due to `executable_path` is an argument of `webdriver.chrome.service.Service`, see [ducumentation][1]
Just use
driver = webdriver.Chrome()
# or
service = webdriver.chrome.service.Service(executable_path='path/to/your/chrome/driver')
driver = wbdriver.Chrome(service=service)
[1]: ... |
{"OriginalQuestionIds":[60640745],"Voters":[{"Id":87698,"DisplayName":"Heinzi","BindingReason":{"GoldTagBadge":"c#"}}]} |
I have two middleware in my ASP.NET Core application. One needs to be registered with `ConfigureServcies`, but the other one doesn't.
For example:
1.
```
public class RequestMiddleware
{
private readonly RequestDelegate _next;
public RequestMiddleware(RequestDelegate n... |
Why do some middleware need to be registered with `ConfigureServices` while others don't? |
`foo()` is taking in a primitive `int` *by value*, so it is a *copy* of whatever value you pass in at the call site. There is no reference here.
It doesn't matter what `foo()` does internally to the value of `y`, that value does not get reflected back to the caller.
Also, there is no such thing as "point at a va... |
here's an alternative using left join unnest instead of having to write out all the dates. Made a mock table to how the results in the CTE/with function.
WITH
mock_data AS (
SELECT
'2024-03-12' AS date,
'NA' AS region,
999999 AS revenue
UNION ALL
SELECT
... |
Adding this here for the extra visibility, but if you're using VS Code, the CMake Tools extension has commands to view/edit the variable cache, either using an intermediary UI or directly by opening the cache in a text editor tab so you don't have to go dig into your build folder for it. |
Implement FFDShow in .net |
|c#|.net|ffdshow|dolby| |
I'm trying to have an element project a shadow / blurred edge onto an element behind it, causing the latter to "dissolve", without impacting the background. Hopefully the following images can better illustrate my problem.
This is what I was able to get:
[Shadow clearly stands out from the background](https://i.stac... |
null |
I currently have an Android application built with Jetpack Compose on the Play Store with [android-maps-compose librairie](https://github.com/googlemaps/android-maps-compose). For several days now, I've been receiving reports of recurring crashes from the Play Store, but I'm unable to reproduce the issue on my end.
... |
Android Maps Compose | MarkerState.setMarker IllegalStateException |
|android|google-maps|android-jetpack-compose|google-maps-markers| |
null |
We recently upgraded Allure (2.27.0) and Allure Jenkins plugin (2.31.1) to the latest versions. Now the Allure report is empty and the log file contains:
```
com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "testCaseName" (class io.qameta.allure.model.TestResult), not marked as i... |
com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "testCaseName" (class io.qameta.allure.model.TestResult) |
|allure| |
null |
The accepted answer is correct
git config --global core.autocrlf false
For anyone coming here just to learn - one very helpful thing to keep in mind is that modern IDEs can render files with LF or CRLF. So imagine you're a lone windows dev on a team of macOS users. You'll be checking out a codebase that's l... |
Rotate an object around another object in javascript |
|javascript| |
null |
Try this:
plt.plot(range(1, len(rfecv.cv_results_["mean_test_score"]) + 1), rfecv.cv_results_["mean_test_score"], color='#303F9F', linewidth=3) |
It's been 2 years but hope this helps, at least, it worked for me. If you have the country boundaries GeoJSON (Multipolygon Feature). You may use @turf
import { featureEach, difference, buffer } from '@turf/turf';
const getInverseFeature = (featureCollection, distance) => {
// Create a boun... |
I have data, and for this example it is displayed in two ways. Firstly data is displayed on the server component. The second is data is passed down to a client component, and rendered inside of the client component. If the data changes, and I use either revalidatePath and router.refresh() only the data displayed inside... |
This is due to `executable_path` is an argument of `webdriver.chrome.service.Service`, see [ducumentation][1]
Just use
driver = webdriver.Chrome()
# or
service = webdriver.chrome.service.Service(executable_path='path/to/your/chrome/driver')
driver = webdriver.Chrome(service=service)
[1]:... |
I found a simple solution that works reliably. If you assign a unique `GlobalKey` to your `GoogleMap` instance, and update the `GlobalKey` when the app is resumed, then on resume the old (disposed) Maps widget will be replaced with a new one, which is correctly redrawn. You also have to re-create the controller (or at ... |
In node_modules file i am getting Angular genric error while using fontawesome in angular12 |
The problem is following:
* One of our VS C++ project files is for v142 build tools and it succesfully buildable with MS Build Tool 2019 on our 'build machine'
* but locally (and also on 'build machines' for other customers) I need to build the same VS C++ project with MS Build Tool 2022 (which use v143 build tools... |
Is it possible to build v142 project with v143 build tools? |
|c++|msbuild| |
I am using com.google.maps.android:maps-compose:4.3.3 to show map with markers. There are not so much of them, so I don't use clustering. I have a mutableStateList of markers which fetches data visible in a current viewport from local Room database. I am using MarkerInfoWindow to show custom composable info window on m... |
browse to https://<yoursitename>.scm.azurewebsites.net/ZipDeployUI |
Here's an alternative using left join unnest instead of having to write out all the dates. Made a mock table to how the results in the CTE/with function.
WITH
mock_data AS (
SELECT
'2024-03-12' AS date,
'NA' AS region,
999999 AS revenue
UNION ALL
SELECT
... |
In my database I have a data set with date (startdatetime) and zone (timezone). Zone is posted into the DB from a different application that uses C# DateObject.
Ex. (UTC+01:00) Belgrade, Bratislava, Budapest, Ljubljana, Prague OR another example (UTC-10:00) Hawaii
I need to create a component that can convert dat... |
I'd like to create a custom time zone converter, any pointers? |
|javascript|reactjs|datetime|timezone| |
{"Voters":[{"Id":3745413,"DisplayName":"Ron Maupin"},{"Id":14853083,"DisplayName":"Tangentially Perpendicular"},{"Id":354577,"DisplayName":"Chris"}],"SiteSpecificCloseReasonIds":[18]} |
**I want to fetch data from Amazon's website, list the products, and then navigate to Amazon's site by tapping on the listed items in the application. However, I encountered the following error;**
E/flutter (15082): \[ERROR:flutter/runtime/dart_vm_initializer.cc(41)\] Unhandled Exception: Could not launch /sspa/clic... |
@Tanaike observed that the API will not allow what i want to achieve. Thanks , i've upvoted you.
From my quick research , i've found out it's possible to obtain the same result by AppScripts + webhooks: https://medium.com/@eyalgershon/sending-a-webhook-for-new-or-updated-rows-in-google-sheets-e0c9d6a8cb45
In the ... |
The second way of creating middleware is called [Factory-based Middleware](https://learn.microsoft.com/en-us/aspnet/core/fundamentals/middleware/extensibility)
> `UseMiddleware` extension methods check if a middleware's registered type implements `IMiddleware`. If it does, the `IMiddlewareFactory` instance registere... |
I'm writing a landing page to handle redirects from AWS Marketplace, show a signup form, and if the user signs up associate a marketplace customer ID as a custom attribute in Cognito.
My app uses the amplify <Authenticator> component to render a sign-up/login form, but it doesn't have an obvious prop where I can eit... |
The issue is that you have a string with quotes in it (example: `var str = "<p class="some">Test</p>"`). These `"` need to be escaped. It could be done like this: `var str = "<p class=\"some\">Test</p>"` or you could URL encode the string. JavaScript has functions for encoding and decoding: [encodeURI()](https://develo... |
|python|django|django-models|django-views|django-templates| |
{"Voters":[{"Id":11107541,"DisplayName":"starball"},{"Id":2395282,"DisplayName":"vimuth"},{"Id":1693192,"DisplayName":"Petr Hejda"}],"SiteSpecificCloseReasonIds":[13]} |
df1.assign(higher=df1.High.rolling(3,min_periods=3,center=True).max().eq(df1.High).astype(int))
Date High higher
0 2015-11-11 25.90 0.0
1 2015-11-12 27.12 1.0
2 2015-11-13 26.20 0.0
3 2015-11-16 26.19 0.0
4 2015-11-17 25.51 0.0
5 2015... |
I ran into a problem when I decided to make a server for microservices, but I ran into the problem that my microservice cannot register in Eureka, what could be wrong?
```
apiVersion: v1
kind: ConfigMap
metadata:
name: configmap
data:
foodcataloguedb_url: jdbc:postgresql://35.228.167.123:5432/foodcatalogue... |
Here is my interpretation of the [accepted answer], as well as of the [demonstration video][video] linked from [another answer].
Imagine that the graph edges are ropes of given lengths. To get the shortest path distances from the source node to all the other nodes, as well as the shortest paths themselves, it is en... |
SQLite query not returning expected results despite correct hashing and comparison in Android application" |
SQLite query not returning expected results despite correct hashing and comparison in Android application |
Just for laffs; this has the benefit of showing both lines where `old` and `mat` bars collide, but complicates things beyond what OP seems to be asking for.
``` r
library(ggplot2)
library(dplyr)
library(tidyr)
d <- data.frame(grp=c('a','b','c'),
fmlb=c(100,115,125),
old=c(20... |
MarkerInfoWindow doesn't hold the clicked marker position after list refresh in Compose Map |
|android|kotlin|google-maps|android-jetpack-compose|google-maps-markers| |
null |
if you want to inherit 2 classes, you can also do it this way
class B:
def __init__(self, param1='hello from B'):
print('start B __init__')`enter code here`
self.param1=param1
class C:
def __init__(self, param2='hello from C'):
print('start C __init__... |
I am trying to transform a pandas series which has dates in it. I'd like to take the date that is in there and return the following Monday.
Here is what I have tried:
```
db['date'] = datetime.date.fromisocalendar(db['date'].dt.year.astype(np.int64),(db['date'].dt.week+1).astype(np.int64),1)
```
But I get th... |
How to convert pandas series to integer for use in datetime.fromisocalendar |
|python|pandas|datetime|series| |
# I want to connect to database and do normal login and registration process
- details from registration should be stored in data.db and can be retrieved by login for login purpose that is what i want but as i am new to all database and stuff so its kinda hard
;
const path = require('path');
const cors = require('cors');
require('dotenv... |
null |
|typescript|next.js|next.js13|react-server-components| |
I use shader in phaserjs to change the color of characters and also for rain
But the game renders correctly in Google Chrome, but I have a rendering problem in Capacitor, in such a way that the rain is displayed in the form of a ruler.
Hardware acceleration |
Shader rendering problem in capacitor phaserjs in webgl mode |
|webgl|capacitor|phaserjs| |
null |
<!-- begin snippet: js hide: false console: true babel: false -->
<!-- language: lang-js -->
id: {
allowNull: false,
autoIncrement: true,
primaryKey: true,
type: Sequelize.INTEGER
},
UserId: {
allowNull: false,
... |
I'm traying to launch a Nextflow pipeline, but it throws the following error:
```
ERROR ~ No signature of method: groovyx.gpars.dataflow.DataflowBroadcast.into() is applicable for argument types: (Script_dd34529ec87c0dd2$_runScript_closure3) values: [Script_dd34529ec87c0dd2$_runScript_closure3@39652a30]
Possible sol... |
null |
So, I managed to get it working finally, for some reason the client certs that were signed by the intermediate ca just didn't work, so I signed them with the root, and added the `ca.pem` to `ssl_ca_certs`. Thanks Maarten for your help, its really appreciated! For those that might be in a similar situation, the followi... |
|regex| |
I'm working on some code for a javascript implemenation of Conway's Game of Life Cellular Automata for a personal project, and I've reached the point of encoding the rules. I am applying the rules to each cell, then storing the new version in a copy of the grid. Then, when I'm finished calculating each cell's next stat... |
null |
**I'm trying to link to GLWF using GCC on Windows.**
*I built the code locally on my computer, took the include and lib directories and deleted the rest of the files. Now I'm trying to link them to my code using a batch file and the gcc compiler.*
**build.bat:**
@echo off
SET COMPILER_FLAGS= -I... |
I'm building a product where we use a board running Android 9. One of the programs I am building has to connect to a specific WiFi device without user interactions. Most of the time it connects with no problem, but sometimes it refuses to connects whatsoever. Here is the code I use:
```
public static boolean conne... |
I am trying to create a *whack-a-mole* type of game in Java but when I run my program the images do not show up.
Here is my code so far and I will add the images as well. I am also fairly new to coding so this might be an easy fix.
[kuronomi.gif](https://i.stack.imgur.com/43340.gif)
[kitty.gif](https://i.stack... |
|java|swing| |
How do I set custom attributes on a user who signs up via amplify's Authenticator? |
|amazon-cognito|aws-amplify|aws-marketplace| |
My approach would be 100 - ((100/(highest - lowest)+1))*(triescount))
for example triescount = 3, highest = 20, lowest = 1, 100/20 = 5, 5*3 = 15, 100 - 15 =85 so 85% accuracy
This is probably the easiest way of implementing accuracy |
So I have a scientific data Excel file validation form in django that works well. It works iteratively. Users can upload files as they accumulate new data that they add to their study. The `DataValidationView` inspects the files each time and presents the user with an error report that lists issues in their data tha... |
I'm pretty new to Blazor myself, but this was one of the first questions that occurred to me and I think I have a better solution.
The `IServiceProvider` automagically knows how to provide the [`IHostApplicationLifetime`](https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.hosting.ihostapplicationlifet... |
|android|react-native|react-navigation|deep-linking|react-native-navigation| |
I'm working on a small project where I take content from an Excel Spreadsheet and put it into a word document. I can get the two applications to communicate and put the text in the correct spot, but I cannot change the formatting and I've tried multiple ways. I think I don't understand the Range object, but I'm really ... |
Express JS Serve React JS Site With Path Longer Than Just Subdirectory |
|reactjs|node.js|express| |
null |
I am trying to create a structure `Student` which contains q substructures named `Course`. Each `Course` is a structure with a credit and point `int` values.
How do I set up my `Student` structure to have an integer number of `Course` structures within it? Thanks
```
struct Student{
int q;
Course co... |
I am trying to create a structure `Student` which contains q substructures named `Course`. Each `Course` is a structure with a credit and point `int` values.
How do I set up my `Student` structure to have an integer number of `Course` structures within it? Thanks
```
struct Student{
int q;
Course co... |
Here's a "prettier" version of all this.
SpringDoc provides their own static method set to automatically add unresolved schemas to the components (and OpenAPI object respectively), so they can be referenced from other places.
```java
import io.swagger.v3.core.util.AnnotationsUtils;
@Bean
public OpenApiCustomis... |
Here is the original problem:
> Now consider a deterministic linear search algorithm, which we refer to as
DETERMINISTIC-SEARCH. Specifically, the algorithm searches for in order,
considering [1],[2],A[3]...[] until either it finds [] = or it reaches
the end of the array. Assume that all possible permutations ... |