instruction stringlengths 0 30k ⌀ |
|---|
I have the following query in mysql,
```
SELECT COALESCE(sum(COALESCE(amount, 0)), 0) as sum_amount,
COALESCE(sum(COALESCE(fees_amount, 0)), 0) as sum_fees_amount
FROM incoming_operation
WHERE status = 'CLEARED'
and merchant_id = ?
and shop_id IN (?)
and currency = ?
and cycle_id is null
... |
My code print FAIL as follow:
Need someone to explain the difference.
I want to know the difference between
__asm__ __volatile__(
"addl %1,%0;"
:"=r"(sum)
:"r"(add1),"r"(add2)
);
and
__asm__ ( "addl %%ebx, %%eax;"
: "=a" (sum)
: "a" (add1)... |
the difference between two style of inline ASM |
|c|inline-assembly| |
This example is not a good example, because `java.lang.NullPointerException` could be just anything - and therefore one can't even tell by such example, what the culprit or remedy to it would by. Usually one has to check for files not being checked in into version-control, if they're indeed present, which already catch... |
I am using JavaFX for the first time for my homework assignments. So far, I have had around 5 homework questions that use JavaFX and only one has worked. The others all just show a white screen with 2 buttons, one saying Switch to Primary View and one saying Switch to Secondary View. I have no idea what is causing this... |
JavaFX build generating a blank gui with primary view and secondary view buttons |
|maven|javafx| |
null |
In my code
@telebot.TeleBot.callback_query_handler(func=lambda callback: True )
def answer(callback):
I get error: TypeError: TeleBot.callback_query_handler() missing 1 required positional argument: 'self'
Python 3.10
telebot 0.0.5
What can I do to fix this problem?
I've write my first bot for telegram ... |
Whow to use callback_query_handler in Python 3.10 |
|linux| |
null |
`math.gcd()` is certainly a Python shim over a library function that is running as machine code (i.e. compiled from "C" code), not a function being run by the Python interpreter. See also: [Where are math.py and sys.py?](https://stackoverflow.com/questions/18857355/where-are-math-py-and-sys-py)
Update: This should b... |
For my scenario, I wound up disabling `create_before_destroy` (changing from true to false). Otherwise, I could not figure out where to apply the other solutions and terraform state did not show `deposed` nor `tainted` anywhere. |
Is there a penalty to calling `with_column` many times in polars. Does it lead to dataframe "fragmenting"?
EDIT: I don't mean to distract with the term "fragmenting". My real question is, is there any performance penalty to calling `with_columns` many times instead of `with_columns` with many columns? |
I'm trying to understand the distinction between declarations and definitions in C++. I've read various answers here and consulted the C++ Standard, but I'm still confused about a few points:
1. Some explanations suggest that definitions allocate memory to the variable, implying that if memory isn't allocated, it's ... |
It's not in the package itself, it's in the lib. Should be:
`import { AWSIoTProvider } from '@aws-amplify/pubsub/lib/Providers'`
I think the working statement (just `import { AWSIoTProvider } from '@aws-amplify/pubsub'` vs `import { AWSIoTProvider } from '@aws-amplify/pubsub/lib/Providers'` changes depening on th... |
I been trying to fix my code for it to give me the right number of nodes within the netlist and it keeps getting one less node than what it actually is, this is the part of my code that reads and analyze the info from the file. I am going insane at this point ); ( I already asked ai to help me fix this issue and nothin... |
I've just installed C compilers and everything looks normal, however, when I try to run a code it takes too long. A simple ''hello word'' is taking 12 seconds. An online compiler is doing the same thing in just 2 seconds. I don't know what may be happening[the code](https://i.stack.imgur.com/bWw8J.png) [the hello word ... |
I need help to understand the time wich my simple ''hello world'' is taking to execute |
|c|performance|time| |
null |
In my case I got this error on Windows 10 and NordVPN caused the problem. I realize this is probably not the OP's problem but could help others who come across this question.
Besides this docker error, I also would get the following error attempting to start a WSL command line:
`An operation was attempted on someth... |
null |
The data structure for this is a [Trie][1] (Prefix Tree):
```php
<?php
class TrieNode
{
public $childNode = []; // Associative array to store child nodes
public $endOfString = false; // Flag to indicate end of a string
}
class Trie
{
private $root;
public function __construct()
... |
Is there a way in vscode to after I type Ctrl + . and accept a correction with quick fix, to automatically run the key combo Alt+F8 to move to the next problem without having to press it yourself?
I use a spelling extension and it to correct a word by selecting Ctrl+ . then selecting the correct suggestion. However ... |
Some SO users may think that this question is "opinion-based" and try to close it. I think this is a valid question, as proven by the fact that the other similar post you linked, [Relative imports for the billionth time](https://stackoverflow.com/questions/14132789/relative-imports-for-the-billionth-time), addresses th... |
I'm trying to use native api. I have the following code to get the 5 most used apps. It's a Native Android module with TypeScript because I can't call APIs with React Native:
```
fun getUsageData(startTime: Double, endTime: Double, successCallback: Callback) {
val usageStatsManager = reactApplicationContext.ge... |
I want Query Function That I can pass in FindAll Query To Get Daynamic data
Example: If I want to get data like `age>5` then direct I can get using query paramas
This is just example
At the end I want query funcatuion that can genrate dynamic query on query params
I have made this funcation for daynami... |
How Can I Make Dynamic Query In Sequelize with nodeJs |
|node.js|express|sequelize.js| |
null |
For structural pattern matching, the class pattern requires parentheses around the class name.
For example:
<!-- language: python -->
x = 0.0
match x:
case int():
print('I')
case float():
print('F')
case _:
print('Other')
|
# **Guys I'm about to lose it**
```plugins {
id("com.android.application")
id("org.jetbrains.kotlin.android")
id("com.google.devtools.ksp")
id("com.google.dagger.hilt.android") version "2.49" apply false
}
android {
namespace = "com.example.notesapp"
compileSdk = 34
defau... |
Every Time i run the app it gives me an error related to gradle |
|android|kotlin|gradle| |
null |
I fell into a gotcha:
<!-- language: python -->
match 0.0
case int:
print(1)
effectively redefines int, so the next time I tried the match I posted, it failed since _my_ int was shadowing the built in |
The `BYROW` function applies a `LAMBDA` function to **each row** of a given array or range. As such, each iteration is referencing an entire row, even if the array only contains a single column.
When using `=BYROW(SEQUENCE(7), LAMBDA(r, ...))`, the `SEQUENCE(7)` function returns an **array object** consisting of {1;... |
declaration vs definition in relation to Memory |
|c++| |
null |
Why do we have interfaces?
========
From a theoretical point of view, both interface implementation and class inheritance solve the same problem: They allow you to define a [subtype relationship](https://en.wikipedia.org/wiki/Subtyping) between types.
So why do we have both in C#? Why do we need interfaces at al... |
```
io.on("connection", (socket) => {
console.log(`User Connected: ${socket.id}`);
//joining Room
socket.join(selectedOption);
socket.broadcast.emit("userConn", `${username} joined ${selectedOption}`);
socket.on('emitMessage', (data) => {
if(data.room == selectedOption){
sock... |
User is connecting to socket.io server twice |
|javascript|node.js|express|socket.io| |
null |
1. Return a pointer to the `Node` of interest instead of updating the out parameter `head_dest`.
1. The current implementation changes the original list. To create a new list you need to return a pointer to *copy* of the smallest node or NULL. To emphasize that I made the argument constant with `const Node *head`.... |
Install python3-tk package seems to work for me. I'm on Ubuntu by parallels(M1 Mac).
```
sudo apt-get install python3-tk
``` |
I am following this [tutorial][1] to fetch the auth token for the HERE maps. I am able to fetch the token with my iOS app, However I cannot seem to get the token with Android. I keep getting the error `errorCode: '401300'. Signature mismatch. Authorization signature or client credential is wrong."`
Below is my code ... |
Signature mismatch. Authorization signature or client credential is wrong with Android |
|android|here-api|signature|heremaps-android-sdk|hmacsha256| |
A windowed function is processed at the same time the SELECT is.
More specifically, this is the order of operations:
FROM and JOINS
WHERE
GROUP BY
HAVING
SELECT
notice how SELECT is processed last.
Therefore your queries are not the same. Your first query is filtering before the windowed function. The s... |
I'm trying to use native api. I have the following code to get the 5 most used apps. It's a Native Android module with TypeScript because I can't call APIs with React Native:
```
fun getUsageData(startTime: Double, endTime: Double, successCallback: Callback) {
val usageStatsManager = reactApplicationContext.ge... |
# Definition of STDIN, STDOUT, and STDERR
<br>
The OS' kernel of all operating systems use these 3 main **I/O (Input/Output)** streams, and these are **STDIN**, **STDOUT**, and **STDERR**. **STDIN** is the **I/O** stream that is processing information related to input, **STDOUT** is the **I/O** stream that is pro... |
I'm currently trying to learn how to make Minecraft mods in Intellij and I'm fresh off a set of tutorials on youtube but when I try to run Minecraft with the content I've added there just isn't anything there. The only evidence my mod has even loaded is the name of it in the Mods section. It is as if I just ran regular... |
null |
I'm currently trying to learn how to make Minecraft mods in Intellij and I'm fresh off a set of tutorials on youtube but when I try to run Minecraft with the content I've added there just isn't anything there. The only evidence my mod has even loaded is the name of it in the Mods section. It is as if I just ran regular... |
> I use gem to install everything explictly ... RUN gem install syntax_tree
By default `Rails` knows nothing about gems you have installed locally (via `gem install ...`).
> First I make sure the syntax_tree gem is installed properly: ...
You have no problem in `test.rb` because it's a pure non-Rails `Ruby` f... |
null |
I'm new to networking. I'm also learning the usage of eBPF. Currently I'm working on a project where I've to capture the inner packet of a openconnect traffic. This is my code:
https://github.com/inspektors-io/xdp-tutorial/tree/nobin/xdp_dump_with_grpc
xdp_dump.c
```
// Copyright (c) 2019 Dropbox, Inc.
// Full... |
Detect and capture openconnect traffic using eBPF/XDP |
|packet-capture|bpf|xdp-bpf|openconnect| |
null |
null |
null |
null |
Just use a normal **window.onerror** event to catch it...
<!DOCTYPE html><html><head></head><body>
<script>
window.onerror=(e)=>{alert(e);};
setTimeout(function(){
console.log(window.frames.testframe.location.href);
},2000);
</script>
... |
I do not understand how the following operations `2s – 1` and `1 - 2s` are performed in the following expressions:
```vhdl
R <= (s & '0') - 1;
L <= 1-(s & '0');
```
Considering the fact that `R` and `L` are of type `signed(1 downto 0)` and `s` of type `std_logic`. I have extracted them from a `vhdl` code... |
Yes, there is a difference.
When you are using a map the JVM will instantiate an additional object (`mappings`), it will take some additional memory. And operator function `map.get` will provide the result based on key object hash code. So for user there is no difference but not for the JVM. |
I cannot execute a procedure stored on mssql server from django.
Here is the configuration for the db<br/>
DATABASES = {
'default': {
'ENGINE': 'mssql',
'NAME': os.environ.get('DB_NAME'),
'USER': os.environ.get('DB_USER'),
'PASSWORD': os.environ.get('... |
`make menuconfig` allows to tweak the Buildroot configuration, not the Linux kernel configuration. To tweak the Linux kernel configuration, run `make linux-menuconfig`, which will fire up the menuconfig of the Linux kernel.
See https://bootlin.com/doc/training/buildroot/buildroot-slides.pdf starting slide 76 for mor... |
```
int sumInString(const char *str) {
// valid str
if (str == NULL || *str == '\0') {
return 0;
}
int num = 0;
int res = 0;
int i = 0;
while (str[i] != '\0') {
if (str[i] >= '0' && str[i] <= '9') /*is numerical*/ {
num *= 10;
num += str[i] - '0'; // char->int conversion
... |
How to dynamically update filters? |
|r|shiny| |
If composite indexing created - indexing is called? |
In following example the struct is used to left join tbl2 to tbl1. If there are several matching entries in tbl1, take only one (`LIMIT 1`). Thus the row size of tbl1 keeps constant. The `SELECT AS STRUCT` puts all rows of tbl2 into one structure.
~~~SQL
WITH
tbl1 as (SELECT * FROM UNNEST([1,2]) AS x),
tbl2 A... |
I want to have on the first bar the bar_index of the last bar available on the chart.
The problem is that the last_bar_index is not updated when a new candle starts, ex checking BTCUSDT on 1 min chart
var arr_test_1 = array.new_float()
var arr_test_2 = array.new_float()
if array.size(arr_tes... |
How to get last_bar_index on bar_index == 0 |
|pine-script| |
There seems to be an undeleted value on the registry, but i have not been able to solve it yet.
But, as a workaround to this problem, you can directly copy the file:
C:\Program Files (x86)\Eziriz\.NET Reactor\VSPackage\17\ [Content_Types].xml
to
C:\Users\%CurrentUser%\AppData\Local\Microsoft\VisualStudio\17... |
Say I have HTML that looks a bit like this
<div>
<p>Text 1</p>
<p class="foo">Text 2</p>
<p>Text 3</p>
<p>Text 4</p>
<p>Text 5</p>
<p>Text 6</p>
<p class="foo">Text 7</p>
<p class="foo">Text 8</p>
<p>Text 9</p>
<p class="foo">Text 10</p>
... |
Grouping HTML elements by their class name |
|javascript|html|class|element|group| |
{"Voters":[{"Id":354577,"DisplayName":"Chris"},{"Id":16217248,"DisplayName":"CPlus"},{"Id":1974224,"DisplayName":"Cristik"}],"SiteSpecificCloseReasonIds":[18]} |
{"Voters":[{"Id":354577,"DisplayName":"Chris"},{"Id":16217248,"DisplayName":"CPlus"},{"Id":1974224,"DisplayName":"Cristik"}],"SiteSpecificCloseReasonIds":[16]} |
{"Voters":[{"Id":11002,"DisplayName":"tgdavies"},{"Id":992484,"DisplayName":"MadProgrammer"},{"Id":18157,"DisplayName":"Jim Garrison"}]} |
can anyone help me downloading python in windows 10? it saying it is downloaded but could not get verified and I can not locate the file especially the exe. thats when I can not add it to path. please help. thanks
try everything but did not work, watched bunch of videos, followed the instructions etc. |
python could not get verified after installation |
|python| |
null |
{"Voters":[{"Id":207421,"DisplayName":"user207421"},{"Id":10871900,"DisplayName":"dan1st might be happy again"},{"Id":18157,"DisplayName":"Jim Garrison"}]} |
After you put the list in your question in A:B, and set the target dates (or date strings) in D2:D, you may want to use the formula like what I wrote below:
```
=ARRAYFORMULA(
IF(D2:D<>"",
FILTER(B2:B,
(YEAR(DATEVALUE(A2:A))=YEAR(DATEVALUE(D2:D)))
*
(MONTH(DATEVALUE(A2:A))=MONTH(DATE... |
'pyodbc.Cursor' object has no attribute 'callproc', mssql with django |
|sql-server|django|mssql-django| |
I need something similar to a [`QToolBox`][1] with multiple expanding items / widgets that - as opposed to a `QToolBox` - supports displaying more than a single item at a time: When the user clicks on the item, it should expand; upon a second click, it should collapse: All, some or no items may be expanded at the same ... |
Here is an extract of GTK3 code. I would like the translation with GTK4.
GtkWidget *menu, *item1, *item2, *item3;
menu = gtk_menu_new();
item1 = gtk_menu_item_new_with_label("Item 1");
item2 = gtk_menu_item_new_with_label("Item 2");
item3 = gtk_menu_item_new_with_label("Item 3");
... |
I would like to write a simple popup contextual menu with C langage using GTK4. I did that with GTK3 but I am lost with hje way to do with GTK4 |
|popupmenu|gtk4| |