Skip to main content
Filter by
Sorted by
Tagged with
5 votes
1 answer
110 views

I'm wondering what the best approach for finding the closest match to a given value from a collection of items is. The most important part is the lookup time relative to the input size, the data can ...
JoniKauf's user avatar
  • 346
0 votes
0 answers
37 views

I'm trying to organize market lists by metro regions but I'm running into issues retrieving elements by their ID. Specifically, I'm encountering a TypeError: Cannot read properties of null (reading '...
choche7's user avatar
  • 59
1 vote
1 answer
48 views

I have two tables in access with different dates for one and the same order ID. In first one I have only one record per order with date. In the second one I have multiple records per order with ...
Ivaylo Dimitrov's user avatar
-3 votes
2 answers
81 views

I need a formula to cell G2 to find the nearest match based on cell E2 and F2. My desired result would be Working Offline, since range A2:A13 = E2 (Agent 1) and C2:C13 = F2 (10:00:00), the status ...
Harvey's user avatar
  • 137
0 votes
1 answer
180 views

I try make table using array for example table like this int array[5][3] = { {A, 200, 400}, {B, 300, 600}, {C, 100, 200}, {D, 200, 100}, {E, 200, 400} }; so array output will be like this : | id | X ...
ocat dota2's user avatar
0 votes
2 answers
378 views

I'm working on an Angular application where I have a filter component that toggles its visibility based on a click outside event. This works as expected, but I have an issue when there is a calendar ...
Amanda's user avatar
  • 81
1 vote
1 answer
109 views

Suppose I have Table1 and Table2 with the below data. I want to find the next closest Date match for Table 1(JoiningDt) that is available in Table2.ClosestDt for each ID. Note: Closest Match from ...
Poorna Prakash's user avatar
2 votes
1 answer
97 views

I'm trying to find the diameter at 50% of the total particles. So I was able to use this code to find the diameter size at 50% of the total particles. So the first column is the diameter size, the ...
Maria's user avatar
  • 49
0 votes
2 answers
61 views

I have two tables as below: Table A: ID Age Dept Salary Start_date 1 30 A $1000 01-01-2000 1 31 B $1200 01-01-2022 2 25 C $1200 01-06-2021 2 26 A $1300 01-01-2022 3 34 D $1400 01-01-2021 3 35 C $1800 ...
Sudd_SQL's user avatar
1 vote
0 answers
45 views

I have two integers "X" and "Y" where X > Y, I want to find a closest larger number to Y, which is obtained by deleting zero or more digits from X, by keeping the order of ...
Sai Likhith Adari's user avatar
0 votes
0 answers
41 views

I have two lists: a = [35, 400, 200] b = [100, 32] I want to match each value in ‘b’ with the closest value in ‘a’. Each value in ‘b’ can have at most one match. The final list contains values that ...
Matas M's user avatar
  • 73
0 votes
2 answers
63 views

I have a text in a set of divs. If somebody clicks on that text I have to know if the 4th parent div with the class "div1" holds the class name "exampleclass". My HTML: <div ...
Lukas Schwarzenbacher's user avatar
0 votes
0 answers
256 views

**e.target.closest event triggering twice** *I am using vuetify framework in my vuejs code.. on clicking v-card(overall), i want the page to redirect to another page, except on ...
Poovizhi's user avatar
0 votes
1 answer
28 views

ul alt2 should be aaa3 but becomes aaa0 why? $(" .item").each(function(e){ tt=$(this); tt.attr("alt",e); $(this).closest('.item').attr('alt2', 'aaa'+$(this).attr('alt') ); }) <script ...
Hakan's user avatar
  • 722
0 votes
0 answers
79 views

I have an array of objects, and I'd like to find the closest number to a specific key value. I've seen other answers that show how to do it for an array full of numbers, but I can't figure out the ...
User's user avatar
  • 21
1 vote
0 answers
92 views

I have a large dataset where each row is a station. I need to find the closest station within each year but where a different type of equipment was used. I then want to either combine these rows into ...
GenieV's user avatar
  • 33
