Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/perl
use Cwd; # module for finding the current working directory
$|=1; # turn off I/O buffering
$num_arguments = $#ARGV + 1;
$directory_name = $ARGV[0];
foreach $arg_index (0 .. $num_arguments) {
if ($ARGV[$arg_index] eq "-name") {
def return_max_record(timetable):
'''This function returns the maximum number of possible non-concurrent
recordings from VHS. Input a list with each row formatted:
[start time, end time]'''
for times in timetable:
times.append(times[1] - times[0])
# Maximizing the number
timetable = sorted(timetable, key = lambda x: x[2])
@afnanenayet
afnanenayet / Demo
Last active August 29, 2015 14:19
Business Server Stuff
/*Items originating from org*/
select ItemId, ItemDescription from Items where ItemOriginalOrgId = 279;
/*Those with roles in org*/
select RoleId, AcctId from Roles where OrgId = 279;
/*Items purchased from org and those who ordered them*/
select Details.DItemId, Details.DItemDescription, Orders.OId, Orders.OAcctId, Orders.OBillTo from Orders join Details on OId=DOId where OAcctId=326 order by DItemId;
<?php
require('OrganizationHome.php');
require("$OrganizationHome/SessionSpecifics.php");
if (isset($_SESSION['Authority']) and $_SESSION['Authority'] != '') {
header("Location: Controller.php");
exit;
}
if (!isset($_SESSION["Attempts"])) {
$_SESSION["Attempts"] = 0;
$FirstTime = true;
<?php
require("OrganizationHome.php");
require("$OrganizationHome/SessionSpecifics.php");
/*
$ConnectMsg = ConnectToDatabase();
if ($ConnectMsg <> "") {
$_SESSION["MenuMsg"] = "Unable to connect to the database at this time...";
header ("Location: Controller.php");
exit;
}