instruction stringlengths 0 30k β |
|---|
null |
I am plotting some lines with Seaborn:
```python
import matplotlib.pyplot as plt
import seaborn as sns
import pandas as pd
# dfs: dict[str, DataFrame]
fig, ax = plt.subplots()
for label, df in dfs.items():
sns.lineplot(
data=df,
x="Iteration",
y="Loss",
error... |
import pandas as pd
import numpy as np
terms = ['A.B3.C4', 'A.B3.C5', 'A.B4.C6', 'A.B5.C6',
'A1.B1.C1.D1', 'A1.B1.C1.D2', "D1",
"A.B10.C10.D1", "A.B20.C10.D1", "A.B20.C20.D1",
"A.B100.C100.D100.D1", "A.B200.C100.D100.D1",
"A.B300.C200.D100.D1", ... |
I don't understand what's wrong, I just copy pasted it in my professor's powerpoint that's supposed to run withour errors.
Here's the query:
```
SELECT student.admission_no, student.first_name,
student.last_name, fee.course, fee.amount_paid
FROM student
FULL OUTER JOIN fee
ON student.admission_no = fee.admis... |
What's supposed to be the problem in this query? |
|mysql|localhost| |
null |
I have a json data and I want to write data keys once using twig. But when I try to store keys in uniqueArray to check the key is exists in the array, it is not working.
Here is my twig code, where is the problem ?
```
{% macro fetch(uArray, data) %}
<ul>
{{ _self.keys(uArray, data) }}
</... |
Spark generally wants to minimize the movements of data during shuffling, So it will perform "group by" first on the partitions and then shuffle the data to bring related groups together again.
Example: When you perform groupBy("city","country") it will shuffle within the partitions(intra) and then inter partitions ... |
I use IdeaVim and have gotten in the habit of tapping Esc frequently to get out of insert mode, etc. I also use Esc to go from the Terminal window back to the Editor. So basically I tap Esc a lot.
I've recently starting doing some android dev in Android Studio.
One thing that I keep doing by accident is pressing ... |
Is there any way to disable [Esc] from being "Back" in Android Studio's Android emulator? |
|flutter|android-studio|android-emulator| |
I am building a basic registration feature for a school project and keep getting an error when I try to check the username and password from a database. The idea is to have a user type in their login info and then have a function receive that information and compare it with the user info from the database. if it matche... |
Writing each key once in twig |
|symfony|duplicates|twig| |
|mariadb|localhost| |
{"OriginalQuestionIds":[44153287],"Voters":[{"Id":11107541,"DisplayName":"starball","BindingReason":{"GoldTagBadge":"visual-studio-code"}}]} |
It is presumed that the string array is the same length as the number of rows of the double array.
- iterate over the number of rows doing the following:
- print the string value for given row.
- then print the double values for that row.
- then print a new line.
- done iterating
You may need to p... |
I am now studying the concept of OOD and I have created a program for a pizza shop. The base class here is pizza. I want to put a spicy characteristic for pizza as an interface, but I find a problem in the actual application. Here is the code. How can I combine making pizza with it being spicy?
how i can make beef s... |
How do I apply the interface concept with the base-class in design? |
|c++|oop|interface|base-class| |
null |
I ran into the same issue; assuming you are injecting the Router instance using the inject method, please note that there is a difference between `Inject(Router)` and `inject(Router)`
import { Inject, inject } from '@angular/core';
You need to use the latter. i.e.
import { inject } from '@angular/c... |
Flutter ran into error:
ββββββββ Exception caught by widgets library βββββββββββββββββββββββββββββββββββ
Null check operator used on a null value
The relevant error-causing widget was:
In Visual studio code, the above message did not show file and line number. |
```Bot is ready
/home/runner/BattleEx/.pythonlibs/lib/python3.10/site-packages/disnake/ext/commands/common_bot_base.py:464: RuntimeWarning: coroutine 'setup' was never awaited
setup(self)
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
Ignoring exception in on_ready
Traceback (most rece... |
{"OriginalQuestionIds":[3402371],"Voters":[{"Id":20002111,"DisplayName":"Friede"},{"Id":17562044,"DisplayName":"Sunderam Dubey"},{"Id":22180364,"DisplayName":"Jan"}]} |
Interest is supposed to be Percentages. Your formula expressed it as a decimal value.
Change the line below to:
// Convert annual interest rate percentage to decimal and then into monthly interest rate.
double monthlyInterestRate = (annualInterestRate / 100) / 12.0; |
Having some problem of ressources on my environment, I tried to implement an MixedImageDataGenerator relying on underlying ImageDataGenerator, in order to generate Inmges and lables at training time.
The idea was to generate all images with a limitation for each underlyine generators for each epochs refreshing the l... |
If you're writing something that does "the same thing, with just one thing changing at each step", that's a loop. You don't use separate `if` statements. Not even when, as you say, "you're being lazy": being lazy is an _excellent_ trait to have when you're a programmer, because it means you want to do as little work as... |
```js
let promise = ''
function A() {
return new Promise((resolve) => {
resolve(promise)
})
}
function callbackA(res) {
console.log("callbackA:", res)
return new Promise(resolve => {
promise = 'A'
resolve()
})
}
function B() {
return new Promise((resolve) => {
resol... |
How to make promises execute in order? |
UnicodeEncodeError when building ESP-IDF project |
|esp32|esp-idf| |
I have a script that process millions of data. Same data are corrupted, thus the framework I use is fail and throws exception. I am dependent to a framework that I cannot change/update. I have use it as it is. Every time I use function of this framework I use try/catch. Therefore, I am using lots of try/catch blocks as... |
I'm trying to build an exe file.
The code imports pylibdmtx to decode data matrices. I found somewhere that this might cause issues with ctypes but i have no clue how to procede here. [Picture of the error I get when i try to start the exe](https://i.stack.imgur.com/VaDO9.png)
Tried reinstalling everything but have... |
Error when trying to build an exe file with pyinstaller (pylibdmtx) |
|python|pyinstaller| |
null |
Maybe should think about it the other way around. Instead of checking the search value and printing static results, you could have the results in an array and filter this array by the entered search term.
<!-- begin snippet: js hide: false console: true babel: false -->
<!-- language: lang-js -->
const dat... |
flutter Null check error: did not show file and line number |
|flutter|visual-studio-code| |
I have the following:
```
syms x;
F = {3*x,2*x,x};
```
I would like to make ```F``` the following array ```G```:
```
G = [3*x,2*x,x];
```
To do this, I have tried this:
```
G = double(F);
```
and this:
```
G = double([F{:}]).';
```
Neither options work. Is there a way to do this in MATLAB? |
Convert Cell Array of Symbolic Functions to Double Array of Symbolic Functions MATLAB |
|matlab|double|symbolic-math|cell-array|sym| |
In order to assign a *static* IP address on your AWS Fargate task, you will have to create a static IP address (AWS calls this an elastic IP address) that will serve as the origin address of traffic originating your VPC from network outsiders point of view. To implement this:
You need the following:
- A [VPC][1]
... |
I basically have to create a method that takes in a string array and a 2D array consisting of three double arrays and puts the first string with the first array, second string with the second array, etc.
```
public static void printData(String[] c, double[][] d) {
String cname = "";
for (int i = 0; i < c.... |
Using ACF I created a :
field group: customers
repeater field: global_regions
repeater sub-field: continents
text subfield: continent_name
repeater subfield: countries
I have also created posts for this category and populated them with relevant data.
Now I want to create a facet on WPGri... |
It seems like my function is only receiving the first char of a string when being called |
I am trying to downlead a file form a shared Dropbox location.
I have been given a URL form a client and URL is public.
for example
https://www.dropbox.com/scl/fi/cr9zwyye5bz573ix4sjos/801NMSV621R-M570_1.jpg?rlkey=cupnu908llx3h2vzmmec97z9z&dl=0
I was excepting a normal httpclient would be able to do the jo... |
I just realized that I forgot to add `(.*?)` before the role attr
$str = preg_replace('~<(.*?)role="button"(.*?)</(.*?)>~Usi', "", $str);
That way it words fine. |
```
@override
Widget build(BuildContext context) {
double currentSliderValue = 100.0;
return Scaffold(
appBar: AppBar(
backgroundColor: Theme.of(context).colorScheme.inversePrimary,
title: Text(widget.title),
),
body: Slider(
value: currentSliderValue,... |
My slider have value well changed , but cant move it , or cant display changes |
|dart|slider| |
null |
After publishing the pod, the `cocoapods.org` server is still showing the previous version (`0.1`). Second attempt to publish returned `duplicate` error, but version is not found if pulled.
Is this just a delay, or were there some changes in the system? I can't pull `0.2` despite its published output.
```
Cong... |
I am trying to filter this JSON object by the keys:
The data looks like this
```JSON
key1: value1
key2: value2
key3: value3
key4: value4
key5: value5
key6: value6
key7: value7
key8: value8
key9: value9
```
Currently what I am doing right now is renaming the keys to fit that strucure and then try to ... |
|javascript|promise| |
That is not a "something"-delimited file, it's fixed width.
```r
readLines(unz("~/Downloads/2018029_ascii.zip", "FRSS108PUF.dat"), n=3)
# [1] "100011331 1 1 1 1 2 1 2 2 2 2 2 4 1 1 1 1 1 1 2 1 2 3 3 3 3 3 2 2 3 3 3 2 3 2 1 2 3 2 2 2 1 1 1 1 2 1 1 2 1 1 1 1 2 5 3 3 3 3 3 3 3 5 1 5 4 4 4 4 4 4 4 4 120000000000000000... |
null |
null |
I have a c++ template in .cpp file defined as
template <typename T>
void `rank_filter(T* in, T* out, int arr_len, int win_len, int order, Mode mode, T cval, int origin)`
where `Mode` is enum.
Following [this][1] answer, I am trying to wrap it up by Cython, by a .pyx file:
cimport cython
cimport nump... |
wrapping c++ function template with Cython |
|c++|templates|cython| |
I don't believe you can do that with `ffprobe`, but `ffmpeg` can do that, and output the subtitles to stdout.
```
ffmpeg -i video.mkv -f srt -
```
You can switch out `srt` for any other subtitle format `ffmpeg` understands, such as `ass`. |
From the [C23 draft](https://open-std.org/JTC1/SC22/WG14/www/docs/n3220.pdf):
7.23.6.1 The `fprintf` function
> 8. The conversion specifiers and their meanings are:
>
> * `p` The argument shall be a pointer to void or a pointer to a character type. The value of the pointer is converted to a sequence of printing c... |
How to create a facet for WP gridbuilder that displays both parent and child custom fields? |
|php|wordpress|advanced-custom-fields| |
null |
Sorry for my bad english)
I created a dynamic array of structures. This structures contains dynamic array of doubles.
When I add the structure, I fill it this way
The number of sides and the length of the side are filled in calmly, but when it comes to the vertices, or rather to one vertex (along which I have to re... |
Dynamic array of structures in C++/ cannot fill a dynamic array of doubles in structure from dynamic array of structures |
|c++|function|double|structure|dynamic-arrays| |
null |
Here's what worked for me using Qt 6 and CMake.
First of all, an `.rc` file is different than `.qrc`. This isn't explained *at all* in the Qt documentation for setting up an application icon ([link][1]), they just assume everyone knows that. Both formats are *text files*, they don't contain any pixel data. They're j... |
I have used recast for my code generation with babel as i jhave checked it is compatable with babel but recast is removing all my comments
Here is my recast code
const generatedAst = recast.print(ast, {
tabWidth: 2,
quote: 'single',
});
i am passing AST generated from b... |
No, you cannot transition a background.
The simplest solution is to use an SVG element in your HTML. This is what SVG is good at: vector graphics. You then apply styles to that element using CSS.
<!-- begin snippet: js hide: false console: true babel: false -->
<!-- language: lang-css -->
.heart {
... |
I have a data frame with a column of the date:
[](https://i.stack.imgur.com/3ejSV.png)
I would like to partition the DF into 3 DF based on time:
1. 00:00-12:00.
2. 12:00-18:00.
3. 18:00:00:00.
How can it be achieved without a loop?
I c... |
This the workaround I'm now using as an answer until I can get something less fragile.
Instead of importing the correct module 'dyna.ts' instead provides an object (cryptoState) that can be given the correct crypto module by importing (for its side effects alone) a different module (provideNode.ts or provideWeb.ts) ... |
[Error image ][1]Added the AspNetCore.Mvc.Razor.RuntimeCompilation package for live updating of .cshtml pages. But when writing builder.Services.AddControllersWithViews().AddRazorRuntimeCompilation(); an error occurs in the Program.cs file An error occurred during the compilation of a resource required to process this ... |
Python is an interpreted language.
When you write something like:
```
print("1"*n)
```
The Python interpreter performs a loop internally.
It is more efficient in Python because the interpreter is usually written in a compiled language like C (or C++) and so the loop is more efficient when done internally.
... |
{"OriginalQuestionIds":[23937262,10714251],"Voters":[{"Id":4279155,"DisplayName":"Dominique"},{"Id":9245853,"DisplayName":"BigBen","BindingReason":{"GoldTagBadge":"excel"}}]} |
I try to implement simple delay-typing functionality in React component
What is working but still without debounce:
```
const handleChange = useCallback(
(ev: ChangeEvent<HTMLInputElement>) => {
if (!isNaN(ev.target.value as unknown as number)) {
setTextField(ev.target.valu... |
I essentially want to write a program that takes F and decrements it until its 0, displaying the results like : F E D C B A 9 8 7 6 5 4 3 2 1 0. I specifically have to use a loop to write these out, i can't just say "db 'F E D C B A 9 8 7 6 5 4 3 2 1' , 10, 0". Since I can't use system calls to print (write) hex digits... |
|java|arrays|multidimensional-array| |
We've built a Teams tab app following pretty much this sample https://github.com/OfficeDev/TeamsFx-Samples/tree/dev/hello-world-tab-with-backend
It is working fine on all platforms (Teams Web, Teams Desktop, Teams Mobile, Outlook Web, Outlook Desktop) except Outlook Mobile. It seems that outlook mobile is not gettin... |
Teams tab application returns SSO error in mobile Outlook |
|reactjs|microsoft-graph-api|microsoft-teams| |
null |
A bit better patch:
+ if (p->nullValue[0] != '\0' && cli_strcmp(z, p->nullValue)==0) sqlite3_bind_null(pStmt, i+1);
+ else sqlite3_bind_text(pStmt, i+1, z, -1, SQLITE_TRANSIENT);
Now, when .nullvalue is set this value is replaced to NULL while importing CSV/TSV file. |
A bit beter patch:
+ if (p->nullValue[0] != '\0' && cli_strcmp(z, p->nullValue)==0) sqlite3_bind_null(pStmt, i+1);
+ else sqlite3_bind_text(pStmt, i+1, z, -1, SQLITE_TRANSIENT);
Now, when .nullvalue is set this value is replaced to NULL while importing CSV/TSV file. |
I am trying formula `if` with multi conditions in Excel.
but the result `#VALUE!`is there is something wrong with my formula please guide me
Thanks
| DATE | IN/OUT |TIME |DEF IN |DEF OUT |RESULT |
| -------- | -------- |-------- |-------- |-------- |--------|
| 13-03-24 | IN |7:35:4... |
How to formula if with multi conditions in Excel |
|excel|excel-formula|excel-2010| |
null |
As of [JMeter 5.6.3][1] it's not possible.
As a workaround you can use [Backend Listener][2] to send test metrics to a database like [InfluxDB][3]. Then you can plot whatever charts you want in [Grafana][4]
Alternatively you can customize the dashboard by manipulating the files in the [report-template][5] folder... |
I have used recast for my code generation with babel as i jhave checked it is compatable with babel but recast is removing all my comments
Here is my recast code
const generatedAst = recast.print(ast, {
tabWidth: 2,
quote: 'single',
});
i am passing AST generated from b... |
Attempts at running conpot is giving me a illegal instruction (core dumped) error.
I am running an Ubuntu 22.04.4 server and I am attempting to run a conpot on it. It was working this morning and I went to boot up another vm from the same ISO and now when I attempt to start conpot. (conpot -f --template default). I ... |
Why am I getting an Illegal instruction (core dumped) error when attempting to run conpot in a vm? |
|python|ubuntu-22.04|honeypot| |
null |
{"Voters":[{"Id":23922491,"DisplayName":"Piotr GasidΕo"}],"DeleteType":1} |