Issue Given two Date() objects, where one is less than the other, how do I loop every day between the dates? for(loopDate = startDate; loopDate < endDate; loopDate += 1) { } Would this sort of loop work? But how
Continue readingTag: loops
VBA: How can I fill in cells in one column based on the collective information of iterative ranges?
Issue I need to fill in Col H (see red text in image for an example) as follows: There are 3 subjects listed (separated by grey background) (Col C for number) Each subject has multiple data points (one per row-Col
Continue readingDetermine if a class falls on a holiday, given the start and end dates of the class and the dates of all holidays
Issue I have 2 tables in a database, the first has the following kind of information in it SECTION_NUMBER SECTION_ID MEETING_ID DAY_TYPE MEETING_NUMBER DATE_TIME_BEGIN DATE_TIME_END 390 166316 102451 1 1 2023-01-23 9:30:00 2023-05-17 10:50:00 390 166316 102451 3 1 2023-01-23
Continue readingHow to loop through an Array in a subscribe and ngOnInit method?
Issue I have a question i want to loop through an .subscribe() method which is in an ngOnInit() method: ngOnInit() { this.service.getEmployees().subscribe( (listBooks) => { this.books = listBooks var events: CalendarEvent[] = [ { start: new Date(this.books[0].date_from_og), //loop instead of
Continue readingCreating an array from a text file in Bash
Issue A script takes a URL, parses it for the required fields, and redirects its output to be saved in a file, file.txt. The output is saved on a new line each time a field has been found. file.txt A
Continue readingHow to highlight an HTML table column without using loops?
Issue I have a table like this: <table> <thead> <tr> <th id=”col-1″><input type=”button” class=”some” value=”Company” /></th> <th>name</th> <th>Adress</th> <th>Zip</th> <th>Place</th> <th>Country</th> </tr> </thead> <tbody> <tr class=”even”> <td headers=”col-1″>Some ltd</td> <td>some name</td> <td>some street</td> <td>some zip</td> <td>some town</td> <td>some country</td> </tr>
Continue readingPHPBB nested template loops not working correctly
Issue I’m trying to wrap my head around PHPBB templating but it’s not working like I want. So this is what the HTML of my template looks like: <div id=”invtabs”> <ul> <!– BEGIN TAB_LOOP –> <li><a href=”#invtabs-{TAB_LOOP.TAB_ID}”>{TAB_LOOP.TAB_NAME}</a></li> <!– END TAB_LOOP
Continue readingHow to get the first 6 texts
Issue for now I have an output with many ratings, and would want to only print out the first sixth in python. import re import requests data = requests.get(‘https://www.imdb.com/chart/’).text titles = re.findall(‘/title/\w*/(?=">)’, data) rating = re.findall(‘\d\.\d.*ratings’, data) rating output I
Continue readingHow to iterate two separate arrays in handlebars Nodejs with {{#each}}?
Issue I am creating a Risk Management System using Nodejs and Express with Handlebar views. Using SQL, I am extracting two queries in my GET router and rendering them to the handlebar view. This is how it looks: const parametro
Continue readingPHP while loop add by 2
Issue Currently I have a code that looks like: for ($i=0; $i<=($num_newlines – 1); $i++) { $tweetcpitems->post(‘statuses/update’, array(‘status’ => wordFilter(“The item $parts[$i] has been released on Club Penguin. View it here: http://clubpenguincheatsnow.com/tools/swfviewer/items.swf?id=$parts[$id]”))); sleep(90); } What I want to do make
Continue readingHow to loop through subdirectories and files in subdirectories then print file names in bash
Issue Given a root path, I am trying to loop through the sub-directories to loop through the files in each subdirectory and print the names of the files. The directory structure is like this: Root directory dir2, file{1..10} dir3, file{1..10}
Continue readingShould you create a var inside a for-in loop?
Issue for(var key in object){ //process object[key] } or just for(key in object) { //process object[key] } Is there a difference? Solution Yes, there’s a difference. Whether you use var or not key will still be a variable, and its
Continue readingUsing variables from two different while loops
Issue How do I use variables from different while loops and insert them in a print statement? public class Squares{ public static void main (String [] args){ int counterA = 0; int counterB= 0; while (counterA<51){ counterA++; if (counterA %
Continue readingPassing variables to $.ajax().done()
Issue I’m lost. How might I pass a loop variable to an AJAX .done() call? for (var i in obj) { $.ajax(/script/).done(function(data){ console.log(data); }); } Obviously, if I were to do console.log(i+’ ‘+data) i would return the very last key
Continue readingPython yfinance – Pulling option chains for multiple tickers and all expirations per ticker
Issue I’m trying to use yfinance to pull option chains per stock from a list of tickers and for all the available expirations per ticker. So my code should loop over each ticker, get expiration dates, loop over each date,
Continue readingRestructure code to avoid for loops in training loop?
Issue I am defining a train function which I pass in a data_loader as a dict. data_loader[‘train’]: consists of train data data_loader[‘val’] consists of validation data. I created a loop which iterates through which phase I am in (either train
Continue readingHow to do nested loops inside template view in angular2+
Issue I need to view different array indexes and their values inside my template. I have this object: vegetables = [ {name: ‘Carrot’, type: ‘vegetable’}, {name: ‘Onion’, type: ‘vegetable’}, {name: ‘Potato’, type: ‘vegetable’}, {name: ‘Capsicum’, type: ‘vegetable’}], [ {name: ‘Carrotas’,
Continue readingGet iteration index from List.map()
Issue I wrote an iteration on list of letters and put inside cards on screen using "map" class. In the code you can see that I made a row, and using "map" printed all the userBoard on cards to the
Continue readingShow multiples of a given number within a range
Issue How can I fix the following code in better way (alternative way to iterate range from first element to last element? My goal is to write kotlin code in most efficient and simplest way I am looking someone tell
Continue readingHow do you make a range in Rust?
Issue The documentation doesn’t say how and the tutorial completely ignores for loops. Solution As of 1.0, for loops work with values of types with the Iterator trait. The book describes this technique in chapter 3.5 and chapter 13.2. If
Continue readingImporting a tuple to a list from a function
Issue I’m trying to modify pixels using range in a loop but I can’t import the range from size function. load = bnw.load() loadpx = [ (a), (b) ] bnw.size(loadpx) print(loadpx) for x in a: for y in b: new
Continue readingHow to loop over all the product details in an html file?
Issue In this code, I am trying to loop over all the product details in an HTML file using range but it is giving me an error Error executing "body" at <.>: range can’t iterate over {[product-names…] [product-images…] [product-links…] [product-prices…]}
Continue readingIs it possible to implement a Python for range loop without an iterator variable?
Issue Is it possible to do following without the i? for i in range(some_number): # do something If you just want to do something N amount of times and don’t need the iterator. Solution Off the top of my head,
Continue readingProcess a list with a loop, taking 100 elements each time and automatically less than 100 at the end of the list
Issue Is there a way to use a loop that takes the first 100 items in a big list, does something with them, then the next 100 etc but when it is nearing the end it automatically shortens the “100”
Continue readingThis For Loop works for the first sheet, but not for the subsequent sheets
Issue Dim a As Integer Dim RNG As Range For i = 1 To 24 Sheets("IntangibleAssets").Select Set RNG = wksht.Range("F10:F63") Selection.Copy Range("E10").Select Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False ‘ Move onto next tab, macro starts again from the beginning
Continue readingIterating through integers not found in a list of ranges in Python
Issue So, I have a function which outputs a list of ranges, e.g. [range(1,5),range(8,13)]. I need to iterate through those integers which are not in a range in this list. For example, using the previous list I would like to
Continue readingMerge rows across defined set of columns in VBA
Issue I want to merge a group of rows (keeping all the contents of each row) and then move on to the next column in a defined cell range. I’m trying to expand this Excel VBA code (https://excelchamps.com/vba/merge/) to a
Continue readingWhat happens when my Python range object stop value is never hit?
Issue I’m learning python and I have a little snippet that is shown below: for i in range(-10, 11, -6): print(i) This did not throw up an error nor give an output. Surprisingly I expected an error, since that stop
Continue readingPrinting random Phone Numbers in a range
Issue I’m trying to print a large list of phone numbers. In this context, phone numbers have a format (24)999999999. (Parenthesis for clarity, they are incidental.) I need this list to be randomized, with certain constraints. The first two digits
Continue readingHow do I change the height of dynamically created elements using JavaScript?
Issue I’ve dynamically created a fretboard with 6 strings. Each are given a height of 8px using the class of .string:before. How do I give each string a height value taken from the stringGauge array so that as they are
Continue readingFailed to looping javascript with HTML table
Issue I failed to looping data with javascript and show it inside HTML table, the failed is the data that shown is not right as i expected, the data is outside the table, how to make the data show inside
Continue readingHow to bind style on-click in a loop
Issue I’ve an array of objects (items) that can be incremented with other items, I show them by looping into the array. see: and I would like to high-light an item when I click on it (e.g. : another border-top-color),
Continue readingHow to do a for loop in a array with a index that contain object
Issue I’m trying to do a for loop in a array like this: a0C7X0000056xmxUAA: { attributes: { type: ‘GRD__c’, url: ‘/services/data/v53.0/sobjects/GRD__c/a0C7X0000056xmxUAA’ }, Id: ‘a0C7X0000056xmxUAA’, Name: ‘Lote-6155066’, Guia__c: [ a0Y7X000006RUHxUAO: [Object], a0Y7X000006RUI2UAO: [Object] ] }, a0C7X0000056x9EUAQ: { attributes: { type: ‘GRD__c’,
Continue readingIssue with displaying data from an API into the HTML, pure Javascript
Issue I must use only vanilla JS for this, no jQuery or frameworks (which would make life much easier)… But here’s the JS file: let candidates = []; const getCandidates = () => { axios.get(‘<a certain endpoint here, the endpoint
Continue readingLooping through array of booleans to determine which object to include in another array
Issue I have a Javascript question related to mapping. So I have two arrays… Array1 [ { "id": 1, "name": "admin" }, { "id": 2, "name": "analyst" }, { "id": 3, "name": "reviewer" }, { "id": 4, "name": "administrator" },
Continue readingHow to get typewriter to loop?
Issue I want to figure out how to get the typewriter to loop infinitely with a subtle delay. Currently, it only triggers on page load. <!DOCTYPE html> <html> <body> <h1>Typewriter</h1> <p id="demo"></p> <script> var i = 0; var txt =
Continue readinghow to stop the first click loop after click next run
Issue every click I do a loop in js, but when I click next the first loop is still running, finally there is a double loop on the same id, how do I stop the first loop and replace it
Continue readingIn vue js with the help of loop i am showing all elements and i want to hide one element from that but all elements are getting hide
Issue First Image without clicking on Edit Second Image when i click on Edit here when i click on which ever edit button all the task which is in loop plus it is in if part will be hidden and
Continue readingAdding HTML in a if-statement
Issue I want the html to open when the password is right and I have tried .js, document.write, .html, href, div, document.getElementById and nothing is working when it’s inside the if condition but I need it in there so it
Continue readingWhile loop not terminating even after the 'return'
Issue I am using the while loop to iterate through an array and trying to terminate the loop using the return (I tried foreach before which doesn’t terminate for return but the while loop should terminate with the use of
Continue readingfailed to insert data into variable with looping node js
Issue i try to insert data into variable with looping on node js inside function, but when i try to push the data into telegram bot, the variable is empty, how to insert the data into the variable properly. the
Continue readingchange values while reading a file / shell scripting loops ,
Issue I have a log file that looks like this, <tr><td>AAA-application-01 <br> Qality_gate_failed_reason:xxxxxxx </td></tr> <tr><td>AAA-application-02 <br> Qality_gate_failed_reason:xxxxxxx </td></tr> <tr><td>BBB-application-03 <br> Qality_gate_failed_reason:xxxxxxx </td></tr> <tr><td>BBB-application-04 <br> Qality_gate_failed_reason:xxxxxxx </td></tr> <tr><td>CCC-application-01 <br> Qality_gate_failed_reason:xxxxxxx </td></tr> <tr><td>CCC-application-02 <br> Qality_gate_failed_reason:xxxxxxx </td></tr> <tr><td>CCC-application-03 <br> Qality_gate_failed_reason:xxxxxxx </td></tr> I am
Continue readingLoop iterating over a list of BeautifulSoup Parse Tree Elements terminating too early
Issue I am taking an Intro to Data Science Course and my first task is to extract certain Data Fields from each country page from the CIA World Factbook. Although I have recently become aware that there is easier ways
Continue readingGet data from array of object in Angular
Issue I have an array of objects in my angular app and I am trying to read data in objects with "for loop" and I got nothing in the console. Here are the model and other details how I created
Continue readingUsing a for loop to update with a class method – not working
Issue I’m trying to create an array of objects with a "Node" class constructor. Each Node should have an array containing neighbouring nodes. When I use a for loop to iterate through each Node to add neighbours, it triggers the
Continue readingFor Looping data in html and SketchUp
Issue I have an array of data in SketchUp which I need to present to html in a table format. I have an example of my code which I have hard-coded. ID = [["Harry", "22", "Male"],["Sam", "19", "Male"],["Christine", "23", "Female"]]
Continue readingUsing a for loop to update with a class method – not working
Issue I’m trying to create an array of objects with a "Node" class constructor. Each Node should have an array containing neighbouring nodes. When I use a for loop to iterate through each Node to add neighbours, it triggers the
Continue readingHow to call a function with data from foreach method in HTML string?
Issue I am generating some html card and buttons from an array. I want to call a function with the data from the foreach. But I can’t seem to figure it out. I am getting the problem in the renderProducts()
Continue readingI need help understanding a Javascript function used to search a list with a search bar so I can modify it to search a table
Issue I’m working on a college assignment where I use a PHP class to generate table values which a Javascript function then searches with a search bar. It builds off of a previous assignment that uses the same search bar
Continue readinghow to append and remove div based on textbox value
Issue Here is my code i want to append data based on all three textbox if textbox value is 2 and textbox2’s value is 3 and textbox3’s value is 1 the The result will be 2 apple 3banans and 1
Continue readingForEach function not performing actions on each object, only once
Issue Im building a Deck building application for a card game, i also have a database setup that i use to sell these cards i play with, this deck builder effectively allows me to take from the stock of the
Continue readingLoop two-level nested lists in SCSS to create a dynamic @font-face
Issue I have a list like: $fonts: ( primary: ( extra-light: ( family:’Literata’, weight: 200, style: normal, display: swap, src: url(‘/assets/fonts/Literata-Regular.woff2’), ), light: ( family: ‘Literata’, weight: 300, style: normal, display: swap, src: url(‘/assets/fonts/Literata-Regular.woff2’), ), regular: ( family: ‘Literata’, weight:
Continue readingI need help understanding a Javascript function used to search a list with a search bar so I can modify it to search a table
Issue I’m working on a college assignment where I use a PHP class to generate table values which a Javascript function then searches with a search bar. It builds off of a previous assignment that uses the same search bar
Continue readingI need help understanding a Javascript function used to search a list with a search bar so I can modify it to search a table
Issue I’m working on a college assignment where I use a PHP class to generate table values which a Javascript function then searches with a search bar. It builds off of a previous assignment that uses the same search bar
Continue readingCreate a new array of objects by property value from existing object add existing objects to new array
Issue I have an existing array of objects which share a property titled type like so [ { id: 1, name: ‘a’, type: ‘foo’, },{ id: 2, name: ‘b’, type: ‘bar’, },{ id: 3, name: ‘c’, type: ‘fizz’, },{ id:
Continue readingCreate a new array of objects by property value from existing object add existing objects to new array
Issue I have an existing array of objects which share a property titled type like so [ { id: 1, name: ‘a’, type: ‘foo’, },{ id: 2, name: ‘b’, type: ‘bar’, },{ id: 3, name: ‘c’, type: ‘fizz’, },{ id:
Continue readingdjango templates disappearing on refresh
Issue I have constructed a news aggregator website which shows 10 headlines with corresponding images, scraped from https://thestar.com ( The Toronto Star ) , using bs4. Here’s a photo for reference: However, the major problem is, Everytime i refresh the
Continue readingWrite a function which editUser if the user exist in the users array?
Issue I am using the array.map higher order function with a ternary operator to check the condition. I am not familiar with the method Object.assign I tried a solution for the question, but it gives no return in the console,
Continue readingUsing loop for showing data from table MySQL
Issue So I create a webpage where I sort my data out of MySQL. My main problem is based on a loop. I used an if statement and it only work for 1 row at a time, not filtering my
Continue readingUsing loop for showing data from table MySQL
Issue So I create a webpage where I sort my data out of MySQL. My main problem is based on a loop. I used an if statement and it only work for 1 row at a time, not filtering my
Continue readingLoop two-level nested lists in SCSS to create a dynamic @font-face
Issue I have a list like: $fonts: ( primary: ( extra-light: ( family:’Literata’, weight: 200, style: normal, display: swap, src: url(‘/assets/fonts/Literata-Regular.woff2’), ), light: ( family: ‘Literata’, weight: 300, style: normal, display: swap, src: url(‘/assets/fonts/Literata-Regular.woff2’), ), regular: ( family: ‘Literata’, weight:
Continue readingForEach function not performing actions on each object, only once
Issue Im building a Deck building application for a card game, i also have a database setup that i use to sell these cards i play with, this deck builder effectively allows me to take from the stock of the
Continue readingWrite a function which editUser if the user exist in the users array?
Issue I am using the array.map higher order function with a ternary operator to check the condition. I am not familiar with the method Object.assign I tried a solution for the question, but it gives no return in the console,
Continue readingloop through returned results node.js
Issue I am getting results returned from my request made to my server. It is returning multiple lines, in which each line is a new entry into the array. So right now I am logging it as: completion.data.choices[0].text and it
Continue readingAngular loop through Object in array
Issue Hi this is my angular project and I want to get userName of user for every posted comment. The entities are from my spring boot project. Is there a way to get a username for every comment? This is
Continue readingLimit the number of times an HTML5 video plays
Issue I know I can loop a video infinitely using the ‘loop’ attribute. But can I limit the number of times the video loops to perhaps 5 times? Solution You will need to use JavaScript to achieve this. Have a
Continue readingHow to count the total digit/numbers, the odd numbers and even numbers respectively in a php loop
Issue I want to count the total numbers in the pyramid loop and I want to count all the odd and even numbers respectively. There is a problem in my code where odd and even numbers are incorrectly counted. The
Continue readingPHP Uploads with loop array
Issue I’m uploading files into cloud files and, but they have a limit of 100 uploads/second per container, so what I’m trying to do is, if the upload fails, I tried again. while (!$object = $container->uploadObject($remoteFile, $handle));{ $container = $objectStoreService->getContainer($containerName);
Continue readingHow to print images in a loop in html the code is shared below
Issue I have made a loop of image urls through python and now I want to display all the images on html page using all the image urls,i am using jinja for loop. what am I doing wrong here ,
Continue readingAngular 5 w/Angular Material – Extracting an object property from ngFor to use in component
Issue <div *ngFor=”let player of players”> <h4 mat-line>{{player.firstName}} {{player.lastName}} – {{player.id}}</h4> </div> I’m doing a HTTP get call from my player.service.ts file, and then looping through the player object that gets returned, printing out the firstName, lastName and id properties
Continue readingMap an array to access dictionary values in TypeScript
Issue I’m learning, So I have the next code… const numbers = { one: "1", two: "2", three: "3" } const arr= ["one","one","two","one","three"] arr.map((each)=>numbers[each]) If I do numbers["one"] I get "1", but it is not working with the array, for
Continue readingadding alternative class for sets of items in angular loop?
Issue how can I add two classes alternatively for three three sets of items in ngFor angular. Please refer image. Solution You could use the following. Where i is the index in loop. *ngFor=”let i of [1,2,3,4,5,6,7,8,9]” [style.background-color]=”check(i) ? ‘red’
Continue readingAngular 2 databinding in the object
Issue When you loop through the object , is there a way I can dynamically put angular handlers inside angular handlers? Array ‘editor’ with list of items. It has 4 top level items with id ( 1,2,3) It has 2
Continue readingIs there a nicer way of iteration and comparing objects in 2 arrays?
Issue I am still fresh in JS/Angular, and maybe I dont know about something. I am having 2 arrays: : boardP1: BoardCellModel[][] and forbiddenCells: BoardCellModel[]. And I want to know, if in the first array there are cells matching cells
Continue readingHow to iterate through all tags of a website in Python with Beautifulsoup?
Issue I’m a newbie in this sector. Here is the website I need to crawling "http://py4e-data.dr-chuck.net/comments_1430669.html" and here is it source code "view-source:http://py4e-data.dr-chuck.net/comments_1430669.html" It’s a simple website for practice. The HTML code look something like: <html> <head> <title>Welcome to the
Continue readingFor loop Iteration in reactjs table
Issue I am learning to use the props and refactor the code in Reactjs. While working on the table to print the data I am repeating the table heading each time. Table.js import React from "react"; const Table = ({
Continue readingGet all descendants of an entry
Issue I have a huge referral system (Over 500k entries) that works like this [{id: 1, name: "John", ref: 0}, {id: 2, name: "Jack", ref: 1}, {id: 3, name: "Bill", ref: 1}, {id: 5, name: "Jason", ref: 2}, {id: 6,
Continue readinghow to use foreach loop with css
Issue hi I am trying to get data from the database by the use of foreach loop in Laravel, I want to organize them horizontally.I mean the fist group of data beside second group of data. The problem is that
Continue readingSASS : How to generate a map using a loop
Issue My goal is to generate a SASS map to store variants of colors that are stored in the following map: $colors : ( jet : #333333, wintergreen-dream : #588C73, eton-blue : #8FC0A9, sunglow : #FFC33C, light-kaki : #F2E394, bege
Continue readingAngular 2 Cannot find control with unspecified name attribute on formArrays
Issue I am trying to iterate over a formArray in my component but I get the following error Error: Cannot find control with unspecified name attribute Here is what the logic looks like on my class file export class AreasFormComponent
Continue readingPass json string having dynamic data as a source to primeNG datatable
Issue I’ll be getting json dynamically from service as follows: {“items”:[[{“key”: “SerialID”,”value”: “P1.M1.T1”},{ “key”: “Description”, “value”: “Dummy Desc 1”},{ “key”: “Label”, “value”: “A123”}],[{“key”: “SerialID”,”value”: “P1.M1.T2”},{ “key”: “Description”, “value”: “Dummy Desc 2”},{ “key”: “Label”, “value”: “B123”}]]} Here, sample 2 rows in
Continue readingHow to access the property of objects obtained after a forEach?
Issue I receive from the backend an array of nested objects, I go through them to modify values and filter according to conditions I need for my application const data = this.market; data.forEach(function(item: any, i) { if (item.functional_id === ‘cool’)
Continue readingthis in the DOM and event listeners
Issue Could some one please tell me how to refactor the JavaScript without "this" in a way that explains the use of "this" in the browser context? (please don’t answer the following question with jQuery solutions) I have passed e
Continue reading