I hereby claim:
- I am nickrobson on github.
- I am nickrobson (https://keybase.io/nickrobson) on keybase.
- I have a public key whose fingerprint is 3569 207D 80BC 0CE5 34C0 606D 7387 E46A FFBD A4CE
To claim this, I am signing this object:
import json | |
import requests | |
import xml.etree.cElementTree as XML | |
SOAP_TEMPLATE = '<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><s:Body>{0}</s:Body></s:Envelope>' | |
GET_QUEUE_BODY_TEMPLATE = '<u:Browse xmlns:u="urn:schemas-upnp-org:service:ContentDirectory:1"><ObjectID>Q:0</ObjectID><BrowseFlag>BrowseDirectChildren</BrowseFlag><Filter>dc:title,res,dc:creator,upnp:artist,upnp:album,upnp:albumArtURI</Filter><StartingIndex>{0}</StartingIndex><RequestedCount>{1}</RequestedCount><SortCriteria></SortCriteria></u:Browse>' | |
def cmd(sonos_ip, endpoint, soap_action, body): | |
headers = { |
import com.jtelegram.api.TelegramBotRegistry; | |
import com.jtelegram.api.chat.id.ChatId; | |
import com.jtelegram.api.commands.filters.MentionFilter; | |
import com.jtelegram.api.commands.filters.TextFilter; | |
import com.jtelegram.api.menu.Menu; | |
import com.jtelegram.api.menu.MenuHandler; | |
import com.jtelegram.api.menu.viewer.RegularMenuViewer; | |
import com.jtelegram.api.requests.message.send.SendText; | |
import com.jtelegram.api.update.PollingUpdateProvider; | |
import com.jtelegram.api.util.TextBuilder; |
public class Permute { | |
public static void main(String[] args) { | |
for (String res : permute(args.length > 0 ? args[0] : "AABC")) { | |
System.out.println(res); | |
} | |
} | |
public String[] permute(String str) { | |
if (str.length() <= 1) |
I hereby claim:
To claim this, I am signing this object:
package ass1; | |
public class MyCoolGameObject extends GameObject { | |
public MyCoolGameObject() { | |
super(GameObject.ROOT); | |
new PolygonalGameObject(this, new double[] {0, 0, 0, .5, .5, .5, .5, 0}, new double[] {1, 0, 0, .5}, null); | |
new LineGameObject(this, 0, 0, 1, 0, new double[] {0, 1, 0, .5}); | |
new LineGameObject(this, 0, 0, 0, 1, new double[] {0, 1, 0, .5}); |
#!/usr/bin/env python | |
import re | |
import urllib2 | |
import bs4 | |
BASE_URL = 'http://www.bbc.co.uk/news/politics/eu_referendum/results/local/' | |
VOTES = re.compile(r'[0-9]+(?:,[0-9]+)*') | |
def get_urls(): |
#!/usr/bin/env python | |
import re | |
import urllib2 | |
import bs4 | |
BASE_URL = 'http://www.bbc.co.uk/news/politics/eu_referendum/results/local/' | |
VOTES = re.compile(r'[0-9]+(?:,[0-9]+)*') | |
def get_urls(): |
#include <Wire.h> | |
#include <LiquidCrystal_I2C.h> | |
#define I2C_ADDR 0x3F | |
#define TEMP_SENSOR A0 | |
LiquidCrystal_I2C lcd(I2C_ADDR, 20, 4); | |
void setup() { |
import sys | |
import time | |
import urllib | |
import urllib2 | |
import bs4 | |
headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64; rv:40.0) Gecko/20100101 Firefox/40.0'} | |
def scrape(id): | |
req = urllib2.Request('http://www.strawpoll.me/%s' % id, headers=headers) |
def number_shuffle(number) | |
dig = number.to_s.split '' | |
if dig.length == 1 | |
return dig | |
end | |
out = [] | |
(0...dig.length).each do |d| | |
nums = [] | |
if d > 0 | |
nums = nums << dig[0..d-1] |