This example demonstrates how to add and remove nodes and links from a force layout. The graph initially appears with three nodes A, B and C connected in a loop. Three seconds later, node B is removed, along with the links B-A and B-C. At six seconds, node B is reintroduced, restoring the original links B-A and B-C. This example uses the general update pattern for data joins.
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
""" | |
This comes from Mahmoud Hashemi @mhashemi found at: | |
https://gist.github.com/mahmoud/db02d16ac89fa401b968 | |
This is an extension of the technique first detailed here: | |
http://sedimental.org/remap.html#add_common_keys | |
In short, it calls remap on each container, back to front, using the accumulating | |
previous values as the default for the current iteration. |
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
(Pdb) w | |
<stdin>(1)<module>() | |
c:\old_user\workspace\cyopenssl\test\_test.py(117)session_test() | |
-> tls_c.send('hello') | |
c:\old_user\workspace\cyopenssl\test\cyopenssl\openssl.pyx(680)cyopenssl.openssl.Socket.send (cyopenssl/openssl.c:6673)() | |
> c:\old_user\workspace\cyopenssl\test\cyopenssl\openssl.pyx(776)cyopenssl.openssl.Socket._do_ssl (cyopenssl/openssl.c:8320)() | |
(Pdb) l | |
771 elif err == SSL_ERROR_SSL: | |
772 raise SSLError("SSL_ERROR_SSL") | |
773 elif err == SSL_ERROR_WANT_READ: |
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 os | |
import random | |
import threading | |
import sqlite3 | |
class W(threading.Thread): | |
def __init__(self, connection): | |
super(W, self).__init__() |
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
SELECT rc.rc_id, | |
rc.rc_cur_id, | |
rc.rc_title, | |
rc.rc_timestamp, | |
rc.rc_this_oldid, | |
rc.rc_last_oldid, | |
rc.rc_user_text, | |
rc.rc_old_len, | |
rc.rc_new_len, | |
rc.rc_comment |
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
<!doctype html> | |
<meta charset="utf-8"> | |
<title>C3 visualization</title> | |
<style> | |
text { | |
font: 300 16px "Helvetica Neue"; | |
} |
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
''' | |
JKS file format decoder. | |
Use in conjunction with PyOpenSSL to translate to PEM, or load private key and certs | |
directly into openssl structs and wrap sockets. | |
See http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/6-b14/sun/security/provider/JavaKeyStore.java#JavaKeyStore.engineLoad%28java.io.InputStream%2Cchar%5B%5D%29 | |
''' | |
import struct | |
import hashlib |
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
from StringIO import StringIO | |
import xml.etree.cElementTree as ET | |
def pretty_xml(xml_str, indent=" "): | |
""" | |
A very simple, hopefully not simplistic, XML pretty printer. | |
Concept courtesy Mark Williams. | |
""" | |
if not hasattr(xml_str, "read"): # ElementTree uses file-like objects | |
fn = StringIO(xml_str) # cStringIO doesn't support UTF-8 |