Skip to main content
Filter by
Sorted by
Tagged with
1 vote
0 answers
49 views

In Pine script version 6, we can define a variable with var and without var. Like this sample: var float Number1 = 0.0 and float Number1 = 0.0 If this variable does not need the value of the ...
Hadi's user avatar
  • 144
0 votes
0 answers
29 views

I have a code where many combinations of conditions (some parts of which are repeated) lead to the same outcome. For example: if (A and Y and a) or (B and Y and b) or (C and c): run() I feel ...
WeCanDoItGuys's user avatar
0 votes
2 answers
477 views

I have 2 folders each containing 1507 csv files, i am using the following code to save each file as a polars dataframe using list comprehension: bdsim=[pl.read_csv(x, schema_overrides = {"X0.6&...
ELOY GARCIA's user avatar
1 vote
0 answers
87 views

There are various buttons in my C# winform and for each button press an action is associated with it. I currently have code where when the button is clicked I record the date the button was clicked, ...
Past Expiry's user avatar
1 vote
0 answers
49 views

I am trying to insert 60 to 70 rows at once in a SQL Server table. Currently, I have a function to do it but it is taking almost 15 seconds to complete the task. It would not be a problem if it was ...
Luiza Souza Simões's user avatar
-1 votes
1 answer
95 views

I am a beginner in this, I was curious if i can write the below code more efficiently. I can't use loops or conditional statements, just logical operators. double a = Double.parseDouble(args[0]...
CowardPeasant's user avatar
0 votes
0 answers
29 views

I'm looking to do something like this: create or replace table patients as select distinct id from dataset where value in (var1:var30) ; I could make a temp table that contains just the variable ...
Caitlin Haven's user avatar
0 votes
0 answers
52 views

My code currently looks like: for j in range(len(destined)): if destined[j] == 1: if den[j,i+1] == 0: is_dense = np.hstack((is_dense, j)) elif den[j,i+1]...
Dylan Benton's user avatar
1 vote
1 answer
268 views

Given a matrix A, I need to multiply with another constant vector B, N times (N > 1 million). The size of A is 9000x1 and B is 9000x1000. The code is currently evaluated in the following way: for i=...
RajaKrishnappa's user avatar
1 vote
1 answer
86 views

I am programming the game Set! which consist of finding a valid set of three cards in a table of twelve cards. Each card has a unique combination of four characteristics: -Shape(Oval, Diamond, peanut) ...
ATalkingMonkey's user avatar
0 votes
1 answer
60 views

I have an array stored in the site options in WordPress which will potentially have 3000 email addresses in it. Every night I need to process this list with some checks on those email addresses and I'...
Naomi S's user avatar
  • 67
0 votes
2 answers
103 views

Is there a way to essentially write "and vice versa" in an if statement without writing the same code again but with "||"? if (currentDirection == 1 && nextDirection == 2) ...
Cameron Lindo's user avatar
0 votes
1 answer
42 views

Given: Sample Pandas Dataframe with dictionaries in each cell: user_token_df = pd.DataFrame( { "usr": ["u1", "u2", "u3", "u4", "u7"...
farid's user avatar
  • 1,631
0 votes
2 answers
502 views

I'm working on this problem from LeetCode.com: Column Name Type machine_id int process_id int activity_type enum timestamp float The table shows the user activities for a factory website. (machine_id, ...
Burton_Gustice's user avatar
-1 votes
2 answers
106 views

if (i != 0 && i != 15 && i != 20) { ... } For the above code snippet, how can I combine all the conditions so I won't have to use multiple comparison operators?
JWpark's user avatar
  • 15
1 vote
1 answer
64 views

typedef struct { string color; int age; }Dog; int main(void) { Dog cookie = ("brown", 6); cookie.color = "blue"; cookie.age = 12; } Hello, I'd like to know if ...
JWpark's user avatar
  • 15
0 votes
0 answers
41 views

I am currently programming an application, that connnects to a mysql database and reads, inserts and changes data in it. I am coding in Kotlin and use the JDBC Driver. My problem is, that for every ...
Sc4rocko's user avatar
0 votes
1 answer
42 views

Given: A synthetic dataset in pandas DataFrame format users vs. tokens, generated via the following helper function: import numpy as np import pandas as pd import string import random def get_df(...
farid's user avatar
  • 1,631
0 votes
1 answer
913 views

So, I have an issue. I need to try and get as "clean" or a URL as possible; meaning removing unnecessary query parameters from an URL. I realize that this would be close to impossible to do, ...
AJ Tatum's user avatar
  • 713
1 vote
4 answers
145 views

It is a simple task to get random numbers of the Bates distribution. I need 1 million averages to run 10k times: bates1 = replicate(10000, mean(runif(1e+06,1,5))) summary(bates1) I waited forever to ...
bprijadi's user avatar
-1 votes
1 answer
112 views

my question is in the title. After hours of thinking and looking up sites on google i came to the conclusion that i'm not quite sure how to solve this problem or if it is correct. Maybe you guys could ...
Brogrammer31's user avatar
1 vote
2 answers
523 views

I am trying to get grouped summary statistics of multiple variables conditional on other different columns. For example, I have three total difference variables (n.diff.total) and three variables ...
J.K.'s user avatar
  • 411
0 votes
2 answers
44 views

Below is a sample of a large data set from which I want to delete quadrats (Qm) numbered greater than than 3 in parcels (PARCELLE) 1, 3, 4, and 8. FIELD SECTOR PARCELLE Qm Total North A 1 ...
Enialoj's user avatar
-1 votes
2 answers
71 views

I have a simple piece of code that works, but I'd like to know if I can make it more Pythonic by using the dict.get() method. chunk_size = 100000 if "chunk_size" in self.conf["...
Joep's user avatar
  • 43
0 votes
2 answers
347 views

I have written a dice roller utility for a tabletop RPG in JavaScript. Before I add more functionality to it, I would like to simplify the code by simplifying functions to remove unnecessary code. ...
Richard Cosgrove's user avatar
2 votes
1 answer
65 views

In this problem, I am trying to "score" a task from a computer administered questionnaire, where each person is asked to type 5, 3-letter words into a text box. The result in the data.frame ...
rrevans's user avatar
  • 23
0 votes
1 answer
1k views

I run 2 Microsoft Edge browser instances for work, 1 for normal use and the other for AWS Console SAML login. I often mix them up. The latter is started with "runas /u: 'C:\ \msedge.exe'". ...
Peter Ji's user avatar
1 vote
1 answer
951 views

Can anyone explain why this is O(sqrt(n))? Is the best way to approach this by putting numbers to it? i:=1 p:=0 for (p<n) do p = p+i i+=1 Picture Here I thought it was O(n), but if I put n =...
CandyLand3601's user avatar
0 votes
1 answer
39 views

Question: How can I improve the processing time of the following code? Goal description: I have the following example dataset in which each observation contains ids of two individuals (the primary ...
J.K.'s user avatar
  • 411
1 vote
2 answers
107 views

Purpose: past vector is the set of o3.cpts found in the past period. current vector is the set of o3.cpts found in the current period. Each o3.cpt has a set of numbers that are associated with the ...
J.K.'s user avatar
  • 411
0 votes
2 answers
240 views

Consider the following DataFrame >>> df Start End Tiebreak 0 1 6 0.376600 1 5 7 0.050042 2 15 20 0.628266 3 10 15 0.984022 4 11 12 0.909033 5 ...
clueless's user avatar
  • 313
1 vote
1 answer
65 views

All of the code included in this question can be found in the 'LASSO code(Version for Antony)' script in the GitHub Repository for this project. This is all part of a research project with a ...
Marlen's user avatar
  • 173
0 votes
0 answers
105 views

So lets say I have a DataFrame: stuff temp id 1 3 20.0 1 6 20.1 1 7 21.4 2 1 30.2 2 3 0.0 2 2 34.0 3 7 0.0 3 6 0.0 3 ...
Pythoneer's user avatar
  • 433
5 votes
1 answer
631 views

I have seen previous solutions to this problem, but it is all complete search with a check function and not fast enough for me. I am working on a C++ program trying to generate all prime palindromes ...
Hudson's user avatar
  • 347
0 votes
0 answers
29 views

I'm trying to improve myself to write better quality code. However, I have a question. For example, does it make sense to create an appbar class like the one below and call that code where I need it? ...
user avatar
0 votes
1 answer
51 views

I would like to sum a frequency table into a more compact frequency table by filtering by a variable and certain intervals without using loops and manually creating most of the data frame. What I'm ...
Jeremiah's user avatar
1 vote
1 answer
374 views

I came to a point where I needed to check a condition and proceed with another condition if its true for many times. Here I'm using fromNS string which has the base of number (like - binary, decimal, ...
Advaitya Jadhav's user avatar
-1 votes
2 answers
200 views

I have made a program which outputs the factorial of a number by calling the function: factorial() which uses recursion to calculate and return the value. I have also included a loop to break the ...
Silent_Arts's user avatar
1 vote
4 answers
162 views

I have got a tibble of more than 2 million rows. One of the columns size is a value using M to represent million, k to represent thousand; it also has some <NA> values. The column type is ...
sam's user avatar
  • 61
1 vote
0 answers
1k views

I am writing a javascript function that takes a nested array and returns the numbers that occurs more than once in that array. I believe my function is accurate (meaning that it passes their "...
Joseph Etim's user avatar
0 votes
0 answers
143 views

I know how to do this combining a lot of if...else statements but I need a faster and more efficient way. I need a function that will run through a nested array and return the numbers that occur more ...
Joseph Etim's user avatar
0 votes
0 answers
29 views

Okay, so I'm trying to update some old js/html/jquery code for my work website. I want to modify a section of code which I'm pretty sure is written with horrible inefficiency, but I'm too dumb to know ...
bookworm's user avatar
1 vote
0 answers
61 views

Hi I have EA with code structure like this, void OnTick() { resetCounterVar(); //there's for loop CloseOrders(); //there's for loop UpdateAllOpenOrders(); //there's for loop SetSLTP(); //...
Luandre Ezra's user avatar
0 votes
2 answers
46 views

Hi i want to make some kind of filtering feature, so in my example there are the brand of the car and the type of the car and if both are exist i want the brand url parameter always in the front of ...
alvian ramaditya's user avatar
0 votes
2 answers
85 views

I want to compare two huge identical nested lists and by iterating over both of them. I'm looking for nested lists in where list_a[0] is equal to list_b[1]. In that case I want to merge those lists (...
Duon's user avatar
  • 1
0 votes
1 answer
214 views

Setup I have an array of captured data. The data may be captured on just 1 device or up to a dozen devices, with each device being a column in the array. I have a prior statement which I execute on ...
Trashman's user avatar
  • 1,664
0 votes
0 answers
94 views

I have a pandas dataframe containing 400 individual measurements. Each mesurment is a time series composed of roughly 1000 rows. The whole dataframe therefore contains roughly 400.000 rows. The index ...
sensation96's user avatar
0 votes
1 answer
46 views

I have this code that lets me handle button combinations in Unity: using System.Collections; using System.Collections.Generic; using UnityEngine; public class InputBufferScriptTest: MonoBehaviour { ...
KingBarou13's user avatar
-1 votes
1 answer
54 views

I have 4 structs: Computer, Home, Car, Ship I declared: 1. An array that can hold up to 5 types of computers. 2. An array that can hold up to 20 houses, each can have one computer. 3. An array that ...
Programmer man's user avatar
2 votes
1 answer
176 views

I have two data frames: dat <- data.frame(Digits_Lower = 1:5, Digits_Upper = 6:10, random = 20:24) dat #> Digits_Lower Digits_Upper random #> 1 ...
kzyat's user avatar
  • 23

1
2 3 4 5
9