Skip to content

Instantly share code, notes, and snippets.

View erinxocon's full-sized avatar

Erin O'Connell erinxocon

View GitHub Profile
from lxml import etree
def main():
some_file = "http://gist.github.com/api/v1/xml/gists/kennethreitz"
tree = etree.parse(some_file)
root = tree.getroot()
for element in root.iter("description"):
print("%s" % (element.text))
main()
#===============================================================================
# lab7.py
# Student Name: Michael O'Connell
# Assignment: Lab #7
# Submission Date: 11/05/2008
# Honor Code Statement: I received no assistance on this assignment that
# violates the guidelines as set forth by the instructor
# and the class syllabus.
# References: Blackboard Forums, Python Texts, Lab and Class Slides, http://forums.devshed.com/python-programming-11/password-input-100483.html for the getpass help
# Comments: Over all no major problems, figuring out how to use the dictionaries was a little tough. Instead of using a raw_input for the
Downloading/unpacking krpython
Running setup.py egg_info for package krpython
warning: no files found matching 'CHANGELOG'
warning: no files found matching 'data/krpython.desktop'
Requirement already satisfied (use --upgrade to upgrade): pygments in /usr/local/Cellar/python/2.7/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (from krpython)
Downloading/unpacking pyparsing (from krpython)
Running setup.py egg_info for package pyparsing
Requirement already satisfied (use --upgrade to upgrade): xerox in /usr/local/Cellar/python/2.7/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (from krpython)
#!/usr/bin/perl -w
use strict;
my$f= $[;my
$ch=0;sub l{length}
sub r{join"", reverse split
("",$_[$[])}sub ss{substr($_[0]
,$_[1],$_[2])}sub be{$_=$_[0];p
(ss($_,$f,1));$f+=l()/2;$f%=l
();$f++if$ch%2;$ch++}my$q=r
from flask import Flask, Response, render_template
import time
import datetime
import random
app = Flask(__name__)
MEETING_TITLES = ['Firefly Fan Club Meeting', 'Klingon 302: Dealing with Qapla\'', 'Star Trek: An Introduction to Looking Pensive in your Ready Room', 'Synergy Ad Synergy Targeting Synergy', 'Synergy', 'Star Wars: How to Discover the Force Within', 'Elvish 101: Na vedui!', 'Sign Builders Anonymous', 'Very Important Business Meeting', 'Branded Integrations with Content Creators', 'User Sourced Ad Integration with P2P Technology', 'Cloudsourced Integration Synergy', 'Matching Brands to Alpha Based Consumers', 'Radical Transparency with Multistage Engagement', 'Mobile Based App Farming and You', 'Geotargeting Adserve with Content Synergy']
ENDPOINTS_MAIN = ['/', '/xml']
ENDPOINTS_XML = ['/xml/ems']
ENDPOINTS_EMS = ['/xml/ems/city', '/xml/ems/envision', '/xml/ems/delphi', '/xml/ems/salespro', '/xml/ems/ebms', '/xml/ems/isac']
import sys
import os
import struct
from ctypes import (CDLL, get_errno)
from ctypes.util import find_library
from socket import (
socket,
AF_BLUETOOTH,
SOCK_RAW,
BTPROTO_HCI,
@erinxocon
erinxocon / bonnaroo_attendance.py
Created May 31, 2015 07:16
Short script to pull attendance information for the bonnaroo lineup.
from bs4 import BeautifulSoup
import csv
import requests
def get_linup():
"""Returns a request response object of the lineup html"""
return requests.get('http://lineup.bonnaroo.com')
@erinxocon
erinxocon / distinct.xsl
Created September 18, 2015 03:05
Distinct XSLT 1.0
<xsl:key name="product" match="/xpath/xpath/text()" use="." />
<xsl:template match="/">
<xsl:for-each select="/xpath/xpath/text()[generate-id()= generate-id(key('product',.)[1])]">
<li>
<xsl:value-of select="."/>
</li>
</xsl:for-each>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Http.Headers;
using Newtonsoft.Json;
namespace Test.Controllers
using System;
using System.Diagnostics;
using System.Linq;
using System.IO.Ports;
using SpotifyAPI.Local;
using System.Collections.Generic;
using System.Collections.Concurrent;
using System.Threading;
class PortDataReceived