Dustin Wright

Ranch Hand
+ Follow
since Aug 27, 2014
Dustin likes ...
Android Eclipse IDE Chrome
Omaha, NE
Cows and Likes
Cows
Total received
1
In last 30 days
0
Total given
0
Likes
Total received
5
Received in last 30 days
0
Total given
11
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Dustin Wright

No problem!  I can easily buy your book from the fine folks at No Starch Press.  Multiple ebook formats all DRM free!  Need that to work with my app that reads to me called "Voice Dream".  Thank you so much Dr.  You've really made my day!
9 months ago
Thank you very much Dr. Dr. Tuckfield,


I'd like to get to full production applications.  However, baby steps.  Your book does sound like it's a good fit for me!  Thank you for mentioning Daniel Zingaro.  You've given me lots to think about and yes, my low vision is not my biggest issue.  Easily my biggest issue is my crushing lack of self confidence as a result of my disability.  I can't hide it.  I can't fix it and in the 1970s, 80s, and even into the 90s the world was not kind to those with impairments.  At least not in small town Midwest USA.  I'm older now and try to not let the past interfere with the future.  As is easy to tell, I've not fully defeated my demons.

Again thank you and I hope I win!  Should I win, may I have a PDF instead of a physical book?
9 months ago
Dr. Tuckfield,


Thank you for doing the giveaway and being here on the forum.  Looking at the books description on Amazon I'm unable to determine if your book is appropriate for a person like me.  Please let me know your thoughts.  I've wanted to learn to be a programmer since I was a kid in the 1970s.  I've tried many times and have realized I may simply lack the cognitive ability and/or intelligence to do this kind of work.  My wife of 15 years has observed as we interact with people such as repair people in our home or out in retail sales/service personnel encounters it appears to take me an inordinate amount of time to process what someone says in order to respond.  Every attempt I've made at learning to code has ended with me getting to the point of making the transition to object oriented programming.  It seems once I try to deal with polymorphism and inheritance I start to have real difficulty in understanding what I'm doing.  What stops me cold is problem solving.  It seems I have an insurmountable obstacle with this task.  Often I know I lack domain knowledge.  Of course I can't write code to solve a problem, if I don't understand the problem.  For example, a recent attempt was to create a knowledge base web application.  Of course I can Google this and likely find an example, but at that point, I'm nearly taking someone elses existing application and tweaking it to be my own.  Honestly at the moment, I've let go of the goal to change careers to be a programmer. (I'm 52 and "legally blind".  Very hard to find am employer when you have two strikes against you from the word go.)  My goal now is simply to do it for my own benefit.  So, having said all of this, might your book help me learn how to write code such that I could actually write a complete application of my original work?

Forgive my long-windedness and thank you for your time.
9 months ago

Hello.  From the Amazon description "...junior developers capable of writing basic Java code...". Please help me understand what you mean.  What do you consider basic Java?  Thank you!

Should I be chosen, may I please have an ebook copy?  My eyesight is too poor to read physical books.  Thank you!
Hello Don.  What mathematical skills must I possess to become a successful, EMPLOYABLE programmer?  I'm 51.  School was a long time ago.  Is your book a tool to help me acquire this skill?

"Who This Book Is For
Those new to programming and Java but have some background in mathematics and are at least comfortable with using a computer."


Thanks.
1 year ago
Victory!

Thank you, Mr. Murach.

3 years ago
Hello All!

It seemed to get too complicated to try to explain via text, so I made a video.  I'm trying to solve Exercise 1 of Chapter 10, Murach's Java 5th edition.  The exercise/solution files are freely available on Murach's site https://www.murach.com/shop/murach-s-java-programming-5th-edition-detail

Thank you all so much!!!

3 years ago
Thank you!  It appears to be in order now.  I suspect this could be written more compactly.  Please bear with me, I'm very much a novice.

3 years ago

Paweł Baczyński wrote:You never update the firstChar variable.
So, if the character at index 0 is not a letter or digit then the loop never stops until the string is too short and an invocation of substring throws an exception.



Thank you!  I see that now.
3 years ago
Hello all,

I'm trying to read in words from a file and remove any non-letter chars from either or both ends of each word.  I thought a while loop would do this, but I'm getting unexpected results.  I'm trying to use a while loop because I've seen instances of two non-letter chars beginning a word.  However, it seems what the code is actually doing is whittling down each word to nothing.  Doesn't the while loop check each iteration if the firstChar isn't a letter or digit?  Maybe I don't understand a while loop?

