Win a copy of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 this week in the Java in General forum!

Roger Frybarger

Greenhorn
+ Follow
since Apr 12, 2020
Instead of duplicating my "About" info here, just head over to my website tutoringbyroger.com. That info will be better curated anyway.
Cows and Likes
Cows
Total received
2
In last 30 days
0
Total given
0
Likes
Total received
3
Received in last 30 days
0
Total given
5
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Roger Frybarger

Tim Holloway wrote:... likely to have legal consequences. Definitely have legal consequences if you tried doing it with an Oracle JVM.


Yes. That was definitely one of the many issues I ran into.

Also a related piece of advice: If you ever do try to experiment with creating .exe files, I would strongly advise that you avoid running them in your main system in case things go... ummm..... Badly. I would advise that you install a virtual machine and run your experimental .exe files in there. That way there is a bit of a barrier preventing your main system from potential damage.
1 year ago
Given that I was in a similar situation a few years ago, I thought I would share a few tips/discoveries from my research:

1. I am not a lawyer, so won’t discuss the legality of virtualizing Mac OS. However, it does seem that Apple doesn’t want you to do that.

2. Even if you do manage to virtualize Mac OS you may not be happy with the outcome. I have heard that there are many driver issues and stability problems since Apple only focuses on making drivers for their specific hardware. Certainly there are workarounds available, but they take time to research, time to fiddle with, and often work only on particular hardware if they work at all.

3. If you allow your virtual Mac OS to auto-update you will likely spend a lot of time fixing the things that the update broke, if they are fixable at all. However, if you don’t allow your virtual Mac OS to update, you will be testing your code against a version of the OS that may not reflect the OS that your users are currently using.

4. You may have issues attempting to publish, sign, and/or distribute your code from such a sketchy/unstable platform.


In the end, I eventually borrowed a Mac from a friend to do the final testing before I published my program. If I had it to do over again, I would seriously consider one of the web-based services that allow you to remotely access their real Mac hardware over the internet. Here are a few websites that seem to offer such services, but others may exist:  macincloud.com, macstadium.com, macweb.com. Personally, I feel that if you factor in the cost of the time you would need to invest in order to virtualize a Mac, a web-based solution will clearly be the cheaper option. It will probably yield a more conducive environment for testing and publishing stuff as well.

I hope that helps,
1 year ago
Having run into this same situation a few years ago when I was first learning Java, I thought I would share a few things I learned/discovered in the hope that they will be helpful to you:


1. Because there are people in this world who wish to distribute malicious .exe files, it has become extremely difficult to distribute homemade .exe files. When I tried to do this a few years ago I ran into roadblocks at every turn. I found I couldn’t email them to others, I couldn't share them using file sharing sites, and I couldn’t install them without them being flagged as potentially malicious. I could discuss at length about how unfair and frustrating that is to those who don’t want to make money from their programs, but that topic is a can of worms for another post and another day.

2. Eventually, after many months of trial and error and frustration at every turn, I gave up on trying to distribute my programs as .exe files. I found that it simply wasn’t worth the trouble and expense. If you are working inside a business that already has the ability to sign .exe files, or you have already built up a reputation over many years, then distributing your program as a .exe file might make sense. However, in your situation, I would strongly suggest that you avoid the trouble of trying to distribute a .exe file.

3. If you are just trying to share your code with others as an example of what you have built, I would suggest that you investigate the following alternate:
At the moment that I am writing this, it seems that https://repl.it/languages/java10 will allow anyone, (with or without an account), to paste in Java code and run it virtually. This means that your friends can simply go to this website, paste in your code and run it. They won’t have to mess around with downloading Java or installing anything that they may or may not trust. It also means that even if you were distributing something malicious, the potential damage it could cause to their computer would be limited since they could simply close their browser. Don’t get me wrong. There is no such thing as 100% security. However, asking your friends to go to a web page is a lot less intimidating than asking them to install Java, especially given Java’s history as a vector for malicious exploitation.

