「これがarray」 つ int[] a = {...}; a.length
「これがArrayList」 つ ArrayList al = ...; al.size()
娘氏「全部同じ(なのに違う)じゃないですかー」
ワイ「ちがいますよー」「これだからしろうとはダメだ!もっとよく見ろ!」
※別に簡単ではなかった
「これがarray」 つ int[] a = {...}; a.length
「これがArrayList」 つ ArrayList al = ...; al.size()
娘氏「全部同じ(なのに違う)じゃないですかー」
ワイ「ちがいますよー」「これだからしろうとはダメだ!もっとよく見ろ!」
※別に簡単ではなかった
I've always known using += was bad, so I've been using ArrayList instead...
Apparently generic lists are significantly faster and aren't under threat of deprecation, lol
learn.microsoft.com/...
I've always known using += was bad, so I've been using ArrayList instead...
Apparently generic lists are significantly faster and aren't under threat of deprecation, lol
learn.microsoft.com/...
A experiência é algo que cê não compra mesmo não
A experiência é algo que cê não compra mesmo não
- o uso de streams implica 10x penalidade
- usar linkedlist para appendar é melhor do que arraylist
Usei JMH para tentar simular e não encontrei nada disso...
- o uso de streams implica 10x penalidade
- usar linkedlist para appendar é melhor do que arraylist
Usei JMH para tentar simular e não encontrei nada disso...
ArrayList al1();
I've seen code like this, and it's a nightmare to maintain.
ArrayList al1();
I've seen code like this, and it's a nightmare to maintain.
https://magicmarcy.de/sieb-des-eratosthenes-primzahlen-systematisch-finden
#Primzahlen #Sieb #Eratosthenes #Vielfachen #ArrayList #Coding #Programming #Java #NamendProblems #SiebDesEratosthenes
https://magicmarcy.de/sieb-des-eratosthenes-primzahlen-systematisch-finden
#Primzahlen #Sieb #Eratosthenes #Vielfachen #ArrayList #Coding #Programming #Java #NamendProblems #SiebDesEratosthenes
This is a thread about data structures. 🧵 1/8
– Lenkede lister kan lagre enorme mengder informasjon, men tilgangen er treg. 😅
This is a thread about data structures. 🧵 1/8
No sé seguir, y eso tampoco está bien...
No sé seguir, y eso tampoco está bien...
Finalmente encontrei o código pra completar a primeira tarefa do Nathan. A primeira print é os condicionais do spawn de inimigos nos primeiros andares da dungeon. A segunda é a dungeon gerando esses spawns a partir do primeiro código. Complexo, mas consegui!
#gamedev
Finalmente encontrei o código pra completar a primeira tarefa do Nathan. A primeira print é os condicionais do spawn de inimigos nos primeiros andares da dungeon. A segunda é a dungeon gerando esses spawns a partir do primeiro código. Complexo, mas consegui!
#gamedev
You could use the exact right collection, but typically ArrayList was just as performant.
You could use the exact right collection, but typically ArrayList was just as performant.
donraab.medium.com/one-positive...
donraab.medium.com/one-positive...
One can choose any map implementation they want:
Map<K, List<V>> m = ...;
m.computeIfAbsent(key, ArrayList::new).add(value);
You can use `collections.defaultdict` and the built-in `list`.
This creates a dictionary that maps every single key to an empty list by default.
Then, appending to a key means adding a value to that key.
But this is “cheating”.
Why is it cheating..?
One can choose any map implementation they want:
Map<K, List<V>> m = ...;
m.computeIfAbsent(key, ArrayList::new).add(value);
var list = new ArrayList<>();
What do you think is the type? (Hint: It's not what you think, no matter what you think...)
var list = new ArrayList<>();
What do you think is the type? (Hint: It's not what you think, no matter what you think...)
private static final List
Some parts of the code may keep adding elements without removing them, eventually leading to memory exhaustion.
#Java #MemoryManagement
private static final List
Some parts of the code may keep adding elements without removing them, eventually leading to memory exhaustion.
#Java #MemoryManagement