Skip to content

Instantly share code, notes, and snippets.

<html>
<body>
<form <!-- This specifies a form HTML element: https://developer.mozilla.org/en-US/docs/HTML/Element/form -->
action="formProcessor.php" <!-- path to a script that processes the form -->
method="post"> <!-- general rule: POST sends data, GET gets data. Forms send data -->
<label> <!-- A label element /labels/ the input element -->
Enter Your Text Here:
<input <!-- input HTML element: https://developer.mozilla.org/en-US/docs/HTML/Element/input -->
@MarkyC
MarkyC / mysqlerr.sql
Last active December 11, 2015 00:19
MySQL Error
INSERT INTO 'members1'(
email, # varchar(80)
password, # varchar(64)
first_name, # varchar(24)
last_name, # varchar(24)
birthday, # date
school, # varchar(32)
school_program, # varchar(32)
start_year, # date
signup_date # datetime
<?php
// create empty cells to populate table
// create 1 row for every half hour of the day (48 rows)
$time = mktime(0, 0, 0, 1, 1);
for ($i = 0; $i < 86400; $i += 1800) { // 1800 = half hour, 86400 = one day
echo "<tr ";
if ($i < 25200) {
// initially hide before 7am
echo "class=\"initiallyHiddenTop\" ";
<form id="signup" onSubmit="return validateForm();"
21action="login-verify.php" method="post">
<label for="email">Name:
<input name="email" id="email" type="text" class="input-block-level"
value="<?php echo $first_name ?>'s Timetable">
</label>
<label for="private">Visibility:
<select name="private" id="private" class="input-block-level">
<option value="private">private</option>
<div class="input-prepend">
<span class="add-on">Day: </span
<select name="day" id="day" class="input-block-level">
<?php
// create array to populate <option>'s
$dow = array(
"Sunday",
"Monday",
"Tuesday",
"Wednesday",
<?php
// get first row, and number of rows
// we have to keep track so we don't mysql_fetch_row() more than we can
$row = mysql_fetch_row($result);
$num_rows = mysql_num_rows($result);
$current_row = 1;
// grab info for the first class
$name = $row[0];
$description = $row[1];
<?php
while($row = mysql_fetch_row($result) {
$row_start_time = $row[0];
$row_end_time = $row[1];
// check if row_start_time <= start_time < row_end_time
// or row_start_time < end_time <= row_end_time
if ((($start_time >= $row_start_time) && ($start_time < $row_end_time)) ||
(($end_time > $row_start_time) && ($end_time <= $row_end_time)))
}
@MarkyC
MarkyC / gnu-mv.c
Created January 26, 2013 00:30
150 lines main method!
/* mv -- move or rename files
Copyright (C) 1986-2013 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
/** avg.c
* Author: Marco Cirillo
* Uses getchar() to compute an average of a series of digits
*/
#include <stdio.h>
int main(int argc, char* argv[]) {
int total=0,subtotal=0,n=0;
int c;
printf("Enter numbers followed by spaces and press enter when finished: ");
while (c = getchar()) {
package name.marcocirillo;
import java.io.IOException;
import java.io.InputStream;
import javax.imageio.ImageIO;
import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JLabel;