instruction stringlengths 0 30k ⌀ |
|---|
I had the same problem with an IntelliJ IDE.
In my case setting `"sourceMap": true` in tsconfig.json did the trick. |
I have a constraint in a MILP formulated in pyomo.
Thats a general formulation of it:
def constraint(m, t):
return (m.y[t] <= max(0,m.x1[t] - m.x2[t]))
model.constraint_c = pyo.Constraint(model.timeindex, rule=constraint)
y, x1 and x2 are timeindexed Non Negative Real Variables.
In own words: y should b... |
I'd like to log a value which resides in a `ScopedValue` (currently [in preview](https://openjdk.org/jeps/429) in Java 21+). I'm guessing I'd have to somehow bridge this to MDC, however all attempts fail, e.g. overwriting the `MDCAdapter` (Logback doesn't seem to use e.g. `MDCAdapter.get` to actually read the MDC's val... |
Logback: using a ScopedValue inside a log message |
|java|logback|mdc|virtual-threads|project-loom| |
# Update
Starting from Android Studio 2022.2.1 Device mirroring is under "Tools" menu in "Preferences" or "Settings" (For mac users).
https://stackoverflow.com/questions/75888209/how-to-show-the-screen-of-a-physical-device-inside-android-studio
# Old Answer
[Droid@Screen][1] might work for you. I've never us... |
I'm encountering an issue with Playwright while sending a POST request using the `request.post()` method. However, when I send the same request using Postman, I receive the response correctly.
Here's the error message I'm receiving:
Response:
```
{
"message" : "Required request body is missing: public org... |
Check if minikube is running then you can use dashboard which will give you local minikube cluster link to open in browser and verify your cluster.
minikube status
minikube dashboard
|
Above post needs two modification to make it work properly
1. Create a new pageable object with `created_at` and pass that in the native query, because native query understands table column and not the attribute of the entity class.
2. The query will again include filtered data when the post gets reported by anot... |
|excel|vba|outlook| |
To make the country code non-editable while showing a placeholder in `react-phone-input-2`, you've mostly got it right. However, ensure your `countryCodeEditable` prop is set to `false` as you've done. The placeholder showing after the country code and being uneditable should work with the `placeholder` prop as you've ... |
Python Code:
```python
from Crypto.Random import get_random_bytes
from Crypto.Cipher import AES
from Crypto.Util.Padding import pad
import base64
def encrypt_string(input_string, key_base64, str_iv):
try:
key = key_base64.encode('utf-8')
i... |
I have the following configuration
Client(Browser) ---> Nginx ——————> Auth backend
|
————————> Protected Backend
When the browser hits Nginx for `Protected Backend`, it is directed to the Identity Provider (Azure Active Directory). Th... |
Pyomo linearization of min(0,x1-x2) in MILP |
|linear-programming|pyomo|linearization| |
I should say first that I have found and read most (if not all) of the questions with the same error message. So far, none of lead to a solution. Most seemed to be aimed at IIS hosted apps. And the ones that are Azure hosted are old and just don't have solutions, or have dead links to old articles that no longer exist.... |
I'm trying to setup SMTP for Kiwi TCMS. When trying to send a test email I'm getting a long error and at the bottom it says OSError: \[Errno 99\] Cannot assign requested address
Here is the SMTP setup on the common.py file:
```
SERVER_EMAIL = DEFAULT_FROM_EMAIL = 'emailaddress'
EMAIL_SUBJECT_PREFIX = "[Kiwi-T... |
**EDIT**
Asof @BigBen comment rephrased the answer.
The faulty code is that if you want to copy the entire row, but the target is not cover an entire row. Therefore try this:
````
myCell.EntireRow.Copy Worksheets("TestSheet").Range("B" & Rows.Count).End(xlUp)(2).EntireRow
````
If you want to paste in the firs... |
|html|css|flexbox|pseudo-element| |
{"Voters":[{"Id":20643658,"DisplayName":"Black cat"}]} |
From the [*Guards* section of the The Gleam Language Tour][1]:
[1]: https://tour.gleam.run/flow-control/guards/
> Only a limited set of operators can be used in guards, and **functions cannot be called at all**.
This restriction of not calling functions in guards is to avoid side effects in pattern matchin... |
I have a Windows Forms application VS2010 C# which displays a MessageBox with an OK button.
How can I make it so that, if the user walks away, the message box automatically closes after a timeout of, say, 5 seconds? |
I run Linux Mint 21.3 x86_64, I use the Eclipse IDE (version 2023-12 (4.30.0)) for Java development. I have a Java application (Eclipse Scout) that was working until this morning.
I tried to run the application from the IDE by clicking on the icon ***Run -> [webapp] all***. This has always worked before by launchin... |
setState will update the variable on the next rerender.
Try this:
```
function App() {
const [userData, setData] = useState([]);
const getData = async () => {
const res = await fetch("https://jsonplaceholder.typicode.com/users");
const data = await res.json();
setData(data);
};
con... |
Set-Cookie header not forwarded by nginx to the client |
|authentication|nginx|authorization|webapi| |
Once it reaches `DB::commit`, it throws an error. However, if I comment out the `Schema::table` code, it works in PHP 8.3. In PHP 7.3, it still works as expected.
```
try {
DB::beginTransaction();
// sm model::create() operations
if(!empty($table)){
Schema::table($table, function (Blueprint $table) use (... |
|excel|vba|outlook| |
It is actually just a curiosity, but here's how I came up with it.
#### tl;dr
I could have wondered how to write a sensible `Enum` `instance` for a type larger than `Int`, say `(Int, Int)`.
#### A bit longer
But actually I was wondering: why does `Enum`'s minimal definition assumes that the possible values ... |
Why does Enum require to implement toEnum and fromEnum, if that's not enough for types larger than Int? |
|haskell|enums|functional-programming|typeclass|bounded-types| |
I get the following errors when republishing the image I took with ros2 run ffmpeg.;
ros2 run image_transport republish ffmpeg in/ffmpeg:=image_raw/ffmpeg raw out:=image_raw/uncompressed --ros-args -p "ffmpeg_image_transport.map.hevc_rkmpp:=hevc"`
terminate called after throwing an instance of 'image_... |
Once it reaches `DB::commit`, it throws an error. However, if I comment out the `Schema::table` code, it works in PHP 8.3. In PHP 7.3, it still works as expected.
```
try {
DB::beginTransaction();
// performing some model::create() operations
if(!empty($table)){
Schema::table($table, function (Blueprint ... |
I have a list `List<IVehicle> vehicles = new List<IVehicle>();` and in that list I want to store objects (`Car`, `Boat`, `Mc`) that implement `IVehicle`.
How can I print out how many objects of ex car I have in the list?
I tried using LINQ `int count = vehicles.Count(x => x == car);` but it does now count correct... |
Kiwi TCMS - Test Email failing |
|kiwi-tcms| |
null |
**EDIT**
____
Working solution found. See **NEW SECTION** below.
____
Original Question:
Trying to make a classic function to call a file, read a csv, ask the user which columns to keep, and then return the resulting minimized dataframe.
The outcome is that the dialog works, but it doesn't update the resu... |
I found a solution which worked for me . Give it a try if it works !!.
Go to index.js file and replace <React.StrictMode> to <BrowserRouter>
Attached the snippet for reference.
Good Luck [enter image description here][1]
[1]: https://i.stack.imgur.com/XMtZe.png |
Checking a float-like type with
isinstance(x, float)
or
type(x) is float
will return `False` if the type is not exactly a float, but, for example, a numpy.float32:
import pandas as pd
import numpy as np
x = pd.Series([0.2], dtype=np.float32)[0]
As pointed out in [a comment of thi... |
This is my Gmail SMTP Sample with Google Xoauth2 using the Google .net client library
// Copyright 2023 DAIMTO ([Linda Lawton](https://twitter.com/LindaLawtonDK)) : [www.daimto.com](http://www.daimto.com/)
//
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file... |
How do list all keys including disabled from Azure Key vault |
|azure|azure-keyvault| |
Have just come across a problem where I believe this is the solution.
At the moment I have the following code:
function siteUsers()
{
global $database;
$q = "SELECT username, id FROM ".TBL_USERS."";
return mysql_query($q, $this->connection);
}
function generateUserArray()
{
$u = array(... |
Return two separate columns of data from a function |
null |
You can use a `RoundedRectangle` to provide the base shape, then the sides can be hidden using blocks of the same Color and blend mode `.destinationOut`. For the thin line that goes all the way round, just paint another `RoundedRectangle` on top.
This shape can be applied as an overlay over the image. It is importan... |
I have HTML table with following structure:
```
<table>
<thead>..</thead>
<tbody>
<tr class="certain">
<td><div class="that-one"></div>some</td>
<td>content</td>
<td>etc</td>
</tr>
several other rows..
<tbody>
</table>
```
And I am trying to figure out what to do with the `<div class="that-one">` (o... |
In such cases `for` loops can be much faster.
> for (s in seq_along(my_list)) {
+ x <- my_list[[s]]
+ if ('col3' %in% names(x)) {
+ x$col3[is.na(x$col3) & x$col1 %in% c('v2', 'v3')] <- 'VAL'
+ my_list[[s]] <- x
+ }
+ }
> my_list
[[1]]
col1 col2 co... |
[file routing here](https://i.stack.imgur.com/ea8I7.png)
Every Page generated from static routes works fine on vercel but not the one from [slug] page js
`{workshops.map((workshop) => (<Link href={`/workShops/${workshop.title}`} key={workshop.id} passHref>
<PersonalCard workshop={workshop} /></Link>))}`
here ... |
The new operator in C++ performs the following actions:
1. Allocates Memory: It allocates memory on the heap for a single object or an array of objects. The amount of memory allocated is enough to hold the object(s) of the specified type.
2. Initializes Object(s): After allocating memory, new initializes the obje... |
|c++|singleton|cpu|cpu-architecture|new-operator| |
Note: I am by no means a coder, but this is just a task I have been assigned. Any help is greatly appreciated.
The software outputting on port 2000 is a flight simulator, which automatically outputs flight data in some sort of encoding.
The code I am using to receive the data is in Python.
```
import socket
impo... |
I have data coming through port 2000 on my computer from a simulator software. How can I convert the raw data to usable data? |
|python|telemetry|bytestream| |
null |
If I read your requirements as:
*select any text node that is a* child *of `u` (i.e. not inside another element such as `desc` or `del`), but exclude text nodes that are in-between two `anchor` elements*
then I arrive at the following expression:
//u/text()[not(preceding-sibling::*[1][self::anchor] and fol... |
In an HTML document, suppose I have something like a link that starts after another non-whitespace character, e.g.
<!-- begin snippet: js hide: false console: true babel: false -->
<!-- language: lang-css -->
p {
max-width: 140px;
}
<!-- language: lang-html -->
<p>This is some text th... |
Next 14 App Router pages from dynamic routes not generating when deployed on vercel but only work on localhost |
|deployment|vercel|production|app-router|nextjs-dynamic-routing| |
null |
The issue is caused by a malformed request URL.
To run the GET function you must be request with GET method.
Example:
const getBookings = async () => {
try {
const res = await fetch('http://<your-site-host>/api/v1/bookings',{
method: 'GET',
headers: {
'content-type'... |
I am trying to convert some R code I've written into an R shiny app so others can use it more readily. The code utilizes a package called `IPDfromKM`. The main function of issue is `getpoints()`, which in R will generate a plot and the user will need to click the max X and max Y coordinates, followed by clicking thr... |
I'm integrating Google sign-in with Firebase authentication in my Flutter app. When trying to assign the result of `GoogleSignIn().signIn(`) to a `GoogleSignInAccount` variable, I encounter a type mismatch error. Here's the relevant part of my code:
```
// ignore: import_of_legacy_library_into_null_safe
import '... |
Error Assigning 'GoogleSignInAccount?' to 'GoogleSignInAccount' in Flutter Authentication |
|flutter|dart|firebase-authentication|google-signin| |
I found a solution which worked for me . Give it a try if it works !!.
Go to index.js file and replace <React.StrictMode> to
<BrowserRouter>
Attached the snippet for reference.
Good Luck [enter image description here][1]
[1]: https://i.stack.imgur.com/XMtZe.png |
I have two apps using MUI, each has a theme. I have a separate npm package containing components used by both apps. This works fine except when I import a component from my npm package, it doesn't use the theme of the app consuming it, it appears to just use the default theme (as the separate package has no theme defin... |
Components using MUI in shared library not using parent app theme |
|reactjs|next.js|material-ui| |
please explain why my map is not displayed on the site. Now I have my top bar of the site and a blank white background, but there should be a map. please help me fix it. My API is connected to the project and also billing is connected.
I would also like to help with a question regarding adding a lot of markers to Goog... |
Uncaught TypeError: google.maps.LatLng is not a constructor at init (script.js:7:13) |
|html|css|api|google-maps| |
null |
OP Here.
The command that is working is:
curl -Lfs "https://motivatedsisters.com/2019/07/08/arabic-review-sr-rahat-basit/" | rg -o '<li>.*?href="(.*?)".*?</a> (.*?)<\/li>' -r 'echo $1 $(unescape_html "$2")' | bash | rg -o '(https?://\S+)\s(.*)' -r 'echo $1 $(unescape_html "$2")' -r '{"url": "$1", "title": "$... |
What is the relationship between "Composite indexing" and "Index Skip Scan"?
If you create a composite indexing on 3 columns `eid`, `ename`, `esal`?
- If I mention only `eid=10` after where clause will the indexing be called ?
```
select * from emp where eid=10;
```
- If I mention only eid=10 an... |
|oracle|indexing| |
I am trying to convert some R code I've written into an R shiny app so others can use it more readily. The code utilizes a package called `IPDfromKM`. The main function of issue is `getpoints()`, which in R will generate a plot and the user will need to click the max X and max Y coordinates, followed by clicking thr... |
I am sharing the whole code fixed:
```
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Taskboard</title>
<link rel="stylesheet" href="/static/styling/home.css">
<style>
body, html {
... |
How can I accumulate a binary array containing 0 and 1 into an integer?
vector<int> arr = {1,0,1,0,1,1,1,0,1,0,0};
int num = accumulate(arr.begin(), arr.end(), [] (int &a, int &b)
{ // ??? });
At each step I need something like this:
if(arr[i] % 2) num += pow(2, i);
But how to impl... |
After updating to Next.js 14.1, I get these build messages telling me that all my pages are deopted into client-side rendering due to "useSearchParams().
Here is an example from the terminal when running next build:
Entire page "/404" deopted into client-side rendering due to "useSearchParams()". Read more:... |
How to fix useSearchParams deopted into client-side rendering? |
|next.js| |
null |
There has to be a better way... but a quick short hack following up on @user1579943's comments with a bit of additional detail.
Subclass your custom user from IdentityUser
public class MyUser : IdentityUser
{
public string? Name { get; set; } = "";
public string? Street { get; set; } ... |
You are allowed to call `fork()` on iOS, just not on watchOS and tvOS. However, despite being allowed to call it, `fork()` will always fail as an application process is not allowed to manage other processes on iOS, so you cannot directly create a child process by yourself. Also not using `system()` or `posix_spawn()` ... |
I had a similar issue with getting my `jest` tests to run. They ran fine locally, but not in Azure Pipelines. I ended up discovering that there was a hanging process that was never closed after my tests were done causing it to freeze.
I used the command `jest ./tests --detectOpenHandles` to find the process and ... |
I think the best solution (from both a code, accessibility and UI point of view) is to use the `selection:` parameter of `List`.
This has the main benefit of automatically highlighting the cell on tap, and handling the tap gesture states correctly (triggering the selection change only on touch up if the finger is st... |
|emacs|themes|dot-emacs| |
I have given code like below. But the accountsGroup is of empty list as the FetchAccountGroups() event is not calling while debugged.
```
class AccountsScreen extends StatelessWidget {
final bool fromAddEditScreen;
const AccountsScreen({
super.key,
this.fromAddEditScreen = false,
});
@overri... |
Bloc not calling while calling event with cascade in BlocProvider. But working fine if assigned to a variable and passed to BlocProvider |
|flutter|dart|flutter-bloc| |
As I found out that the issue is as follows:
While in the first case as I am using cascade to add an event and in the widget subtree I am not using any BlocBuilder or Listeners, so the bloc is managing to not even create the instance and pass to the widget tree. And while I am calling this
```
BlocProvider.of<Accoun... |
I am making `MultiVector` class for Entity Component System. It is used for storing objects of different types for iterating over them efficiently.
I use vectors of bytes as raw storage and `reinterpret_cast` it to whichever type I need. Basic functionality (`push_back` by const reference and `pop_back`) seems to work... |
I want PHP to generate an HTML table from a nested JSON object. I want the output to resemble the format shown in the image. The main challenges lie in handling the rowspan and colspan. While I can calculate the rowspan, I am encountering difficulties with the colspan. I need a recursive PHP function. The current one c... |
Generate HTML table with complex nested JSON |
|php|html|json| |
*There is very good post about trimming 1fr to 0: https://stackoverflow.com/questions/52861086/why-does-minmax0-1fr-work-for-long-elements-while-1fr-doesnt*
In general I would like to have a cell which expands as the content grows, but within the limits of its parent.
Currently I have a grid with cell with such ... |
On Android Studio Hedgehog 2023.1.1 Patch 2 sticky services don't restart too if you launch your app with the debugger due to a bug in it. Tested on Android 12. |
I have an element in my HTML like this. While the user types, I'm showing successive filtrations in a list to pick from. Once the user clicks on that component, I want to update the value typed in the search box below and replace it with the full name available in the clicked item.
<input #userSelector (keyu... |