instruction stringlengths 0 30k ⌀ |
|---|
null |
You can inspect the GADT using `reify` or a package like `th-abstraction` that provides more predictable wrappers around `reify`.
Best practice is probably to use `th-abstraction`, but for your specific example, the way `th-abstraction` handles GADTs might make it more difficult, so maybe you want to stick with `rei... |
I'm editing a website that has existing filters that filter through all products in all categories.
I'm changing the menu structure to display pages that show the categories on separate pages. I would like to retain the filters but I can't figure out how to edit them to filter just the category that is being display... |
Filtering posts within a page that displays a single category php |
|php|filter|categories| |
Basically I have an embedded interpreter in the main thread that is replaced by a new interpreter in a new thread. I got crash if the first module import has the same `import` statement that is in the evaluated python file (that the sub thread executes).
Many days of trial-and-error, probably I am missing something so... |
"Critical error detected" in double import of Python module - Pybind11 |
null |
I just wanted to ask that I am going in a right direction and it is even possible with MSAL library for authentication in Azure.
We have multiple single page applications which are under the same tenant in one organization. All use similar subdomains like a.service.com / b.service.com / c.service.com.
Is it possi... |
How to create a docker composer environment where containers can communicate each other? |
|docker|docker-compose|docker-network| |
A set of methods being listed as a minimal definition means that the other methods all have default definitions in terms of the minimal set. But the other methods are still part of the typeclass, not separate functions, you certainly can provide your own definitions. Indeed it's reasonably common to see a redundant met... |
[{
"service": "abc",
"capability": "s"
},
{
"service": "def",
"capability": "s"
},
{
"service": "abc",
"capability": "v"
},
{
"service": "def",
"capability": "v"
}
]
The api data is returned with capability ke... |
Only store keys with specific values from json data in php |
|php|json| |
null |
{"Voters":[{"Id":60761,"DisplayName":"Henk Holterman"}]} |
[{
"service": "abc",
"capability": "s"
},
{
"service": "def",
"capability": "s"
},
{
"service": "abc",
"capability": "v"
},
{
"service": "def",
"capability": "v"
}
]
The api data is returned with capability ke... |
I was solving this problem on Leetcode but I am unable to understand why my solution is wrong I am using the hash map approach to solve this, the time complexity is O(n) but the error is not something related to time exceeding
**Question:**
You are given two strings `s` and `t`.
String `t` is generated by r... |
You need to set the log level
```
opentelemetry::sdk::common::internal_log::GlobalLogHandler::SetLogLevel(opentelemetry::sdk::common::internal_log::LogLevel::Debug);
``` |
Actually, I am running wildfly elytron-tool.sh to mask the password.. It is done after the wildfly directory is installed in my node server which is done previous to this step. I want to capture that masked password which is returned from the exec command which can be used later.
How to achieve that . Please help me w... |
null |
I am running wildfly elytron-tool.sh to mask the password. It is done after the wildfly directory is installed in my node server which is done previous to this step. I want to capture that masked password which is returned from the exec command which can be used later.
How to achieve that?
```
class classname{
... |
After I pass the memory to the chain, they seem to perform the same. RetrievalQA chain with memory has conversation history as context. It also responses to follow-up questions similarly to ConversatonalRetrievalQA Chain. So, what is the difference?
This is my code for the RetrievalQA chain.
```
q... |
How does Conversational Retrieval QA Chain different from Retrieval Qa chain |
|python|langchain|large-language-model| |
null |
**In Bootstrap 5;**
// to enable tooltips, with default configuration
$('[data-bs-toggle="tooltip"]').tooltip()
// to initialize tooltips with given configuration
$('[data-bs-toggle="tooltip"]').tooltip({ boundary: 'clippingParents', customClass: 'myClass' })
If you don't want to use jQuery,... |
I'm making a simple news app with swiftUI. the problem is that I want to add a view model to my project but now when I run the app nothing is shown. When I first added the viewmodel everything was perfect, but now the viewmodel can't see the changes I make or it doesn't communicate them. I tried everything that I could... |
null |
{"OriginalQuestionIds":[24414921],"Voters":[{"Id":9837301,"DisplayName":"JaMiT","BindingReason":{"GoldTagBadge":"c++"}}]} |
my react app git repo link = "https://github.com/MuhdSHiBiLi/employee-front.git"
this is my host llink = "https://muhdshibili.github.io/employee-front/" it only gives a blank screen as output
how to solve this issue. am also added the home pages and deploy scripts on package.jsom. doesnt work
am tried to resolve b... |
React deploying as blank screen, in locally works fine |
|javascript|reactjs|components|jsx| |
null |
|javascript|firebase|firebase-authentication| |
null |
# Handling Unknown Enum Cases in Swift with Codable #
protocol UnknownCodable: RawRepresentable, Codable where RawValue: Codable {
static var unknown: Self { get }
}
extension UnknownCodable {
init(from decoder: Decoder) throws {
let container = try decoder.singleValu... |
Can anyone help me to find sum of input values using JavaScript. The HTML and JavaScript is given below. Thanks in advance
HTML
```
<input type="text">
<input type="text">
<button>Find Sum</button>
```
JavaScript
```
let inputs=document.getElementsByTagName('input');
let button=document.querySelector('butto... |
how to find sum of input value in javascript |
|javascript|html|input|sum|return-value| |
// Print all prime numbers from 1 to given number
> C Programming
#include <stdio.h>
#include <math.h>
void checkprime(int);
int main()
{
int num;
printf("Enter the number till which you want prime numbers: ");
scanf("%d\n", &num);
checkprime(n... |
Google Chrome is consuming a lot of CPU on a video call? |
|javascript|google-chrome|video|video-streaming|cpu| |
{"OriginalQuestionIds":[17273030],"Voters":[{"Id":20860,"DisplayName":"Bill Karwin","BindingReason":{"GoldTagBadge":"mysql"}}]} |
```bash
$ pip install torch
Defaulting to user installation because normal site-packages is not writeable
ERROR: Could not find a version that satisfies the requirement torch (from versions: none)
ERROR: No matching distribution found for torch
```
I keep on getting this error while downloading torch for senten... |
|pip|pytorch|sentence-transformers| |
Java is a **modern** language that came up around the *early Unicode era* (in the beginning of the '90s), so it supports Unicode by default as a first class citizen like most new *contemporary* languages (like Python, Visual Basic or JavaScript...), OSes (Windows, Symbian, BREW...) and frameworks/interfaces/specificati... |
|pytorch|gradient| |
{"Voters":[{"Id":16540390,"DisplayName":"jabaa"},{"Id":3689450,"DisplayName":"VLAZ"},{"Id":446594,"DisplayName":"DarkBee"}],"SiteSpecificCloseReasonIds":[13]} |
I'm trying to create a Settings module using SwiftUI.
I have the following hierarchy
- Settings (struct)
- Section (struct)
- Subsection (struct)
- ButtonRow: Row
- Subsection (struct)
- ButtonRow: Row
- ToggleRow: Row
- Section (struct)
- Subsection (struct)
- But... |
I use chillerlan qr_code to generate a qrcode in php.
$gdImage = (new QRCode ($options)) ->render('https://www.youtube.com/watch?v=dQw4w9WgXcQ');
I can echo the qrcode on the screen as a qrcode.
I can also printit as a string.
BUT the following call returns false.
$gdImage2 =@imagecreatefromstring($gdImage... |
|security|request| |
<s>As you have not shared the schema of your dataframe, I am assuming your df has an "id" column. You can update it accordingly to any other column as per your requirement.</s>
You can simply apply the [`row_number()`](https://spark.apache.org/docs/latest/api/python/reference/pyspark.sql/api/pyspark.sql.functions.ro... |
**Root cause:** Your `main` branch is in fact *[unborn](https://git-scm.com/docs/gitglossary#Documentation/gitglossary.txt-aiddefunbornaunborn)* here.
---
To give a bit more details,
```
git rev-parse --abbrev-ref <ref>
```
tries to recursively search **for the commit hash** ultimately sitting behind `<ref>` (w... |
{"Voters":[{"Id":10867454,"DisplayName":"A Haworth"},{"Id":9695286,"DisplayName":"Karan"},{"Id":13376511,"DisplayName":"Michael M."}]} |
Trying to fetch the TestCases along with Actions in an sequence
```
@Entity
@Table(name = "Test_Cases")
@OptimisticLocking(type = OptimisticLockType.NONE)
@DynamicUpdate(value=true)
@SelectBeforeUpdate(value=true)
public class TestCases {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(n... |
Authentication with Azure MSAL in multiple apps without a redirection |
|angular|azure|authentication|msal| |
null |
I have a situation where I'm trying to access a protected resource via OAuth2 Auth Code flow and the authorization server makes refresh tokens available during the initial access token request. The problem arises when trying to make use of these refresh tokens as the authorization server has a distinct refresh endpoint... |
Spring Security Reactive OAuth2 Client: Options for Customizing Refresh Endpoint |
|spring-boot|spring-security|spring-webflux|spring-security-oauth2| |
null |
The `includePaths` option is the correct one to use with `sass-loader`. This option allows you to specify directories for the loader to resolve `@import` declarations. Here's how you can use it:
```javascript
{
loader: 'sass-loader',
options: {
sassOptions: {
includePaths: [path.reso... |
The setup with clangd on neovim works fine for c++, but found it does not work in this case:
File A.h if has #include "A.hcpp" at its end then nothing in A.hcpp can be looked up like jump to function definition etc. It works perfectly for A.h file. This kind of file naming is common for templates in c++
A.h
... |
As the [official document](https://pymupdf.readthedocs.io/en/latest/page.html#Page.get_text) says, you can use the `clip` argument to do it:
```py
doc = fitz.open(fname)
page = doc[0]
rect = page.rect
height = 50
clip = fitz.Rect(0, height, rect.width, rect.height-height)
text = page.get_text(clip=clip)
``` |
[{
"service": "abc",
"capability": "s"
},
{
"service": "def",
"capability": "s"
},
{
"service": "abc",
"capability": "v"
},
{
"service": "def",
"capability": "v"
}
]
The api data is returned with capability ke... |
I have an issue with IBM DB2 console. After updating expired certs (using [this](https://www.ibm.com/docs/en/ias?topic=certificates-console-certificate) instruction) it just stopped work. It happened just right after I uploaded the new cert using web console web interface.
```bash
$ openssl s_client -showcerts -con... |
IBM DB2 console doesn't work after SSL certificate update |
|ssl|db2|ssl-certificate| |
Push your `label`s into an array. Then check its size. Whenever it is greater than 5, you can use the `array.shift` to remove the first element and get its value which will point to the oldest `label`. Then delete it.
var label_arr = array.new_label()
len_arr = array.size(label_arr)
if (len... |
I am trying to code a doubly linked list with Rust. The main two types are defined as:
```rust
struct IntList {
head: *mut Node,
tail: *mut Node,
size: usize,
}
#[derive(Copy)]
#[derive(Clone)]
struct Node {
data: i32,
prev: *mut Node,
next: *mut Node,
}
```
I used 2 util func... |
What's the difference between using an intermediate variable in Rust lang? |
So all I have for my Lambda Function so far is:
```
import json
import os
import tuya_connector
```
And when I click "Test", I'm getting the following error:
"Unable to import module 'lambda_function': No module named 'tuya_connector'",
I tried to resolve the error by creating a layer, but I believe I may b... |
Export OpenAPI to native/plain javascript |
|javascript|openapi| |
null |
I have a project with one target.
This target has few schemes for different purpose and each scheme has their own GoogleService-Info.plist.
One of them needs 2x GoogleService-Info.plist for 2x different Firebase clouds. I need to change the default name to be able to differentiate them when selecting the right o... |
Can a project using Crashlytics can have a GoogleService-Info.plist file rename to something else? |
|swift|xcode|crashlytics| |
{"Voters":[{"Id":4267244,"DisplayName":"Dalija Prasnikar"}]} |
I'm evaluating if using [vscode remote development][1] to connect and develop against an EC2 instance. We will be executing Jupyter Notebooks (or just plain python scripts) against S3/RDS data.
We would like to prevent the data from being stored persistently on the developer's local file system. This includes gene... |
vscode remote development: What information is copied to the local machine? |
|visual-studio-code|vscode-remote| |
I am trying to install dynamics 365 9.0 on the following configuration:
- Windows Server 2022
- SQL Server 2022
However, the installation stalls at the verification sql components step and the download consistently fails. Downloading missing components always fails. [Result scan](https://i.stack.imgur.com/rEF6a.p... |
Add a event for amount field
<div><%= item_form.number_field :amount, min: 0, onchange: "updateTotal()" %></div>
Add id to element show total amount:
<div id="total"><%= number_to_currency(@total, unit: "$", precision: 2) %></div>
Add js code for update total amount when you have change on item cmount:
... |
In my codes, Row widget nested in Column widget are causing exception at times. I searched and found that you *can* nest Row in Column however. So, I am unable to find the cause and more importantly the fix of the exception.
My main code has the following layout as shown in the diagram below: (Here, if Column widget... |
`onMount` only runs fairly late on the client.
You could probably also move the logic to a head script in a layout:
```svelte
<svelte:head>
<script>
...
</script>
</svelte:head>
```
Such scripts should execute about as early as they can (but you cannot use Svelte features there). |
I am writing a frontend application that will provide a UI enabling users to make certain filter selections. We are creating a data visualization that will be populated by data objects fitting the user's filter criteria. For example, user might say:
> Show me all data objects that have the emails `X@fake.com`, `Y@... |
Can find the reason why can use Transient Services but Scoped Services
// in programe.cs
```
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddTransient<IConfigurateServices, ConfigurateServices>();
var app = builder.Build();
var test2 = app.Services.GetService<IConfigurateServices>();
``... |
code
import cv2
import pytesseract
pytesseract.pytesseract.tesseract_cmd = '/Users/navroop/Desktop/text reco/tesseract'
img = cv2.imread("car.png")
---------------------------------------------------------------------------
PermissionError Traceback (... |
See [RFC 5322: Internet Message Format][1] and, to a lesser extent, [RFC 5321: Simple Mail Transfer Protocol][2].
[RFC 822][3] also covers email addresses, but it deals mostly with its structure:
addr-spec = local-part "@" domain ; global address
local-part = word *("." word) ... |
If you want to create a unique filename, you can also try the unix time.
from datetime import datetime
outputfile = "{}.xlsx".format(str(datetime.utcnow().timestamp()).replace('.', ''))
|
I am creating an Notification Listener app in which , i am using https://pub.dev/packages/flutter_notification_listener for listing of the notifications . The problem with this is when ever the app is destroyed or removed from recents it stops working and says " flutterjni was detached from native c++...... .
That ... |
How to even listen to Notification service when the app is destroyed in flutter |
|flutter|dart| |
null |
{"Voters":[{"Id":7508700,"DisplayName":"David Buck"},{"Id":16076,"DisplayName":"Mitch Wheat"},{"Id":8017690,"DisplayName":"Yong Shun"}]} |
I'm working on the render part of Assignment 2 for CMU's 15-418 course,which involves writing a high-performance renderer using CUDA. In my code, each CUDA thread is responsible for computing a single pixel, which is a data-parallel task.
To accelerate the computation, I'm using shared memory to store intermediate r... |