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
| package net.mvaz.examples.visualization.processingparis; | |
| import java.util.ArrayList; | |
| import java.util.Calendar; | |
| import java.util.HashMap; | |
| import java.util.HashSet; | |
| import java.util.List; | |
| import java.util.Map; | |
| import java.util.Set; |
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
| package net.mvaz.examples.graph; | |
| import org.jgrapht.DirectedGraph; | |
| import org.jgrapht.alg.DijkstraShortestPath; | |
| import org.jgrapht.event.ConnectedComponentTraversalEvent; | |
| import org.jgrapht.event.TraversalListenerAdapter; | |
| import org.jgrapht.event.VertexTraversalEvent; | |
| import org.jgrapht.graph.SimpleDirectedGraph; | |
| import org.jgrapht.traverse.DepthFirstIterator; | |
| import org.jgrapht.traverse.GraphIterator; |
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
| mvn install:install-file -Dfile=weka.jar -DgroupId=nz.ac.waikato -DartifactId=weka -Dversion=3.7.3 -Dpackaging=jar -DgeneratePom=true -Dsources=weka-src.jar |
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
| class TzCronTrigger(CronTrigger): | |
| def __init__(self,**values): | |
| self.tz = values.pop('tz', None) | |
| if self.tz: | |
| if self.tz not in pytz.all_timezones: | |
| raise ValueError("invalid specified timezone '%s'" % self.tz) | |
| self.tz = pytz.timezone( self.tz ) | |
| super(TzCronTrigger, self).__init__(**values) | |
| def get_next_fire_time(self, start_date): |
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 site | |
| from os import environ | |
| from os.path import join | |
| import sys | |
| if 'VIRTUAL_ENV' in environ: | |
| virtual_env = join(environ.get('VIRTUAL_ENV'), | |
| 'lib', | |
| 'python%d.%d' % sys.version_info[:2], | |
| 'site-packages') |
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> | |
| <html> | |
| <head> | |
| <script type="text/javascript" src="http://mbostock.github.com/d3/d3.js?2.6.1"></script> | |
| <script type="text/javascript" src="http://polymaps.org/polymaps.min.js?2.5.0"></script> | |
| <style type="text/css"> | |
| @import url("http://polymaps.org/style.css"); | |
| html, 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
| select --* | |
| col.table_name, col.column_name, cc.constraint_name , rel.table_name, rel.column_name | |
| from user_tab_columns col, | |
| user_cons_columns con, | |
| user_constraints cc, | |
| user_cons_columns rel | |
| where col.table_name = con.table_name | |
| and col.column_name = con.column_name | |
| and con.constraint_name = cc.constraint_name | |
| and cc.constraint_type = 'R' |
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
| # http://code.google.com/p/pyodbc/wiki/GettingStarted | |
| # http://code.google.com/p/pyodbc/wiki/ConnectionStrings | |
| import pyodbc | |
| cnxn_string = r'DRIVER={Microsoft Access Driver (*.mdb)};DBQ=C:\PATH\TO\FILE.mdb' | |
| cnxn = pyodbc.connect(cnxn_string) | |
| cursor = cnxn.cursor() | |
| cursor.execute("SELECT * from MY_TABLE") |
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 cx_Oracle | |
| import pandas | |
| connection = cx_Oracle.connect('username/pwd@host:port/dbname') | |
| def read_query(connection, query): | |
| cursor = connection.cursor() | |
| try: | |
| cursor.execute( query ) | |
| names = [ x[0] for x in cursor.description] |
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
| # http://code.activestate.com/recipes/576534-dump-oracle-db-schema-to-text/ | |
| #!/usr/bin/env python | |
| # -*- coding: utf8 -*- | |
| __version__ = '$Id: schema_ora.py 928 2012-01-12 19:09:34Z tt $' | |
| # export Oracle schema to text | |
| # usable to compare databases that should be the same | |
| # |