instruction stringlengths 0 30k ⌀ |
|---|
|python|matrix|diagonal| |
I have a very simple to-do app with a form and a list of to-dos, built in Fiber and HTMX. When the user adds a new to-do via the form, I want HTMX to refresh the list of todos. I know I can use `hx-swap-oob`, but then I'm returning the new To-Do as part of my form partial, and that doesn't feel correct.
According t... |
Go Fiber and HTMX - HX-Trigger header is changed to Hx-Trigger, which is not what HTMX is listening for |
|go|htmx|go-fiber| |
I'm currently working on a topic model in R for the purpose of extracting topics from groups of tasks. I've been using an LDA with the topicmodels package, and while this runs, it's not exactly what I'm looking for in terms of topic coherence. I've tried separating these tasks to one document each, and while this has y... |
Is it possible (or necessary) to run a GSDMM topic model in R? |
|lda|topic-modeling|topicmodels| |
null |
I have a main website example.com and another website subsidary.com.
The subsidary.com website is to be phased out and redirects put in place.
`subsidary.com` will have its A record repointed to `example.com` and a domain added in cPanel for `example.com`
Most of the entries in htaccess are straightforward, of t... |
301 Redirect to assimilate one website into another |
|redirect|http-status-code-301| |
I have collection with below documents:
_id : "123"
name : "rahul"
age : 40
experience: "10"
_id : "124"
name : "manish"
age : 42
experience: "12"
I want to find the sum of all the ages and also experience:
I am using below query:
... |
How do i find the sum of a field in Mongo with specific conditions? |
|jquery|mongodb|collections|field|compass| |
Compression was supported by TLS v1.2 and earlier but is prohibited in TLS v1.3 and higher, since compression creates known bit patterns which greatly ease hacking attempts. As such, you should assume that no compression will be done by HTTPS/TLS and if you want compression, must enable it on the HTTP level. |
You can do this with a mapped conditional type. First, let's describe the basic shape of your `settings` param:
```
type GetSettingsParamObject = Record<
string,
| { setting: StringSetting }
| { setting: StringSettingWithParam; param: string }
| { setting: ArrayOfStringsSetting }
>;
```
We'... |
I have images like this [![Orig OCR image][1]][1]
When trying to use C# TesseractOCR to read them, I sometimes get result 38845283-05 which is incorrect because the '3' at the beginning is something that should not be there.
This is page.ThresholdedImage image directly from Tesseract result:
[![thresholded image][2]... |
Using NOT LIKE and OR statement together producing FALSE output |
There's possible solutions:
1- Is to close the keyboard before popping the screen, using `FocusManager.instance.primaryFocus?.unfocus();`
2- Is to set the resizeToAvoidBottomInset property in the first screen to `false`. |
Error is occur due to .next folder is not present in your that is related to your build folder
You need to start **npm run build** than start the server again it's getting works |
I’m new to programing in C and have run into a problem trying to add a value to an array.
When trying to ad the value the following error is thrown: “subscripted value is neither array nor pointer nor vector”.
If someone could help me out, I would be thankful
Here is my code:
The array is declared in the mai... |
|java|spring|apache-kafka|microservices|reactive| |
I'm trying to handle a text file containing a list of numbers (generated from a python script) into a LUA script.
the text file contain this (I formatted it in the python script to match the list syntax of LUA) :
{"0.0", "0.1", "0.2", "0.3", "0.4", "0.5", "0.6", "0.7", "0.8", "0.9", "1.0", "834.3", "1667.6", ... |
This problem comes when there is no input value passing in routerchain, If you can provide logs from langsmith we can detect problem more easily.
Or you can try this: https://towardsdatascience.com/a-gentle-intro-to-chaining-llms-agents-and-utils-via-langchain-16cd385fca81
which contains same use case.
Currently,... |
This happened to me. I had a Vim extension enabled in vscode. Disable it if you have one installed. You can go to your extensions and type vim. You should be able to see the one you installed and disable it. |
I create an array of size 50 for example without any value, then I insert let's say 3 values in it at random indexes and then I want to fill the rest of the array by interpolating between those values.
First I create my array:
n = 50
a = [None]*n
which give me an "empty array" of 50 slots:
[No... |
```
m = [[[math.inf] * 10] for i in range(10)]
for i in range(len(m)):
for j in range(len(m)):
if(i == j):
m[i][i] = 0
```
[![][1]][1]
[1]: https://i.stack.imgur.com/YypkA.png
I try to insert zero And I used the debugger to watch the process go. Instead of changing it to
```
[... |
Setting diagonal of a matrix to zero |
Hey all I am wondering how I can have a generic call to one of my classes so that I can minimize my code.
Currently I have a at of if else code that determines which class should be loaded up.
As an example in my MainActivity:
if (btnName.equals("up"))
if (globalRoom.equals("ABC")) {
bt... |
Creating global Class holder |
|java|android| |
I have had to overcome this same kind of issue with a leaflet map being called via JSInterop. What I ended up doing was making the map div itself a component, with a bool parameter of "display: @isVisible ? block : none"
I put that component into my actual MainLayout.razor, which was my central layout for the multip... |
I rewrote and simplified your code. Since I'm assuming you might want to choose different colors, I wrote a method specifically to choose a color based on the `colorName` parameter.
def select_color(colorName):
WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.XPATH, f"//div[./div[text()='{... |
It seems like this issue is related to authentication with the KubeAPI server. To troubleshoot and resolve this problem follow these steps:
**Check Kubernetes API Server Configuration:**
Ensure that your Python environment has access to the Kubernetes configuration file (~/.kube/config by default). This file cont... |
|asp.net-core-webapi|.net-6.0|azure-keyvault|docker-desktop|azure-identity| |
As per React documentation, [you cannot call hooks conditionally][1].
[Here][2] is explained in depth why.
When the need to call a hook conditionally arises, you could opt for two soutions :
1. Either you call `useDataForm` and then you use `contactForm` only if `dataValid` is `true`
```jsx
const contactF... |
To direct to the point, you can easily use xpath. The exact and simple way to do this using the below code. Kindly try and provide feedback. Thank you.
JavascriptExecutor js = (JavascriptExecutor) driver;
//To click an element
WebElement element=driver.findElement(By.xpath(Xpath));
... |
Here is an example of how to insert an image and resize to fit a range of cells.
**Code.gs**
function insertImage() {
try {
let spread = SpreadsheetApp.getActiveSpreadsheet();
let sheet = spread.getSheetByName("Sheet25");
let file = DriveApp.getFileById("1F...................... |
The official [example](https://datatables.net/examples/ajax/custom_data_flat.html) explains that flat data sources should use `dataSrc: ''` in the option, and your option would look like this:
$("#tblNotes").DataTable({
"ajax" : {
"url": "/projects/ajaxGetProjectNotes/",
"type"... |
I am having problems with autocomplete of imported styles in JSX files.
Whenever i import styles from another files i dont get autocompletion.
Like i have a style in JS file:
```
searchWrapper: {
flex: 1,
backgroundColor: COLORS.white,
marginRight: SIZES.small,
justifyContent: "center",
... |
VSC Autocomplete imported styles for JSX files |
|javascript|node.js|autocomplete| |
null |
{"OriginalQuestionIds":[123758],"Voters":[{"Id":12002570,"DisplayName":"user12002570","BindingReason":{"GoldTagBadge":"c++"}}]} |
In the Bellman equation for MRP, I cannot understand why:
expectation[ G_(t+1) | s_t = s] = expectation[ expectation[ G_(t+1) | s_(t+1)] | s_t = s].
How should I understand this?
[bellman equatin for MRP](https://i.stack.imgur.com/V6fW3.png)
Equations of the process of transformation. |
Bellman equation for MRP? |
null |
{"Voters":[{"Id":4369919,"DisplayName":"N69S"},{"Id":1255289,"DisplayName":"miken32"},{"Id":14732669,"DisplayName":"ray"}],"SiteSpecificCloseReasonIds":[13]} |
I installed OpenVINO dependencies and converted the model to OpenVINO format. I have OpenCL device available:
```
$ clinfo -l
Platform #0: Intel(R) OpenCL HD Graphics
`-- Device #0: Intel(R) Graphics [0xa7a0]
```
Trying to run `yolo predict` on a GPU, e.g.
```
yolo predict model=openvino_model source='samples/... |
`sudo pip install` is most likely installing globally into a Python interpreter that is different than the one that you have selected in VS Code. Please [select the Python interpreter you want to use][1] and then install explicitly using that interpreter (if you're not using a virtual environment then use something lik... |
In your `ProductModel` schema the `category` property has a `name` property given to it. That suggests you want `category` to be an Object with a `name` property. I pressume that was not your intention. You need to remove that so that `category` is just a property with a value of type `ObjectId`.
````js
const Pro... |
First of all, response.json() does not return a JavaScript object, it returns a Promise which resolves to a JavaScript object. Second, I can't recall how response.json() works but I have a feeling it 'runs' its input as regular JavaScript, which means if the MIME type returned by the server isn't application/javascript... |
I want to show text within an SVG which is wholly defined in js. The SVG picture shows as expected, but the text does not.
I have tried the actual SVG definition in an online SVG viewer and it has the same result: picture is good, but no text showing.
I create the following string in js and then use it as the co... |
subscripted value is neither array nor pointer nor vector (C) |
|arrays|c| |
null |
I am building a simple drag gesture animation in a **Rectangle()** that, in the end of the gesture, stick the shape in the closest item of a group.
Check the example in the image bellow.
I was able to achieve a decent result with the following approach:
- Manually computing the x absolute position of the black... |
How to build a DragGesture with a "sticky" behavior in SwifUI? |
|swift|swiftui|gesture|hstack|draggesture| |
```
from pysmt.shortcuts import *
from pysmt.typing import *
hello = [Symbol(s, INT) for s in "hello"]
pysmt = [Symbol(s, REAL) for s in "pysmt"]
domains_1 = And([And(GE(l, Int(1)),
LT(l, Int(10))) for l in hello])
domains_2 = And([And(GE(l, Real(1)),
LT(l, Real(10))) for... |
{"OriginalQuestionIds":[2735783],"Voters":[{"Id":11182,"DisplayName":"Lex Li","BindingReason":{"GoldTagBadge":"c#"}}]} |
I found that this package solves the problem: [pure_dart_ui][1]. Replace this import
import 'dart:ui';
to
import 'package:pure_dart_ui/pure_dart_ui.dart';
[1]: https://pub.dev/packages/pure_dart_ui |
I follow https://www.infragistics.com/products/ignite-ui-react/react/components/general-getting-started
```
npx create-react-app MyAppName --typescript
npm install --save igniteui-react
npm install --save igniteui-react-charts igniteui-react-core
npm install --save igniteui-react-excel igniteui-react-core
npm... |
Why I use parameter typescript, but still generate javascript project? |
|javascript|reactjs|typescript|create-react-app|infragistics| |
In React, using something like updating on `document.body.scrollHeight` worked for me:
```jsx
const [viewHeight, setViewHeight] = useState<
string | number
>("100vh")
useEffect(() => {
setViewHeight(document.body.scrollHeight)
}, [document.body.scrollHeight])
...
return <div style={{ height: viewHe... |
{"Voters":[{"Id":839601,"DisplayName":"gnat"},{"Id":213269,"DisplayName":"Jonas"},{"Id":14732669,"DisplayName":"ray"}]} |
We're creating an app that uses custom icons that we made in Figma, some of which are faces, waving hands, etc. As of now, we're just using a default yellow color, but I think it would be a nice touch if we could just use the same settings as what the user has for their device. Does Flutter have a way of accessing and ... |
In Flutter, is there a way to determine the user's skin color settings for their emojies? |
|flutter|dart|colors|flutter-dependencies| |
null |
I have an application in Laravel 11 that is configured as follows in the `app.php` file:
return Application::configure(basePath: dirname(__DIR__))
->withRouting(
web: __DIR__.'/../routes/web.php',
api: __DIR__.'/../routes/api.php',
commands: __DIR__.'/../routes/con... |
inline SVG text (js) |
|javascript|svg| |
null |
I'm struggling to edit a Jtabel with a picture on it.
So basically, I can edit the table ONLY if I edit the picture on it.
I can't edit anything if I am not editing the column on the picture on it:
trying to debug but the listener isn't doing the query on the server.
here's the code
```
public class Visualizz... |
null |
I want to show text within an SVG which is wholly defined in js. The SVG picture shows as expected, but the text does not.
I have tried the actual SVG definition in an online SVG viewer and it has the same result: picture is good, but no text showing.
I create the following string in js and then use it as the co... |
The problem is not (as Greg and lorem ipsum have suggested) that your API key is not secured, as that value is only accessible to folks who have administrative access to your project.
The problem is that your `generateText` Cloud Function performs a pretty blanket API call to OpenAI and doesn't do anything to verify... |
null |
null |
I am creating a app that will read data from firebase and display it on a map. The app keeps crashing because there are hell lot of records to retrieve from the database. I need a way with which I get only the latest node data and not the entire data snapshot.
MainActivity.java:
```
public class MainActivity ext... |
null |
null |
You can do it by creating a function that changes the `fontSize` and add it on the `LocalStorage` every time a person clicks on it.
After that you can use the `window.onload()` to always check, when the page loads, if there is any `fontSize` on the `LocalStorage` and set it if there is.
Example:
**HTML**
... |
I created an Azure function and enabled the managed identity option. It creates a new Enterprise application with a unique guid. I would like to add this managed identity as an owner of a specific AAD group. In the browser it works when I enter the managed identity guid, but when I try it by PowerShell code I get the e... |
null |
I try to launch multiple experiments, but I want to keep the code script in cache so that any change will not affect experiments waiting to be executed.
The bash script I use is:
```
for SIZE in 1 2 4 8 16; do
python main.py $SIZE
done
```
The problem with my current script is that once I make changes to... |
Launch jobs in cache in a loop in bash script |
|bash|for-loop|caching| |
null |
{"Voters":[{"Id":1116230,"DisplayName":"Nico Haase"},{"Id":794749,"DisplayName":"gre_gor"},{"Id":1007220,"DisplayName":"aynber"}],"SiteSpecificCloseReasonIds":[18]} |
I am using Parros OS [tag:parrotOS]. Recently I update my apt packages by this comment: `sudo apt update` and it shows some packages telling me that, These packages it not needed anymore. I uninstalled this packages manually. Then I got this:
```
$sudo apt full-upgrade
Reading package lists... Done
Building depen... |
hashcat : Depends: libminizip1t64 but it is not installable E: Unable to correct problems, you have held broken packages |
|linux|package|apt|parrot-os|hashcat| |
Create a middleware.ts (or .js) in the root of your project. (https://nextjs.org/docs/app/building-your-application/routing/middleware)
import { NextResponse } from 'next/server';
export function middleware(request: Request) {
const requestHeaders = new Headers(request.headers);
requestH... |
I am have an issue with google colab pro. I subscribed to this plan to use the generative code assistant however I cannot access this feature. I am located in Germany at the moment if this info could be helpful.
Thank you in advance.
I tried to find colab customer service but there was none as they mentioned that I... |
google colab pro issue, cannot access generative code ai assistant |
|google-colaboratory| |
null |