instruction stringlengths 0 30k β |
|---|
It sounds like you are on the right track using [`pl.DataFrame.join_asof`](https://docs.pola.rs/py-polars/html/reference/dataframe/api/polars.DataFrame.join_asof.html). To group by the symbol the `by` parameter can be used.
```python
(
fr
.join_asof(
events,
left_on="Date", right_on="Ea... |
Getting Run-time error '13': Type Mismatch using .Find |
|excel|vba| |
As you can read in the [documentation of `list.sort`][1]
> This method modifies the sequence in place for economy of space when sorting a large sequence. **To remind users that it operates by side effect, it does not return the sorted sequence** (use sorted() to explicitly request a new sorted list instance).
(bo... |
I have $10$ random variables $X_1, X_2, \ldots X_{10} \sim \mathcal{N(0,1)}$, I want to generate $5000$ samples for them such that $X_1 < a$ and $X_i > a \forall i \in {2, 3, \ldots, 10}$.
The problem is I want this to be replicable given the same initial seed. By this I mean that if the seed supplied is the same, ... |
Producing filtered random samples which can be replicated using the same seed |
|numpy|random|filter|random-seed| |
format() method would work here as well:
for i in range(triangle_height + 1):
print('{}{}'.format(triangle_char, " ") * i)
i += 1
|
I'm experimenting with GLFW (compiling with **g++ -o nxtBluePixel nxtBluePixel.cpp -lglfw -lGLEW -lGL** ) to simply draw a blue box and move it up/down/left/right. I want to output a message "out of bounds" when the box touches the edges of the visible area, which should logically be -1 or 1 (in those so-called normali... |
i have being building a telegram bot with nodejs where people can send in a url of a tweet and if it contains a media of type video. it downloads it and sends it to the user. Thats the purpose, which i already completed.
The problem i have is with setting a paywall on this bot account so that after 2 or 3 request, ... |
Stripe Pre-Checkout Timeout Error while making a Test Payment from Telegram Bot |
Since `mod_dav_svn.so` and `mod_authz_svn.so` were not present in SVN (TortoiseSVN), I downloaded the files from https://github.com/nono303/win-svn/tree/master/vc15/x64 and moved them to `C:\Apache24\modules`.
I then added the following lines to the `httpd.conf` file in Apache24:
```
# Subversion Configuration
... |
I'm having a huge problem.
I have a struct
```c++
struct Particle {
int x = -1;
int y = -1;
int type = -1;
int number = -1;
bool operator==(Particle p) {
if (this->x == p.x && this->y == p.y && this->type == p.type
&& this->number == p.number) { return true; }
... |
The hitbox positions are wrong i think
```haxe
final hitboxBlasterRatio:Int = blaster.width * 0.5; //adjust
final hitboxRatio:Int = soul.width * 0.5;
final bCornerUp:FlxPoint = FlxPoint.weak(blaster.x + blaster.width / 2 - hitboxBlasterRatio / 2, blaster.y + blaster.height / 2 - hitboxBlasterRatio / 2);
final ... |
|python|state-pattern| |
s = ("If Iβm not in a hurry, then I should stay. " +
"On the other hand, if I leave, then I can sleep.")
re.findall(r'[Ii]f (.*), then', s)
The output is:
Iβm not in a hurry, then I should stay. On the other hand, if I leave
The question is: Why aren't the words "If" and "then" not included i... |
Python and regex, can't understand why some words are left out of the match |
|python|regex| |
I am building a registration. I built the page and here is a sample code block from that:
class RegistrationPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Color(0xFFB0C4DE),
body: SafeArea(
... |
I have a data structure on Qdrant that in the payload, I have something like this:
```
{
"attributes": [
{
"attribute_value_id": 22003,
"id": 1252,
"key": "Environment",
"value": "Casual/Daily",
},
{
"attribute_value_id... |
The results of `scipy.stats.shapiro` are unlikely to be incorrect here; as mentioned in the comments, the p-value is consistent with that produced by R's `shapiro.test`.
```R
options(digits=16)
x = seq(2, 43)
shapiro.test(x)
# W = 0.95605246967015, p-value = 0.1065549026935
```
Compared to other normality te... |
`LIBRARY_PATH` is used by linker (ld)
`LD_LIBRARY_PATH` is used by loader (ld.so) |
You can do :
xl info | grep "total_memory"
which gives you your host memory in KB. |
> My expectation would be that creating the instance `Base` with the specified type `str` it is used for `V` which should be compatible in the `test()` return value as it converts to `Test[str](t)`
Your `b = Base[str]()` line has no retroactive effect on the definition of `class Base(Generic[V]):` whatsoever - the ... |
The error states there KeyError: "['1'] not found in axis", meaning that you don't refer to the right column or '1' doesn't even exist in the dataframe.
To see columns in your dataframe, you can check with
df.columns
or
print(df.columns)
To delete (or drop i might say) column you can do like follow... |
Well the issue was on the `Output Directory`, the default directory was set to `dist` but my build was `dist/client/`. All I needed to do was to edit the vercel output directory to match the `dist/client/` path. |
IIUC use:
b = housing_labels['median_house_value'].to_numpy()
out = np.median(b[idx], axis=1)
print (out) |
1. Add the [Plugin.Maui.Audio](https://www.nuget.org/packages/Plugin.Maui.Audio/) Nuget Package
````
<PackageReference Include="Plugin.Maui.Audio" Version="2.1.0" />
````
2. Add the following line to the `MauiProgram.cs`
````
builder.Services.AddSingleton(AudioManager.Current);
````
... |
I want to use the Flutter Custom Clipper to create a shape like the picture below, but it doesn't work. Is there anyone who can help?
[![enter image description here][1]][1]
```dart
class MyCustomClipper extends CustomClipper<Path> {
@override
Path getClip(Size size) {
List<Offset> polygon = [
... |
|python|widget|jupyter|ipywidgets|pandas-profiling| |
You can capture initial zeros and 3 alhpanumeric chars right after them in one group, the middle part into a second group, and then the last 4 alphanumeric chars into a third group, then only replace each char in the second group.
Here is an example (Java 11 compliant):
```java
String text = "0001113033AA55608981"... |
More in detail:
I would like to choose one specific column based on a header value from snakemake rule input file and then select this specific column's first value. I was considering something like this: (df['colname'].iloc[0]) but now I am getting confused when {input} comes also into a play. So instead of a 'df' me... |
How to apply python iloc on snakemake input file? |
|python|pandas|function|indexing|snakemake| |
null |
this one worked for me
auth('sanctum')->user()->tokens()->delete(); |
As **backend developers**, we often encounter theoretical concepts during our education or self-study, such as transactions in MongoDB or the principles of ACID (Atomicity, Consistency, Isolation, Durability). However, in practical scenarios within organizations, do we find ourselves actually implementing these concept... |
Do Backend Developers Truly Apply Theoretical Concepts like Transactions in MongoDB and ACID Principle in Real-world Applications? |
.NET (and consequently PowerShell) distinguishes between value types and reference types - value types are data types whose values are _copied_ on reference, whereas reference types are data types whose values are _passed by reference_.
This means that "an array of hashtables" is not actually that - it's an array of... |
Make UI fit the screen in dart on mobile view |
|flutter|dart|android-studio|mobile| |
{"OriginalQuestionIds":[65833341],"Voters":[{"Id":14868997,"DisplayName":"Charlieface","BindingReason":{"GoldTagBadge":"c#"}}]} |
I have a C cli program that I compiled to was with Emscripten. I'm trying to run that program each time a button is pressed, and read from a textbox into stdin and from stdout to another textbox. However, I can only call `Module.callMain()` successfully once. Each subsequent invocation does not execute. How to properly... |
As others mentioned before, in 2 steps:
1. Dex2jar
2. Pick up a decompiler
I will focus on step 2.
Take a look at this research paper : [The Strengths and Behavioral Quirks of Java Bytecode Decompilers][1]
Understand the strength and weaknesses of each decompiler.
1. [CFR][2]: Considered by many as t... |
i need to set up text to bar using BarGraphItem with pyqtgraph
I need something like this:
[enter image description here](https://i.stack.imgur.com/pOMlM.png)
or set the names in the middle.
there was an idea to set TextItem by coordinates,
but after writing it, it turned out that with a large number of ... |
The problem I found that I cannot make Postgres use GIN index when I use **jsonb_*** functions in my queries.
The problem exists for both **jsonb_ops** and **jsonb_path_ops** operator classes.
Let's first make preparations.
Create the table
```lang-sql
CREATE TABLE applications
(
id TEXT PRIMARY... |
How to make Postgres GIN index work with jsonb_* functions? |
|postgresql|indexing|jsonb| |
null |
Here is some interesting information from the official documentation regarding hosts : https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_vars_facts.html#information-about-ansible-magic-variables
I recommend using the inventory_hostname as you define it yourself.
Since you also define the address in t... |
My original post - https://stackoverflow.com/a/57224037/1979465
To call a stored procedure and get the result into a list of model in EF Core, we have to follow 3 steps.
**Step 1.**
You need to add a new class just like your entity class. Which should have properties with all the columns in your SP. For example... |
Sometimes after adding new columns to a table we face with problem of strange aliases in projection columns: new columns have aliases of old columns names. Columns were added like `alter table DMA.test_migrations add column my_column int`
Example of DDL:
```
CREATE TABLE DMA.test_migrations
(
launch_id int N... |
`#{}` is a placeholder in prepared statement, so you cannot use it in a literal.
Although it is technically possible to generate such literal using `${}` instead of `#{}`, it is not recommended because it is difficult to prevent SQL injection that way (see this [FAQ](https://github.com/mybatis/mybatis-3/wiki/FAQ#wha... |
You can work with [**`replicateM :: Int -> m a -> m [a]`**](https://hackage.haskell.org/package/base-4.19.1.0/docs/Control-Monad.html#v:replicateM):
import Control.Monad(replicateM)
generate :: Int -> [[Int]]
generate = replicateM <*> enumFromTo 1
The `replicateM` essentially works as:
<pre... |
I am trying to download a .stl file from a URL:- `https://cdn.thingiverse.com/assets/99/39/31/f9/33/90_Degree_-_4_Segments.stl`
I have created a service for the same - **app-stl.service.ts**, which accepts the URL and returns the required file --
import { Injectable } from '@angular/core';
import { HttpH... |
Check to see that you set your .recordSelectionFormula before you assign the report to the reportsource property of the viewer.
This Doesn't seem to Work
CrystalReportViewer1.ReportSource = reportDoc
reportDoc.RecordSelectionFormula = "{MyField} = '1008'"
CrystalReportViewer1.Show()
This... |
# Docker Traefik Provider Example
---
## Case
For example, in case a WebDav service is behind a TLS reverse-proxy (e.g. Traefik, port `443`), and the service itself is running on non-TLS protocol (i.e. port `80`), and renaming a file (i.e. HTTP method `MOVE`) in Nginx may result in error:
```
..."MOVE /dav... |
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 {
... |
Player class with boolean settings which I want to get in another class and change
public Dictionary<string, bool>? Settings
{
get
{
Dictionary<string, bool> settings = null!;
foreach (var property in GetType().GetProperties().Where(p => p.PropertyType == typeof... |
Unable to get bool settings from class |
I'm having a huge problem.
I have a struct
```c++
struct Particle {
int x = -1;
int y = -1;
int type = -1;
int number = -1;
bool operator==(Particle p) {
if (this->x == p.x && this->y == p.y && this->type == p.type
&& this->number == p.number) { return true; }
... |
You need to call `dispose()` on the first instance first.
Then use another.
final matching = PixelMatching();
// setup target image
await matching?.initialize(image: image);
// compare image
final double? similarity = await matching?.similarity(cameraImage);
// dispose
matching?... |
I want to generate a list given a number n which returns all possible combinations from one to `n` recursively and without imports.
For example
```
generate 3
```
should return:
```
[[1,1,1],[1,1,2],[1,1,3],[1,2,1],[1,2,2],[1,2,3],[1,3,1],[1,3,2],[1,3,3],[2,1,1],[2,1,2],[2,1,3],[2,2,1],[2,2,2],[2,2,3],[2,3,1]... |
You can create a RandomRange class, you can create as many as you want and put into a list
public class RandomRange
{
public int Start { get; set; }
public int End { get; set; }
public int Exception { get; set; }
public RandomRange(int start, int end, int exception)
... |
I'm experimenting with GLFW (compiling with **g++ -o nxtBluePixel nxtBluePixel.cpp -lglfw -lGLEW -lGL** ) to simply draw a blue box and move it up/down/left/right. I want to output a message "out of bounds" when the box touches the edges of the visible area, which should logically be -1 or 1 (in those so-called normali... |
Clone gist with SSH:
$ git clone git@gist.github.com:<hash>.git mygist
HTTP clone worked fine, but ran into HTTP authentication problems at `git push`. |
The IsShuttingDown property is a internal static property of Apllication class therefore you can access to value of it with bellow code
var isShuttingDownProp = typeof(Application).GetProperty("IsShuttingDown", BindingFlags.Static | BindingFlags.NonPublic);
var isShuttingDown = isShuttingDownProp.Ge... |
The [`Kbd`](https://codeberg.org/xmobar/xmobar/src/branch/master/doc/plugins.org#user-content-headline-24) monitor plugin can be installed in the xmobar status bar like this,
```haskell
Run $ Kbd [("it", "IT"), ("ru(phonetic)", "RU")]
```
and then switch keyboard via `setxkbmap`, the monitor will reflect the change... |
|firefox|gpo| |
i try to run this code
```
#!/bin/bash
source BBSW.sh
declare -g HTXApiKey=""
declare -g HTXSecretKey=""
declare -g HTXIdApi=""
function _Init_Huobi_ApiSecretIDData() {
if [ -z "$1" ]; then
echo "Errore: Nome exchange mancante."
return 1
fi
exchange_name="$1"
if [ "$2" == "D... |
why this code return api signature not valid in huobi api? |
|bash|huobi| |
I am working on an Angular application where I need to upload files or images to an S3 server using the http.put method. I have written the following code, but I am encountering issues with the upload process. Here is my code:
uploadFileToS3(fileUrl: string, file: File): Observable<any> {
const formData... |
How to obtain the capacity of a USB drive on Android. Some devices mount USB drives to/mnt/media_rw.
Cannot obtain the capacity of the USB drive through StatFs. The files in the USB drive will not be scanned into MediaStore, so they cannot be obtained through MediaStore. My app is not a system application. Is there ... |
How to obtain USB drive capacityοΌ |
|usb| |
null |
The most efficient approach is to sort both lists by time then concurrent run through both lists. Complexity is 2 sorts plus O(n), where "n = min(runEvents.Count, heartBeats.Count)" |
I have a program that aims to function like an etch-a-sketch.
If you hit A, the X coordinate will change, and if you hit B the Y coordinate will change.
I use a sprite as the 'crosshair' and pressing A+B will plot a point at the current coordinate. The problem is whenever there's a sprite on the screen plot just do... |
You can use this code belo
```
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
home: Sc... |
we have recently set up rootless docker alongside our existing docker but ran into problems injecting host GPUs into the rootless containers. A workaround was presented in a Github [issue](https://github.com/NVIDIA/nvidia-container-toolkit/issues/85) (toggling no-cgroups to switch between rootful and rootless) with a m... |
You should use for example:
<!-- begin snippet: js hide: false console: true babel: false -->
<!-- language: lang-html -->
<Lightbox
activeProps={{
style: {
width: "100%",
height: "100%",
},
}}
>
</Lightbox>
<!-- end snippet -->
with t... |
We have a website where we provide the assignment service user are experiencing the issue of unable to go to payment gateway
https://www.ignougalaxy.in/handwritten-assignments-order
This is the link to the order form it is linked to paymnet gateway
Some of the users are saying that they cannot click on the p... |
Issue in payment form gateway |
|php|payment-gateway|payment| |
null |
It's my first time deploying a website via github pages and I've noticed a problem with embedding videos (mp4 in my case). Everything else is working and loading fine (including images) however whenever I try to view any of the embedded videos on my website, I get the following black screen with the controls greyed out... |
I am trying to write my version of the function `strncmp` that already exists in the C language. Below is the solution I have found; I have tested it with a handful of cases and compared the results with the original `strncmp` C function and I have got same results. Please let me know if there are any flaws in my solut... |
I had problems using Java 21 in VSCode with Gradle on WSL. VSCode has an internal Java 17 runtime (March 2024) [as described here][1]. In order to let VSCode use your default Java 21 installation add the 'java.jdt.ls.java.home' setting, for me it looks like this:
"java.jdt.ls.java.home": "/usr/lib/jvm/java-21-op... |
Want descending order of data in hive:
Requirement: Our requirement is we want to get pnote column in a way that data for particular invoice number should be in descending order. As we want to get the most recent date record from the top of the array (zeroth element) from pnote column.
Currect outputs:
1. sel... |
which running pdb in docker shell/container, in order to exit
run ```pdb.disable()``` and then ```exit()``` |
|javascript|dropbox| |
i want to turn windows on and off from java code so to do this need to execute cmd command with admin privilege to do this please any one help me
i tried this but it is not running as admin public void execute_cmd2() {
Process exec = Runtime.getRuntime().exec("cmd");
OutputStream ... |
execute cmd commands as admin with java code |
|java|cmd|admin| |
null |
I have two different services (Service A and Service B) that share Redis Session and both services were using Spring-boot 1.5
Service A is the authentication service (SSO)
While Service B is the User service
Recently, Service B was upgraded to Spring-boot 2.7.
It has become a problem to share session Id betw... |
How can I change XMobar's Kbd monitor plugin such that clicking on it loops throught the layouts? |
{"Voters":[{"Id":23918954,"DisplayName":"payam jabbari"}],"DeleteType":1} |
I've created a new Blazor 'Web App' project in .net 8.
I include 'Individual Accounts' when setting up the project.
I've setup email delivery and try a password reset. It sends the reset email first, I click then enter the email and new passwords, upon doing that I get this error:
"A valid antiforgery token was ... |