This file contains 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
WITH temp_Pages (pId, pLangId,pParentId, pFriendlyUrl) AS | |
( | |
SELECT pId, pLangId, | |
pParentId, | |
CONVERT(NVARCHAR(200), | |
'http://' + | |
(SELECT e.siteName FROM cms_Sites e WHERE e.siteID=pSiteID) + | |
'/' + | |
(SELECT c.langShortName FROM cms_Languages c WHERE c.langID=pLangID) + | |
'/' + |
This file contains 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
mysql> explain select p.id,h.host,i.key_,p.clock,p.timestamp, | |
p.source,p.severity,p.value,p.logeventid | |
from hosts h,items i,proxy_history p where h.hostid=i.hostid | |
and i.itemid=p.itemid and p.id>21824754 order by p.id limit 1000\G | |
*************************** 1. row *************************** | |
id: 1 | |
select_type: SIMPLE | |
table: p | |
type: range | |
possible_keys: PRIMARY,id |
This file contains 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
mysql> explain select p.id,h.host,i.key_,p.clock,p.timestamp, | |
p.source,p.severity,p.value,p.logeventid | |
from hosts h inner join items i on h.hostid=i.hostid | |
right outer join proxy_history p on i.itemid=p.itemid | |
where p.id>21824754 order by p.id limit 10\G | |
*************************** 1. row *************************** | |
id: 1 | |
select_type: SIMPLE | |
table: p | |
type: range |
This file contains 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
#!/usr/bin/python2.7 | |
from random import randrange | |
from datetime import timedelta,datetime | |
def prepare_message(): | |
message = """<?xml version="1.0" encoding="UTF-8"?> | |
<SOAP-ENV:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" | |
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" | |
xmlns:xsd="http://www.w3.org/2001/XMLSchema" |
This file contains 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
#!/usr/bin/python | |
import httplib, time | |
from flights_pb2 import SearchRequest | |
class FlightsService(object): | |
"""Basic Flights service implementation with common methods""" | |
def __init__(self,host="10.0.0.210",port=80): | |
self.__ws = httplib.HTTPConnection(host,port) |
This file contains 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
if (type.IsMap()) | |
{ | |
Label work = il.DefineLabel(); | |
Label getNext = il.DefineLabel(); | |
Label end = il.DefineLabel(); | |
il.EmitLd(arg_writer); | |
// 1. Get length of the dictionary | |
il.EmitLd(arg_obj); |
This file contains 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
server { | |
... | |
# This is a copy&paste snippet to put your server in maintenance mode | |
error_page 503 @maintenance; | |
location @maintenance { | |
rewrite ^(.*)$ /maint.html break; | |
} | |
return 503; |
This file contains 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
#! /bin/sh | |
### BEGIN INIT INFO | |
# Provides: FastCGI servers for Django | |
# Required-Start: $network | |
# Required-Stop: $network | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: Start FastCGI servers with Django. | |
# Description: Django, in order to operate with FastCGI, must be started | |
# in a very specific way with manage.py. This must be done |
This file contains 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
def bootstrap(config_uri, options=None): | |
""" | |
Bootstraps a pyramid environment | |
Differences with the default pyramid bootstrap: | |
- It handles tasks.base_url | |
""" | |
app = get_app(config_uri, options=options) | |
registry = global_registries.last | |
base_url = registry.settings.get('tasks.base_url', None) |
This file contains 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
""" | |
ZODB support in flask | |
Usage: `DB = FlaskZODB(APP)` | |
In your views use `DB.root` to get the database root dictionary. | |
""" | |
from flask import _app_ctx_stack as stack | |
import transaction | |
import zodburi |
OlderNewer