Skip to content

Instantly share code, notes, and snippets.

View ChrisMoney's full-sized avatar

Chris Weathers ChrisMoney

  • Onevested
  • St. Louis, MO
View GitHub Profile
@ChrisMoney
ChrisMoney / ajax.vb
Last active August 29, 2015 13:57
AJAX in .NET
'first bind the ajax function to the dom object
ddlInstitution.Attributes.Add("onchange", "return abc()")
' This ajax call gets a drop down list and appends it to a dropdown on the mark up side
'<WebMethod()> set call a web service in the file code behind, note a webservice page does not really work
'its best to call the web method in the same page in which the AJAX resides
' <ScriptMethod(UseHttpGet:=False, ResponseFormat:=ResponseFormat.Json)> _ dictates if the web method accepts
'a HTTP 'GET' or 'POST' request
' it also determines the return type (JSON or XML) which is declared in the AJAX
@ChrisMoney
ChrisMoney / row_number.sql
Last active December 28, 2021 13:37
SQL - Row_Number() OVER (ORDER BY)
SELECT ApplicantID, Email, FName, LName, Application_Status,
(SELECT CASE WHEN Conflicts.conflictId IS NULL THEN 0 ELSE 1 END AS HasConflict
FROM Conflicts
WHERE (applicantId = Applicant.ApplicantID) AND (reviewerId =
(SELECT ReviewerID FROM (
SELECT ROW_NUMBER() OVER (ORDER BY ReviewerName ASC) AS RowNum, *
FROM vwAssignedReviewers
WHERE (Program_Name = @programType)) AS Conflicts
WHERE RowNum = 1))) AS Conflict01,
(SELECT ReviewerName FROM (
@ChrisMoney
ChrisMoney / time_tracker.vb
Created March 22, 2012 15:11
VB - Time Tracker App that opens results in Excel Spreadsheet
Imports System.Data.OleDb
Imports System.Windows.Forms.VisualStyles.VisualStyleElement.TaskbarClock
Imports System.Security.Principal
Imports System.Net.Mime.MediaTypeNames
Imports Microsoft.Office.Interop.Access
Imports System.Globalization
Public Class Time_Tracker
Dim timeStart As DateTime 'Time when timer starts
Dim timeEnd As DateTime 'Time when timer ends
@ChrisMoney
ChrisMoney / allocate_memory.s
Created March 1, 2012 02:27
Assembly - Program manages memory usage
#PURPOSE: Program to manage memory usage - allocates and deallocates memory as required
#NOTES: The program using these routines will ask for a certain size of memory.
# We actually use more than that size, but we put it at the beginning, before the pointer we hand back. we add a size field and an AVAILABLE/UNAVAILABLE marker, so the memory looks like this
###############################################################
# Available Marker#Size of memory#Actual memory locations
##############################################################
# Return pointer; Pointer points here
# The pointer we return only points to the actual locations requested to make it easier for the calling program. it also allows us to change our structure without the calling program having to change at all.