Skip to content

Instantly share code, notes, and snippets.

Ryan Hope RyanHope

Block or report user

Report or block RyanHope

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@RyanHope
RyanHope / badtab.py
Created Oct 24, 2018
wxPython broken notebook on Linux/Gtk3
View badtab.py
import wx
class Tab1(wx.Panel):
def __init__(self, parent):
wx.Panel.__init__(self, parent)
self.l = wx.StaticText(self, label="Text")
self.sizer = wx.GridBagSizer(0,0)
self.sizer.Add(self.l, pos=(0,0))
self.SetSizer(self.sizer)
View gen_eeg_event_files.py
#!/usr/bin/env python
"""
Parse a SF logfile and BDF file and generate EEGLAB compat event file
"""
from __future__ import print_function, division
import sys, os
import csv
@RyanHope
RyanHope / msys2_theano.Rmd
Last active Jan 29, 2017
MSYS2 Theano Windows 10 64bit
View msys2_theano.Rmd
MSYS2 Theano Windows 10 64bit Setup Notes
==========================================
Update MSYS2, run until no updates
-------------------------------------
```
pacman -Syuu
```
Install GCC
View gist:76e2f1935fa41ba5422ebb51391782e1
2016-07-27 11:15:35,214 [ pgoapi] [ INFO] Create new request...
2016-07-27 11:15:35,216 [ pgoapi] [ INFO] Adding 'ENCOUNTER' to RPC request including arguments
2016-07-27 11:15:35,216 [ pgoapi] [DEBUG] Arguments of 'ENCOUNTER':
{'player_longitude': -79.99990432564914, 'spawn_point_id': u'8834f156fb7', 'encounter_id': 5752263169355807389L, 'player_latitude': 40.4409188}2016-07-27 11:15:35,217 [ pgoapi] [ INFO] Execution of RPC
2016-07-27 11:15:35,217 [ rpc_api] [DEBUG] Generating main RPC request...
2016-07-27 11:15:35,219 [ rpc_api] [DEBUG] Generating sub RPC requests...
2016-07-27 11:15:35,219 [ rpc_api] [DEBUG] Subrequest class: POGOProtos.Networking.Requests.Messages_pb2.EncounterMessage
2016-07-27 11:15:35,220 [ rpc_api] [DEBUG] Generated protobuf request:
status_code: 2
request_id: 8145806132888207460
View random-walk.py
#!/usr/bin/env python
"""
pgoapi - Pokemon Go API
Copyright (c) 2016 tjado <https://github.com/tejado>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
@RyanHope
RyanHope / httpRequest.py
Created Jul 25, 2016 — forked from lukemarsden/httpRequest.py
Simple function to do an HTTP POST using Twisted Agent
View httpRequest.py
from twisted.web.iweb import IBodyProducer
from twisted.internet import defer
from twisted.web.client import Agent
from twisted.web.http_headers import Headers
import urllib
class StringProducer(object):
implements(IBodyProducer)
def __init__(self, body):
View Pokemon
move_1 move_2 name pokemon_id individual_stamina power_quotient individual_defense stamina individual_attack cp nickname
------------- --------------- ---------- ------------ -------------------- ---------------- -------------------- --------- ------------------- ---- ----------
Ember Heat Wave Flareon 136 15 91 11 77 15 1195
Zen Headbutt Psybeam Psyduck 54 11 89 14 55 15 434
Pound Psyshock Drowzee 96 13 89 12 61 15 362
Poison Sting Horn Attack Nidorino 33 13 89 14 76 13 689
Confusion Psychic Hypno 97
View gist:7dca5cb63057eb411f10a20a26b40ac2
#!/usr/bin/env python
import sys,os
# For general environment
from twisted.internet import reactor
from twisted.internet.task import LoopingCall, Cooperator
from twisted.protocols.basic import LineReceiver
from twisted.internet.protocol import Factory
import json
View killa_lipstick.html
<html xmlnx="http://wwww.w3.org/1999/xhtml">
<head>
<title>Killa Lipstick</title>
<link rel="stylesheet" href="style.css" type="text/css">
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
</head>
<body>
<div id="wrapper">
<div id="header">
View split_apply_combine_answers.md

Assignments

Problem 1

Using the iris dataset as input, write a function that computes and returns the mean, std.dev and group size of Sepal.Length for each Species split by Petal.Length > CRITICAL_LENGTH where CRITICAL_LENGTH is the second input variable of you function. The output should be a data.frame and the column names should be meaningful. You must use split and apply (or sapply/lappy). No for-loops allowed.

You can’t perform that action at this time.