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
/* | |
celebrity.c | |
Author: George Lesica | |
Description: An implementation of the celebrity | |
graph algorithm. | |
*/ | |
#include <stdlib.h> | |
#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
// base class | |
function Animal() { | |
// constructor | |
} | |
Animal.prototype.makeNoise = function() { | |
// make noise | |
} | |
// first sub-class | |
function Dog() { |
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
$.fn.orderly = function(method, options) { | |
// Decide which method we're supposed to call and call it | |
if (methods[method]) { | |
return methods[method].apply(this, Array.prototype.slice.call(arguments, 1)); | |
} else if (typeof method === 'object' || ! method) { | |
return methods.init.apply(this, arguments); | |
} else { | |
$.error('Method ' + method + ' does not exist on jQuery.orderly'); | |
} | |
}; |
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
SELECT | |
a.application_id, | |
a.application_name, | |
a.application_vendor, | |
a.application_version, | |
(SELECT COUNT(*) FROM installations i WHERE i.application_id=a.application_id) count | |
FROM | |
applications a | |
WHERE | |
1=1 |
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
ERROR:root:Uncaught exception POST /audit/computer01 (127.0.0.1) | |
HTTPRequest(protocol='http', host='localhost:8888', method='POST', uri='/audit/computer01', version='HTTP/1.1', remote_ip='127.0.0.1', body='{"date": "2011-11-11","applications":[{"name":"Adobe CS4", "vendor":"Adobe, Inc.", "version":"9.2.0"}]}', headers={'Host': 'localhost:8888', 'Content-Type': 'applications/json', 'Content-Length': '103', 'Accept': '*/*', 'User-Agent': 'curl/7.21.0 (x86_64-pc-linux-gnu) libcurl/7.21.0 OpenSSL/0.9.8o zlib/1.2.3.4 libidn/1.15 libssh2/1.2.6'}) | |
Traceback (most recent call last): | |
File "/home/george/Repos/auditr/envs/auditr/lib/python2.6/site-packages/tornado/web.py", line 954, in _execute | |
getattr(self, self.request.method.lower())(*args, **kwargs) | |
File "server.py", line 83, in post | |
application['version'] | |
File "/home/george/Repos/auditr/envs/auditr/lib/python2.6/site-packages/tornado/database.py", line 111, in query | |
column_names = [d[0] for d in cursor.description] | |
TypeError: 'NoneType' object is |
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 post(self, computer_name): | |
computer = self._get_computer(computer_name) | |
data = json.loads(self.request.body) | |
for application in data['applications']: | |
result = self.database.query( | |
''' | |
INSERT INTO applications ( | |
application_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
mysql> SELECT c.computer_name, a.application_name, a.application_version, i.audit_date FROM installations i INNER JOIN computers c ON i.computer_id=c.computer_id INNER JOIN applications a ON i.application_id=a.application_id WHERE c.computer_name="computer01" ORDER BY c.computer_name, a.application_name, i.audit_date; | |
+---------------+-----------------------+---------------------+------------+ | |
| computer_name | application_name | application_version | audit_date | | |
+---------------+-----------------------+---------------------+------------+ | |
| computer01 | Adobe Acrobat Reader | 8.1.4 | 2011-11-09 | | |
| computer01 | Adobe Acrobat Reader | 8.1.4 | 2011-11-10 | | |
| computer01 | Microsoft Office 2007 | 12.0.1 | 2011-11-09 | | |
| computer01 | Microsoft Office 2007 | 12.0.1 | 2011-11-10 | | |
| computer01 | Mozilla Firefox | 5.0 | 2011-11-09 | | |
| computer01 | Mozilla Firefox | 7.0 | 2011-11-10 | |
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
'******************************************************************************* | |
' software.vbs | |
' Create a list of software installed on one or more | |
' machines in TSV format. | |
' | |
' Usage: cscript.exe software.vbs [/path:<path>] [machine names] | |
' | |
' If <path> is given, the script will attempt to store logs | |
' in that location. It is treated as a relative path and must | |
' end in a backslash. |
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 forward = function($c) { | |
var t = window.setTimeout(function() { | |
if ($c.data('running')) { | |
goForward.call($c); | |
} | |
forward($c); | |
}, settings.delay); | |
} | |
forward($container); |
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
// Mutifunctional method to get and set values to a collection | |
// The value/s can optionally be executed if it's a function | |
access: function( elems, key, value, exec, fn, pass ) { | |
var length = elems.length; | |
// Setting many attributes | |
if ( typeof key === "object" ) { | |
for ( var k in key ) { | |
jQuery.access( elems, k, key[k], exec, fn, value ); | |
} |