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 sys | |
import pyExcelerator | |
from pyExcelerator import * | |
import xlrd | |
from database import PGDatabase | |
mydb = PGDatabase() | |
#mydb = mydbC.connect() |
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 Products.CMFCore.utils import getToolByName | |
request = container.REQUEST | |
catalog = getToolByName(context, 'portal_catalog') | |
path = '/mysite/temples' | |
for brain in catalog(portal_type='Temple', path=path): | |
try: | |
obj = brain.getObject() | |
print brain.getPath().split('/')[5] + ', ' + brain['Title'] + ', ' + obj.getEra() | |
except: |
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
# !/usr/bin/python | |
# -*- coding: gbk -*- | |
# http://hi.baidu.com/xiaopch/item/3a54eec3d93f9e2def466548 | |
from __future__ import division | |
import os | |
import codecs | |
import nltk | |
from nltk import * | |
##from nltk.book import * |
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 bs4 import BeautifulSoup | |
import requests | |
r = requests.get("http://www.nasdaq.com/symbol/f/dividend-history") | |
data = r.content | |
soup = BeautifulSoup(data) | |
for i in range(1,31): | |
id_exdate = "#quotes_content_left_dividendhistoryGrid_exdate_"+str(i) | |
id_cash = "#quotes_content_left_dividendhistoryGrid_CashAmount_"+str(i) | |
id_decl = "#quotes_content_left_dividendhistoryGrid_DeclDate_"+str(i) | |
id_rec = "#quotes_content_left_dividendhistoryGrid_RecDate_"+str(i) |
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
# Configuration file for dircolors, a utility to help you set the | |
# LS_COLORS environment variable used by GNU ls with the --color option. | |
# Copyright (C) 1996, 1999-2011 Free Software Foundation, Inc. | |
# Copying and distribution of this file, with or without modification, | |
# are permitted provided the copyright notice and this notice are preserved. | |
# The keywords COLOR, OPTIONS, and EIGHTBIT (honored by the | |
# slackware version of dircolors) are recognized but ignored. | |
# Below, there should be one TERM entry for each termtype that is colorizable | |
TERM Eterm | |
TERM ansi |
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 Testing import makerequest | |
root = makerequest.makerequest(app) | |
site = root.mysite | |
folder = site.myfolder['some-folder'] | |
admin = root.acl_users.getUserById('admin') | |
admin = admin.__of__(site.acl_users) | |
from AccessControl.SecurityManagement import newSecurityManager | |
newSecurityManager(None, admin) |
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
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" | |
xmlns:tal="http://xml.zope.org/namespaces/tal" | |
xmlns:metal="http://xml.zope.org/namespaces/metal" | |
xmlns:i18n="http://xml.zope.org/namespaces/i18n" | |
lang="en" | |
metal:use-macro="context/main_template/macros/master" | |
i18n:domain="plone"> | |
<body> |
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
>>> dir(site.myfolder['page-one']) | |
['COPY', 'COPY__roles__', | |
'Contributors', 'Contributors__roles__', | |
'CookedBody', 'CookedBody__roles__', | |
'CreationDate', 'CreationDate__roles__', | |
'Creator', 'Creator__roles__', 'Creators', 'Creators__roles__', | |
'DELETE', 'DELETE__roles__', | |
'Date', 'Date__roles__', | |
'Description', 'Description__roles__', | |
'EditableBody', 'EditableBody__roles__', |
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
/* main menu sticky setting */ | |
#st-wrapper { | |
width: 100%; | |
margin: 0 auto; | |
} | |
#main-nav-holder { | |
height: 56px; | |
} | |
#main-nav { |
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
<nav id="mainMenu" class="tencol last"> | |
<a class="toggleMenu" href="#" style="display: none;">Menu <span class="expandicon"><img src="http://talks.taishinart.org.tw/pic/menu-expand.png"></span></a> | |
<ul class="nav" tal:define="root_url context/@@plone_portal_state/navigation_root_url; isAnon context/@@plone_portal_state/anonymous" > | |
<li class=""><a class="rootmenulink parent" href="#" tal:attributes="href string:${root_url}/event/info">藝術雷達<span class="eng-info" style="cursor: default">TS Art Radar</span></a> | |
<ul class="submenu"> | |
<li class="menuitem"><a class="menulink" href="#" tal:attributes="href string:${root_url}/event/info">藝術動態</a> </li> | |
<li class="menuitem"><a class="menulink" href="#" tal:attributes="href string:${root_url}/event/talks">藝論紛紛</a> </li> | |
<li class="menuitem" tal:condition="python: not isAnon"><a class="menulink" href="#" tal:attributes="href string:${root_url}/event/advisors">推薦團</a> </li> | |
</ul> |