Results for “cd”
Small, practical examples. Search by task or narrow things down below.
Calculate a least common multiple using a GCD
C: Divide before multiplying to reduce the risk of intermediate overflow.
C✓ Tested
Calculate the greatest common divisor
C: Euclid’s algorithm repeatedly replaces a pair with the divisor and remainder.
C✓ Tested
Enter and leave a practice directory
Linux Commands: Enter and leave a practice directory using GNU/Linux commands in an empty practice directory.
Linux Commands✓ Tested
Find common factors and multiples
Python: Use the integer gcd and lcm helpers to avoid floating-point calculations.
Python✓ Tested
Find the greatest common divisor
Java: BigInteger.gcd calculates an exact nonnegative common divisor.
Java✓ Tested
Find the greatest common divisor with the standard library
C++: std::gcd computes a nonnegative integer common divisor.
C++✓ Tested
Append a list item
Build a jQuery element with text and append it safely.
jQuery✓ Tested
Clear an element
Remove child content while keeping the jQuery-selected container.
jQuery✓ Tested
Disable a button
Set the live disabled property with jQuery prop.
jQuery✓ Tested
Filter a selection
Reduce a jQuery selection to elements with a matching class.
jQuery✓ Tested
Find descendants
Select only matching descendants of a jQuery container.
jQuery✓ Tested
Find the nearest matching ancestor
Read a parent row attribute using jQuery closest.
jQuery✓ Tested