-
-
Notifications
You must be signed in to change notification settings - Fork 36
Adds a cheatsheet for Java fixes issue #42 #45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Adds a cheatsheet for Java fixes issue #42 #45
Conversation
@@ -0,0 +1,227 @@ | |||
<?xml version="1.0" encoding="UTF-8"?> | |||
|
|||
<section xml:id="ap-java-cheatsheet" xmlns:xi="http://www.w3.org/2001/XInclude"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems odd to include a section AFTER the backmatter. This seems like an appendix
to me and should be xi:included inside the backmatter. Therefore it should also have an appendix
tag instead of a section
PreTeXt tries to help you semantically structure your book. Its worth following its lead!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your help! I've now made the change, converting the section to an appendix and including it inside the backmatter tag. I will make sure to follow PreTeXt's lead on structure in the future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This leaves the repo in a broken state. Maybe you have some uncommitted changes?
- The closing tag of the index needs to be replaced. Maybe you accidentally deleted it?
- You need to change main.ptx to include the new appendix where it should go.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is better, but it needs a full checkover. Here are some issues I see immediately:
- Floor Division //: This operator does not exist in Java. Java uses regular / for division, and for integer division, you'd use / with integer operands or Math.floorDiv().
- Exponent **: This operator does not exist in Java. Java uses Math.pow() for exponentiation.
- Logical operators and, or, not: These are Python operators, not Java. Java uses &&, ||, and !.
There is a LOT here! Often, less is better than more. I recommend we only include things that are discussed in this text, which is supposed to be a simple transition. Do we really want bitwise operations, for example?
This is much improved! Let's make a few more changes:
|
This adds Python and Java equivalent functions, operators, and one-liners to show how different operators are. This should help the students with Python knowledge.