-
Notifications
You must be signed in to change notification settings - Fork 1
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
docs/howto/ensure-int-is-odd-or-even: Ensuring that an integer value is either odd or even #97
Labels
content idea
Idea for a new piece of content
good first issue
Good for newcomers
howto
For content that in the "howto" diataxis quadrant
Comments
It'd be worth checking in on cue-lang/cue#2926 to see if a standard-library-based solution could also be demonstrated. |
cueckoo
pushed a commit
to cue-lang/cuelang.org
that referenced
this issue
Mar 9, 2024
This adds a Commented Cue guide demonstrating how to ensure that a given number is even/odd. Examples are provided for the 4 different validation outcomes. For cue-lang/docs-and-content#97 Preview-Path: /docs/howto/ensure-int-is-odd-or-even/ Change-Id: Ibc7a31dcbbb13a8d155f30731c961691e47d79ed Signed-off-by: Noam Dolovich <noam.tzvi.dolovich@gmail.com>
cueckoo
pushed a commit
to cue-lang/cuelang.org
that referenced
this issue
Mar 9, 2024
This adds a Commented Cue guide demonstrating how to ensure that a given number is even/odd. Examples are provided for the 4 different validation outcomes. For cue-lang/docs-and-content#97 Preview-Path: /docs/howto/ensure-int-is-odd-or-even/ Change-Id: Ibc7a31dcbbb13a8d155f30731c961691e47d79ed Signed-off-by: Noam Dolovich <noam.tzvi.dolovich@gmail.com>
cueckoo
pushed a commit
to cue-lang/cuelang.org
that referenced
this issue
Mar 9, 2024
This adds a Commented Cue guide demonstrating how to ensure that a given number is even/odd. Examples are provided for the 4 possible different validation outcomes. For cue-lang/docs-and-content#97 Preview-Path: /docs/howto/ensure-int-is-odd-or-even/ Change-Id: Ibc7a31dcbbb13a8d155f30731c961691e47d79ed Signed-off-by: Noam Dolovich <noam.tzvi.dolovich@gmail.com>
cueckoo
pushed a commit
to cue-lang/cuelang.org
that referenced
this issue
Mar 12, 2024
This adds a Commented Cue guide demonstrating how to ensure that a given number is even/odd. Examples are provided for the 8 different validation outcomes, based on the following matrix: - odd/even - positive/negative - valid/invalid For cue-lang/docs-and-content#97 Preview-Path: /docs/howto/ensure-int-is-odd-or-even/ Change-Id: Ibc7a31dcbbb13a8d155f30731c961691e47d79ed Signed-off-by: Noam Dolovich <noam.tzvi.dolovich@gmail.com>
cueckoo
pushed a commit
to cue-lang/cuelang.org
that referenced
this issue
Mar 12, 2024
This adds a Commented Cue guide demonstrating how to ensure that a given number is even/odd. Examples are provided for the 8 different validation outcomes, based on the following matrix: - odd/even - positive/negative - valid/invalid For cue-lang/docs-and-content#97 Preview-Path: /docs/howto/ensure-int-is-odd-or-even/ Change-Id: Ibc7a31dcbbb13a8d155f30731c961691e47d79ed Signed-off-by: Noam Dolovich <noam.tzvi.dolovich@gmail.com>
cueckoo
pushed a commit
to cue-lang/cuelang.org
that referenced
this issue
Mar 12, 2024
This adds a Commented Cue guide demonstrating how to ensure that a given number is even/odd. Examples are provided for the 8 different validation outcomes, based on the following matrix: - odd/even - positive/negative - valid/invalid For cue-lang/docs-and-content#97 Preview-Path: /docs/howto/ensure-int-is-odd-or-even/ Change-Id: Ibc7a31dcbbb13a8d155f30731c961691e47d79ed Signed-off-by: Noam Dolovich <noam.tzvi.dolovich@gmail.com>
cueckoo
pushed a commit
to cue-lang/cuelang.org
that referenced
this issue
Mar 12, 2024
This adds a Commented Cue guide demonstrating how to ensure that a given number is even/odd. Examples are provided for the 8 different validation outcomes, base on the following matrix: - odd/even - positive/negative - valid/invalid For cue-lang/docs-and-content#97 Preview-Path: /docs/howto/ensure-int-is-odd-or-even/ Change-Id: Ibc7a31dcbbb13a8d155f30731c961691e47d79ed Signed-off-by: Noam Dolovich <noam.tzvi.dolovich@gmail.com>
cueckoo
pushed a commit
to cue-lang/cuelang.org
that referenced
this issue
Mar 12, 2024
This adds a Commented Cue guide demonstrating how to ensure that a given number is even/odd. Examples are provided for the 8 different validation outcomes, based on the following matrix: - odd/even - positive/negative - valid/invalid For cue-lang/docs-and-content#97 Preview-Path: /docs/howto/ensure-int-is-odd-or-even/ Change-Id: Ibc7a31dcbbb13a8d155f30731c961691e47d79ed Signed-off-by: Noam Dolovich <noam.tzvi.dolovich@gmail.com>
cueckoo
pushed a commit
to cue-lang/cuelang.org
that referenced
this issue
Mar 12, 2024
This adds a Commented Cue guide demonstrating how to ensure that a given integer is even/odd. Examples are provided for the 8 different validation outcomes, based on the following matrix: - odd/even - positive/negative - valid/invalid For cue-lang/docs-and-content#97 Preview-Path: /docs/howto/ensure-int-is-odd-or-even/ Change-Id: Ibc7a31dcbbb13a8d155f30731c961691e47d79ed Signed-off-by: Noam Dolovich <noam.tzvi.dolovich@gmail.com>
cueckoo
pushed a commit
to cue-lang/cuelang.org-trybot
that referenced
this issue
Mar 12, 2024
This adds a Commented Cue guide demonstrating how to ensure that a given integer is even/odd. Examples are provided for the 8 different validation outcomes, based on the following matrix: - odd/even - positive/negative - valid/invalid For cue-lang/docs-and-content#97 Preview-Path: /docs/howto/ensure-int-is-odd-or-even/ Change-Id: Ibc7a31dcbbb13a8d155f30731c961691e47d79ed Signed-off-by: Noam Dolovich <noam.tzvi.dolovich@gmail.com> Dispatch-Trailer: {"type":"trybot","CL":1177968,"patchset":10,"ref":"refs/changes/68/1177968/10","targetBranch":"alpha"}
cueckoo
pushed a commit
to cue-lang/cuelang.org
that referenced
this issue
Mar 14, 2024
This adds a Commented Cue guide demonstrating how to validate an integer value's parity. Examples are provided for the 8 different validation outcomes, based on the following matrix: - odd/even - positive/negative - valid/invalid For cue-lang/docs-and-content#97 Preview-Path: /docs/howto/ensure-int-is-odd-or-even/ Change-Id: Ibc7a31dcbbb13a8d155f30731c961691e47d79ed Signed-off-by: Noam Dolovich <noam.tzvi.dolovich@gmail.com>
cueckoo
pushed a commit
to cue-lang/cuelang.org
that referenced
this issue
Mar 14, 2024
This adds a Commented Cue guide demonstrating how to validate an integer value's parity. Examples are provided for the 8 different validation outcomes, based on the following matrix: - odd/even - positive/negative - valid/invalid For cue-lang/docs-and-content#97 Preview-Path: /docs/howto/ensure-int-is-odd-or-even/ Change-Id: Ibc7a31dcbbb13a8d155f30731c961691e47d79ed Signed-off-by: Noam Dolovich <noam.tzvi.dolovich@gmail.com>
cueckoo
pushed a commit
to cue-lang/cuelang.org
that referenced
this issue
Mar 14, 2024
This adds a Commented Cue guide demonstrating how to validate an integer value's parity. Examples are provided for the 8 different validation outcomes, based on the following matrix: - odd/even - positive/negative - valid/invalid For cue-lang/docs-and-content#97 Preview-Path: /docs/howto/validate-integer-value-parity/ Change-Id: Ibc7a31dcbbb13a8d155f30731c961691e47d79ed Signed-off-by: Noam Dolovich <noam.tzvi.dolovich@gmail.com>
cueckoo
pushed a commit
to cue-lang/cuelang.org-trybot
that referenced
this issue
Mar 14, 2024
This adds a Commented Cue guide demonstrating how to validate an integer value's parity. Examples are provided for the 8 different validation outcomes, based on the following matrix: - odd/even - positive/negative - valid/invalid For cue-lang/docs-and-content#97 Preview-Path: /docs/howto/validate-integer-value-parity/ Change-Id: Ibc7a31dcbbb13a8d155f30731c961691e47d79ed Signed-off-by: Noam Dolovich <noam.tzvi.dolovich@gmail.com> Dispatch-Trailer: {"type":"trybot","CL":1177968,"patchset":13,"ref":"refs/changes/68/1177968/13","targetBranch":"alpha"}
cueckoo
pushed a commit
to cue-lang/cuelang.org
that referenced
this issue
Mar 14, 2024
This adds a Commented Cue guide demonstrating how to validate an integer value's parity. Examples are provided for the 8 different validation outcomes, based on the following matrix: - odd/even - positive/negative - valid/invalid For cue-lang/docs-and-content#97 Preview-Path: /docs/howto/validate-integer-value-parity/ Change-Id: Ibc7a31dcbbb13a8d155f30731c961691e47d79ed Signed-off-by: Noam Dolovich <noam.tzvi.dolovich@gmail.com> Reviewed-on: https://review.gerrithub.io/c/cue-lang/cuelang.org/+/1177968 Reviewed-by: Paul Jolly <paul@myitcv.io> Reviewed-by: Jonathan Matthews <github@hello.jonathanmatthews.com> TryBot-Result: CUEcueckoo <cueckoo@gmail.com>
Closed via cue-lang/cuelang.org@e57cd0e, and now published at https://alpha.cuelang.org/docs/howto/validate-integer-value-parity/. Many thanks for writing this, @NoamTD! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
content idea
Idea for a new piece of content
good first issue
Good for newcomers
howto
For content that in the "howto" diataxis quadrant
Can, of course, be expanded to check for multiples of any integer, not just 2; but the resulting page title would get a little wordy.
This also works:
... but doing the same for
#odd
is more fiddly, as it requires responding to the sign of the original number. i.e. the trailing+1
needs to be-1
if the number is negative. Not /hard/, just inelegant, relative to the first solution, above.The text was updated successfully, but these errors were encountered: