Arlon's CSUMB Java Software Design CST-338 Module 3 Learning Journal 11 for the week Wed 03/17-Tues 03/23, year 2021

Arlon's CSUMB Java Software Design CST-338 Module 3 Learning Journal 11 for the week Wed 03/17-Tues 03/23, year 2021
<script type="text/javascript">

   <!--

/*    Arlon's CSUMB Java Software Design CST-338 Module 3 Learning Journal 11

                for the week Wed 03/17-Tues 03/23, year 2021



Prepared questions: What is the largest multi-dimensional array that you have used?

What is the largest that you think would be unwieldy and why?

What does inheritance do for your classes? Have you used it in the past? How?

Update your learning journal from what you experienced this week with class.



I have been programming for 33 years and since we don't necessarily visually

see or remember everything we create I really have absolutely no idea what the

biggest multi-dimensional array a program I've made has used has been, but in

computer science 21 - algorithms class - at Cabrillo with Professor Hodges - we 

made 3000x3000 mazes generated with disjoint sets - I think that had a huge array

in it. My CompBlaster program can parse MLS rows which is probably a huge

ArrayList of ArrayLists but I'm not positive. I don't really know, because it's

hard to remember the exact implementation of every algorithm I've made or

every program I've made. I've had programs that got out of control before,

for sure. When I was making my Minesweeper solver - it simulates actual

clicks on the screen, with java.awt.Robot - more than once, building it - 

I lost control and saw it click too much or all over the place and I had to kill

the program with the computer's power button!! Since I'm not exacty sure what

the biggest array I've ever made is, I'll make it here, now, with JavaScript,

the biggest array you can possibly make in JavaScript - and probably the biggest

array I've ever used right here:

*/     // do not actually run this with this:

	 var ybig = [], bigger = /* Number.MAX_SAFE_INTEGER */

	    /* Just kidding: do not run that. */ 5; // run that instead.

	 for( var i = 0 ; i < bigger ; i++ ){

	    ybig[i] = [];

	    for( var j = 0 ; j < bigger ; j++ )ybig[i][j] = i + ' ' + j + '!';

	 }

	 for( var i = 0 ; i < bigger ; i++ )for( var j = 0 ; j < bigger ; j++ )

	    console.log( 'Line 16 ybig[i][j] is: ' + ybig[i][j] );

/*   And that has to be the biggest  multi-dimensional array I've ever made, at
least in JavaScript, because that's the biggest you can make in JavaScript - 
                 - Number.MAX_SAFE_INTEGER. It's 9007199254740991.

Don't believe me? Hit F12, make sure you see 'console', type:
                                                      Number.MAX_SAFE_INTEGER
                                                       and then hit >Enter<

 (If you enter that into the JavaScript console, you should see: 9007199254740991)

     Do not run a loop with that - the universe could implode - 
 I'm just being silly but - that's way too big of a number to use! 
   Your computer could get stuck - or over heat - or something - 
                         - I don't know.

As far as what I'd think would be a good idea to run - anything in the millions

and for sure billions, or above I'd definitely think twice about making - I'm not

sure of what to say any practical limit is but I'm well familiar with writing 

in something that will make the program try and do to much, loops that take up

too much processing power, there are all kinds of things that can go wrong.

If there is any output - better keep the loop in the thousands - output to 

the screen makes a HUGE, HUGE, HUGE difference in the performance of loops. As

Professor Hodges of Cabrillo College says, 'If you're lucky - you get errors. 

If you're unlucky - you don't notice until something is really going wrong.'



Then after I wrote all that I realized: maybe they actually meant: largest - 

 - as-in - largest number of dimensions! Ok, that is a different question. I'm 

still not sure though. Floyd Warshall algorithm comes to mind and any time 

I've tried to solve games, you make an array of pieces and an array of where

they are and an array of choices they could make and an array of all possible

choices and an array of future choices - that can get deep - robot brains - 

I have made one or two of those. Braveheart baby, the online reversi playing

robot for Super Bomb Reversi. So I still don't know exactly but I've made

very multi-dimensional arrays of multi-dimensional arrays upon arrays in

various programs.



And my accounting software, AccountBlaster - makes any arbitary level of multi-

dimensional arrays of accounts. Accounts have accounts which have accounts 

which have acounts. Each account is an array of accounts - the user can 

define as multi-dimensional of a system as they want!



For example, you could make this in AccountBlaster, and transfer money around:



            Bank< Account 1<List of transactions

          /       Account 2<List of transactions

       Me<

World<     Wallet - List of transactions - and transactions - ARE accounts!

      \                                          \

       Everywhere You Spend Money Listed          Refund to Transaction 5 etc. 

	Place 1

	Store 2

	  Etc... And that can go as multi-dimensional as you want it to!!



I use inheritance where it's appropriate, and I love the concept, although

actually using the paradigm is not as common as you might think.



One thing it's good for is versioning and feature-sets too. 

Bla extends bla, and here's some more features for you. I've used it for this

when I had a rock-solid component I needed to add features onto. 



The classic sense of inheritance/polymorphism is often something you do in 

the beginning of designing a program - usually you know right when you design 

the program where inheritance will come in handy, and then maybe later for

extending features.



So I guess it's sort of a top down design paradigm. It's fun to write in because

it matches natural hierarchical classification paradigm like Kingdom>Phylum>

class>order>family>genus>species - if you think about it - the arrows should 

actually be fans outward: Kingdom<Phylum<class<...etc because each is a list - 

 - a multi-dimensional array.



I'm not sure why Bart's not allowed to use the paradigm, because it's a very

useful paradigm.



This week's class topics were wrapper classes, variable references, objects

as parameters, arrays, object references, inheritance design and implementation.



Other topics included deep copy vs shallow copy and specifically arrays of 

objects (generally speaking in real life - it's more common to use a

 java.util.ArrayList<whatever>... so you can shrink/grow it more simply - 

sometimes arrays are simpler though, too, but the two options go hand-in-hand.)



The other aspect of this weeks learning was learning to use GitHub which was 

greatly appreciated and very effective at helping our team create our team 

program of dealing hands with a working deck of cards as this weeks programming 

project.									*/

   //-->

</script>

Comments

Popular posts from this blog

Module 2 Learning Journal 1-19-21

Arlon's CSUMB ProSeminar CST300 Module 4 Learning Journal for the week Wed 1/27-Tues 2/2, year 2021

Arlon's CSUMB ProSeminar CST300 Module 8 Learning Journal for the week Wed 02/24-Saturday 02/27, year 2021 - Journal 8