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
/* Copyright 2011 Wes Freeman | |
* | |
* This program is free software: you can redistribute it and/or modify | |
* it under the terms of the GNU Lesser 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 | |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
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
/* Copyright 2011 Wes Freeman | |
* | |
* This program is free software: you can redistribute it and/or modify | |
* it under the terms of the GNU Lesser 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 | |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
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
<html> | |
<head> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js" type="text/javascript"></script> | |
<script> | |
$(document).ready(function() { | |
var colortest = $("#colortest"); | |
for (i = 1; i <= 300; i++) { | |
var c = genColor(); | |
var newhtml = "<span style='font-family:\"Courier\",monospace;width:50px;height:30px;background-color:#" + c + "'>#" + c + "</span>"; | |
colortest.html(colortest.html() + newhtml); |
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
<?php | |
$file = 'filename.pdf'; | |
if (file_exists($file)) { | |
header('Content-Description: File Transfer'); | |
header('Content-Type: application/octet-stream'); | |
header('Content-Disposition: attachment; filename='.basename($file)); | |
header('Content-Transfer-Encoding: binary'); | |
header('Expires: 0'); | |
header('Cache-Control: must-revalidate, post-check=0, pre-check=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
import java.util.*; | |
import javax.mail.*; | |
import javax.mail.internet.*; | |
import javax.activation.*; | |
// Send a simple, single part, text/plain e-mail | |
public class TestEmail { | |
public static void main(String[] args) { | |
String to = "sendToMailAddress"; |
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
525 ERROR_NO_SUCH_USER (The specified account does not exist.) | |
NOTE: Returns when username is invalid. | |
52e ERROR_LOGON_FAILURE (Logon failure: unknown user name or bad password.) | |
NOTE: Returns when username is valid but password/credential is invalid. | |
Will prevent most other errors from being displayed as noted. | |
530 ERROR_INVALID_LOGON_HOURS (Logon failure: account logon time restriction violation.) | |
NOTE: Returns only when presented with valid username and password/credential. |
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
var filters = ['abcd', 'efgh', 'ijkl', 'mnop', 'qrst', 'uvwx', 'yz']; | |
var flen = filters.length; | |
var n = 1000000; | |
var max = -1; | |
function printInterestingStats(explain) { | |
print(" cursor: " + explain.cursor); | |
print(" nscanned: " + explain.nscanned); | |
print(" scanAndOrder: " + explain.scanAndOrder); | |
print(" millis: " + explain.millis); |
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
var populateMulti = function(colSize) { | |
db.test10.drop(); | |
for(var i=0;i<colSize;i++) { | |
db.test10.save({name:""+i, order:i}); | |
} | |
db.test10.ensureIndex({order:1}); | |
} | |
var moveMulti = function(oldPos,newPos) { | |
if(oldPos == newPos) return; |
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
function getRandomTime() { | |
return new Date(new Date() - Math.floor(Math.random()*1000000)); | |
} | |
function initialInsert() { | |
// insert 1 million records | |
for(var i = 0; i < 1000000; i++) { | |
db.test.save({ | |
date_added:getRandomTime(), | |
optical_lumo:Math.random()*30-10, // let's make the range 1/3 of the result |
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
<label for="state">*State</label> | |
<select id="state" name="state"> | |
<option value="">Select one...</option> | |
<option value='AL'>Alabama</option> | |
<option value='AK'>Alaska</option> | |
<option value='AZ'>Arizona</option> | |
<option value='AR'>Arkansas</option> | |
<option value='CA'>California</option> | |
<option value='CO'>Colorado</option> | |
<option value='CT'>Connecticut</option> |
OlderNewer