#array list
Explore tagged Tumblr posts
ratter-dreams · 15 days ago
Text
Tumblr media
Theres a long journey ahead of you.
148 notes · View notes
valiantarcher · 1 year ago
Text
Since the 2023 Book List was helpful for working through some books this year, I think I'd like to give it a shot again next year. I've got about a dozen books on the list so far, mostly rereads and some Reader's Choice options to clear out things from my shelves and I'd like to have fifteen total again. Would anyone like to throw out some book suggestions for consideration, please? Thank you! :)
19 notes · View notes
arshikasingh · 9 months ago
Text
How to convert List to Array?
Let us see how to convert List to Array:
Tumblr media
4 notes · View notes
retphienix · 2 years ago
Text
I should spend a week or so farming plat so I can buy the final few weapons I'm missing....
but also I like wasting resources and time making silly builds instead~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fuck
Anyways, after my grinds tonight I am now down to 18 mastery items (non intrinsic) left.
3 are syndicate weapons I just need to trade for.
2 are the ESO vandal weapons because RNG is evil and ESO is boring.
1 is Hema which I plan on sitting down and grinding out the rest of the samples to get it "legit". We are reasonably invested, so a little while of deimos farming with multiple boosters should do it.
Then the remaining 12 are prime weapons that I'm missing like a single part for each, so not too expensive on that front but a bit tedious to map out.
Every day my various collections get a little closer to being finished ^^
7 notes · View notes
camthecatchameleon · 2 years ago
Text
listened to Dream Sweet in Sea Major by Miracle Musical with Good Omens in mind right after binging the second season and actually /srs started tearing up
Tumblr media
Edit: I made more!
Part 1 / Part 2 / ?
17 notes · View notes
javafullstackdev · 1 year ago
Text
JavaCollections: Your Data, Your Way
Master the art of data structures:
List: ArrayList, LinkedList
Set: HashSet, TreeSet
Queue: PriorityQueue, Deque
Map: HashMap, TreeMap
Pro tips:
Use generics for type safety
Choose the right collection for your needs
Leverage stream API for elegant data processing
Collections: Because arrays are so last century.
2 notes · View notes
snzical · 1 year ago
Text
this project is easy as fuck actually (a finger on the monkeys paw curls)
4 notes · View notes
uk07 · 1 year ago
Text
Help my stupid code wont work
3 notes · View notes
nodogsallowed · 1 year ago
Text
just finished never let me go - kazuo ishiguro im so normal about this. watching the movie tonight 4 sure
3 notes · View notes
1o1percentmilk · 1 year ago
Text
remember when wordle came out and every programmer and their mother was making algorithms to automate guessing it. those were good times
3 notes · View notes
lazaruspiss · 1 year ago
Text
hm. never too early to make up my own kinktober prompts.
1 note · View note
oshaviolater · 2 years ago
Text
i feel like the clock is ticking too fuckin fast nd every single day i spend not grinding leetcode is going to kill my career like no. no is dsa even imp in the holy year of 2023 or not that missed Microsoft internship is fucking Killin me.
3 notes · View notes
premise29 · 10 months ago
Text
I was going to reblog this but i thought, "hey i should do the tier list first. I could share my results and everyone would have a great time."
There were so many effing dragons OP. There were sooooooo many dragons. It's not possible to give an accurate rating when i was just desperately trying to get the dragons to go somewhere, anywhere.
Anyways... love your art. If anyone else wants to do the tier list make sure you have plenty of time. 10 minutes? More than that. 20 minutes? More than that. If you go into it attempting to give honest ratings, schedule for half an hour minimum.
Tumblr media
based on a real conversation I had with my brother just now. which means you can do the dragon tier list
4K notes · View notes
justnshalom · 3 months ago
Text
When to Use an Array and When to Use a Linked List in JavaScript
Introduction As a JavaScript developer, you are likely familiar with arrays and linked lists. Both of these data structures have their own advantages and use cases. In this article, we will discuss when to use an array and when to use a linked list in JavaScript, along with example code to demonstrate their usage. When to Use an Array Arrays are one of the most commonly used data structures in…
0 notes
engenhariadesoftware · 10 months ago
Text
C# Programming Challenge: Student Registration System
Welcome to this programming challenge designed for beginners in C#. In this exercise, you’ll create a simple student registration system. This challenge will help you practice fundamental programming concepts such as handling user input, working with lists, and using basic control structures. Challenge Description You are tasked with developing a basic console application for a school that…
0 notes
jcmarchi · 10 months ago
Text
All About JavaScript Loops
New Post has been published on https://thedigitalinsider.com/all-about-javascript-loops/
All About JavaScript Loops
Every programming language has loops. Loops perform an operation (i.e., a chunk of work) a number of times, usually once for every item in an array or list, or to simply repeat an operation until a certain condition is met.
JavaScript in particular has quite a few different types of loops. I haven’t even used all of them, so for my own curiosity, I thought I’d do a high-level overview of them. And as it turns out, there are pretty good reasons I haven’t used at least a couple of the different types.
So, for now let’s spend a while exploring the different types of loops, what we can do with each of one, and why you might use one over another. (You’ll think that little play on words is absolutely hilarious by the end.)
The while and do...while loops
First up is the while loop. It’s the most basic type of loop and has the potential to be the easiest to read and the fastest in many cases. It’s usually used for doing something until a certain condition is met. It’s also the easiest way to make an infinite loop or a loop that never stops. There is also the do...while statement. Really, the only difference is that the condition is checked at the end versus the beginning of each iteration.
// remove the first item from an array and log it until the array is empty let queue1 = ["a", "b", "c"]; while (queue1.length) let item = queue1.shift(); console.log(item); // same as above but also log when the array is empty let queue2 = []; do let item = queue2.shift() ?? "empty"; console.log(item); while (queue2.length);
The for loop
Next is the for loop. It should be the go to way to do something a certain number of times. If you need to repeat an operation, say, 10 times, then use a for loop instead. This particular loop may be intimidating to those new to programming, but rewriting the same loop in the while-style loop can help illustrate the syntax make it easier to stick in your mind.
// log the numbers 1 to 5 for (let i = 1; i <= 5; i++) console.log(i); // same thing but as a while loop let i = 1; // the first part of a for loop // the second while (i <= 5) console.log(i); i++; // the third ("end");
The for...of and for await...of loops
A for...of loop is the easiest way to loop through an array.
let myList = ["a", "b", "c"]; for (let item of myList) console.log(item);
They aren’t limited to arrays though. Technically they can iterate through anything that implements what is called an iterable protocol. There are a few built-in types that implement the protocol: arrays, maps, set, and string, to mention the most common ones, but you can implement the protocol in your own code. What you’d do is add a [Symbol.iterator] method to any object and that method should return an iterator. It’s a bit confusing, but the gist is that iterables are things with a special method that returns iterators; a factory method for iterators if you will. A special type of function called a generator is a function that returns both a iterable and iterator.
let myList = *[Symbol.iterator]() yield "a"; yield "b"; yield "c"; , ; for (let item of myList) console.log(item);
There is the async version of all the things I just mentioned: async iterables, async iterators, and async generators. You’d use an async iterable with for await...of.
async function delay(ms) return new Promise((resolve) => setTimeout(resolve, ms); ); // this time we're not making an iterable, but a generator async function* aNumberAMinute() let i = 0; while (true) // an infinite loop yield i++; // pause a minute await delay(60_000); // it's a generator, so we need to call it ourselves for await (let i of aNumberAMinute()) console.log(i); // stop after one hour if (i >= 59) break;
One unobvious thing about for await...of statement is that you can use it with non-async iterables and it will work just fine. The reverse, however, is not true; you can’t use async iterables with the for...of statement.
The forEach and map loops
While these are not technically loops per se, you can use them to iterate over a list.
Here is the thing about the forEach method. Historically it was much slower than using a for loop. I think in some cases that may not be true anymore, but if performance is a concern, then I would avoid using it. And now that we have for...of I’m not sure there is much reason to use it. I guess the only reason that it still may come up is if you have a function ready to use as the callback, but you could easily just call that same function from inside the body of for...of.
forEach also receives the index for each item though, so that may be a thing you need too. Ultimately, the decision to use it will probably come down to whether any other code you’re working with uses it, but I personally would avoid using it if I’m writing something new.
let myList = ["a", "b", "c"]; for (let item of myList) console.log(item); // but maybe if I need the index use forEach ["a", "b", "c"].forEach((item, index) => console.log(`$index: $item`); );
Meanwhile, map essentially converts one array into another. It still has the same performance impact that forEach has, but it is a bit nicer to read than the alternative. It’s certainly subjective though, and just like with forEach you’ll want to do what the rest of your other code is doing. You see it a ton in React and React-inspired libraries as the primary way to loop through an array and output a list of items within JSX.
function MyList(items) return ( <ul> items.map((item) => return <li>item</li>; ) </ul> );
The for...in loop
This list of loops in JavaScript wouldn’t be complete without mentioning the for...in statement because it can loop through the fields of an object. It visits fields that are inherited through the object’s prototype chain too, though, and I’ve honestly always avoided it for that reason.
That said, if you have an object literal, then for...in might be a viable way to iterate through the keys of that object. Also it’s worth noting that if you’ve been programming JavaScript for a long time, you may remember that the order of keys use to be inconsistent between browsers, but now the order is consistent. Any key that could be an array index (i.e., positive integers) will be first in ascending order, and then everything else in the order as authored.
let myObject = a: 1, b: 2, c: 3, ; for (let k in myObject) console.log(myObject[k]);
Wrapping up
Loops are something that many programmers use every day, though we may take them for granted and not think about them too much.
But when you step back and look at all of the ways we have to loop through things in JavaScript, it turns out there are several ways to do it. Not only that, but there are significant — if not nuanced — differences between them that can and will influence your approach to scripts.
0 notes