Roaming Eagles

From the BBC:
Roaming Eagles - https://www.bbc.com/news/world-europe-50180781
And what'll happen when the Russian eagles discover Instagram and start taking selfies from Iran and other far-away places?

Thursday, October 24, 2019

Award from General Motors

After more than 31 years of working, with the last 2 and a half years of it being with GM, I received my first ever professional award.
Thank you GM!

Monday, October 21, 2019

Monday, October 14, 2019

Tuesday, October 1, 2019

Execution Speeds of Java Collections

Execution Speeds of Java Collections - List/for, Array/for, List/foreach, Array/foreach

===Results==

List/for 3697
Array/for 1548
List/foreach 5654
Array/foreach 5659

===Code====

List list = new ArrayList(); Integer[] arr = new Integer[6000000]; Random rand = new Random(12345); for (int i = 0; i < 6000000; i++) { list.add(rand.nextInt(5000)); arr[i] = rand.nextInt(); } int chk = 0; Stopwatch watch = new Stopwatch(); watch.start(); for (int rpt = 0; rpt < 100; rpt++) { int len = list.size(); for (int i = 0; i < len; i++) { chk += list.get(i); } } watch.stop(); System.out.println("List/for: " + watch.elapsedMillis()); chk = 0; watch = watch.reset(); watch = watch.start(); for (int rpt = 0; rpt < 100; rpt++) { for (int i = 0; i < arr.length; i++) { chk += arr[i]; } } watch.stop(); System.out.println("Array/for: "+ watch.elapsedMillis()); chk = 0; watch = watch.reset(); watch = watch.start(); for (int rpt = 0; rpt < 100; rpt++) { for(Integer i: list) { chk += i; } } watch.stop(); System.out.println("List/foreach: " + watch.elapsedMillis()); chk = 0; watch = watch.reset(); watch = watch.start(); for (int rpt = 0; rpt < 100; rpt++) { for(Integer i: list) { chk += i; } } watch.stop(); System.out.println("Array/foreach: " + watch.elapsedMillis());