This file contains 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
# When comparing inexact strings in Python doctests, and using ellipsis, | |
# be sure to follow the output generating statement with a comment: | |
# "# doctest: +ELLIPSIS" | |
# Reference: https://web.archive.org/web/20190806202840/https://pymotw.com/2/doctest/#handling-unpredictable-output | |
# This tripped me up when first starting out with doctests. I would | |
# output a string in which the end or middle was unimportant. I needed | |
# to ensure only certain parts. The tests would always fail. This | |
# turns on ellipsis processing when dealing with strings. |
This file contains 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
/** | |
* Drive a collection of stepper motors, 1 step at a time in sequence, a desired number of steps. | |
* Used to approximate simultaneous motion of each stepper by not blocking until motion is completed. | |
* | |
* steppers = Array of Stepper library stepper motors. | |
* numSteppers = length of steppers array. | |
* numStepsMap = number of total steps to advance by. Positve number moves forward. Negative number moves backward. | |
*/ | |
void simultaneousStepperDrive(Stepper steppers[], int numSteppers, int numStepsMap[]) { | |
int stepsExecuted = 0; |
This file contains 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
<ul id='main-nav'> | |
<li><a href=''>Item 1</a></li> | |
<li><a href=''>Item 2</a></li> | |
<li><a href=''>Item 3</a></li> | |
<li> | |
<a href=''>Item 4</a> | |
<ul> | |
<li> | |
<a href=''>Subitem 1</a> | |
<ul> |
This file contains 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
#main-nav { list-style-type: none; } | |
#main-nav ul { list-style-type: none; margin: 0; padding: 0; } | |
#main-nav a { display: block; width: 100%; height: 100%; text-align: center; line-height: 30px; } | |
/* Universal Level Code */ | |
#main-nav li { width: 175px; height: 30px; } | |
#main-nav li ul { position: absolute; display: none; } | |
#main-nav li:hover > ul { display: block; } | |
/* Level 1 */ |
This file contains 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
RewriteEngine On | |
RewriteCond %{HTTP_HOST} !^your-site.com$ [NC] | |
RewriteRule ^(.*)$ http://your-site.com/$1 [L,R=301] |
This file contains 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
$(document).ready(function(){ | |
$("form#formId").submit(function() { | |
inputField = $('#inputFieldId').attr('value'); | |
$.ajax({ | |
type: "POST", | |
url: "yourpage.php", | |
cache: false, | |
data: "inputField ="+ inputField, | |
success: function(html){ | |
$("#ajax-results").html(html); |
This file contains 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
<!DOCTYPE HTML> |