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
class Node(object): | |
def __init__(self, initdata=None, next=None): | |
self.data = initdata | |
self.next = next | |
def getData(self): | |
return self.data | |
def getNext(self): | |
return self.next |
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
class TreeNode: | |
def __init__(self, key, value, left=None, right=None, parent=None): | |
self.key = key | |
self.value = value | |
self.left = left | |
self.right = right | |
self.parent = parent | |
def hasLeft(self): |
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 qsort(arr): | |
low = 0 | |
high = len(arr) - 1 | |
_sort(arr, low, high) | |
return arr | |
def _sort(arr, low, high): | |
if low < high: |
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
%matplotlib inline | |
# Import Libraries | |
from __future__ import division, print_function | |
import os | |
import json | |
from glob import glob | |
import numpy as np | |
from matplotlib import pyplot as plt | |
import utils |
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
SELECT | |
OrderRel.PartNum, | |
Sum(OrderRel.OurReqQty) AS 'Required for 2017' | |
FROM ERP10PROD.Erp.OrderRel OrderRel | |
WHERE (OrderRel.ReqDate<'20171231') | |
GROUP BY OrderRel.PartNum |
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
SELECT PartMtl.PartNum, PartMtl.MtlPartNum, PartMtl.QtyPer, ROUND(12/PartMtl.QtyPer,0) AS 'Bar Yield' | |
FROM ERP10PROD.Erp.PartMtl PartMtl | |
WHERE (PartMtl.UOMCode='FT') |
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
SELECT | |
O.PartNum, | |
SUM(O.OurReqQty) AS [2017 Total Due], | |
ROUND(12/ PartMtl.QtyPer,0) [Bar Yield Qty] | |
FROM ERP10PROD.Erp.OrderRel O | |
LEFT JOIN ERP10PROD.Erp.PartMtl PartMtl ON | |
O.Company = PartMtl.Company AND | |
O.PartNum = PartMtl.PartNum AND |
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
SELECT | |
PartBin.PartNum, | |
Sum(PartBin.OnhandQty) AS 'ON Hand' | |
FROM ERP10PROD.Erp.PartBin PartBin | |
WHERE (PartBin.WarehouseCode='FGI') | |
GROUP BY PartBin.PartNum |
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
--Query of yesterday's labor notes in Epicor ERP system. If Today is monday (assuming no labor on sunday) pulls from Friday | |
IF EXISTS ((SELECT * FROM ERP.LaborDtl WHERE Labordtl.ClockinDate = dateADD(day, -1, Convert(DAte, getdate())))) | |
BEGIN | |
SELECT | |
DATENAME(weekday, L.CLOCKINDATE), | |
j.PartNum, | |
l.JobNum, | |
L.OprSeq, |
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
--Sums up burden hours on each machine as recorded in MES, calculates what the hours should be based on qty made and Production Rate. | |
SELECT L.PayrollDate, Sum(L.BurdenHrs) AS [Total Burden Hours], COUNT(L.LaborDtlSeq) AS [#Activities], COUNT(DISTINCT L.ResourceID) AS [Total Active Machines], | |
Sum(L.LaborQty / (J.ProdStandard + .0001)) AS [Total Calculated Burden Hours], UPPER(L.ResourceID) | |
FROM ERP10PROD.Erp.LaborDtl L | |
LEFT JOIN ERP10PROD.Erp.JobOper J ON | |
L.Company = J.Company AND | |
L.AssemblySeq = J.AssemblySeq AND | |
L.JobNum = J.JobNum AND | |
L.Oprseq = J.OprSeq |
OlderNewer