0 votes
1 answer
190 views

I want to use "once per bar" feature in Strategy inputs as in Indicator. What should I do? I want the strategy to be traded immediately as in the indicator without waiting for the candle to ...
sperci0's user avatar
-1 votes
2 answers
53 views

I'm trying to display a text in the closest element with the .msg class, but it always displayed in the first element with .msg class. let btn = document.querySelectorAll('button'); btn.forEach(...
Joga gavidia's user avatar
0 votes
1 answer
1k views

I have two dataframes, one with a "full" time series and another with far fewer elements representing special points in time for an experiment with many trials. The time variable runs from 0 ...
B_Sil's user avatar
  • 15
0 votes
2 answers
68 views

I know this is a bit on nonsense but I need to get the closest number out of 2 arrays or: const myarr = [[12, 42], [12, 56], [30, 54]] console.log(colsest_out_of_closest(myarr, [12, 50]))
Klesty Selimay's user avatar
-1 votes
1 answer
406 views

I have a Pandas DataFrame and comparation list like this: In [21]: df Out[21]: Results 0 90 1 80 2 70 3 60 4 50 5 40 6 30 7 20 8 10 In [23]: ...
Daniel Echenique's user avatar
1 vote
5 answers
680 views

I am trying to find a way to find the closest value in a vector, from elements in the SAME vector, but excluding the row in question. For example, suppose I have dataframe A with one column (column_1):...
eades's user avatar
  • 81
1 vote
1 answer
481 views

