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
# Example code doing SSL using pycurl and CurlMulti | |
import pycurl | |
import cStringIO | |
response_buffer = cStringIO.StringIO() | |
multi = pycurl.CurlMulti() | |
curl = pycurl.Curl() | |
curl.setopt(pycurl.URL, 'https://www.yammer.com') | |
curl.setopt(pycurl.SSL_VERIFYPEER, 1) |
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
"CREATE TRIGGER Dive_Update AFTER " | |
"UPDATE OF dive_datetime ON Dive BEGIN " | |
"UPDATE Dive " | |
"SET dive_number= " | |
" (SELECT CASE " | |
" WHEN dive_id = NEW.dive_id THEN " | |
" /* The updated dive, set the number to the number of older dives */ " | |
" 1 + (SELECT COUNT(*) FROM Dive WHERE dive_datetime < NEW.dive_datetime) " | |
" WHEN NEW.dive_datetime > OLD.dive_datetime " | |
" /* All other dive, move by +/- 1 depending on whether we've moved the datetime " |
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
DROP TRIGGER Dive_Insert; | |
/* | |
if no dives predate this then | |
if lowest number is > 1: | |
lowest number - 1 | |
else | |
1 | |
else | |
pick most recent +1 |
NewerOlder