This file contains hidden or 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
/** | |
* compile: g++ -std=c++0x -o dnssd dnssd.cpp -lresolv | |
* Your g++ compiler must have lambda support | |
* | |
* Code based on examples from: | |
* http://www.cs.columbia.edu/~zwb/project/dotslash/dots_apache/dnsc.c | |
* http://people.samba.org/bzr/jerry/slag/unix/query-srv.c | |
*/ | |
#include <arpa/nameser.h> | |
#include <functional> |
This file contains hidden or 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
import re | |
from HTMLParser import HTMLParser | |
whitespace = re.compile('(\w+)') | |
class HTMLAbbrev(HTMLParser): | |
def __init__(self, maxlength, *args, **kwargs): | |
HTMLParser.__init__(self, *args, **kwargs) | |
self.stack = [] |