Thank you!



Here's the output from the console:

3 years ago
Thanks for trying to help, I have no URL to put a screenshot on.  It's not that big a deal.  It's just the sample code.
4 years ago
Thanks, but something is wrong, Compiling it again with the wildcard worked.  It still will not run.  Again, this is the sample code.  I've not changed it.  Other code runs on my machine, so I know it's not my PC.
4 years ago
Hello all,

Please bear with me I'm on my lunch break and have to do this quickly.  I'm working through the book.  In chapter 2 is the guessing game.  I have the sample code from WikedlySmart.com below.  It appears to have been compiled as there are both .java and .class files in the folder.
Sample Code

I tried to run the game from the sample code folder:

C:\Users\nzero\Google Drive\Development\Head First Java\Sample Code\Head-First-Java-master\chap02>java GameLauncher
Error: Could not find or load main class GameLauncher

C:\Users\nzero\Google Drive\Development\Head First Java\Sample Code\Head-First-Java-master\chap02>


I then tried to copy the .java files to an empty folder and recompile it.  That results in this:

C:\Users\nzero\Google Drive\Development\Head First Java\Sample Code\Head-First-Java-master\chap02\Test>javac GameLauncher.java
GameLauncher.java:5: error: cannot find symbol
       GuessGame game = new GuessGame();
       ^
 symbol:   class GuessGame
 location: class GameLauncher
GameLauncher.java:5: error: cannot find symbol
       GuessGame game = new GuessGame();
                            ^
 symbol:   class GuessGame
 location: class GameLauncher
2 errors

I've not modified the code.  What might I be doing wrong?

Thanks.
4 years ago
This is rather unprofessional of me.  I don't see how to edit my post.  I'm not allowed to attach a PDF.  Here's the test of the assignment:

A PDF of the programming exercise can be found in the Resources tab.

For files related to this assignment, visit the DukeLearnToProgram Project Resources page for this course: http://www.dukelearntoprogram.com/course2/files.php. Also linked in the Resources tab.

You can also find the frequently asked questions page for this course’s assignments on DukeLearnToProgram: http://www.dukelearntoprogram.com/course2/faq.php. Also linked in the Resources tab.

Part 1: Finding a Gene - Using the Simplified Algorithm

This assignment is to write the code from the lesson from scratch by following the steps below. This will help you see if you really understood how to put the code together, and might identify a part that you did not fully understand. If you get stuck, then you can go back and watch the coding videos that go with this lesson again. We recommend you try this with many of the future Java coding examples before starting programming exercises.

Specifically, you should do the following:

1. Create a new Java project named StringsFirstAssignments. You can put all the classes for this programming exercise in this project.

2. Create a new Java Class named Part1. The following methods go in this class.

3. . Write the method findSimpleGene that has one String parameter dna, representing a string of DNA. This method does the following:

Finds the index position of the start codon “ATG”. If there is no “ATG”, return the empty string.
Finds the index position of the first stop codon “TAA” appearing after the “ATG” that was found. If there is no such “TAA”, return the empty string.
If the length of the substring between the “ATG” and “TAA” is a multiple of 3, then return the substring that starts with that “ATG” and ends with that “TAA”.
4. Write the void method testSimpleGene that has no parameters. You should create five DNA strings. The strings should have specific test cases, such as: DNA with no “ATG”, DNA with no “TAA”, DNA with no “ATG” or “TAA”, DNA with ATG, TAA and the substring between them is a multiple of 3 (a gene), and DNA with ATG, TAA and the substring between them is not a multiple of 3. For each DNA string you should:

Print the DNA string.
See if there is a gene by calling findSimpleGene with this string as the parameter. If a gene exists following our algorithm above, then print the gene, otherwise print the empty string.
Part 2: Finding a Gene - Using the Simplified Algorithm Reorganized

This assignment will determine if a DNA strand has a gene in it by using the simplified algorithm from the lesson, but organizing the code in a slightly different way. You will modify the method findSimpleGene to have three parameters, one for the DNA string, one for the start codon and one for the stop codon.

Specifically, you should do the following:

1. Create a new Java Class named Part2 in the StringsFirstAssignments project.

2. Copy and paste the two methods findSimpleGene and testSimpleGene from the Part1 class into the Part2 class.

