This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| javascript:(function(){ const existingOverlay = document.getElementById("focus-overlay"); if (existingOverlay) { existingOverlay.remove(); return; } const overlay = document.createElement("div"); overlay.id = "focus-overlay"; overlay.style = ` position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(0, 0, 0, 0.5); /* Even lighter dark background */ z-index: 9999; pointer-events: none; display: flex; justify-content: center; align-items: center; `; const focusArea = document.createElement("div"); focusArea.style = ` width: 99vw; height: 40vh; background: rgba(255, 255, 255, 0.2); /* Lighter focus area */ box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5); backdrop-filter: brightness(1.8) contrast(1.5); /* Text more visible */ color: black; /* Darker text inside the focus area */ padding: 20px; display: flex; align-it |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| function my_theme_enqueue_styles() { | |
| $parent_style = 'twentyseventeen-style'; // This is 'twentyseventeen-style' for the Twenty Seventeen theme. | |
| wp_enqueue_style( $parent_style, get_template_directory_uri() . '/style.css' ); | |
| wp_enqueue_style( 'child-style', | |
| get_stylesheet_directory_uri() . '/style.css', | |
| array( $parent_style ), | |
| wp_get_theme()->get('Version') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ''' | |
| Write a program to calculate the credit card balance after one year if a person only pays the minimum monthly payment required by the credit card company each month. | |
| The following variables contain values as described below: | |
| balance - the outstanding balance on the credit card | |
| annualInterestRate - annual interest rate as a decimal | |
| monthlyPaymentRate - minimum monthly payment rate as a decimal |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ''' | |
| The greatest common divisor of two positive integers is the largest integer that divides each of them without remainder. For example, | |
| gcd(2, 12) = 2 | |
| gcd(6, 12) = 6 | |
| gcd(9, 12) = 3 | |
| gcd(17, 12) = 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ''' | |
| The greatest common divisor of two positive integers is the largest integer that divides each of them without remainder. For example, | |
| gcd(2, 12) = 2 | |
| gcd(6, 12) = 6 | |
| gcd(9, 12) = 3 | |
| gcd(17, 12) = 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ''' | |
| We can use the idea of bisection search to determine if a character is in a string, so long as the string is sorted in alphabetical order. | |
| First, test the middle character of a string against the character you're looking for (the "test character"). If they are the same, we are done - we've found the character we're looking for! | |
| If they're not the same, check if the test character is "smaller" than the middle character. If so, we need only consider the lower half of the string; otherwise, we only consider the upper half of the string. (Note that you can compare characters using Python's < function.) | |
| Implement the function isIn(char, aStr) which implements the above idea recursively to test if char is in aStr. char will be a single character and aStr will be a string that is in alphabetical order. The function should return a boolean value. | |
| As you design the function, think very carefully about what the base cases should be. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # In this problem, you'll create a program that guesses a secret number! | |
| # The program works as follows: you (the user) thinks of an integer between 0 (inclusive) and 100 (not inclusive). | |
| # The computer makes guesses, and you give it input - is its guess too high or too low? | |
| # Using bisection search, the computer will guess the user's secret number! | |
| low = 0 | |
| high = 100 | |
| print('Please think of a number between ' + str(low) + ' and ' + str(high) + '!') | |
| found = False |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import random | |
| guessTaken = 0 | |
| print('Hello! What is your name?') | |
| myName = input() | |
| print('Hello', myName ,', lets start a guess game where you need to guess between numbers 1 and 100') | |
| number = random.randint(1, 100) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| s = 'jzleuajreuvxhmwaer' | |
| currString='' | |
| lastString='' | |
| i = 0 | |
| while(i+1<len(s)): | |
| if(s[i]<=s[i+1]): | |
| currString = currString + s[i] | |
| if(i+2==len(s)): | |
| currString += s[i+1] | |
| else: |
NewerOlder