instruction stringlengths 0 30k ⌀ |
|---|
{"OriginalQuestionIds":[42866013],"Voters":[{"Id":7758804,"DisplayName":"Trenton McKinney"},{"Id":17562044,"DisplayName":"Sunderam Dubey"},{"Id":466862,"DisplayName":"Mark Rotteveel"}]} |
React having to double-click |
|reactjs| |
null |
In a Java EE web application project, there is a DAO annotated as a CDI bean:
@RequestScoped
public class CustomerDAO {
@PersistentContext
private EntityManager em;
//some persistence operation afterwards
@Transactional
public void update() {
//implementation using ... |
Is EntityManager injected with @PersistenceContext to a @RequestScoped CDI bean thread-safe? |
I want a cron to run every hour that updates a table in my database.
I have a colum called "is_premium" and another that is "is_premium_until". If the time that is stored in "is_premium_until" has passed then, the "is_premium" changes from "Premium" to "Basic".
I'm struggling with the logic, can anyone help?
... |
My program has a main while loop as the main logic, with an inner while loop for running the logic of the "command function". When inside the inner while loop, I want EOF (<kbd>Ctrl</kbd> + <kbd>D</kbd>) to exit from the inner while loop only and continue with the outer loop (to listen to more commands). However, its e... |
When trying to minimise an objective through CVXPY, I have two different optimisation problems. When a parameter alpha is set to 0, both these objectives should give the same minimisation results. But for me it gives two different results.
These are the two problems
Problem 1 :
```
w = cp.Variable(shape = m)... |
CVXPY : Minimising with parameter set to 0 and minimising without parameter gives different answers |
|python|mathematical-optimization|cvxpy| |
null |
I am running `flutter build apk` command in my flutter project and receiving the error below
```
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':generateReleaseBuildConfig'.
> Error while evaluating property 'applicationId' of task ':generateReleaseBuildConfig'
> F... |
```
SELECT OBJECTID, ACTIVITYID, STATUS,LASTUPDATEDATE,DATAMGMTPOLICY,DCTCOMMAND,ACTIVITYTYPE
FROM ( SELECT OBJECTID, ACTIVITYID, STATUS,LASTUPDATEDATE, DATAMGMTPOLICY,DCTCOMMAND,ACTIVITYTYPE
FROM (SELECT CASE
WHEN DAH.STATUS = 'I' THEN 1
... |
Postgres SQL performance improve |
|postgresql| |
null |
Just find another way to do it. `window.getSelection()` is just frustratingly poorly designed. It should have been a text based function, not a node based function from day 1.
Let's take something really basic - you want to highlight a text an make that section bold. Great, window.getSelection() is fantastic for tha... |
I'm trying to biuld a counter with stm32f103c8t6 and watch counting variable value using keil uvision debugger.
when i press the button, the variable value change, but after that the variable value change to zero and doesn't save .
I don't know what to do.
i think that keil write code on micro repeatedly and so the ... |
keil debugging mode doesn't work properly |
|hex| |
null |
Another option is to define the environment variables of uvicorn app and get them through Python. I recommend [this amazing tutorial](tps://fastapi.tiangolo.com/advanced/settings/#environment-variables) that will explain it better than me. But if you are lazy to read or prefer a TL;DR explanation, here it goes:
You ... |
I have created my schema and my resolver class and i implement GraphQLQueryResolver but it is not mapping it[[enter image description here](https://i.stack.imgur.com/0MxRr.jpg)](https://i.stack.imgur.com/B5sGX.jpg)
I tried injecting some dependancies like java kickstart for graphql, and i annotated the method in my ... |
GraphQL and springboot resolver mapping problem |
|java|spring-boot|graphql| |
null |
```
try:
something = response.json['field_name']
except:
pass
``` |
You get the error due to the `JsonDeserializer` uses the constructor in your `AddSkillRequest` class and the sent JSON request doesn't match the parameters for the constructor.
[Parameterized constructors][1]
> For a class, if the only constructor is a parameterized one, that constructor will be used.
You need... |
How to solve Execution failed for task ':generateReleaseBuildConfig'. error in a flutter project |
|android|flutter|gradle|apk| |
These days, the most popular (and very simple) option is the [ElementTree API][3],
which has been included in the standard library since Python 2.5.
The available options for that are:
- ElementTree (Basic, pure-Python implementation of ElementTree. Part of the standard library since 2.5)
- cElementTree (Opt... |
null |
{"Voters":[{"Id":9223839,"DisplayName":"Joakim Danielson"},{"Id":3306020,"DisplayName":"Magnas"},{"Id":466862,"DisplayName":"Mark Rotteveel"}]} |
We first define two helper functions: `calculateWeights` corresponds to your first four lines of provided code and `getResidualData` reflects the fifth line.
```
library(dplyr)
library(tidyr)
library(ape)
calculateWeights <- function(df, site) {
df |>
filter(Site == site) |>
select(x_coord, y_coo... |
I'm trying to upload a file using my spring boot app from a pod to Amazon S3 storage. Last year this setup worked without any problems, but now I'm getting an error
java.net.UnknownHostException: custom-bucket-name.s3.eu-west-1.amazonaws.com
This spring boot app works when I run it locally, but once deployed ... |
I can't connect to S3 from the Kubernetes pod when the bucket name is longer than 14 characters |
|kubernetes|amazon-s3| |
It was resolved by adding the line:
```
response.setCharacterEncoding("ISO-8859-1")
``` |
null |
{"OriginalQuestionIds":[73326884],"Voters":[{"Id":14868997,"DisplayName":"Charlieface","BindingReason":{"GoldTagBadge":"sql"}}]} |
I have a program that is able to expose itself as a self hosted WCF service. It does this when it's started as a process with certain parameters. In the past I've passed in a port for it to host on but I want to change that so it finds an available port and then returns that to the caller. (It also sets up a Session... |
How to return the port from a program that self hosts as a WCF service |
|process.start| |
I tried the 'fa-meh-blank' Remove. When I clicked it worked. And when I clicked again, my icon disappeared completely.
My new JavaScript:
icone.addEventListener('click', function(){
//console.log('icône cliqué');
icone.classList.toggle('happy');
icone.classList.toggle('fa-meh-blank')... |
When installing packages with yarn berry(v3.6.3), I encountered an error where types couldn't be imported.
Although there were no issues in vscode, when running the React app with 'yarn start', the following error occurred: a
"Module not found: Error: Package path ./dist/types is not exported from package /Users... |
Yarn berry can't find type in module |
Exit inner loop only when EOF (Ctrl+D) is given via standard input |
The way to do this is actually easy, but requires some manual steps. Here are the steps for Linux:
1. You create a network:
```
$ docker network create docker_airgap_network
bb7645298697d420dab8eaf1fd4738fccceb8230c783aa93ebe76abec6c40f41
```
2. Fetch the created bridge interface name:
```
... |
After deploying to webhosting, it throws me an error on the /graphiql route to the console:
Mixed Content: The page at 'https://myweburl.com/graphiql/' was loaded over HTTPS, but requested an insecure resource 'http://myweburl.com/graphql/'. This request has been blocked; the content must be served over HTTPS.
... |
Mixed Content HTTP / HTTPS - (GraphQL) Lighthouse is requesting an unsecured http url |
I see two methods how to train model:
- training based on one picture with my true predict of decision
- training based on one big picture with set of pics inside and keep training like sets with my true predict of decision
Predict input may be as one picture or sets
If you have suggestions, will be nice ... |
Should I train my model with a set of pictures as one input data or I need to crop to small one? | PyTorch | Machine Learning |
|python|machine-learning|pytorch| |
null |
The flow is to be basically as follows:
1. Function ```addTaskToDb()``` writes HTML form data to the spreadsheet (e.g. Task 3);
2. ```google.script.run.withSuccessHandler(_ => loadClientTasks(selectedClient)).newTask(task);``` will load updated tasks onto the active HTML page (e.g. Tasks: 1, 2 and **3**);
3. ``... |
I'm trying to get the other input values, but they're always blank. Here's the code I got:
```
function savePo() {
let table = document.getElementById("dtable");
let [, ...tr] = table.querySelectorAll("tr");
let tableData = [...tr].map(r => {
let td = r.querySelectorAll("td");
return [...td].map((c... |
|reactjs|typescript|hadoop-yarn|yarn-berry| |
> CUDA kernel errors might be asynchronously reported at some other API call, so the stacktrace below might be incorrect.
For debugging consider passing `CUDA_LAUNCH_BLOCKING=1`.
Compile with `TORCH_USE_CUDA_DSA` to enable device-side assertions.
I try the enter the command in the bash: `export CUDA_LAUNCH_BLOCK... |
[![enter image description here][1]][1]
In my case Mysql could not start due to the below issue (mysql_error.txt):
> 2024-03-27 19:42:10 0 [ERROR] mysqld.exe: Aria recovery failed. Please
> run aria_chk -r on all Aria tables and delete all aria_log.########
> files 2024-03-27 19:42:10 0 [ERROR] Plugin 'Aria' regi... |
Try using delagtes!
protocol FileImporterDelegate: AnyObject {
func fileImporter(_ importer: FileImporter,
shouldImportFile file: File) -> Bool
func fileImporter(_ importer: FileImporter,
didAbortWithError error: Error)
func fileImporterDidFinish... |
I want to remove this border (regardless of what theme is used).
Other borders are removed and only this remains:
[![border to remove][1]][1]
[1]: https://i.stack.imgur.com/1uz0q.png |
How can you remove the border from the top tab bar of Visual Studio Code? |
|visual-studio-code| |
It appears that your `GROUP BY` is grouping the entirety of each `InvoiceHeader` row, while the other table references are only used to calculate sums for details and payments. In that case, I believe that is would be simpler to select directly from `InvoiceHeader` only at the top level and use `CROSS APPLY` subqueries... |
I am working with Azure Mobile Services API, my API on the local host running well. I have checked with the help of Swagger UI. but when I publish my API to azure then after that by accessing the API with Swagger I got this error.
> 500 : {"Message":"An error has occurred."}
http://xxxxxxxxxxx.azurewebsites.net/... |
|azure|swagger|azure-mobile-services| |
When trying `from osgeo import gdal` I got the error `ModuleNotFoundError: No module named '_gdal'`. I installed gdal 3.5.1 from binary.
|
ModuleNotFoundError: No module named '_gdal' |
I am trying to use a form with two images, and then download both images to local when submitted the form. But both images are downloaded as the same image.
In HTML I have this fields:
<img src="data:image/jpeg;base64,UklGRoog..." id="foto_muestra__url_val">
<img src="data:image/jpeg;base64,/9j/4AAQ..." ... |
Form with two images is saving both with same content as first in PHP |
|php|image|forms|upload|move| |
I have a usercontrol that raises an event after communicating with a web service. The parent handles this event when raised. What I *thought* would be the proper approach would be to pass the object returned from the webservice to the parent as eventargs???
If this is the proper way I can't seem to find the instruct... |
|ios|swift|avfoundation|avaudiosession|avaudiorecorder| |
I have written a C# program that reads WMI Instance operation events in a particular namespace. Another third-party software (SCCM client [1]) is responsible for creating these instances in the background. When running multiple instances of my program, only the first one is able to listen to the events and fire the cal... |
|laravel|graphql|laravel-lighthouse|graphiql| |
I'm trying to publish a project with Vercel, but I'm getting the following error:

I've tried this but it didn't work:
{"minifySvg": false }
This didn't work also:
module.exports = { "minifySvg":false }
What could be the prob... |
I have this code
```lang-html
<h1><span class="tag">My text to animate</span></h1>
```
```lang-CSS
.tag {
color : #0000;
--g : linear-gradient(beige 0 0) no-repeat;
background : var(--g),var(--g);
background-size : 0% 100%;
-webkit-background-clip : padding-box,text;
... |
Why container constraints property ignore minimum width? |
I am working through the book "[Program Proofs][1]". Specifically, I am doing exercise 5.9.
My attempt is as follows:
function Mult(x: nat, y: nat): nat
{
if y == 0 then 0 else x + Mult(x, y - 1)
}
lemma {:induction false} MultCommutative(x: nat, y: nat)
decreases x + y
... |
Dafny: comparing lexicographic tuples |
|dafny| |
I am going through TPM (Trusted Platform Module) and trying to do a task.
How can I store data on the TPM chip? Also, how can I read that data?
|
How to read and store data to TPM Chip? |
null |
I am not sure about `Provider` but you can surround your `ListTile` Item with a `GestureDetector` or `InkWill` Widget and when you tap on your list tile you can send the id of your item to the next page with page parameters for example:
GestureDetector(
onTap:(){
Navigato... |
I think it should always be done if you made the inner type `pub`. As this basically means that we have complete transparency. I actually think in this case `Deref`, `DerefMut`, `From` and `Into` should be implemented automatically by Rust like `Sync` and `Send` is.
But if it is not `pub` then never do it, unless the ... |
null |
It's pretty easy -- just start by selecting your target nodes, then doing the layout using "Selected Only". That will only layout your target nodes. Then repeat the process for your source nodes.
|
Is there a paradigm that gives you a different mindset or have a different take to writing multithreaded applications?
Perhaps something that feels vastly different, like [procedural programming][1] to [functional programming][2].
[1]: https://en.wikipedia.org/wiki/Procedural_programming
[2]: https://en.wi... |
It can be done in single animation starting at "`0` rotation" without stacking and without negative delay, and you were pretty close to that. (Welcome to SO, by the way!)
You just had the easing functions set one frame later, but the progression (`ease-out` - `ease-in-out` - `ease-in`) was correct.
For the POC de... |
{"Voters":[{"Id":23179206,"DisplayName":"Lee-xp"}],"DeleteType":1} |
When writing async code, you need to code to the principle not the implementation.
> Would the following program be safe to run without locks?
No, the operation is non-atomic and a race condition. A task could read the variable, any other number of tasks in the meantime can read and write to the value, then the ... |
Just another solution:
If we want to achieve with interactive mode using git rebase command:
Then run:
`git rebase -i HEAD~2`
Note: <~N> is number of commits messages we want to see in interactive window.
There are various options, we can pick only those commits which we want, We can squash all commits into ... |
null |
Its easy do not use nodemon install the latest version of npm and use this command:-
node --watch filename
for eg
node --watch index.js
It will work same as the nodemon but remeber on latest version of node I think 19 but if you are trying 17 or something it will not work so make sure to update it before using |
My problem is that there is a generic class called `TypedProducer<K, V>` for key and value and I do have to instantiate it from configuration (let's say someone tells me that key is `Integer` and value is `String` in configuration during runtime but it can be any `Object` subtype really) so I don't know the types befor... |
I have table which represents sequence of points, I need to get sum by all possible combinations. The main problem is how to do it with minimum actions because the Real table is huge
Col1|col2|col3|col4|col5|col6|ct
Id1 |id2 |id3 |id4 |id5 |id6 |30
Id8 |id3 |id5 |id2 |id4 |id6 |45
The expected result is
... |
Summarize all possible combinations in pandas dataset |
|python|pandas|dataframe| |