diff --git a/enter/.obsidian/plugins/recent-files-obsidian/data.json b/enter/.obsidian/plugins/recent-files-obsidian/data.json index bbe7c75..ddc5b48 100644 --- a/enter/.obsidian/plugins/recent-files-obsidian/data.json +++ b/enter/.obsidian/plugins/recent-files-obsidian/data.json @@ -1,13 +1,13 @@ { "recentFiles": [ - { - "basename": "Java", - "path": "Java.md" - }, { "basename": "Fortran", "path": "Coding Tips (Classical)/Terminal Tips/Languages/Fortran.md" }, + { + "basename": "Java", + "path": "Coding Tips (Classical)/Terminal Tips/Languages/Java.md" + }, { "basename": "6. Sample Bookkeeping", "path": "Coding Tips (Classical)/Project Vault/Comms/WRITTEN TEXT/E-Mail Settings/6. Sample Bookkeeping.md" diff --git a/enter/.obsidian/workspace.json b/enter/.obsidian/workspace.json index 6c5cf85..c42b23f 100644 --- a/enter/.obsidian/workspace.json +++ b/enter/.obsidian/workspace.json @@ -130,7 +130,7 @@ "state": { "type": "markdown", "state": { - "file": "Java.md", + "file": "Coding Tips (Classical)/Terminal Tips/Languages/Fortran.md", "mode": "source", "backlinks": false, "source": false @@ -200,7 +200,7 @@ "state": { "type": "outline", "state": { - "file": "Java.md" + "file": "Coding Tips (Classical)/Terminal Tips/Languages/Fortran.md" } } }, @@ -210,7 +210,7 @@ "state": { "type": "outgoing-link", "state": { - "file": "Java.md", + "file": "Coding Tips (Classical)/Terminal Tips/Languages/Fortran.md", "linksCollapsed": false, "unlinkedCollapsed": true } @@ -237,8 +237,8 @@ }, "active": "5ea761f970043868", "lastOpenFiles": [ + "Coding Tips (Classical)/Terminal Tips/Languages/Java.md", "Coding Tips (Classical)/Terminal Tips/Languages/Fortran.md", - "Java.md", "Coding Tips (Classical)/Project Vault/Comms/WRITTEN TEXT/E-Mail Settings/6. Sample Bookkeeping.md", "Coding Tips (Classical)/Project Vault/Comms/WRITTEN TEXT/E-Mail Settings/E-Mail.md", "Coding Tips (Classical)/Project Vault/Comms/WRITTEN TEXT/E-Mail Settings/5. Quantum Cover Letter.md", diff --git a/enter/Coding Tips (Classical)/Terminal Tips/Languages/Fortran.md b/enter/Coding Tips (Classical)/Terminal Tips/Languages/Fortran.md index 04c17e6..e10242b 100644 --- a/enter/Coding Tips (Classical)/Terminal Tips/Languages/Fortran.md +++ b/enter/Coding Tips (Classical)/Terminal Tips/Languages/Fortran.md @@ -1,7 +1,7 @@ Fortran stands for **For**mula **Tran**slating System - a programming language developed in 1857 at IBM. program hello_world.f90 -``` +```fortran program first implicit none ! write 'Hello World!' to stdout @@ -18,7 +18,7 @@ $ ./hello_world All code taked place between the program first and end program first statements, where first is the nmae given to the program. The `!` indicates a comment and the `write(*,*)` instructs the computer to write the statement Hello World to the screen, indicated by the first asterisk using free-format, the second asterisk. The implicit none if a very important statement as well. -``` +```fortran program temperature implicit none ! declare variables diff --git a/enter/Java.md b/enter/Coding Tips (Classical)/Terminal Tips/Languages/Java.md similarity index 96% rename from enter/Java.md rename to enter/Coding Tips (Classical)/Terminal Tips/Languages/Java.md index a5ec88f..a9fb4ac 100644 --- a/enter/Java.md +++ b/enter/Coding Tips (Classical)/Terminal Tips/Languages/Java.md @@ -2,6 +2,8 @@ The very first object-oriented language I learned when I was 19 in my computer science & engineering program at school. I had my professor Jeff Meunier teaching us through making projects which, looking back, was the best way that he could have taught us Java to be honest. It was and still is an incredibly verbose language but at the end we made a cool project with a music beat to it. I struggled with it before but I wonder how well I would do at it now. +This was the main part of the code that I was really stoked that I figured out. Looking back i don't really know why... + ```java public Chord(Sound[] sounds) @@ -25,7 +27,7 @@ Recommended reading in the Murach book: -#### Steps +#### Steps for the old java synthesizer assignment @@ -46,7 +48,7 @@ Make a `IPublisher` and `ISubscriber` class/interface - In IPublisher interface copy&paste: -``` +```java public interface IPublisher { @@ -62,7 +64,7 @@ public interface IPublisher - In ISubscriber interface copy&paste: -``` +```java public interface ISubscriber { @@ -90,7 +92,7 @@ There will be redlines and therefore right click to automatically correct Create a constructor: -``` +```java public Broadcaster(int max_subscribers){ int [ ] array = _iSubscriberholder; @@ -109,7 +111,7 @@ private int[ ] _iSubscriberholder 5. Creating the subscribe method in the Broadcaster class -``` +```java private int x = 0; @Override @@ -138,7 +140,7 @@ public void subscribe(ISubscriber subscriber){ example: -``` +```java /**  * Broadcasts a message to multiple subscribers. @@ -264,7 +266,7 @@ to fix: don’t call notify method on null array location  -11.  Copy&Paste Broadcaster class and rename as `Sequencer` +11.  Copy&Paste `Broadcaster`class and rename as `Sequencer` @@ -328,7 +330,7 @@ TestSubscriber notified, name = second code should look like this: -``` +```java public static void main(String[] args) { @@ -547,11 +549,8 @@ instance. lolwut? It works like this: -``` +```java - - -``` for(some loop) { @@ -562,6 +561,9 @@ for(some loop) } + +``` + @@ -582,7 +584,7 @@ You should hear all three sounds played at the same time -34. create a SoundBank class in the model package +34. create a `SoundBank` class in the model package @@ -590,12 +592,16 @@ You should hear all three sounds played at the same time 35.  Give this class a constructor that has a Sound array parameter and stores that array in a member var iable. +```java + Sound [ ] _soundbanks; SoundBank(Sound[ ] y){ y = _soundbanks;} +``` + @@ -607,6 +613,8 @@ y = _soundbanks;} 37.  TestSoundBank  +```java + public static void main(String[] args) { @@ -626,16 +634,23 @@ public static void main(String[] args)  c.notify(null); } +``` + Also make sure that this works: +```java Chord c = sb.chord(new int[]{0, 1, 2}); +``` + 38.  Test this in the main class: +```java + public static void main(String[] args)  { @@ -700,6 +715,8 @@ public static void main(String[] args)  } +``` + It should work, sequence of 16 beats that repeats twice  @@ -721,4 +738,3 @@ Delete these classes: -** \ No newline at end of file