I have two pyspark dataframes like shown below: dfamr = spark.read.csv("/C:/Sushant Workspace/Tech/Self/pyspark datasets/amrrates.csv", header="true") dfexclusion = spark.read.csv(...
sushapat's user avatar
0 votes
2 answers
133 views

I have the following dataframe: gp_columns = { 'name': ['companyA', 'companyB'], 'firm_ID' : [1, 2], 'timestamp_one' : ['2016-04-01', '2017-09-01'] } fund_columns = { 'firm_ID': [1, 1, 2, 2, 2], ...
tab_stopp's user avatar
1 vote
1 answer
100 views

We have a PySpark dataframe containing rate codes that we have to use to give discounted offers to our customers. -ratecode - Actual rate code -weeklyrate - weekly dollar amount that the customer ...
sushapat's user avatar
1 vote
1 answer
123 views

I would like to join two dataframes based on currency rate exchange and date from the second dataframe. I have tried the approach cited here, but the datediff gives the difference in dates so it doesn'...
f.ivy's user avatar
  • 75
0 votes
2 answers
417 views

This code is giving me undefined value when I try to show the value through alert message. <div> <input type="checkbox"> <div class="aid_closest"> &...
Anonymous's user avatar
0 votes
1 answer
388 views

Problem: I have 2 datasets with no matching identifiers (like ID) and need to find the closest match in df1$time to df2$tstart. df1 (with time column) has 660,000 rows with time stamps approximately ...
Amanda's user avatar
  • 49
0 votes
1 answer
75 views

Maybe it's a dumb question, but there is a way to get closest value to target? Something as writing closest(58px, 6.4vh, 2vw) and between 6.4vh and 2vw retrieve the closest to 58px
Cippo Nessuno's user avatar
1 vote
1 answer
157 views

I have a df with data from a qPCR run: df_1 <- structure(list( row = c("A", "A", "A", "A", "B", "B"), column = c(17L, 18L, 19L, 20L, ...
LePlant's user avatar
  • 13
1 vote
1 answer
709 views

I need to get the closest ancestor by class, byt I need to use a partial class. For instance: <div class="parent-1"> <div class="child"></div> </div> I'...
Berg_Durden's user avatar
  • 1,811
0 votes
0 answers
49 views

I want to open this dot_card.php page in a dialog box. I want to interrupt the the form submission to do some stuff and them do an ajax call. After the form is submitted via ajax, I want to close ...
karozans's user avatar
2 votes
1 answer
1k views

Is there a way to find the closest value from a list that is either less than or greater than a value gathered by input? The input value has to be excluded from the possible values. I've used this, ...
Spaceman530's user avatar
1 vote
1 answer
342 views

I have two element inside <tr>: <table> <tbody> <tr> <td><input type="text" class="form-control input-state" onclick="myfunction(this)"...
aref razavi's user avatar
1 vote
1 answer
513 views

Is there an elegant way to obtain the closest smaller and bigger values compared to some reference value? Following example should clarify my goal: set.seed(42) df_Date <- data.frame(Date = seq(...
KidLu's user avatar
  • 223
0 votes
2 answers
825 views

this is my point x=3; array =[4,8,7,5,6,9]; if would like to know if there is a value in array equal to x, and, if there isn't, find the two closest values in the left and in the right, in that case ...
Naomi's user avatar
  • 37
-1 votes
1 answer
173 views

I have a shopping cart view cart list count and this document <div class="input-group input-number-group"> <div class="input-group-button" onclick="decrement_cart(...
aref razavi's user avatar
1 vote
2 answers
2k views

I made a program to plot a figure from point cloud data (x,y,z coordinates shown as list x_list, y_list, z_list). Now, I have to find the closest point to (0,0,0). Anybody has an idea to do that? Here ...
mika hirvonen's user avatar
0 votes
0 answers
30 views

Say, Given an arbitrary RGB Value and an array of colors with defined values(eg red, blue, green, yellow, etc.), what would be an optimal way of finding the nearest defined color to the arbitrary ...
FaffyWaffles's user avatar
4 votes
2 answers
796 views

I have two dataframes that I want to merge by the closest value in one column. The first dataframe (DF1) consists of individuals and their estimated individual risk ("risk"): DF1<- data....
Wilmer Cristobal Guzman-Vilca's user avatar
0 votes
0 answers
109 views

I have a 3d scene (with pointclouds and some other objects). I implemented algorithm to pick the closest point to the mouse for a pointclouds. But my problem is : I have several objects in my scene, ...
Julien Chaize's user avatar
0 votes
1 answer
335 views

I'm creating a personal use website where I want to add "modules" or groups in which I can add links. The problem I'm facing is when I add a group and start adding links, it all works fine. ...
Arkiverat's user avatar
2 votes
4 answers
1k views

Consider the following random MWE. For every row, I am trying to determine which variable has the closest value below the constant reference_day and which variable has the closest value above the ...
vlangen's user avatar
  • 522
-1 votes
1 answer
91 views

I have code which is taking RA and DEC values (some coordinates in str form) from a text file and using astroquery to query objects respect to those RA and DEC data and shows a table for those objects ...
Ege Tunç's user avatar
0 votes
2 answers
1k views

I'm tried to solve this challenge from testdome and i got stuck. The following HTML represents a family tree: <James> <Dave></Dave> <Mike></Mike> <Sarah></...
munteanu dan's user avatar
2 votes
0 answers
94 views

In my app, I'm trying to add an active class to the proper section, and the logic is based on the .closest() method. When I click on Span 2 I need to get the section with .--level-2, I can get the ...
MarkMark's user avatar
  • 184
0 votes
0 answers
483 views

We are looking for an efficient algorithm to solve the following problem: Given two increasingly sorted arrays. Find the closest corresponding elements in each array that difference is below a user ...
sgibb's user avatar
  • 25.8k
3 votes
2 answers
1k views

I have a very simple Binary Tree class TreeNode(object): def __init__(self, x): self.val = x self.left = None self.right = None root = TreeNode(8) root.left = TreeNode(5) ...
lukasz21's user avatar
0 votes
1 answer
693 views

I am scraping the text of a long document with the same ticker repeated multiple times throughout. I am trying to locate a specific ticker that is closest to another word (let's call it a base word. ...
MellyJ13's user avatar
1 vote
1 answer
62 views

I have a list in which each item can display its content by injecting it with Ajax. (function($) { $(document).ready(function() { $('.show-content').click(function() { ...
Scotty's user avatar
  • 119

1
2 3 4 5
12