{"id":24021107,"url":"https://github.com/zipcodecore/monkeystypewritersohmy","last_synced_at":"2025-07-19T03:34:40.860Z","repository":{"id":36325345,"uuid":"175488564","full_name":"ZipCodeCore/MonkeysTypewritersOhMy","owner":"ZipCodeCore","description":null,"archived":false,"fork":false,"pushed_at":"2025-04-20T20:20:29.000Z","size":5,"stargazers_count":0,"open_issues_count":11,"forks_count":41,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-01T01:29:43.552Z","etag":null,"topics":["corejava","corejava-chapter14"],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ZipCodeCore.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2019-03-13T19:48:25.000Z","updated_at":"2025-04-20T20:20:33.000Z","dependencies_parsed_at":"2023-10-17T23:32:21.915Z","dependency_job_id":null,"html_url":"https://github.com/ZipCodeCore/MonkeysTypewritersOhMy","commit_stats":null,"previous_names":["zipcodecore/monkeystypewritersohmy"],"tags_count":0,"template":true,"template_full_name":null,"purl":"pkg:github/ZipCodeCore/MonkeysTypewritersOhMy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZipCodeCore%2FMonkeysTypewritersOhMy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZipCodeCore%2FMonkeysTypewritersOhMy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZipCodeCore%2FMonkeysTypewritersOhMy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZipCodeCore%2FMonkeysTypewritersOhMy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ZipCodeCore","download_url":"https://codeload.github.com/ZipCodeCore/MonkeysTypewritersOhMy/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZipCodeCore%2FMonkeysTypewritersOhMy/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265883683,"owners_count":23843793,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["corejava","corejava-chapter14"],"created_at":"2025-01-08T12:38:47.685Z","updated_at":"2025-07-19T03:34:40.838Z","avatar_url":"https://github.com/ZipCodeCore.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MonkeysTypewritersOhMy\n\n## Monkey Typewriter\nAccording to Wikipedia:\n\n\u003e The infinite monkey theorem states that a monkey hitting keys at random on a typewriter keyboard for an infinite \namount of time will almost surely type a given text.\n\nWe don't have that kind of time, but what we do have are super smart monkeys.  These monkeys are able to copy text.\n\nSo, guess what?  We're starting a printing company powered entirely off of monkey typists.\n\n### What to do!\nTesting multithreaded applications is SUPER difficult.  Even moreso, there's a chance that (if you're not actually\ntesting things correctly) your tests will occasionally pass when they shouldn't (since a poorly threaded application\nisn't guaranteed to mess anything up).  Instead, we're going to use the main method in `Monkey Typewriter` to see\nexactly what happens when things are threaded incorrectly vs correctly.\n\n### Part 1\n\nMade for you is an abstract base class of `Copier` which has a constructor that takes a String and turns that into\nan iterator.  This will allow us to traverse the text to be copied and pass it along to each monkey (thread).\n\nExtend `Copier` in `UnsafeCopier`.  Then, write a `run` method that will have the monkey grab the next word and append\nit to the copy.\n\nModify `MonkeyTypewriter` to create 5 monkeys (threads) using the `UnsafeCopier` and start them.\n\nAfter the sleep, print out the results of the unsafely copied passage.\n\n### Part 2\n\nFinish the `SafeCopier` and then call that from the main method, in addition to the unsafe version.\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzipcodecore%2Fmonkeystypewritersohmy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzipcodecore%2Fmonkeystypewritersohmy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzipcodecore%2Fmonkeystypewritersohmy/lists"}