Arlon's CSUMB Java Software Design CST-338 Module 6 Learning Journal 14 for the week Wed 04/07-Tues 04/13, year 2021

Prescribed questions:

What experience do you have with UML diagrams? I just learned them two weeks ago, and helped make one just a few minutes ago!

Are they used at your workplace? I work in a programming and appraisal office - for myself - and no, I've never used them until two weeks ago.

Have you done multithreading in any language before? Oh yes, all kinds, and cross-the-internet-threading with a Comet Javascript PHP Ajax framework I built for my reversi game, Super Bomb Reversi. You can make a new thread in JavaScript too with:

// JavaScript new thread:
setTimeout( ()=>{ console.log( 'new thread?');/*This stuff runs in a new thread!*/ },0);

Which is good for all kinds of stuff - animations, etc.

Did you find Patterns to be helpful? I definitely agree with extrapolating and creating a logical framework - MVC is a great route if you can't think of your own - I have a few of my own paradigms similar to MVC and often invent new ones.

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

MVC in Java

Now you got my attention. I had a blast with the project. I'm mostly for MVC. It works good with Ajax too because you can send data and render html. It's a good principle. I don't necessarily structure my own programs exactly MVC, but basically. I probably go further and in slightly different directions than that actually in my real programs, not the old ones though. What I do is I take the public/private paradigm a little further too with method inner classes, and move them out when found more generally applicable. That makes for fast building and logical flow and encapsulation.

Also, the complexity introduced here makes up for the apparent simplicity in the beginning of the class, demonstrating that it really is an accelerated course. It may seem slow in the very beginning but you get to play with a big huge mess during MVC week. Java, programming, and MVC knowledge help a lot in actually keeping up. By about 1/3 to the middle of the course on, I'd think if you weren't already a pretty good Java programmer you may be in over your head.

I learned a syntax blip from this class I've never seen before, and I used it in this assignment. It's pretty obvious but I'd never seen it - definitely a missing piece for me until now:

controller.new CardButtonAction()

instance.new Bla()

Cool! And I'm using it all over the place now. Here's some lines I created with it:

class Tricks{
   class Console{
      class Colors{
         String color(int what){return "\u001b["+what+"m";}
         String c(int what){return color(what);}
         String reset(){return color(0);}
         String rst(){return reset();}
         class BG{
            String aqua(){return color(46);}
            String random(){return color(40+(int)(8*Math.random()));}
            String rnd(){return random();}
		 }
         class Text{
            String red(){return color(31);}
            String aqua(){return color(36);}
            String random(){return color(30+(int)(8*Math.random()));}
            String rnd(){return random();}
         }
      }
   }
}

Tricks.Console.Colors c=new Tricks().new Console().new Colors();
Tricks.Console.Colors.BG bg=c.new BG();
Tricks.Console.Colors.Text tx=c.new Text();

String fiftyBackspaces="\b",fb=fiftyBackspaces;
for(int i=0;i<52;i++)fb=fiftyBackspaces+fb;
fiftyBackspaces=fb, test="anything "+Math.random();
int seconds=0;

out.print((seconds++>0?""+fb:"")+("1283 "+Math.random()).substring(0,16)+
   (test).substring(0,16)+tx.rnd()+" random?"+bg.rnd()+" random bg?"+c.rst()+" reset?");

You can sneak this into the program in one big line for colors in the console like:

/* api */class Tricks{class Console{class Colors{String color(int what){return "\u001b["+what+"m";}String c(int what){return color(what);}String reset(){return color(0);}String rst(){return reset();}class BG{String aqua(){return color(46);}String random(){return color(40+(int)(8*Math.random()));}String rnd(){return random();}}class Text{String red(){return color(31);}String aqua(){return color(36);}String random(){return color(30+(int)(8*Math.random()));}String rnd(){return random();}}}}}Tricks.Console.Colors c=new Tricks().new Console().new Colors();Tricks.Console.Colors.BG bg=c.new BG();Tricks.Console.Colors.Text tx=c.new Text();

// program
String fiftyBackspaces="\b",fb=fiftyBackspaces;for(int i=0;i<52;i++)fb=fiftyBackspaces+fb;fiftyBackspaces=fb;
int seconds=0;
String test="anything "+Math.random();
out.print((seconds++>0?""+fb:"")+("1283 "+Math.random()).substring(0,16)+
   (test).substring(0,16)+tx.rnd()+" random?"+bg.rnd()+" random bg?"+c.rst()+" reset?");

This week we invented our own collaboration sub-system based on gitHub and were finally able to live-collaborate similar to if we were using Google Docs - not quite that smooth - but - merging and then keeping each page up to the most current as often as possible - I've been on this boat before - MBARI - they just sit there all day - rough seas - whatever - programming their robots - the underwater robots they have. It sort of inspired me to be sort of like that, so I just turned on the camera and sat and worked on the game for as long as I could, and everyone else did the same, we patched as many bugs as we could and nearly finished it. I think out layout glitch might be because my timer adds itself in after the frame packs but I tried re-pack and I never did work that one out. I think there were a couple other minor bugs we were just about to work out with traces but then time ran out. We had a blast with the project.

Comments

Popular posts from this blog

Module 2 Learning Journal 1-19-21

Service Learning Journal 56, Friday week 8 CST-462s Race,gender, Class in the Digital World

Arlon's CSUMB Intro to HTML CSS JavaScript Node PHP and Web Programming CST-336 Modules 8 Learning Journal #8/#48 for the week Wed 12/15-Tues 12/21, year 2021