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
| # coding=utf-8 | |
| __author__ = 'Maxime Biette' | |
| conf = { | |
| 'from': '[email protected]', | |
| 'to': '[email protected]', | |
| 'server': 'smtp.gmail.com', | |
| 'port': '587', | |
| 'tls': 'yes', | |
| 'login': '[email protected]', |
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
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Text; | |
| using System.Threading.Tasks; | |
| using Oracle.DataAccess.Client; | |
| using Microsoft.VisualBasic.FileIO; | |
| namespace CSVToOracle | |
| { |
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 pyodbc | |
| class CommitMode: | |
| NONE = 0 #Commit immediate (*NONE) --> QSQCLIPKGN | |
| CS = 1 #Read committed (*CS) --> QSQCLIPKGS | |
| CHG = 2 #Read uncommitted (*CHG) --> QSQCLIPKGC | |
| ALL = 3 #Repeatable read (*ALL) --> QSQCLIPKGA | |
| RR = 4 #Serializable (*RR) --> QSQCLIPKGL | |
| class ConnectionType: |
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
| Function GetFileContentFromAS400(host As String, iasp as String, library As String, filename As String) As String | |
| Dim myConnect As New ADODB.Connection | |
| Dim rsRecords As New ADODB.Recordset | |
| Dim fileContent As String | |
| With myConnect | |
| If .State = adStateOpen Then | |
| myConnect.Close | |
| End If | |
| .Open "Driver=iSeries Access ODBC Driver;SYSTEM=" + host + ";DATABASE=" + iasp + ";COMPRESSION=1;TRANSLATE=1;" | |
| End With |
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 win32com.client | |
| def main(host, iasp, library, file): | |
| conn = win32com.client.Dispatch(r'ADODB.Connection') | |
| DSN=('DRIVER=iSeries Access ODBC Driver;SYSTEM='+host+';DATABASE='+iasp+';COMPRESSION=1;TRANSLATE=1;') | |
| conn.Open(DSN) # Will prompt for username/password or connect with Kerberos | |
| rs = win32com.client.Dispatch(r'ADODB.Recordset') | |
| rs.Open("SELECT * FROM "+library+"."+file, conn, 1, 3) | |
| # Get records and fields one by one |
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
| Monty Hall |
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 google.appengine.ext import webapp | |
| from google.appengine.ext.webapp import util | |
| from google.appengine.api import urlfetch | |
| class MainHandler(webapp.RequestHandler): | |
| def get(self): | |
| url = "" | |
| result = urlfetch.fetch(url) | |
| if result.status_code == 200: |
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 offer import offer | |
| import psycopg2 | |
| class dbOffer: | |
| def __init__(self,sourcename,host="localhost",port="5432",database="rsstracker",user="rsstracker",password="rsstracker"): | |
| psycopg2.extensions.register_type(psycopg2.extensions.UNICODE) | |
| psycopg2.extensions.register_type(psycopg2.extensions.UNICODEARRAY) | |
| self.conn = psycopg2.connect(host=host,port=port,database=database,user=user,password=password) | |
| self.sourcename = sourcename |