3. The method findSimpleGene has one parameter for the DNA string named dna. Modify findSimpleGene to add two additional parameters, one named startCodon for the start codon and one named stopCodon for the stop codon. What additional changes do you need to make for the program to compile? After making all changes, run your program to check that you get the same output as before.

4. Modify the findSimpleGene method to work with DNA strings that are either all uppercase letters such as “ATGGGTTAAGTC” or all lowercase letters such as “gatgctataat”. Calling findSimpleGene with “ATGGGTTAAGTC” should return the answer with uppercase letters, the gene “ATGGGTTAA”, and calling findSimpleGene with “gatgctataat” should return the answer with lowercase letters, the gene “atgctataa”. HINT: there are two string methods toUpperCase() and toLowerCase(). If dna is the string “ATGTAA” then dna.toLowerCase() results in the string “atgtaa”.

Part 3: Problem Solving with Strings

This assignment will give you additional practice using String methods. You will write two methods to solve some problems using strings and a third method to test these two methods.

Specifically, you should do the following:

1. Create a new Java Class named Part3 in the StringsFirstAssignments project. Put the following methods in this class.

2. Write the method named twoOccurrences that has two String parameters named stringa and stringb. This method returns true if stringa appears at least twice in stringb, otherwise it returns false. For example, the call twoOccurrences(“by”, “A story by Abby Long”) returns true as there are two occurrences of “by”, the call twoOccurrences(“a”, “banana”) returns true as there are three occurrences of “a” so “a” occurs at least twice, and the call twoOccurrences(“atg”, “ctgtatgta”) returns false as there is only one occurence of “atg”.

3. Write the void method named testing that has no parameters. This method should call twoOccurrences on several pairs of strings and print the strings and the result of calling twoOccurrences (true or false) for each pair. Be sure to test examples that should result in true and examples that should result in false.

4. Write the method named lastPart that has two String parameters named stringa and stringb. This method finds the first occurrence of stringa in stringb, and returns the part of stringb that follows stringa. If stringa does not occur in stringb, then return stringb. For example, the call lastPart(“an”, “banana”) returns the string “ana”, the part of the string after the first “an”. The call lastPart(“zoo”, “forest”) returns the string “forest” since “zoo” does not appear in that word.

5. Add code to the method testing to call the method lastPart with several pairs of strings. For each call print the strings passed in and the result. For example, the output for the two calls above might be:

The part of the string after an in banana is ana.
The part of the string after zoo in forest is forest.
Part 4: Finding Web Links

Write a program that reads the lines from the file at this URL location, http://www.dukelearntoprogram.com/course2/data/manylinks.html, and prints each URL on the page that is a link to youtube.com. Assume that a link to youtube.com has no spaces in it and would be in the format (where [stuff] represents characters that are not verbatim): “http:[stuff]youtube.com[stuff]”

Here are suggestions to get started.

1. Create a new Java Class named Part4 in the StringsFirstAssignments project and put your code in that class.

2. Use URLResource to read the file at http://www.dukelearntoprogram.com/course2/data/manylinks.html word by word.

3. For each word, check to see if “youtube.com” is in it. If it is, find the double quote to the left and right of the occurrence of “youtube.com” to identify the beginning and end of the URL. Note, the double quotation mark is a special character in Java. To look for a double quote, look for (\”), since the backslash (\) character indicates we want the literal quotation marks (“) and not the Java character. The string you search for would be written “\”” for one double quotation mark.

4. In addition to the String method indexOf(x, num), you might want to consider using the String method lastIndexOf(s, num) that can be used with two parameters s and num. The parameter s is the string or character to look for, and num is the last position in the string to look for it. This method returns the last match from the start of the string up to the num position, so it is a good option for finding the opening quotation mark of a string searching backward from “youtube.com.” More information on String methods can be found in the Java documentation for Strings: http://docs.oracle.com/javase/7/docs/api/java/lang/String.html.

Caution: The word Youtube could appear in different cases such as YouTube, youtube, or YOUTUBE. You can find the URLs more easily by converting the string to lowercase. However, you will need the original string (with uppercase and lowercase letters) to view the YouTube URL to answer a quiz question because YouTube links are case sensitive. The link https://www.youtube.com/watch?v=ji5_MqicxSo is different than the link https://www.youtube.com/watch?v=ji5_mqicxso, where all the letters are lowercase.
4 years ago