instruction
stringlengths
0
30k
### Summary There is a difference between `any` in type parameter and `any` in regular function parameter. Your case is the former one for generics. So you need to instantiate `T`(decide `T`'s concrete type) first when assigning it to the concrete variables Ref1. https://stackoverflow.com/questions/71274361/go-erro...
I have a very large text file (58 million lines) that I want to process using Cython. It looks like this: 262.000 1.000 2.2900 263.000 1.000 -2.1562 264.000 1.000 -1.7201 265.000 1.000 1.1220 266.000 1.000 -0.0108 267.000 1.000 ...
|java|reference|pass-by-reference|call-by-value|
{"Voters":[{"Id":770830,"DisplayName":"bereal"},{"Id":1902010,"DisplayName":"ceejayoz"},{"Id":238704,"DisplayName":"President James K. Polk"}]}
I searched online but could not find an answer. I know i+=1 in Python is equivalent to i++ in C/C++. But what about ++i? when I want to increment first and then assign. Is it never used in Python and why it is not needed? I searched online for an answer but could not find one.
how to write "++i" in Python?
|python|python-3.x|
null
The code below uses a **background callback** (plotly/dash) to retrieve a value. [![enter image description here][1]][1] Every 3 seconds, `update_event(event, shared_value)` sets an `event` and define a `value`. In parallel, `listening_process(set_progress)` waits for the `event`. This seems to work nicely w...
I have a relatively large PostgreSQL (v12) table storing JSONB data that has unintentional duplicate data (based on a composite unique index on two columns, `aCol` and `bCol`). In order to create that index, I have to first delete all of the accidental duplicates from the DB. This works fine in 2/3 of our DB servers (s...
The result of dereferencing a deleted pointer is undefined. That means anything can happen, including having a program appear to work. There is no promise that an exception will be thrown, or that an error message will be displayed.
**UPDATE** I reread your question and understand now, that it's more about understanding the `styled` function, which I can't really help, sorry. But still, for a reusable approach of actually getting the tooltip to not wrap, I leave my answer here. **TL;DR**: `useTheme` + `useMemo` + 'stylesOverrides' I ran ...
A quick aside, we can cast to-and-fro from one table type to another, with restrictions: /** create a TYPE **/ CREATE TYPE tyNewNames AS ( a int, b int , c int ) ; SELECT /** note: order, type & # of columns must match exactly**/ ROW((rec).*)::tyNewNames ...
null
When I run the command npm run build (webpack), webpack builds a folder with all of the static files bundled together in bundle.js. Then, when I run the command npm run dev (webpack serve), it opens html file located in the build folder in the browser. But when I look at the source folder using chrome dev tools, the bu...
The webpack bundle created and stored in the project directory is different than the one used to run the application with webpack-dev-server
<!-- language-all: sh --> > Why is PowerShell failing when redirecting the output? The reason is that `python` (which underlies `html2text`) - like many other Windows CLIs - modifies its output behavior based on whether the output target is a *console (terminal)* or is _redirected_: * In the *former* case, suc...
I have the following code in a file testKtor.main.kts: @file:DependsOn("com.aallam.openai:openai-client-jvm:3.7.0") @file:DependsOn("io.ktor:ktor-client-cio-jvm:2.3.9") import com.aallam.openai.client.OpenAI val openAiClient = OpenAI(token = "your-api-token") When running this with ...
Why doesn't CIOEngine have a dispatcher in kotlin script?
|kotlin|kotlin-coroutines|ktor|kotlin-script|
The solution is to reorder the dependencies. This works: @file:DependsOn("io.ktor:ktor-client-cio-jvm:2.3.9") @file:DependsOn("com.aallam.openai:openai-client-jvm:3.7.0") import com.aallam.openai.client.OpenAI val openAiClient = OpenAI(token = "your-api-token") As to why, I can give...
{"Voters":[{"Id":3745413,"DisplayName":"Ron Maupin"},{"Id":354577,"DisplayName":"Chris"},{"Id":4850040,"DisplayName":"Toby Speight"}],"SiteSpecificCloseReasonIds":[18]}
I am trying to extract some links and text in a .json file from a web-page. I have parsed the HTML tbody > tr > td, and each td contains `<a href="TextWithUrlBehind">Something</a>` But this `TextWithUrlBehind` in Inspect Element is clickable, it has a link attached to it. It is not a well-known `<a href=https//...
|reactjs|webpack|webpack-dev-server|webpack-5|
null
You need to send the message to the `HWND` that `CreateWindow()` creates. You can get that from the return value of `CreateWindow()`, or from `GetDlgItem()` after `CreateWindow()` is finished. The `LPARAM` needs to be a pointer to the 1st character of a null-terminated C-style string, eg: ``` char myline[size]; ...
I have an application (nestjs) working into docker container into vm in google cloud, sending and receiving http requests to/from server of other company in other city/state (they use azure cloud). But that other company created a vpn site to site, and now we need to make this container send and receive the http reque...
m hosting a c# api locally on my machine , while trying to connect to it from my flutter app i kept getting a timeout . This is not my first time trying to connect to a local api so i know that i have to use my private ip address instead of localhost . Tried to shutdown my firewall but when shutting my public network f...
Flutter connection to a local api
|.net|flutter|rest|timeout|
**This is not possible.** Because the font is not applied to the text and is applied to the visible output for you. Therefore, the font will never be a part of your text and you will not be able to copy or share it as text. **The solution for your case is to provide an image output** to the user and copy, share or ...
from https://www.warp.dev/blog/how-to-open-warp-vscode VS Code > Settings > Preferences Type "terminal" into the search bar Where it says "Terminal > External: Osx Exec", replace whatever is there with "warp.app" Now when you press Command + Shift + C, a new session of Warp should pop up.
I've got a component which does this: ```jsx <CodeBlock language="css" code={`p { color: hsl(1deg, 100%, 50%};`} /> ``` Inside the component I run Prism.js for code highlighting. This is all good. The problem I have is when the indentation of the general code leads to a situation like this: ```jsx <Box> ...
The type of B is displayed as A when `type B = A` is used. Why is it displayed as `any` when `type B = A | A` is used instead?
|typescript|types|
Your second working command is running commands in a Bourne shell (`/bin/sh`); that's what the `-exec sh -c '...'` is for in your `find` command. On the other hand, you're trying to run the first command directly in the `fish` shell. That's not going to work. You could explicitly run it using `/bin/sh`, just like in...
Not exactly to your question, but I have similar issue, just share here, hope it help. My project is blazor server app with VS2022, .Net8, it works fine in Dev and Prod Env. After some code refactor, I rename the project name from 'ProjectName' to 'ProjectNameNew'. It still works fine in Dev environment. However,...
I'm trying to solve a problem in CS50W Project 1 'wiki'. I'm working on the specification - 'Entry Page' where if I add `/wiki/title` to url it should fetch the entry page. These are my files: wiki/urls.py ``` from django.contrib import admin from django.urls import include, path urlpatterns = [ path...
null
I have server code and index.js code conected to index.html file. everything seemed to be working, but i cant get the next task done. Taks is: If a new user created, and he;s redirected to casino.html and after this when he will wisit home page, hape page should check if he has session cookie set, and if yes, he should...
Express session is not seened in server code
|javascript|node.js|express|cookies|
null
so i am new at coding and im trying to create a Clicker game. To sum it up its supposed to be like Cookie Clicker. Click something to get a point and with those points buy upgrades. But i ran into a little Problem, i want to create Infinite Upgrades. So that i can buy a Click upgrader a infinite amount of times. But I ...
Use ::ng-deep along with :host or you can add your css in style.scss so that you dont need to use ::ng-deep. <!-- begin snippet: js hide: false console: true babel: false --> <!-- language: lang-css --> :host{ ::ng-deep { mat-menu { .mat-mdc-menu-panel { .mat-mdc-menu-c...
Guided by https://github.com/microsoft/vscode-python/issues/14639 I suggest to do the following steps: 1. **CTRL + P** 2. Search for **>Preferences: Open User Settings (JSON)** <br> - *(settings.json)* <br> 3. Add `"python.experiments.optInto": ["pythonDiscoveryModule"]` 4. Save the file 5. **View > Comand Pale...
To get some code executed just once in this function, you need to tag the order like: ```php add_action( 'woocommerce_order_status_changed', 'bacs_payment_complete', 10, 4 ); function bacs_payment_complete( $order_id, $old_status, $new_status, $order ) { // 1. For Bank wire and cheque payments if ( $order-...
If you want to use a `switch` statement for ranges, generally you need to map the ranges to specific values - they could be discrete integers, but in Java it makes sense to use `enum`s, because the `enum` definition can have a method that does the mapping. `enum`s can be public, but they can also be private, within ...
Svelte reactivity affected by initial variable value
I've started working with Svelte and I stumbled upon some unexpected behavior. This is the snippet of my app source let currentPage = 1; $: if (currentPage || $selectedOption) { fetchPage(currentPage, $selectedOption); } ...
Error fetching the entry page through Django url path
|html|django-views|web-applications|django-urls|
null
|c#|unity-game-engine|
Trying to work using the fleet ide that was created by Jetbrains Followed the tuturial on the jetbrains webiste: https://www.jetbrains.com/help/fleet/getting-started-with-java-in-fleet.html I am following the one for JAVA and I going for the Gradle wrapper. Was able to get everything working in intellij B...
Jetbrains Intellij Works but Fleet does not
|gradle|intellij-idea|jetbrains-fleet|jetbrains-hub|
I came up with a solution myself. ``` SELECT DISTINCT * FROM ( SELECT group_concat(v2_id ORDER BY v2_sort_me ASC) FROM ( SELECT v1.id AS v1_id, v2.id AS v2_id, v1.sort_me AS v1_sort_me, v2.sort_me AS v2_sort_me FROM t v1 JOIN t v2 ON abs(v1.value - v2.value) < 20 ) GROUP BY v1_id HAVING COUNT...
As mentioned [here](https://github.com/jupyterlab/jupyterlab/issues/2044#issuecomment-1015377299), you can reuse existing kernel by using `--KernelProvisionerFactory.default_provisioner_name=pyxll-provisioner`. For example: ```bash STARTUP_CODE="a = 42" export PYXLL_IPYTHON_CONNECTION_FILE="$(mktemp -d)/conne...
[`git-subtree`](https://github.com/git/git/blob/master/contrib/subtree/git-subtree.txt) is a script designed for exactly this use case of merging multiple repositories into one while preserving history (and/or splitting history of subtrees, though that seems to be irrelevant to this question). It is distributed as part...
{"Voters":[{"Id":3689450,"DisplayName":"VLAZ"},{"Id":5468463,"DisplayName":"Vega"},{"Id":522444,"DisplayName":"Hovercraft Full Of Eels"}],"SiteSpecificCloseReasonIds":[13]}
Please advise how to control rows order in flextable. For example, in the table [The Epidemiologist R Handbook](https://epirhandbook.com/en/index.html) the order of rows arranged in the ascending way, and Other and Missing rows in the midle of table. But I want to have these rows in the end. How to do this? https...
Flextable R - change order of rows
|r|row|flextable|
null
I have the following input ``` <input type="number" [ngModel]="inputValue" (ngModelChange)="handleChange($event)"/> ``` And I am trying to force the input to stay less or equal to 100. using the method handleChange ``` export class AppComponent { inputValue: number = 0; handleChange($event: any) { ...
I'm trying to simulate it, but besides en/decoding, it will also designedly ignore part of the content, and I'm not sure is there more features I don't know. Btw, maybe there is some diffrence when achieving it between Chrome, Edge and other modern explorers? I think I've know the common en/decoding details in it...
What will the explorer do when I use the fuction "Copy Link To text"?
|google-chrome|
null
I have installed evolution x custom rom via adb sideload.Now there is an update coming from evolution x team and i want to update it.But can i dirty flash it via adb sidelaod I am getting issue in installing custom recovery.
Having issue with dirty flash
|pixel|rom|
null
You could have the `-exec` run each line via `bash -c` instead of `echo`ing it to a file to be run later. That would also enable (require, in fact) adjusting your quoting, ultimately allowing a simpler and clearer command. For example: ``` find ./build/html -name '*.html' \ -exec bash -c '../emojize_pngorsvg.py ...
{"OriginalQuestionIds":[41179199],"Voters":[{"Id":1159478,"DisplayName":"Servy","BindingReason":{"GoldTagBadge":".net"}}]}
For `react-router-dom` version 5.3 I used `useHistory()`. Sample code ```JavaScript import React from 'react'; import { useHistory } from 'react-router-dom'; function MyComponent() { const history = useHistory(); const redirectToOverview = () => { // Use the history.push method to navigate to /ap...
### **How Can I Fix this, italic to Normal Style! ***[enter image description here](https://i.stack.imgur.com/qlGtZ.png) I want to make it normal style without italic version. how can I achieve this, please solve me this. this italic version makes me so anger. now I want to make it simple and without italic version.
How Can I Fix Sublime Text CSS Style italic to Normal?
|html|css|sublimetext|sublime-text-plugin|
null
Cart ui not loading data after reload although data are in local storage cart.js ``` import React, { useState } from "react";import { RxCross1 } from "react-icons/rx";import { IoBagHandleOutline } from "react-icons/io5";import { HiOutlineMinus, HiPlus } from "react-icons/hi";import { Link } from "react-router-...
With "Android Studio 2023.2.1", now in 2024-04, it is like this: 5.1 ( Burger Menu ) > Build > Rebuild Project ”( Burger Menu ) > Build > Select Build Variant…”. “Build Variants:”. “Module” = ”:app” “Active Build Variant”. “debug ( default )”. ...
{"Voters":[{"Id":9952196,"DisplayName":"Shawn"},{"Id":9214357,"DisplayName":"Zephyr"},{"Id":4850040,"DisplayName":"Toby Speight"}],"SiteSpecificCloseReasonIds":[18]}
``` import React from "react"; export default function TestComponent(){ const [booValue, setBoolValue] = React.useState(false) React.useEffect(() => { setBoolValue(!booValue); },[]) React.useEffect(() => { console.log('booValue is', booValue) },[booValue]) return ...
{"OriginalQuestionIds":[574594],"Voters":[{"Id":10871900,"DisplayName":"dan1st might be happy again"},{"Id":642706,"DisplayName":"Basil Bourque","BindingReason":{"GoldTagBadge":"java"}}]}
Found out that the key mapping for basic movement is initialized when the character is spawned to the world. The reason that movement does not work let alone moving the camera is, that the input mapping references the player controller and at the point of spawning the pawn, the controller assigned is not the controller...
I'm pretty new to SQL and I have 12 tables with the same schema containing the same types of data from 12 months, and I need to merge them all into one big table. How can I do this in BigQuery using SQL? I have tried creating a temp table, which is all well and good, but I want to be able to come back to it later.
|sql|google-cloud-platform|google-bigquery|merge|
null
from https://www.warp.dev/blog/how-to-open-warp-vscode 1. VS Code > Settings > Preferences 2. Type "terminal" into the search bar 3. Where it says "Terminal > External: Osx Exec", replace whatever is there with "warp.app" 4. Now when you press Command + Shift + C, a new session of Warp should pop up.
I am new to typescript and I am using next auth to build a project I faced this and I do not know why this is happening I checked the next auth files and wrote this question this is not a typescript question since I tried it in a normal ts file and it was working as expected. I am just curious and want an answer to thi...
From .NET 4.5 it can be handled as follows, void DoDynamicCall() { MethodInfo method = /*referencing MyClass method void MyStaticFunction(int x)*/; try { method.Invoke(null, new object[] { 5 }); } catch (TargetInvocationException e) { ...
I dont quite understand why have we used .clone() method when we have a second for loop to restore the letterCount.And when i'm runnig this code without .clone() method its giving me the wrong answer? So what exactly is the need public int solution(String[] words, int[] letterCount, int[] score, int in...
Leetcode 1255-recursion and backtracking
|java|recursion|dynamic-programming|clone|backtracking|
null
According the instruction in Next.js docs [here](https://nextjs.org/docs/messages/app-static-to-dynamic-error), you can use `export const dynamic = 'force-dynamic';` like in the bellow example: ```js export const dynamic = 'force-dynamic'; // <- add this to force dynamic render export const getUsers = async (re...
Diving deep into azure development and can't find any logical solution for load testing of AppService that is using OpenAI services. I suppose there should be some "load testing mode" for Azure Open AI. Maybe separate testing model that will behave like a regular OpenAI model but will not cost a lot of money as a re...
Azure openai load testing mode