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 | |
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; | |
} |
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 | |
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; |
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
/*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; |
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
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]) |
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
#!/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") { |
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
#include <iostream> | |
using namespace std; | |
#ifdef __cplusplus | |
extern "C" { | |
#endif | |
void loop(); | |
#ifdef __cplusplus |
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
/* | |
* atoi - read an integer from each argument, | |
* and print them to stdout. catch errors. | |
* | |
* usage: ./atoi [integer]... | |
* | |
* CS50, July 2017 | |
*/ | |
#include <stdio.h> |
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
# Iterate through arguments supplied from the command line with | |
# a loop in Bash script | |
for arg in "$@" | |
do | |
echo "$arg" | |
done | |
# Example usage: | |
# ./iter_args.sh 1 2 3 4 5 |
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
/* gdb_valgrind_example.c Afnan Enayet | |
* | |
* An example designed to help a user understand how to | |
* use GDB/LLDB and Valgrind | |
* | |
* Functions: | |
* - init_str: a functions that initializes a string | |
* to "hello" | |
* | |
*/ |
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
# Implements a logistic regression with mini-batch gradient descent using tensorflow | |
# testing with the sklearn moons dataset | |
import tensorflow as tf | |
import numpy as np | |
from datetime import datetime | |
from sklearn.datasets import make_moons | |
def get_tb_dir(prefix=None) -> str: |
OlderNewer