instruction stringlengths 0 30k ⌀ |
|---|
|object| |
You need:
su - username -c 'echo "$@"' -- bash "$@"
With [tag:php]:
su - www-data -s /bin/bash -c 'php /tmp/test.php <<< "$@"' -- bash "$@"
**/tmp/test.php**:
```
<?php
$f = file_get_contents("php://stdin", "r");
echo $f;
?>
```
---
The difference between `$@` and `$*`: Without quotes ... |
I am trying to get a virtual machine to send a string/list to a second virtual machine and then have the second virtual machine return a string to the first virtual machine.
To do this, I have decided to go with a Python socket server and client script.
The virtual machines are both hosted via Oracle. Here is the co... |
I am trying to do tokenization as part of my model, as it will reduce my CPU usage, and RAM, on the other hand, it will utilize my GPU more. But I am facing an issue saying `ValueError: as_list() is not defined on an unknown TensorShape.`
I have created a `Layer` called `TokenizationLayer` which takes care of the to... |
Getting `ValueError: as_list() is not defined on an unknown TensorShape.` when trying to tokenize as part of the model |
|python|numpy|tensorflow|keras|tokenize| |
At first, fetch all data, then write this code :
$total_quantity = array_sum(array_column($carts, "quantity"));
Here $carts are all cart data and the other one is the counting column, which you want to count. |
null |
It looks like you've been shifting things around since [last time](https://stackoverflow.com/a/78097819/85371). Some of the shifts have caused confusion.
E.g.:
using Section = std::map<Key, Value>;
struct IniSection {
std::string name;
Section pair;
};
There's a strong d... |
If you want to make sure specific props are not defined you can define them with `prop_name?: never`.
So for the example in the question it would become:
function dbQuery(): User[] {
return [];
}
function getAll(): GetAllUserData[] {
return dbQuery(); // Error: Type 'User[]' ... |
I'm wondering if anybody has used the react-i18next library with the latest React Router v6 and the `createBrowserRouter()`.
I'm experiencing the following warning in my web application:
[](https://i.stack.imgur.com/kLw9D.png)
In React Router `v6` the sugges... |
I am trying to make a new column which will take the first letter from the column and then filter the ones that have letter A
ChatGPT totally give me another way but I just want to understand what is wrong with my logic
'''Select Code,
FROM WIR
Where Code = 'A'
(Select Subject,
Zone_Location,
Left (Final_Sta... |
Non Blocking Retry Support for KafkaStreams |
|spring-kafka|apache-kafka-streams| |
null |
Although it seems like Bash allows putting colons in function names, [this behaviour is not standardized by POSIX][2.9.5 Function Definition Command]:
> The function is named *fname*; the application shall ensure that it is a name (see XBD [*Name*][3.235 Name]) .... An implementation may allow other characters in a fu... |
null |
Here is a significant starting point for how to do this using [GNU awk](https://www.gnu.org/software/gawk/manual/gawk.html) for arrays of arrays, `gensub()`, `PROCINFO["sorted_in"]`, and `\S/\s`:
$ cat tst.sh
#!/usr/bin/env bash
awk '
function grade_to_points(grade, grade2pts,dfltPts... |
This is easy to decode manually:
* 30: data type
* 0f: 15 bytes of data follows
* 31: data type
* 0d: 13 bytes of data follows
* 30: data type
* 0b: 11 bytes of data follows
* 06: data type
* 03: 3 bytes of data follows
* 550403: data
* 13: data type
* 04: 4 byte... |
I'm trying to use drag and drop in Genexus and I can drag an element from my grid to an external variable. Now I need to do the opposite, drag an external variable and drop it in a specific grid (free style grid) cell.
I tried to set
```
Event Grid1.Drop(&SDTDrag)
&text = &SDTDrag.Turno
msg("drop on " + &i... |
Drag and Drop in a specific row of a grid in Genexus |
|genexus| |
just to share my experienced on this issue on composer error # 1.
What I did was to get rid all composer inside the registry editor. It solved my problem. |
{"Voters":[{"Id":874188,"DisplayName":"tripleee"},{"Id":3832970,"DisplayName":"Wiktor Stribiżew"},{"Id":839601,"DisplayName":"gnat"}]} |
Well this would be painful as well since, if you don't have metro running each single change you make in the javascript code base, won't be automatically refresh to the device.
react-native bundle --platform ios --entry-file ./index.js --bundle-output ios/main.jsbundle --assets-dest ios
This command will make... |
You first create a new environment, then want to install Jupyter on top of it right away. What made you opt for not including Jupyter in your initial environment requirements, at the time of creation ? Doing so leverages the conda environment solver to figure your optimal configuration, as shown below.
The followin... |
You can execute linux commands within a php script - all you have to do is put the command line in backticks (`).
And also concentrate on `exec()`, this and `shell_exec()`. |
null |
I have a trouble. please help me.
My config
```java
@Configuration
@EnableWebSecurity
@RequiredArgsConstructor
public class SecurityConfig {
private final CustomUserDetailsService userDetailsService;
@Order(0)
@Bean
SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
... |
Thank you all for checking on this. I've found the answer and would like to share it with you for your benefit.
We have to make sure to give the correct name for the firewall to be turned on in the compute instance.
Make sure to use the target tags. It will help turn on the http and https traffic firewall rules.[en... |
Spring Integration and Spring Batch transaction manager collision |
|spring-boot|spring-batch|spring-integration|spring-jdbc| |
null |
* When you iterate over `a`, `b` and `c` you get one element at a time in `aa`, `bb` and `cc`, so those are the variables you should use, but they are not arrays; they are scalars, so just use `"$aa"`, `"$bb"` and `"$cc"`.
* You need to remove the spaces around `=` in your assignments.
* Use `${a[@]}` etc. in the loo... |
A relative recent re-occurrence of this issue was released as part of https://github.com/git/git/commit/7ee1af8cb8b97385fc4e603bc024d877def5adb4#r139625087
I've got a PR in! Hopefully it'll get through.
But if you look for the new version of `git-prompt.sh` on your machine, in that, look got `\001` and `\002`. It... |
|debian|puppeteer|chrome-for-testing| |
In regex, you have to escape a slash with a backslash (`/` -> `\/`)
So in your case:
```
\/log[^\/].*
▲ ▲
│ │
└──────┴─── Add backslashes here
```
[link to regex101.com](https://regex101.com/r/tru7sf/1) |
|selenium-webdriver|selenium-chromedriver|chrome-for-testing| |
I want to do endless scrolling so that after scrolling 20 more products and so on endlessly. I have a model and the api itself from there I take everything that is required. Everything is working out. But I need another 20 products to appear after scrolling to the end, like in aliexpress. How to do it?
```
@Com... |
Running a Next.js application with PM2 requires some additional configuration, especially if you are using the npm start command.
1.Install PM2 globally if you haven't already: npm install -g pm2
2.Create an ecosystem file for PM2. You can manually create a pm2.config.js file or use the ecosystem.config.js
3. ... |
I need to send the video from my IP camera to Kinesis Video Stream, and use Sagemaker to host my ML model, which will then analyse the video from Kinesis Video Stream in real time. <br />
I followed this link: https://aws.amazon.com/blogs/machine-learning/analyze-live-video-at-scale-in-real-time-using-amazon-kinesis-v... |
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... |
Kindy install the required Hardware and Software requirements by this using this link [Software and Hardware ][1]. and follow the step by step instructions.
Once you have installed all the required software and hardware requirements please follow below steps.
> 1. System requirements:
Ubuntu 16.04 or higher... |
I'm not often working on Angular, so I don't really understand how it works.
I have a subscription like this :
```
this.subscriptions.add(
this.loadDataGrid.pipe(mergeMap((list: any) => this._ecSrvc.loadDataGrid(`api/getSomething?${this.sort ? `sort=${this.sort.field}:${this.sort.order}&` : ''}page=${t... |
Subscription seems lost when error on Angular 11 |
|angular|angularjs|typescript| |
null |
Which to use and when? And what are the advantages of one approach over the other?
Permutation brute force is the one in which at each recursion step, we can enter any of the array elements. If repeats are not allowed, we maintain a "visited" memo(as in DFS), if repeats are allowed, we don't need the "visited" memo
... |
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 ... |
Turn out that the issue I was having wasn't the code. It was an issue with the scene asset itself. I added a parent node to the scene asset and it worked just fine. |
Launching the AMI won't affect the original ec2.
AMI's are pretty expensive. You would likely be better off spinning up a basic ec2 and installing what you need in userdata.
https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/user-data.html
Here is a snippet from a CloudFormation template that will spin up an ec... |
I try to embed the `EditableGraph` function into a `PyQt5` application. I developed the following program for testing, based on solutions found online.
```python
from PyQt5 import QtWidgets, QtCore
from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas
from matplotlib.figure import Figur... |
Permutation brute force vs Selection brute force algorithm. When to use what? |
|algorithm|depth-first-search|backtracking|brute-force| |
null |
When we launch application without docker container, we are able to record the components. But, when we launch inside docker container, record button is disabled.
When we launch standalone application inside docker container we are not able to record the component. |
Can we record components in qf-test if application is launched inside docker container? |
|qf-test| |
null |
I have a problem with my UIKit Swift App. When using a vertical StackView with a UIButton and a UILabel, the contentEdgeInsets gets ignored. This only happens when the UIButton is inside the Stackview with a UILabel. When I remove the UILabel or use the exact same button outside of the StackView it works perfectly fine... |
UIButton.contentEdgeInsets gets ignored when UIButton is in a vertical StackView with a UILabel |
|ios|swift|uikit| |
null |
If you are using Cheerio library for Google Apps Script:
[Source code][1]
[Library page][2]
Installation by library ID:
`1ReeQ6WO8kKNxoaA_O0XEQ589cIrRvEBA9qcWpNqdOP17i47u6N9M5Xh0`
A function to get current emojis [from unicode.org][3]:
```
function getEmojis() {
var t = new Date();
var url = 'h... |
Infinity scroll products with dummyjson |
|kotlin|android-jetpack-compose|android-jetpack-compose-material3| |
null |
I use this, but I cannot confirm if it works with Jupyter notebooks or not.
os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID"
os.environ["CUDA_VISIBLE_DEVICES"] = "0" # or "1", "2", "3", ... |
|c#|selenium-webdriver|selenium-chromedriver|chrome-for-testing| |
I'm able to install the quil-mention but unable to import not sure why im getting the below error. Any suggestions appreciated!
Could not find a declaration file for module 'quill-mention'. '/Users/abcd/jsc-maps-front-end/react/node_modules/quill-mention/src/quill.mention.js' implicitly has an 'any' type.
... |
```
import pandas as pd
data = {'A': ['1, 1, 1', '1', '2', '3', '1'],
'B': ['1', '1,1,1,1', '2', '4', '1'],
'C': ['1, 1', '2', '3', '5', '1']}
df = pd.DataFrame(data)
def all_same(row, item=1):
cc = set()
for val in row:
try:
val = set(val.replace(" ", "").spl... |
I was asked a question today to build a BST from set of coordinates, rather than a set of numbers. So the input would be unsorted coordinates
```[(1,2), (5,7), (0,5)]```
or in other form:
``` x = [1,5,0] y =[2,7,5]```
The heuristic to select a point to a tree is using an axis which has a largest range (med... |
2 dimensions Binary Search Tree and median cut |
|algorithm|binary-tree|binary-search-tree| |
The input shown is malformed so `read_xml` will give an error. Since the question indicates it works there must have been a transcription error in moving the XML to the question. We have added a close div tag before the 4th opening div tag in the Note at the end.
Since the XML uses a namespace, first strip that ... |
null |
First remember that Lambda don't connect to Kinesis Video Stream. Then how do example get frame data of Kinesis Video Stream. It is AWS ECS Docker Image in CloudFormation.
```xml
DockerImageRepository:
Type: String
Default: >-
528560246458.dkr.ecr.us-east-1.amazonaws.com/kinesisvideosagemakeri... |
wen i mov my muos outsid the boundry i drew in tkintre it gives eror
```
> Exception in Tkinter callback
Traceback (most recent call last):
File "c:\Users\My PC\AppData\Local\Programs\Python\Python312\Lib\tkinter\__init__.py", line 1962, in __call__
return self.func(*args)
^^^^^^^^^^^^^^^^
Fil... |
Writing A Subquery with Left and Where |
|sql|google-bigquery|subquery| |
TLS 1.3 Connection with Rust to MariaDB |
|rust|mariadb|tls1.3| |
I have a repo where files are organized by users:
```
-user1
--folder1
---file1
---file2
--folder2
-user2
--folder3
```
etc.
Now i want to make a fork of some work `user1` has done.
I forked the repo, added a `me` user, and a folder `mywork` which will contain, initially, a copy of `folder1`, so
``... |
I try to establish an connection between Rust and MariaDB over MYSQL_async. I get a connection to the database, but someting is wrong. Instead I get this error message:
```
Error: Io(Tls(TlsError(Os { code: -2146893018, kind: Uncategorized, message:"The format of the received message was unexpected or incorrect." })... |
While using @Alex's code, I encountered an issue when the culture info was set to "es" (Spanish). The decimal was printed with the format of "12,34", and the attribute wasn't working properly. I was able to fix this and make some other changes so that it works as closely to other components (such as using braces for pa... |
> Does the standard have anything like the below?
Not as a built-in language feature, so creating a class and adding a user-defined destructor to it like you've done is how it has to be done. There are many variations on that theme, like [`std::experimental::scope_exit`](https://en.cppreference.com/w/cpp/experimenta... |
I have a stored procedure in MS SQL server which I am using for filtering, sorting and server-side pagination.
The filtering and sorting is working fine as expected but the sorting is giving me some trouble due to there being different datatypes sorted.
Below is the query
```
ALTER PROCEDURE [dbo].[GetAllData_... |
How to use different datatypes in a case statement |
|sql-server| |
null |
I have an application dash with a dash_table.DataTable that I can select to generate some graph. For info it look like that :
[![enter image description here][2]][2]
What I need to build the graph is the value in StrategyId of the selected rows. Currently my endpoint looks like that :
@app.callback(
... |
You should you proper debug tools (like silk) if you're chasing performance gains.
From your queryset, i guess you have four models, EventSlot, EventBlock, EventVenue and Event. EventSlot has FKs to Event and EventBlock while EventBlock has a FK to EventVenue.
If thats the case, you might see a performance incr... |
I am new into Python GUI programming, I want to know if Qt Designer always change its geometry calculation for x and y values (or top and left values)? Like for example when I export python code to my VSCode, I soon realize that the x and y value for each different project and forms can be different depends on the size... |
Is Qt Designer changes its reference for coordination value every time the form's/layout's size changes? |
|python|qt|pyqt| |
null |
I tried to make a full-screen dialog using Jetpack Compose using this code:
```
@Preview
@Composable
fun test() {
val showDialog = remember { mutableStateOf(value = false) }
Box(
contentAlignment = Alignment.Center,
modifier = Modifier.fillMaxSize().background(color = Color.White)
... |
Dash : Get column value in selected table |
|python|callback|data.table|plotly-dash| |
You need to add the app id to the specific config inside ios/config and android/config inside your app.json
Check this out: https://docs.expo.dev/versions/latest/config/app/#googlemobileadsappid
The link above is for iOS, which is similar to Android. They are in ios/config and android/config in your app.json - Thes... |