At the moment, that website isn’t the greatest when handling graphical programs, and I haven’t tried it on a mobile device, but at least it will give your friends some form of visual output when viewed on the desktop. You might be able to experiment further and get better results than I did. Here is a slightly modified version of your code that seems to at least run, albeit with warnings, in the aforementioned website:

In the file named Main.java paste in this:


And create another file named MainMenu.java and paste in this:



Beyond this particular website you might be able to find other sites that perform a similar function.

I hope that helps,
1 year ago

Campbell Ritchie wrote:Since the question was asked on Tuesday, and it was Monday (at least in my time zone) by the time you posted your solution, I cannot see that posting a complete answer can do any harm.



Awesome! Thanks Campbell Ritchie!    That helps me feel better about what, how, and when to post. Actually that gives me an idea: I may scout out old posts that don't seem to include a conclusion and provide some kind of complete answer of sorts. We'll see if I have the time for that, but I would certainly enjoy tying up loose ends in that way to aid future readers. Anyhow, thanks again.  
1 year ago
So, I am hoping that I'm not giving away too much here, but this is only my first answer on this site, so I am hoping a moderator will let me know if I am within the bounds of what is considered an acceptable amount of help. Anyhow, here is a code snipit that I created to test if the variable x is equal to 1 without using any if statements. It should at least give you a way to get around the rather odd requirement of not using if statements. It also seems to handle some of the exception handling as well. I have no idea if this is anything like what your assignment is looking for, but I hope it gives you a starting point. You will still need to figure out how to get the user's input into the variable x, and expand the program as necessary to handle all the other various cases. You will also need to ensure that it is in line with what your assignment is looking for, and that it works correctly. You should also check to see if your course has even covered the applicable subject material yet. If you haven't yet covered lambda or the "pass" keyword, this may not be what your assignment is looking for. I have also included the sources of where I found the various pieces that I used to build this snipit, so you should check those out as well to see how I figured out how to put the pieces together.

Anyhow, without further ado, here is the code snipit and sources and description:



Also, I tested this code snipit in Python version 3.6.9, so hopefully it should work on your machine.

I hope that helps.
1 year ago
Hi all, I thought I should give everyone here advanced notice about at some free online tutoring that I will be giving away tomorrow, (May 7th, 2020), starting at 1:00pm AZ/Phoenix time. Anyone interested in scheduling a free online programming tutoring session with me can find out all the details on the "Free Tutoring" page of my website, tutoringbyroger.com. This is a great opportunity if perhaps you are looking to pick up some programming knowledge over the summer, and would like a human to show you the ropes live via videoconferencing. These free tutoring sessions will probably go quickly though, so get yours before they are all gone! Thanks,

PS: I may do more free tutoring giveaways like this in the future, so be sure to check out my website and see if I am giving away free tutoring sessions. You might just get lucky!
1 year ago
Awesome! Thanks for spreading the word Campbell Ritchie!  
1 year ago
Hi all,

    First off, I'd like to thank Coderanch and JavaRanch for supplementing my learning as I worked through my own introductory programming courses back in the spring of 2014! That introduction to Java inspired me to shift my college coursework more towards Information Technology. Eventually, I ended up earning my bachelors degree in Technology Management from Northern Arizona University, which involved taking several programming courses. I had been an on-campus math tutor at my local community college since about 2012, and as I finished my various programming courses, I started occasionally tutoring students in these subjects as well. However, I always yearned to be able to do this type of work remotely. Therefore, I set about building a website for such remote tutoring in my free time. From there, along came our current coronavirus pandemic, and a new rush of free time. This has allowed me to finally finish that website and start accepting appointments from students! Thus, to any programming greenhorns out there who feel too lost to even know what question to ask, you are welcome to schedule a tutoring session with me! To do so, simply head over to my website: www.tutoringbyroger.com. I would be happy to help remotely guide you through your programmatic journey.
1 year ago