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
import json,urllib,cairoplot | |
url='http://thedataweb.rm.census.gov/data/2010/sf1?key={YOUR_KEY_HERE}&get=P0010001,NAME&for=county:025,017,061,165&in=state:39' | |
result=json.load(urllib.urlopen(url)) | |
graphData=[] | |
graphLabels=[] | |
for row in result: |
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
RUN PGM=MATRIX | |
FILEO PRINTO="WrittenScript.S" | |
PAR ZONES=1 | |
PRINT PRINTO=1 LIST="RUN PGM=MATRIX" | |
PRINT PRINTO=1 LIST="FILEO RECO=\"INPUT\DATABASE.DBF\" FIELDS=" | |
LOOP i=1,30 | |
_yr=2010+i |
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
public interface voyagerDLL extends Library{ | |
voyagerDLL INSTANCE=(voyagerDLL) Native.loadLibrary("VoyagerFileAccess",voyagerDLL.class); | |
Pointer MatReaderOpen(String filename, Pointer errMsg, int errBuffLen); | |
int MatReaderGetNumMats(Pointer state); | |
int MatReaderGetNumZones(Pointer state); | |
int MatReaderGetMatrixNames(Pointer state, String[] names); | |
int MatReaderGetRow(Pointer state, int MatNumber, int RowNumber, double[] buffer); | |
void MatReaderClose(Pointer state); | |
} |
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
public static void main(String[] args) { | |
try{ | |
voyagerDLL vdll=voyagerDLL.INSTANCE; | |
String err=""; | |
int errB=256; | |
Pointer state=vdll.MatReaderOpen("C:\\Modelrun\\05e05i05i05aV76_Validation\\VEHTRPAM.MAT", err, errB); | |
int nMats=vdll.MatReaderGetNumMats(state); | |
int Zones=vdll.MatReaderGetNumZones(state); | |
String[] matNames=new String[nMats]; | |
int names=vdll.MatReaderGetMatrixNames(state, matNames); |
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
public interface voyagerDLL extends Library{ | |
voyagerDLL INSTANCE=(voyagerDLL) Native.loadLibrary("VoyagerFileAccess",voyagerDLL.class); | |
Pointer PathReaderOpen(String filename, String errMsg, int errBL); | |
void PathReaderClose(Pointer state); | |
int PathReaderGetTableNames(Pointer state, String[] names); | |
int PathReaderGetNumZones(Pointer state); | |
int PathReaderGetNumTables(Pointer state); | |
int PathReaderGetNumIterations(Pointer state); | |
int PathReaderGetHighestVol(Pointer state); | |
int PathReaderGetMaxPathLen(Pointer state); |
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
public static void main(String[] args) { | |
try{ | |
voyagerDLL vdll=voyagerDLL.INSTANCE; | |
String err=""; | |
int errB=256; | |
Pointer pathState=vdll.PathReaderOpen("C:\\Modelrun\\FieldsErtel\\05e05i05i05aV76FE\\AMPATHS.PTH", err, errB); | |
int nTables=vdll.PathReaderGetNumTables(pathState); | |
String[] tNames=new String[nTables]; | |
int tnr=vdll.PathReaderGetTableNames(pathState, tNames); | |
int prZones=vdll.PathReaderGetNumZones(pathState); |
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
//Law of cosines - cos angle = ((Ladj side 1)^2+(Ladj side 2)^2-(Lopposite)^2) / (2(Ladj side 1)(Ladj side 2)) | |
double LAdj1=0; | |
double LAdj2=0; | |
double LOpp=0; | |
LAdj1=Math.sqrt(Math.pow(B.getX()-A.getX(),2)+Math.pow(B.getY()-A.getY(),2)); | |
LAdj2=Math.sqrt(Math.pow(C.getX()-B.getX(),2)+Math.pow(C.getY()-B.getY(),2)); | |
LOpp=Math.sqrt(Math.pow(C.getX()-A.getX(),2)+Math.pow(C.getY()-A.getY(),2)); | |
theta=Math.acos((Math.pow(LAdj1, 2)+Math.pow(LAdj2, 2)-Math.pow(LOpp, 2))/(2*LAdj1*LAdj2)); |
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
//Check for specific nodes | |
bool output=false; | |
for(int pn=1;pn<prrn-1;pn++){ | |
if(prd.nodes[pn]==9798 && prd.nodes[pn+1]==9750) | |
output=true; | |
} | |
if(output){ | |
of.open(argv[2],iostream::trunc); | |
of << prd.I << ","; |
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
gawk 'BEGIN {FS=","};{print $1,",",$NF}' amPaths.csv >amOD.CSV |
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 [NAICS2]=11 THEN | |
Output="Agr" | |
ELSEIF [NAICS2]>11 AND [NAICS2]<31 THEN | |
Output="Min" | |
ELSEIF [NAICS2]>=31 AND [NAICS2]<33 THEN | |
Output="Man1" | |
ELSEIF [NAICS2]=33 THEN | |
Output="Man2" | |
ELSEIF [NAICS2]=42 THEN | |
Output="Who" |
OlderNewer