Best JavaScript code snippet using best
PROC_F_CI_CUST_SIGN.py
Source:PROC_F_CI_CUST_SIGN.py
1#coding=UTF-82from pyspark import SparkContext, SparkConf, SQLContext, Row, HiveContext3from pyspark.sql.types import *4from datetime import date, datetime, timedelta5import sys, re, os6st = datetime.now()7conf = SparkConf().setAppName('PROC_F_CI_CUST_SIGN').setMaster(sys.argv[2])8sc = SparkContext(conf = conf)9sc.setLogLevel('WARN')10if len(sys.argv) > 5:11 if sys.argv[5] == "hive":12 sqlContext = HiveContext(sc)13else:14 sqlContext = SQLContext(sc)15hdfs = sys.argv[3]16dbname = sys.argv[4]17#å¤çéè¦ä½¿ç¨çæ¥æ18etl_date = sys.argv[1]19#etlæ¥æ20V_DT = etl_date 21#ä¸ä¸æ¥æ¥æ22V_DT_LD = (date(int(etl_date[0:4]), int(etl_date[4:6]), int(etl_date[6:8])) + timedelta(-1)).strftime("%Y%m%d")23#æåæ¥æ24V_DT_FMD = date(int(etl_date[0:4]), int(etl_date[4:6]), 1).strftime("%Y%m%d") 25#ä¸ææ«æ¥æ26V_DT_LMD = (date(int(etl_date[0:4]), int(etl_date[4:6]), 1) + timedelta(-1)).strftime("%Y%m%d")27#10ä½æ¥æ28V_DT10 = (date(int(etl_date[0:4]), int(etl_date[4:6]), int(etl_date[6:8]))).strftime("%Y-%m-%d")29V_STEP = 030#æ¸
é¤æ°æ®31ret = os.system("hdfs dfs -rm -r /"+dbname+"/OCRM_F_CI_CUST_SIGN/*.parquet")32#æ¢å¤æ°æ®å°ä»æ¥æ°æ®æ件33ret = os.system("hdfs dfs -cp -f /"+dbname+"/OCRM_F_CI_CUST_SIGN_BK/"+V_DT_LD+".parquet /"+dbname+"/OCRM_F_CI_CUST_SIGN/"+V_DT+".parquet")34F_CSP_WIRESIGNINFOHIST = sqlContext.read.parquet(hdfs+'/F_CSP_WIRESIGNINFOHIST/*')35F_CSP_WIRESIGNINFOHIST.registerTempTable("F_CSP_WIRESIGNINFOHIST")36F_DP_CBOD_SAACNACN = sqlContext.read.parquet(hdfs+'/F_DP_CBOD_SAACNACN/*')37F_DP_CBOD_SAACNACN.registerTempTable("F_DP_CBOD_SAACNACN")38F_CSP_PERNETBANKCIFINFOHIST = sqlContext.read.parquet(hdfs+'/F_CSP_PERNETBANKCIFINFOHIST/*')39F_CSP_PERNETBANKCIFINFOHIST.registerTempTable("F_CSP_PERNETBANKCIFINFOHIST")40F_CI_AFA_CUSTINFO = sqlContext.read.parquet(hdfs+'/F_CI_AFA_CUSTINFO/*')41F_CI_AFA_CUSTINFO.registerTempTable("F_CI_AFA_CUSTINFO")42F_CSP_SMSSIGNINFOHIST = sqlContext.read.parquet(hdfs+'/F_CSP_SMSSIGNINFOHIST/*')43F_CSP_SMSSIGNINFOHIST.registerTempTable("F_CSP_SMSSIGNINFOHIST")44F_NI_AFA_ELEC_DKGX = sqlContext.read.parquet(hdfs+'/F_NI_AFA_ELEC_DKGX/*')45F_NI_AFA_ELEC_DKGX.registerTempTable("F_NI_AFA_ELEC_DKGX")46OCRM_F_DP_CARD_INFO = sqlContext.read.parquet(hdfs+'/OCRM_F_DP_CARD_INFO/*')47OCRM_F_DP_CARD_INFO.registerTempTable("OCRM_F_DP_CARD_INFO")48OCRM_F_CI_CUST_DESC = sqlContext.read.parquet(hdfs+'/OCRM_F_CI_CUST_DESC/*')49OCRM_F_CI_CUST_DESC.registerTempTable("OCRM_F_CI_CUST_DESC")50F_CSP_MOBILEBANKCIFINFOHIST = sqlContext.read.parquet(hdfs+'/F_CSP_MOBILEBANKCIFINFOHIST/*')51F_CSP_MOBILEBANKCIFINFOHIST.registerTempTable("F_CSP_MOBILEBANKCIFINFOHIST")52F_CSP_ENTBANKCIFINFOHIST = sqlContext.read.parquet(hdfs+'/F_CSP_ENTBANKCIFINFOHIST/*')53F_CSP_ENTBANKCIFINFOHIST.registerTempTable("F_CSP_ENTBANKCIFINFOHIST")54F_CSP_TVSIGNINFOHIST = sqlContext.read.parquet(hdfs+'/F_CSP_TVSIGNINFOHIST/*')55F_CSP_TVSIGNINFOHIST.registerTempTable("F_CSP_TVSIGNINFOHIST")56#ä»»å¡[21] 001-01::57V_STEP = V_STEP + 158sql = """59 SELECT COALESCE(B.SA_CUST_NO, C.CR_CUST_NO) AS CUST_ID 60 ,CASE WHEN A.ZT='0' THEN '1' ELSE '0' END AS STATE 61 ,A.FR_ID AS FR_ID 62 FROM F_NI_AFA_ELEC_DKGX A --ç级çµè´¹ä»£æ£å
³ç³»è¡¨63 LEFT JOIN F_DP_CBOD_SAACNACN B --æ´»å主档64 ON A.YHZH = B.SA_ACCT_NO 65 AND B.FR_ID = A.FR_ID 66 LEFT JOIN OCRM_F_DP_CARD_INFO C --å¡æ¡£67 ON A.YHZH = C.CR_CRD_NO 68 AND C.FR_ID = A.FR_ID 69 WHERE A.SYSID = '800012' 70 AND A.ODS_ST_DATE = V_DT 71 GROUP BY B.SA_CUST_NO 72 ,C.CR_CUST_NO 73 ,A.ZT 74 ,A.FR_ID """75sql = re.sub(r"\bV_DT\b", "'"+V_DT10+"'", sql)76TMP_OCRM_F_CI_CUST_SIGN_01 = sqlContext.sql(sql)77TMP_OCRM_F_CI_CUST_SIGN_01.registerTempTable("TMP_OCRM_F_CI_CUST_SIGN_01")78dfn="TMP_OCRM_F_CI_CUST_SIGN_01/"+V_DT+".parquet"79TMP_OCRM_F_CI_CUST_SIGN_01.cache()80nrows = TMP_OCRM_F_CI_CUST_SIGN_01.count()81ret = os.system("hdfs dfs -rm -r /"+dbname+"/TMP_OCRM_F_CI_CUST_SIGN_01/*.parquet")82TMP_OCRM_F_CI_CUST_SIGN_01.write.save(path=hdfs + '/' + dfn, mode='overwrite')83TMP_OCRM_F_CI_CUST_SIGN_01.unpersist()84et = datetime.now()85print("Step %d start[%s] end[%s] use %d seconds, insert TMP_OCRM_F_CI_CUST_SIGN_01 lines %d") % (V_STEP, st.strftime("%H:%M:%S"), et.strftime("%H:%M:%S"), (et-st).seconds, nrows)86#ä»»å¡[21] 001-02::87V_STEP = V_STEP + 188sql = """89 SELECT DISTINCT COALESCE(B.SA_CUST_NO, C.CR_CUST_NO) AS CUST_ID 90 ,CASE WHEN SYSID = '800235' THEN 'Water' 91 WHEN SYSID = '800037' THEN 'Gas'92 END AS TYPE 93 ,CASE WHEN A.SIGNSTATE = '0' THEN '1' ELSE '0' END AS STATE 94 ,A.FR_ID AS FR_ID 95 FROM F_CI_AFA_CUSTINFO A --代çåä½å®¢æ·ç¾çº¦ä¿¡æ¯è¡¨96 LEFT JOIN F_DP_CBOD_SAACNACN B --æ´»å主档97 ON A.ACCOUNT = B.SA_ACCT_NO 98 AND B.FR_ID = A.FR_ID 99 LEFT JOIN OCRM_F_DP_CARD_INFO C --å¡æ¡£100 ON A.ACCOUNT = C.CR_CRD_NO 101 AND C.FR_ID = A.FR_ID 102 WHERE A.SYSID IN('800235', '800037') 103 AND A.ODS_ST_DATE = V_DT 104 """105sql = re.sub(r"\bV_DT\b", "'"+V_DT10+"'", sql)106TMP_OCRM_F_CI_CUST_SIGN_02 = sqlContext.sql(sql)107TMP_OCRM_F_CI_CUST_SIGN_02.registerTempTable("TMP_OCRM_F_CI_CUST_SIGN_02")108dfn="TMP_OCRM_F_CI_CUST_SIGN_02/"+V_DT+".parquet"109TMP_OCRM_F_CI_CUST_SIGN_02.cache()110nrows = TMP_OCRM_F_CI_CUST_SIGN_02.count()111ret = os.system("hdfs dfs -rm -r /"+dbname+"/TMP_OCRM_F_CI_CUST_SIGN_02/*.parquet")112TMP_OCRM_F_CI_CUST_SIGN_02.write.save(path=hdfs + '/' + dfn, mode='overwrite')113TMP_OCRM_F_CI_CUST_SIGN_02.unpersist()114et = datetime.now()115print("Step %d start[%s] end[%s] use %d seconds, insert TMP_OCRM_F_CI_CUST_SIGN_02 lines %d") % (V_STEP, st.strftime("%H:%M:%S"), et.strftime("%H:%M:%S"), (et-st).seconds, nrows)116#ä»»å¡[12] 001-03::117V_STEP = V_STEP + 1118OCRM_F_CI_CUST_SIGN = sqlContext.read.parquet(hdfs+'/OCRM_F_CI_CUST_SIGN/*')119OCRM_F_CI_CUST_SIGN.registerTempTable("OCRM_F_CI_CUST_SIGN")120TMP_OCRM_F_CI_CUST_SIGN_01 = sqlContext.read.parquet(hdfs+'/TMP_OCRM_F_CI_CUST_SIGN_01/*')121TMP_OCRM_F_CI_CUST_SIGN_01.registerTempTable("TMP_OCRM_F_CI_CUST_SIGN_01")122sql = """123 SELECT A.CUST_ID AS CUST_ID 124 ,A.STATE AS IF_ELEC 125 ,B.IF_WATER AS IF_WATER 126 ,B.IF_TV AS IF_TV 127 ,B.IF_MOBILE AS IF_MOBILE 128 ,B.IF_WY AS IF_WY 129 ,B.IF_MSG AS IF_MSG 130 ,B.IF_GAS AS IF_GAS 131 ,B.IF_WIRE AS IF_WIRE 132 ,B.SIGN_FLAG AS SIGN_FLAG 133 ,A.FR_ID AS FR_ID 134 ,V_DT AS ST_DATE 135 FROM (SELECT FR_ID,CUST_ID,STATE,136 ROW_NUMBER() OVER(PARTITION BY FR_ID,CUST_ID ORDER BY STATE DESC ) RN 137 FROM TMP_OCRM_F_CI_CUST_SIGN_01) A --客æ·ç¾çº¦ä¸´æ¶è¡¨01(çµè´¹)138 LEFT JOIN OCRM_F_CI_CUST_SIGN B --客æ·ç¾çº¦ä¸´æ¶è¡¨139 ON A.CUST_ID = B.CUST_ID 140 AND A.FR_ID = B.FR_ID 141 WHERE A.CUST_ID IS NOT NULL 142 AND RN = '1' """143sql = re.sub(r"\bV_DT\b", "'"+V_DT10+"'", sql)144OCRM_F_CI_CUST_SIGN_INNTMP1 = sqlContext.sql(sql)145OCRM_F_CI_CUST_SIGN_INNTMP1.registerTempTable("OCRM_F_CI_CUST_SIGN_INNTMP1")146sql = """147 SELECT DST.CUST_ID --客æ·å·:src.CUST_ID148 ,DST.IF_ELEC --æ¯å¦çµè´¹ç¾çº¦:src.IF_ELEC149 ,DST.IF_WATER --æ¯å¦æ°´è´¹ç¾çº¦:src.IF_WATER150 ,DST.IF_TV --æ¯å¦å¹¿çµç¾çº¦:src.IF_TV151 ,DST.IF_MOBILE --æ¯å¦ææºé¶è¡ç¾çº¦:src.IF_MOBILE152 ,DST.IF_WY --æ¯å¦ç½é¶ç¾çº¦:src.IF_WY153 ,DST.IF_MSG --æ¯å¦çä¿¡ç¾çº¦:src.IF_MSG154 ,DST.IF_GAS --æ¯å¦ä»£ç¼´è´¹çæ°ç¾çº¦:src.IF_GAS155 ,DST.IF_WIRE --æ¯å¦ä»£ç¼´è´¹çµä¿¡ç¾çº¦:src.IF_WIRE156 ,DST.SIGN_FLAG --ç¾çº¦æ±æ»(ç½é¶-ææºé¶è¡-çä¿¡-çµè´¹-æ°´è´¹-çæ°-广çµ-çµä¿¡):src.SIGN_FLAG157 ,DST.FR_ID --æ³äººå·:src.FR_ID158 ,DST.ST_DATE --ETLæ¥æ:src.ST_DATE159 FROM OCRM_F_CI_CUST_SIGN DST 160 LEFT JOIN OCRM_F_CI_CUST_SIGN_INNTMP1 SRC 161 ON SRC.FR_ID = DST.FR_ID 162 AND SRC.CUST_ID = DST.CUST_ID 163 WHERE SRC.FR_ID IS NULL """164sql = re.sub(r"\bV_DT\b", "'"+V_DT10+"'", sql)165OCRM_F_CI_CUST_SIGN_INNTMP2 = sqlContext.sql(sql)166dfn="OCRM_F_CI_CUST_SIGN/"+V_DT+".parquet"167OCRM_F_CI_CUST_SIGN_INNTMP2=OCRM_F_CI_CUST_SIGN_INNTMP2.unionAll(OCRM_F_CI_CUST_SIGN_INNTMP1)168OCRM_F_CI_CUST_SIGN_INNTMP1.cache()169OCRM_F_CI_CUST_SIGN_INNTMP2.cache()170nrowsi = OCRM_F_CI_CUST_SIGN_INNTMP1.count()171nrowsa = OCRM_F_CI_CUST_SIGN_INNTMP2.count()172OCRM_F_CI_CUST_SIGN_INNTMP2.write.save(path = hdfs + '/' + dfn, mode='overwrite')173OCRM_F_CI_CUST_SIGN_INNTMP1.unpersist()174OCRM_F_CI_CUST_SIGN_INNTMP2.unpersist()175et = datetime.now()176print("Step %d start[%s] end[%s] use %d seconds, insert OCRM_F_CI_CUST_SIGN lines %d, all lines %d") % (V_STEP, st.strftime("%H:%M:%S"), et.strftime("%H:%M:%S"), (et-st).seconds, nrowsi, nrowsa)177#ä»»å¡[12] 001-04::178V_STEP = V_STEP + 1179OCRM_F_CI_CUST_SIGN = sqlContext.read.parquet(hdfs+'/OCRM_F_CI_CUST_SIGN/*')180OCRM_F_CI_CUST_SIGN.registerTempTable("OCRM_F_CI_CUST_SIGN")181TMP_OCRM_F_CI_CUST_SIGN_02 = sqlContext.read.parquet(hdfs+'/TMP_OCRM_F_CI_CUST_SIGN_02/*')182TMP_OCRM_F_CI_CUST_SIGN_02.registerTempTable("TMP_OCRM_F_CI_CUST_SIGN_02")183sql = """184 SELECT A.CUST_ID AS CUST_ID 185 ,B.IF_ELEC AS IF_ELEC 186 ,A.STATE AS IF_WATER 187 ,B.IF_TV AS IF_TV 188 ,B.IF_MOBILE AS IF_MOBILE 189 ,B.IF_WY AS IF_WY 190 ,B.IF_MSG AS IF_MSG 191 ,B.IF_GAS AS IF_GAS 192 ,B.IF_WIRE AS IF_WIRE 193 ,B.SIGN_FLAG AS SIGN_FLAG 194 ,A.FR_ID AS FR_ID 195 ,V_DT AS ST_DATE 196 FROM (SELECT FR_ID,CUST_ID,STATE, ROW_NUMBER()OVER(PARTITION BY FR_ID,CUST_ID ORDER BY STATE DESC) RN 197 FROM TMP_OCRM_F_CI_CUST_SIGN_02 198 WHERE TYPE = 'Water' AND CUST_ID IS NOT NULL199 ) A --客æ·ç¾çº¦ä¸´æ¶è¡¨02(æ°´è´¹ç
¤æ°è´¹)200 LEFT JOIN OCRM_F_CI_CUST_SIGN B --客æ·ç¾çº¦ä¸´æ¶è¡¨201 ON A.CUST_ID = B.CUST_ID 202 AND A.FR_ID = B.FR_ID 203 WHERE RN = '1' """204sql = re.sub(r"\bV_DT\b", "'"+V_DT10+"'", sql)205OCRM_F_CI_CUST_SIGN_INNTMP1 = sqlContext.sql(sql)206OCRM_F_CI_CUST_SIGN_INNTMP1.registerTempTable("OCRM_F_CI_CUST_SIGN_INNTMP1")207sql = """208 SELECT DST.CUST_ID --客æ·å·:src.CUST_ID209 ,DST.IF_ELEC --æ¯å¦çµè´¹ç¾çº¦:src.IF_ELEC210 ,DST.IF_WATER --æ¯å¦æ°´è´¹ç¾çº¦:src.IF_WATER211 ,DST.IF_TV --æ¯å¦å¹¿çµç¾çº¦:src.IF_TV212 ,DST.IF_MOBILE --æ¯å¦ææºé¶è¡ç¾çº¦:src.IF_MOBILE213 ,DST.IF_WY --æ¯å¦ç½é¶ç¾çº¦:src.IF_WY214 ,DST.IF_MSG --æ¯å¦çä¿¡ç¾çº¦:src.IF_MSG215 ,DST.IF_GAS --æ¯å¦ä»£ç¼´è´¹çæ°ç¾çº¦:src.IF_GAS216 ,DST.IF_WIRE --æ¯å¦ä»£ç¼´è´¹çµä¿¡ç¾çº¦:src.IF_WIRE217 ,DST.SIGN_FLAG --ç¾çº¦æ±æ»(ç½é¶-ææºé¶è¡-çä¿¡-çµè´¹-æ°´è´¹-çæ°-广çµ-çµä¿¡):src.SIGN_FLAG218 ,DST.FR_ID --æ³äººå·:src.FR_ID219 ,DST.ST_DATE --ETLæ¥æ:src.ST_DATE220 FROM OCRM_F_CI_CUST_SIGN DST 221 LEFT JOIN OCRM_F_CI_CUST_SIGN_INNTMP1 SRC 222 ON SRC.FR_ID = DST.FR_ID 223 AND SRC.CUST_ID = DST.CUST_ID 224 WHERE SRC.FR_ID IS NULL """225sql = re.sub(r"\bV_DT\b", "'"+V_DT10+"'", sql)226OCRM_F_CI_CUST_SIGN_INNTMP2 = sqlContext.sql(sql)227dfn="OCRM_F_CI_CUST_SIGN/"+V_DT+".parquet"228OCRM_F_CI_CUST_SIGN_INNTMP2=OCRM_F_CI_CUST_SIGN_INNTMP2.unionAll(OCRM_F_CI_CUST_SIGN_INNTMP1)229OCRM_F_CI_CUST_SIGN_INNTMP1.cache()230OCRM_F_CI_CUST_SIGN_INNTMP2.cache()231nrowsi = OCRM_F_CI_CUST_SIGN_INNTMP1.count()232nrowsa = OCRM_F_CI_CUST_SIGN_INNTMP2.count()233OCRM_F_CI_CUST_SIGN_INNTMP2.write.save(path = hdfs + '/' + dfn, mode='overwrite')234OCRM_F_CI_CUST_SIGN_INNTMP1.unpersist()235OCRM_F_CI_CUST_SIGN_INNTMP2.unpersist()236et = datetime.now()237print("Step %d start[%s] end[%s] use %d seconds, insert OCRM_F_CI_CUST_SIGN lines %d, all lines %d") % (V_STEP, st.strftime("%H:%M:%S"), et.strftime("%H:%M:%S"), (et-st).seconds, nrowsi, nrowsa)238#ä»»å¡[12] 001-05::239V_STEP = V_STEP + 1240OCRM_F_CI_CUST_SIGN = sqlContext.read.parquet(hdfs+'/OCRM_F_CI_CUST_SIGN/*')241OCRM_F_CI_CUST_SIGN.registerTempTable("OCRM_F_CI_CUST_SIGN")242sql = """243 SELECT A.CIFNO AS CUST_ID 244 ,B.IF_ELEC AS IF_ELEC 245 ,B.IF_WATER AS IF_WATER 246 ,'1' AS IF_TV 247 ,B.IF_MOBILE AS IF_MOBILE 248 ,B.IF_WY AS IF_WY 249 ,B.IF_MSG AS IF_MSG 250 ,B.IF_GAS AS IF_GAS 251 ,B.IF_WIRE AS IF_WIRE 252 ,B.SIGN_FLAG AS SIGN_FLAG 253 ,A.FR_ID AS FR_ID 254 ,V_DT AS ST_DATE 255 FROM (SELECT DISTINCT CIFNO,FR_ID 256 FROM F_CSP_TVSIGNINFOHIST257 WHERE ODS_ST_DATE = V_DT 258 AND STATE = 'N'259 AND MAINTCODE IN('A', 'U')260 ) A --代缴费广çµç¾çº¦ä¿¡æ¯åå²è¡¨261 LEFT JOIN OCRM_F_CI_CUST_SIGN B --客æ·ç¾çº¦ä¸´æ¶è¡¨262 ON A.CIFNO = B.CUST_ID 263 AND A.FR_ID = B.FR_ID """264sql = re.sub(r"\bV_DT\b", "'"+V_DT10+"'", sql)265OCRM_F_CI_CUST_SIGN_INNTMP1 = sqlContext.sql(sql)266OCRM_F_CI_CUST_SIGN_INNTMP1.registerTempTable("OCRM_F_CI_CUST_SIGN_INNTMP1")267sql = """268 SELECT DST.CUST_ID --客æ·å·:src.CUST_ID269 ,DST.IF_ELEC --æ¯å¦çµè´¹ç¾çº¦:src.IF_ELEC270 ,DST.IF_WATER --æ¯å¦æ°´è´¹ç¾çº¦:src.IF_WATER271 ,DST.IF_TV --æ¯å¦å¹¿çµç¾çº¦:src.IF_TV272 ,DST.IF_MOBILE --æ¯å¦ææºé¶è¡ç¾çº¦:src.IF_MOBILE273 ,DST.IF_WY --æ¯å¦ç½é¶ç¾çº¦:src.IF_WY274 ,DST.IF_MSG --æ¯å¦çä¿¡ç¾çº¦:src.IF_MSG275 ,DST.IF_GAS --æ¯å¦ä»£ç¼´è´¹çæ°ç¾çº¦:src.IF_GAS276 ,DST.IF_WIRE --æ¯å¦ä»£ç¼´è´¹çµä¿¡ç¾çº¦:src.IF_WIRE277 ,DST.SIGN_FLAG --ç¾çº¦æ±æ»(ç½é¶-ææºé¶è¡-çä¿¡-çµè´¹-æ°´è´¹-çæ°-广çµ-çµä¿¡):src.SIGN_FLAG278 ,DST.FR_ID --æ³äººå·:src.FR_ID279 ,DST.ST_DATE --ETLæ¥æ:src.ST_DATE280 FROM OCRM_F_CI_CUST_SIGN DST 281 LEFT JOIN OCRM_F_CI_CUST_SIGN_INNTMP1 SRC 282 ON SRC.FR_ID = DST.FR_ID 283 AND SRC.CUST_ID = DST.CUST_ID 284 WHERE SRC.FR_ID IS NULL """285sql = re.sub(r"\bV_DT\b", "'"+V_DT10+"'", sql)286OCRM_F_CI_CUST_SIGN_INNTMP2 = sqlContext.sql(sql)287dfn="OCRM_F_CI_CUST_SIGN/"+V_DT+".parquet"288OCRM_F_CI_CUST_SIGN_INNTMP2=OCRM_F_CI_CUST_SIGN_INNTMP2.unionAll(OCRM_F_CI_CUST_SIGN_INNTMP1)289OCRM_F_CI_CUST_SIGN_INNTMP1.cache()290OCRM_F_CI_CUST_SIGN_INNTMP2.cache()291nrowsi = OCRM_F_CI_CUST_SIGN_INNTMP1.count()292nrowsa = OCRM_F_CI_CUST_SIGN_INNTMP2.count()293OCRM_F_CI_CUST_SIGN_INNTMP2.write.save(path = hdfs + '/' + dfn, mode='overwrite')294OCRM_F_CI_CUST_SIGN_INNTMP1.unpersist()295OCRM_F_CI_CUST_SIGN_INNTMP2.unpersist()296et = datetime.now()297print("Step %d start[%s] end[%s] use %d seconds, insert OCRM_F_CI_CUST_SIGN lines %d, all lines %d") % (V_STEP, st.strftime("%H:%M:%S"), et.strftime("%H:%M:%S"), (et-st).seconds, nrowsi, nrowsa)298#ä»»å¡[12] 001-06::299V_STEP = V_STEP + 1300OCRM_F_CI_CUST_SIGN = sqlContext.read.parquet(hdfs+'/OCRM_F_CI_CUST_SIGN/*')301OCRM_F_CI_CUST_SIGN.registerTempTable("OCRM_F_CI_CUST_SIGN")302sql = """303 SELECT A.CUST_ID AS CUST_ID 304 ,C.IF_ELEC AS IF_ELEC 305 ,C.IF_WATER AS IF_WATER 306 ,C.IF_TV AS IF_TV 307 ,'1' AS IF_MOBILE 308 ,C.IF_WY AS IF_WY 309 ,C.IF_MSG AS IF_MSG 310 ,C.IF_GAS AS IF_GAS 311 ,C.IF_WIRE AS IF_WIRE 312 ,C.SIGN_FLAG AS SIGN_FLAG 313 ,A.FR_ID AS FR_ID 314 ,V_DT AS ST_DATE 315 FROM (SELECT DISTINCT A.FR_ID,B.CIFNO AS CUST_ID 316 FROM F_CSP_MOBILEBANKCIFINFOHIST A 317 JOIN F_CSP_ENTBANKCIFINFOHIST B ON A.CIFSEQ = B.MAINTJNLNO AND B.FR_ID = A.FR_ID 318 WHERE A.ODS_ST_DATE = V_DT 319 AND A.MAINTCODE IN ('A','U')) A --ææºé¶è¡å¼éä¿¡æ¯åå²è¡¨320 LEFT JOIN OCRM_F_CI_CUST_SIGN C --客æ·ç¾çº¦ä¸´æ¶è¡¨321 ON A.CUST_ID = C.CUST_ID 322 AND A.FR_ID = C.FR_ID """323sql = re.sub(r"\bV_DT\b", "'"+V_DT10+"'", sql)324OCRM_F_CI_CUST_SIGN_INNTMP1 = sqlContext.sql(sql)325OCRM_F_CI_CUST_SIGN_INNTMP1.registerTempTable("OCRM_F_CI_CUST_SIGN_INNTMP1")326sql = """327 SELECT DST.CUST_ID --客æ·å·:src.CUST_ID328 ,DST.IF_ELEC --æ¯å¦çµè´¹ç¾çº¦:src.IF_ELEC329 ,DST.IF_WATER --æ¯å¦æ°´è´¹ç¾çº¦:src.IF_WATER330 ,DST.IF_TV --æ¯å¦å¹¿çµç¾çº¦:src.IF_TV331 ,DST.IF_MOBILE --æ¯å¦ææºé¶è¡ç¾çº¦:src.IF_MOBILE332 ,DST.IF_WY --æ¯å¦ç½é¶ç¾çº¦:src.IF_WY333 ,DST.IF_MSG --æ¯å¦çä¿¡ç¾çº¦:src.IF_MSG334 ,DST.IF_GAS --æ¯å¦ä»£ç¼´è´¹çæ°ç¾çº¦:src.IF_GAS335 ,DST.IF_WIRE --æ¯å¦ä»£ç¼´è´¹çµä¿¡ç¾çº¦:src.IF_WIRE336 ,DST.SIGN_FLAG --ç¾çº¦æ±æ»(ç½é¶-ææºé¶è¡-çä¿¡-çµè´¹-æ°´è´¹-çæ°-广çµ-çµä¿¡):src.SIGN_FLAG337 ,DST.FR_ID --æ³äººå·:src.FR_ID338 ,DST.ST_DATE --ETLæ¥æ:src.ST_DATE339 FROM OCRM_F_CI_CUST_SIGN DST 340 LEFT JOIN OCRM_F_CI_CUST_SIGN_INNTMP1 SRC 341 ON SRC.FR_ID = DST.FR_ID 342 AND SRC.CUST_ID = DST.CUST_ID 343 WHERE SRC.FR_ID IS NULL """344sql = re.sub(r"\bV_DT\b", "'"+V_DT10+"'", sql)345OCRM_F_CI_CUST_SIGN_INNTMP2 = sqlContext.sql(sql)346dfn="OCRM_F_CI_CUST_SIGN/"+V_DT+".parquet"347OCRM_F_CI_CUST_SIGN_INNTMP2=OCRM_F_CI_CUST_SIGN_INNTMP2.unionAll(OCRM_F_CI_CUST_SIGN_INNTMP1)348OCRM_F_CI_CUST_SIGN_INNTMP1.cache()349OCRM_F_CI_CUST_SIGN_INNTMP2.cache()350nrowsi = OCRM_F_CI_CUST_SIGN_INNTMP1.count()351nrowsa = OCRM_F_CI_CUST_SIGN_INNTMP2.count()352OCRM_F_CI_CUST_SIGN_INNTMP2.write.save(path = hdfs + '/' + dfn, mode='overwrite')353OCRM_F_CI_CUST_SIGN_INNTMP1.unpersist()354OCRM_F_CI_CUST_SIGN_INNTMP2.unpersist()355et = datetime.now()356print("Step %d start[%s] end[%s] use %d seconds, insert OCRM_F_CI_CUST_SIGN lines %d, all lines %d") % (V_STEP, st.strftime("%H:%M:%S"), et.strftime("%H:%M:%S"), (et-st).seconds, nrowsi, nrowsa)357#ä»»å¡[12] 001-07::358V_STEP = V_STEP + 1359OCRM_F_CI_CUST_SIGN = sqlContext.read.parquet(hdfs+'/OCRM_F_CI_CUST_SIGN/*')360OCRM_F_CI_CUST_SIGN.registerTempTable("OCRM_F_CI_CUST_SIGN")361sql = """362 SELECT A.CUST_ID AS CUST_ID 363 ,B.IF_ELEC AS IF_ELEC 364 ,B.IF_WATER AS IF_WATER 365 ,B.IF_TV AS IF_TV 366 ,'1' AS IF_MOBILE 367 ,B.IF_WY AS IF_WY 368 ,B.IF_MSG AS IF_MSG 369 ,B.IF_GAS AS IF_GAS 370 ,B.IF_WIRE AS IF_WIRE 371 ,B.SIGN_FLAG AS SIGN_FLAG 372 ,A.FR_ID AS FR_ID 373 ,V_DT AS ST_DATE 374 FROM (SELECT DISTINCT CUST_ID ,FR_ID 375 FROM OCRM_F_CI_CUST_DESC A376 WHERE SUBSTR(A.ODS_SYS_ID, 11, 1) = '1'377 AND A.CRM_DT = V_DT) A --ç»ä¸å®¢æ·ä¿¡æ¯è¡¨378 INNER JOIN OCRM_F_CI_CUST_SIGN B --客æ·ç¾çº¦ä¸´æ¶è¡¨379 ON A.FR_ID = B.FR_ID 380 AND A.CUST_ID = B.CUST_ID 381 """382sql = re.sub(r"\bV_DT\b", "'"+V_DT10+"'", sql)383OCRM_F_CI_CUST_SIGN_INNTMP1 = sqlContext.sql(sql)384OCRM_F_CI_CUST_SIGN_INNTMP1.registerTempTable("OCRM_F_CI_CUST_SIGN_INNTMP1")385sql = """386 SELECT DST.CUST_ID --客æ·å·:src.CUST_ID387 ,DST.IF_ELEC --æ¯å¦çµè´¹ç¾çº¦:src.IF_ELEC388 ,DST.IF_WATER --æ¯å¦æ°´è´¹ç¾çº¦:src.IF_WATER389 ,DST.IF_TV --æ¯å¦å¹¿çµç¾çº¦:src.IF_TV390 ,DST.IF_MOBILE --æ¯å¦ææºé¶è¡ç¾çº¦:src.IF_MOBILE391 ,DST.IF_WY --æ¯å¦ç½é¶ç¾çº¦:src.IF_WY392 ,DST.IF_MSG --æ¯å¦çä¿¡ç¾çº¦:src.IF_MSG393 ,DST.IF_GAS --æ¯å¦ä»£ç¼´è´¹çæ°ç¾çº¦:src.IF_GAS394 ,DST.IF_WIRE --æ¯å¦ä»£ç¼´è´¹çµä¿¡ç¾çº¦:src.IF_WIRE395 ,DST.SIGN_FLAG --ç¾çº¦æ±æ»(ç½é¶-ææºé¶è¡-çä¿¡-çµè´¹-æ°´è´¹-çæ°-广çµ-çµä¿¡):src.SIGN_FLAG396 ,DST.FR_ID --æ³äººå·:src.FR_ID397 ,DST.ST_DATE --ETLæ¥æ:src.ST_DATE398 FROM OCRM_F_CI_CUST_SIGN DST 399 LEFT JOIN OCRM_F_CI_CUST_SIGN_INNTMP1 SRC 400 ON SRC.FR_ID = DST.FR_ID 401 AND SRC.CUST_ID = DST.CUST_ID 402 WHERE SRC.FR_ID IS NULL """403sql = re.sub(r"\bV_DT\b", "'"+V_DT10+"'", sql)404OCRM_F_CI_CUST_SIGN_INNTMP2 = sqlContext.sql(sql)405dfn="OCRM_F_CI_CUST_SIGN/"+V_DT+".parquet"406OCRM_F_CI_CUST_SIGN_INNTMP2=OCRM_F_CI_CUST_SIGN_INNTMP2.unionAll(OCRM_F_CI_CUST_SIGN_INNTMP1)407OCRM_F_CI_CUST_SIGN_INNTMP1.cache()408OCRM_F_CI_CUST_SIGN_INNTMP2.cache()409nrowsi = OCRM_F_CI_CUST_SIGN_INNTMP1.count()410nrowsa = OCRM_F_CI_CUST_SIGN_INNTMP2.count()411OCRM_F_CI_CUST_SIGN_INNTMP2.write.save(path = hdfs + '/' + dfn, mode='overwrite')412OCRM_F_CI_CUST_SIGN_INNTMP1.unpersist()413OCRM_F_CI_CUST_SIGN_INNTMP2.unpersist()414et = datetime.now()415print("Step %d start[%s] end[%s] use %d seconds, insert OCRM_F_CI_CUST_SIGN lines %d, all lines %d") % (V_STEP, st.strftime("%H:%M:%S"), et.strftime("%H:%M:%S"), (et-st).seconds, nrowsi, nrowsa)416#ä»»å¡[12] 001-08::417V_STEP = V_STEP + 1418OCRM_F_CI_CUST_SIGN = sqlContext.read.parquet(hdfs+'/OCRM_F_CI_CUST_SIGN/*')419OCRM_F_CI_CUST_SIGN.registerTempTable("OCRM_F_CI_CUST_SIGN")420sql = """421 SELECT A.CIFNO AS CUST_ID 422 ,B.IF_ELEC AS IF_ELEC 423 ,B.IF_WATER AS IF_WATER 424 ,B.IF_TV AS IF_TV 425 ,B.IF_MOBILE AS IF_MOBILE 426 ,B.IF_WY AS IF_WY 427 ,'1' AS IF_MSG 428 ,B.IF_GAS AS IF_GAS 429 ,B.IF_WIRE AS IF_WIRE 430 ,B.SIGN_FLAG AS SIGN_FLAG 431 ,A.FR_ID AS FR_ID 432 ,V_DT AS ST_DATE 433 FROM (SELECT DISTINCT CIFNO,FR_ID434 FROM F_CSP_SMSSIGNINFOHIST --çä¿¡å¹³å°ç¾çº¦ä¿¡æ¯åå²è¡¨435 WHERE ODS_ST_DATE = V_DT 436 AND MAINTCODE IN ('A', 'U') 437 AND STATE = 'N' ) A 438 LEFT JOIN OCRM_F_CI_CUST_SIGN B --客æ·ç¾çº¦ä¸´æ¶è¡¨439 ON A.CIFNO = B.CUST_ID 440 AND A.FR_ID = B.FR_ID """441sql = re.sub(r"\bV_DT\b", "'"+V_DT10+"'", sql)442OCRM_F_CI_CUST_SIGN_INNTMP1 = sqlContext.sql(sql)443OCRM_F_CI_CUST_SIGN_INNTMP1.registerTempTable("OCRM_F_CI_CUST_SIGN_INNTMP1")444sql = """445 SELECT DST.CUST_ID --客æ·å·:src.CUST_ID446 ,DST.IF_ELEC --æ¯å¦çµè´¹ç¾çº¦:src.IF_ELEC447 ,DST.IF_WATER --æ¯å¦æ°´è´¹ç¾çº¦:src.IF_WATER448 ,DST.IF_TV --æ¯å¦å¹¿çµç¾çº¦:src.IF_TV449 ,DST.IF_MOBILE --æ¯å¦ææºé¶è¡ç¾çº¦:src.IF_MOBILE450 ,DST.IF_WY --æ¯å¦ç½é¶ç¾çº¦:src.IF_WY451 ,DST.IF_MSG --æ¯å¦çä¿¡ç¾çº¦:src.IF_MSG452 ,DST.IF_GAS --æ¯å¦ä»£ç¼´è´¹çæ°ç¾çº¦:src.IF_GAS453 ,DST.IF_WIRE --æ¯å¦ä»£ç¼´è´¹çµä¿¡ç¾çº¦:src.IF_WIRE454 ,DST.SIGN_FLAG --ç¾çº¦æ±æ»(ç½é¶-ææºé¶è¡-çä¿¡-çµè´¹-æ°´è´¹-çæ°-广çµ-çµä¿¡):src.SIGN_FLAG455 ,DST.FR_ID --æ³äººå·:src.FR_ID456 ,DST.ST_DATE --ETLæ¥æ:src.ST_DATE457 FROM OCRM_F_CI_CUST_SIGN DST 458 LEFT JOIN OCRM_F_CI_CUST_SIGN_INNTMP1 SRC 459 ON SRC.FR_ID = DST.FR_ID 460 AND SRC.CUST_ID = DST.CUST_ID 461 WHERE SRC.FR_ID IS NULL """462sql = re.sub(r"\bV_DT\b", "'"+V_DT10+"'", sql)463OCRM_F_CI_CUST_SIGN_INNTMP2 = sqlContext.sql(sql)464dfn="OCRM_F_CI_CUST_SIGN/"+V_DT+".parquet"465OCRM_F_CI_CUST_SIGN_INNTMP2=OCRM_F_CI_CUST_SIGN_INNTMP2.unionAll(OCRM_F_CI_CUST_SIGN_INNTMP1)466OCRM_F_CI_CUST_SIGN_INNTMP1.cache()467OCRM_F_CI_CUST_SIGN_INNTMP2.cache()468nrowsi = OCRM_F_CI_CUST_SIGN_INNTMP1.count()469nrowsa = OCRM_F_CI_CUST_SIGN_INNTMP2.count()470OCRM_F_CI_CUST_SIGN_INNTMP2.write.save(path = hdfs + '/' + dfn, mode='overwrite')471OCRM_F_CI_CUST_SIGN_INNTMP1.unpersist()472OCRM_F_CI_CUST_SIGN_INNTMP2.unpersist()473et = datetime.now()474print("Step %d start[%s] end[%s] use %d seconds, insert OCRM_F_CI_CUST_SIGN lines %d, all lines %d") % (V_STEP, st.strftime("%H:%M:%S"), et.strftime("%H:%M:%S"), (et-st).seconds, nrowsi, nrowsa)475#ä»»å¡[12] 001-09::476V_STEP = V_STEP + 1477OCRM_F_CI_CUST_SIGN = sqlContext.read.parquet(hdfs+'/OCRM_F_CI_CUST_SIGN/*')478OCRM_F_CI_CUST_SIGN.registerTempTable("OCRM_F_CI_CUST_SIGN")479sql = """480 SELECT A.CUST_ID AS CUST_ID 481 ,B.IF_ELEC AS IF_ELEC 482 ,B.IF_WATER AS IF_WATER 483 ,B.IF_TV AS IF_TV 484 ,B.IF_MOBILE AS IF_MOBILE 485 ,B.IF_WY AS IF_WY 486 ,'1' AS IF_MSG 487 ,B.IF_GAS AS IF_GAS 488 ,B.IF_WIRE AS IF_WIRE 489 ,B.SIGN_FLAG AS SIGN_FLAG 490 ,A.FR_ID AS FR_ID 491 ,V_DT AS ST_DATE 492 FROM (SELECT DISTINCT CUST_ID ,FR_ID 493 FROM OCRM_F_CI_CUST_DESC A494 WHERE SUBSTR(A.ODS_SYS_ID, 9, 1) = '1'495 AND A.CRM_DT = V_DT) A --ç»ä¸å®¢æ·ä¿¡æ¯è¡¨496 LEFT JOIN OCRM_F_CI_CUST_SIGN B --客æ·ç¾çº¦ä¸´æ¶è¡¨497 ON A.CUST_ID = B.CUST_ID 498 AND A.FR_ID = B.FR_ID """499sql = re.sub(r"\bV_DT\b", "'"+V_DT10+"'", sql)500OCRM_F_CI_CUST_SIGN_INNTMP1 = sqlContext.sql(sql)501OCRM_F_CI_CUST_SIGN_INNTMP1.registerTempTable("OCRM_F_CI_CUST_SIGN_INNTMP1")502sql = """503 SELECT DST.CUST_ID --客æ·å·:src.CUST_ID504 ,DST.IF_ELEC --æ¯å¦çµè´¹ç¾çº¦:src.IF_ELEC505 ,DST.IF_WATER --æ¯å¦æ°´è´¹ç¾çº¦:src.IF_WATER506 ,DST.IF_TV --æ¯å¦å¹¿çµç¾çº¦:src.IF_TV507 ,DST.IF_MOBILE --æ¯å¦ææºé¶è¡ç¾çº¦:src.IF_MOBILE508 ,DST.IF_WY --æ¯å¦ç½é¶ç¾çº¦:src.IF_WY509 ,DST.IF_MSG --æ¯å¦çä¿¡ç¾çº¦:src.IF_MSG510 ,DST.IF_GAS --æ¯å¦ä»£ç¼´è´¹çæ°ç¾çº¦:src.IF_GAS511 ,DST.IF_WIRE --æ¯å¦ä»£ç¼´è´¹çµä¿¡ç¾çº¦:src.IF_WIRE512 ,DST.SIGN_FLAG --ç¾çº¦æ±æ»(ç½é¶-ææºé¶è¡-çä¿¡-çµè´¹-æ°´è´¹-çæ°-广çµ-çµä¿¡):src.SIGN_FLAG513 ,DST.FR_ID --æ³äººå·:src.FR_ID514 ,DST.ST_DATE --ETLæ¥æ:src.ST_DATE515 FROM OCRM_F_CI_CUST_SIGN DST 516 LEFT JOIN OCRM_F_CI_CUST_SIGN_INNTMP1 SRC 517 ON SRC.FR_ID = DST.FR_ID 518 AND SRC.CUST_ID = DST.CUST_ID 519 WHERE SRC.FR_ID IS NULL """520sql = re.sub(r"\bV_DT\b", "'"+V_DT10+"'", sql)521OCRM_F_CI_CUST_SIGN_INNTMP2 = sqlContext.sql(sql)522dfn="OCRM_F_CI_CUST_SIGN/"+V_DT+".parquet"523OCRM_F_CI_CUST_SIGN_INNTMP2=OCRM_F_CI_CUST_SIGN_INNTMP2.unionAll(OCRM_F_CI_CUST_SIGN_INNTMP1)524OCRM_F_CI_CUST_SIGN_INNTMP1.cache()525OCRM_F_CI_CUST_SIGN_INNTMP2.cache()526nrowsi = OCRM_F_CI_CUST_SIGN_INNTMP1.count()527nrowsa = OCRM_F_CI_CUST_SIGN_INNTMP2.count()528OCRM_F_CI_CUST_SIGN_INNTMP2.write.save(path = hdfs + '/' + dfn, mode='overwrite')529OCRM_F_CI_CUST_SIGN_INNTMP1.unpersist()530OCRM_F_CI_CUST_SIGN_INNTMP2.unpersist()531et = datetime.now()532print("Step %d start[%s] end[%s] use %d seconds, insert OCRM_F_CI_CUST_SIGN lines %d, all lines %d") % (V_STEP, st.strftime("%H:%M:%S"), et.strftime("%H:%M:%S"), (et-st).seconds, nrowsi, nrowsa)533#ä»»å¡[12] 001-10::534V_STEP = V_STEP + 1535OCRM_F_CI_CUST_SIGN = sqlContext.read.parquet(hdfs+'/OCRM_F_CI_CUST_SIGN/*')536OCRM_F_CI_CUST_SIGN.registerTempTable("OCRM_F_CI_CUST_SIGN")537sql = """538 SELECT A.CUST_ID AS CUST_ID 539 ,B.IF_ELEC AS IF_ELEC 540 ,B.IF_WATER AS IF_WATER 541 ,B.IF_TV AS IF_TV 542 ,B.IF_MOBILE AS IF_MOBILE 543 ,B.IF_WY AS IF_WY 544 ,B.IF_MSG AS IF_MSG 545 ,A.STATE AS IF_GAS 546 ,B.IF_WIRE AS IF_WIRE 547 ,B.SIGN_FLAG AS SIGN_FLAG 548 ,A.FR_ID AS FR_ID 549 ,V_DT AS ST_DATE 550 FROM (SELECT CUST_ID,STATE,FR_ID, 551 ROW_NUMBER()OVER(PARTITION BY CUST_ID ORDER BY STATE DESC) RN 552 FROM TMP_OCRM_F_CI_CUST_SIGN_02 553 WHERE TYPE = 'Gas' AND CUST_ID IS NOT NULL554 ) A --客æ·ç¾çº¦ä¸´æ¶è¡¨02(æ°´è´¹ç
¤æ°è´¹)555 LEFT JOIN OCRM_F_CI_CUST_SIGN B --客æ·ç¾çº¦ä¸´æ¶è¡¨556 ON A.CUST_ID = B.CUST_ID 557 AND A.FR_ID = B.FR_ID 558 WHERE RN = '1' """559sql = re.sub(r"\bV_DT\b", "'"+V_DT10+"'", sql)560OCRM_F_CI_CUST_SIGN_INNTMP1 = sqlContext.sql(sql)561OCRM_F_CI_CUST_SIGN_INNTMP1.registerTempTable("OCRM_F_CI_CUST_SIGN_INNTMP1")562sql = """563 SELECT DST.CUST_ID --客æ·å·:src.CUST_ID564 ,DST.IF_ELEC --æ¯å¦çµè´¹ç¾çº¦:src.IF_ELEC565 ,DST.IF_WATER --æ¯å¦æ°´è´¹ç¾çº¦:src.IF_WATER566 ,DST.IF_TV --æ¯å¦å¹¿çµç¾çº¦:src.IF_TV567 ,DST.IF_MOBILE --æ¯å¦ææºé¶è¡ç¾çº¦:src.IF_MOBILE568 ,DST.IF_WY --æ¯å¦ç½é¶ç¾çº¦:src.IF_WY569 ,DST.IF_MSG --æ¯å¦çä¿¡ç¾çº¦:src.IF_MSG570 ,DST.IF_GAS --æ¯å¦ä»£ç¼´è´¹çæ°ç¾çº¦:src.IF_GAS571 ,DST.IF_WIRE --æ¯å¦ä»£ç¼´è´¹çµä¿¡ç¾çº¦:src.IF_WIRE572 ,DST.SIGN_FLAG --ç¾çº¦æ±æ»(ç½é¶-ææºé¶è¡-çä¿¡-çµè´¹-æ°´è´¹-çæ°-广çµ-çµä¿¡):src.SIGN_FLAG573 ,DST.FR_ID --æ³äººå·:src.FR_ID574 ,DST.ST_DATE --ETLæ¥æ:src.ST_DATE575 FROM OCRM_F_CI_CUST_SIGN DST 576 LEFT JOIN OCRM_F_CI_CUST_SIGN_INNTMP1 SRC 577 ON SRC.FR_ID = DST.FR_ID 578 AND SRC.CUST_ID = DST.CUST_ID 579 WHERE SRC.FR_ID IS NULL """580sql = re.sub(r"\bV_DT\b", "'"+V_DT10+"'", sql)581OCRM_F_CI_CUST_SIGN_INNTMP2 = sqlContext.sql(sql)582dfn="OCRM_F_CI_CUST_SIGN/"+V_DT+".parquet"583OCRM_F_CI_CUST_SIGN_INNTMP2=OCRM_F_CI_CUST_SIGN_INNTMP2.unionAll(OCRM_F_CI_CUST_SIGN_INNTMP1)584OCRM_F_CI_CUST_SIGN_INNTMP1.cache()585OCRM_F_CI_CUST_SIGN_INNTMP2.cache()586nrowsi = OCRM_F_CI_CUST_SIGN_INNTMP1.count()587nrowsa = OCRM_F_CI_CUST_SIGN_INNTMP2.count()588OCRM_F_CI_CUST_SIGN_INNTMP2.write.save(path = hdfs + '/' + dfn, mode='overwrite')589OCRM_F_CI_CUST_SIGN_INNTMP1.unpersist()590OCRM_F_CI_CUST_SIGN_INNTMP2.unpersist()591et = datetime.now()592print("Step %d start[%s] end[%s] use %d seconds, insert OCRM_F_CI_CUST_SIGN lines %d, all lines %d") % (V_STEP, st.strftime("%H:%M:%S"), et.strftime("%H:%M:%S"), (et-st).seconds, nrowsi, nrowsa)593#ä»»å¡[12] 001-11::594V_STEP = V_STEP + 1595OCRM_F_CI_CUST_SIGN = sqlContext.read.parquet(hdfs+'/OCRM_F_CI_CUST_SIGN/*')596OCRM_F_CI_CUST_SIGN.registerTempTable("OCRM_F_CI_CUST_SIGN")597sql = """598 SELECT A.CUST_ID AS CUST_ID 599 ,C.IF_ELEC AS IF_ELEC 600 ,C.IF_WATER AS IF_WATER 601 ,C.IF_TV AS IF_TV 602 ,C.IF_MOBILE AS IF_MOBILE 603 ,'1' AS IF_WY 604 ,C.IF_MSG AS IF_MSG 605 ,C.IF_GAS AS IF_GAS 606 ,C.IF_WIRE AS IF_WIRE 607 ,C.SIGN_FLAG AS SIGN_FLAG 608 ,A.FR_ID AS FR_ID 609 ,V_DT AS ST_DATE 610 FROM (SELECT DISTINCT B.CIFNO AS CUST_ID,A.FR_ID 611 FROM F_CSP_PERNETBANKCIFINFOHIST A 612 JOIN F_CSP_ENTBANKCIFINFOHIST B ON A.CIFSEQ = B.MAINTJNLNO AND B.FR_ID = A.FR_ID 613 WHERE A.ODS_ST_DATE = V_DT 614 AND A.MAINTCODE IN ('A','U') --A:ç¾çº¦;U:åæ´;D:解约615 ) A --个人ç½é¶å¼éä¿¡æ¯åå²è¡¨616 LEFT JOIN OCRM_F_CI_CUST_SIGN C --客æ·ç¾çº¦ä¸´æ¶è¡¨617 ON A.CUST_ID = C.CUST_ID 618 AND A.FR_ID = C.FR_ID """619sql = re.sub(r"\bV_DT\b", "'"+V_DT10+"'", sql)620OCRM_F_CI_CUST_SIGN_INNTMP1 = sqlContext.sql(sql)621OCRM_F_CI_CUST_SIGN_INNTMP1.registerTempTable("OCRM_F_CI_CUST_SIGN_INNTMP1")622sql = """623 SELECT DST.CUST_ID --客æ·å·:src.CUST_ID624 ,DST.IF_ELEC --æ¯å¦çµè´¹ç¾çº¦:src.IF_ELEC625 ,DST.IF_WATER --æ¯å¦æ°´è´¹ç¾çº¦:src.IF_WATER626 ,DST.IF_TV --æ¯å¦å¹¿çµç¾çº¦:src.IF_TV627 ,DST.IF_MOBILE --æ¯å¦ææºé¶è¡ç¾çº¦:src.IF_MOBILE628 ,DST.IF_WY --æ¯å¦ç½é¶ç¾çº¦:src.IF_WY629 ,DST.IF_MSG --æ¯å¦çä¿¡ç¾çº¦:src.IF_MSG630 ,DST.IF_GAS --æ¯å¦ä»£ç¼´è´¹çæ°ç¾çº¦:src.IF_GAS631 ,DST.IF_WIRE --æ¯å¦ä»£ç¼´è´¹çµä¿¡ç¾çº¦:src.IF_WIRE632 ,DST.SIGN_FLAG --ç¾çº¦æ±æ»(ç½é¶-ææºé¶è¡-çä¿¡-çµè´¹-æ°´è´¹-çæ°-广çµ-çµä¿¡):src.SIGN_FLAG633 ,DST.FR_ID --æ³äººå·:src.FR_ID634 ,DST.ST_DATE --ETLæ¥æ:src.ST_DATE635 FROM OCRM_F_CI_CUST_SIGN DST 636 LEFT JOIN OCRM_F_CI_CUST_SIGN_INNTMP1 SRC 637 ON SRC.FR_ID = DST.FR_ID 638 AND SRC.CUST_ID = DST.CUST_ID 639 WHERE SRC.FR_ID IS NULL """640sql = re.sub(r"\bV_DT\b", "'"+V_DT10+"'", sql)641OCRM_F_CI_CUST_SIGN_INNTMP2 = sqlContext.sql(sql)642dfn="OCRM_F_CI_CUST_SIGN/"+V_DT+".parquet"643OCRM_F_CI_CUST_SIGN_INNTMP2=OCRM_F_CI_CUST_SIGN_INNTMP2.unionAll(OCRM_F_CI_CUST_SIGN_INNTMP1)644OCRM_F_CI_CUST_SIGN_INNTMP1.cache()645OCRM_F_CI_CUST_SIGN_INNTMP2.cache()646nrowsi = OCRM_F_CI_CUST_SIGN_INNTMP1.count()647nrowsa = OCRM_F_CI_CUST_SIGN_INNTMP2.count()648OCRM_F_CI_CUST_SIGN_INNTMP2.write.save(path = hdfs + '/' + dfn, mode='overwrite')649OCRM_F_CI_CUST_SIGN_INNTMP1.unpersist()650OCRM_F_CI_CUST_SIGN_INNTMP2.unpersist()651et = datetime.now()652print("Step %d start[%s] end[%s] use %d seconds, insert OCRM_F_CI_CUST_SIGN lines %d, all lines %d") % (V_STEP, st.strftime("%H:%M:%S"), et.strftime("%H:%M:%S"), (et-st).seconds, nrowsi, nrowsa)653#ä»»å¡[12] 001-12::654V_STEP = V_STEP + 1655OCRM_F_CI_CUST_SIGN = sqlContext.read.parquet(hdfs+'/OCRM_F_CI_CUST_SIGN/*')656OCRM_F_CI_CUST_SIGN.registerTempTable("OCRM_F_CI_CUST_SIGN")657sql = """658 SELECT A.CUST_ID AS CUST_ID 659 ,B.IF_ELEC AS IF_ELEC 660 ,B.IF_WATER AS IF_WATER 661 ,B.IF_TV AS IF_TV 662 ,B.IF_MOBILE AS IF_MOBILE 663 ,'1' AS IF_WY 664 ,B.IF_MSG AS IF_MSG 665 ,B.IF_GAS AS IF_GAS 666 ,B.IF_WIRE AS IF_WIRE 667 ,B.SIGN_FLAG AS SIGN_FLAG 668 ,A.FR_ID AS FR_ID 669 ,V_DT AS ST_DATE 670 FROM (SELECT DISTINCT CUST_ID ,FR_ID 671 FROM OCRM_F_CI_CUST_DESC A672 WHERE SUBSTR(A.ODS_SYS_ID, 3, 1) = '1'673 AND A.CRM_DT = V_DT) A --ç»ä¸å®¢æ·ä¿¡æ¯è¡¨674 INNER JOIN OCRM_F_CI_CUST_SIGN B --客æ·ç¾çº¦ä¸´æ¶è¡¨675 ON A.FR_ID = B.FR_ID 676 AND A.CUST_ID = B.CUST_ID """677sql = re.sub(r"\bV_DT\b", "'"+V_DT10+"'", sql)678OCRM_F_CI_CUST_SIGN_INNTMP1 = sqlContext.sql(sql)679OCRM_F_CI_CUST_SIGN_INNTMP1.registerTempTable("OCRM_F_CI_CUST_SIGN_INNTMP1")680sql = """681 SELECT DST.CUST_ID --客æ·å·:src.CUST_ID682 ,DST.IF_ELEC --æ¯å¦çµè´¹ç¾çº¦:src.IF_ELEC683 ,DST.IF_WATER --æ¯å¦æ°´è´¹ç¾çº¦:src.IF_WATER684 ,DST.IF_TV --æ¯å¦å¹¿çµç¾çº¦:src.IF_TV685 ,DST.IF_MOBILE --æ¯å¦ææºé¶è¡ç¾çº¦:src.IF_MOBILE686 ,DST.IF_WY --æ¯å¦ç½é¶ç¾çº¦:src.IF_WY687 ,DST.IF_MSG --æ¯å¦çä¿¡ç¾çº¦:src.IF_MSG688 ,DST.IF_GAS --æ¯å¦ä»£ç¼´è´¹çæ°ç¾çº¦:src.IF_GAS689 ,DST.IF_WIRE --æ¯å¦ä»£ç¼´è´¹çµä¿¡ç¾çº¦:src.IF_WIRE690 ,DST.SIGN_FLAG --ç¾çº¦æ±æ»(ç½é¶-ææºé¶è¡-çä¿¡-çµè´¹-æ°´è´¹-çæ°-广çµ-çµä¿¡):src.SIGN_FLAG691 ,DST.FR_ID --æ³äººå·:src.FR_ID692 ,DST.ST_DATE --ETLæ¥æ:src.ST_DATE693 FROM OCRM_F_CI_CUST_SIGN DST 694 LEFT JOIN OCRM_F_CI_CUST_SIGN_INNTMP1 SRC 695 ON SRC.FR_ID = DST.FR_ID 696 AND SRC.CUST_ID = DST.CUST_ID 697 WHERE SRC.FR_ID IS NULL """698sql = re.sub(r"\bV_DT\b", "'"+V_DT10+"'", sql)699OCRM_F_CI_CUST_SIGN_INNTMP2 = sqlContext.sql(sql)700dfn="OCRM_F_CI_CUST_SIGN/"+V_DT+".parquet"701OCRM_F_CI_CUST_SIGN_INNTMP2=OCRM_F_CI_CUST_SIGN_INNTMP2.unionAll(OCRM_F_CI_CUST_SIGN_INNTMP1)702OCRM_F_CI_CUST_SIGN_INNTMP1.cache()703OCRM_F_CI_CUST_SIGN_INNTMP2.cache()704nrowsi = OCRM_F_CI_CUST_SIGN_INNTMP1.count()705nrowsa = OCRM_F_CI_CUST_SIGN_INNTMP2.count()706OCRM_F_CI_CUST_SIGN_INNTMP2.write.save(path = hdfs + '/' + dfn, mode='overwrite')707OCRM_F_CI_CUST_SIGN_INNTMP1.unpersist()708OCRM_F_CI_CUST_SIGN_INNTMP2.unpersist()709et = datetime.now()710print("Step %d start[%s] end[%s] use %d seconds, insert OCRM_F_CI_CUST_SIGN lines %d, all lines %d") % (V_STEP, st.strftime("%H:%M:%S"), et.strftime("%H:%M:%S"), (et-st).seconds, nrowsi, nrowsa)711#ä»»å¡[12] 001-13::712V_STEP = V_STEP + 1713OCRM_F_CI_CUST_SIGN = sqlContext.read.parquet(hdfs+'/OCRM_F_CI_CUST_SIGN/*')714OCRM_F_CI_CUST_SIGN.registerTempTable("OCRM_F_CI_CUST_SIGN")715sql = """716 SELECT A.CUST_ID AS CUST_ID 717 ,B.IF_ELEC AS IF_ELEC 718 ,B.IF_WATER AS IF_WATER 719 ,B.IF_TV AS IF_TV 720 ,B.IF_MOBILE AS IF_MOBILE 721 ,B.IF_WY AS IF_WY 722 ,B.IF_MSG AS IF_MSG 723 ,B.IF_GAS AS IF_GAS 724 ,'1' AS IF_WIRE 725 ,B.SIGN_FLAG AS SIGN_FLAG 726 ,A.FR_ID AS FR_ID 727 ,V_DT AS ST_DATE 728 FROM (SELECT DISTINCT FR_ID,CIFNO AS CUST_ID 729 FROM F_CSP_WIRESIGNINFOHIST 730 WHERE ODS_ST_DATE = V_DT 731 AND MAINTCODE IN ('A','U') --A:ç¾çº¦;U:åæ´;D:解约732 AND STATE = 'N' --N:æ£å¸¸;C:å
³é733 ) A --代缴费çµä¿¡ç¾çº¦ä¿¡æ¯åå²è¡¨734 LEFT JOIN OCRM_F_CI_CUST_SIGN B --客æ·ç¾çº¦ä¸´æ¶è¡¨735 ON A.CUST_ID = B.CUST_ID 736 AND A.FR_ID = B.FR_ID """737sql = re.sub(r"\bV_DT\b", "'"+V_DT10+"'", sql)738OCRM_F_CI_CUST_SIGN_INNTMP1 = sqlContext.sql(sql)739OCRM_F_CI_CUST_SIGN_INNTMP1.registerTempTable("OCRM_F_CI_CUST_SIGN_INNTMP1")740sql = """741 SELECT DST.CUST_ID --客æ·å·:src.CUST_ID742 ,DST.IF_ELEC --æ¯å¦çµè´¹ç¾çº¦:src.IF_ELEC743 ,DST.IF_WATER --æ¯å¦æ°´è´¹ç¾çº¦:src.IF_WATER744 ,DST.IF_TV --æ¯å¦å¹¿çµç¾çº¦:src.IF_TV745 ,DST.IF_MOBILE --æ¯å¦ææºé¶è¡ç¾çº¦:src.IF_MOBILE746 ,DST.IF_WY --æ¯å¦ç½é¶ç¾çº¦:src.IF_WY747 ,DST.IF_MSG --æ¯å¦çä¿¡ç¾çº¦:src.IF_MSG748 ,DST.IF_GAS --æ¯å¦ä»£ç¼´è´¹çæ°ç¾çº¦:src.IF_GAS749 ,DST.IF_WIRE --æ¯å¦ä»£ç¼´è´¹çµä¿¡ç¾çº¦:src.IF_WIRE750 ,DST.SIGN_FLAG --ç¾çº¦æ±æ»(ç½é¶-ææºé¶è¡-çä¿¡-çµè´¹-æ°´è´¹-çæ°-广çµ-çµä¿¡):src.SIGN_FLAG751 ,DST.FR_ID --æ³äººå·:src.FR_ID752 ,DST.ST_DATE --ETLæ¥æ:src.ST_DATE753 FROM OCRM_F_CI_CUST_SIGN DST 754 LEFT JOIN OCRM_F_CI_CUST_SIGN_INNTMP1 SRC 755 ON SRC.FR_ID = DST.FR_ID 756 AND SRC.CUST_ID = DST.CUST_ID 757 WHERE SRC.FR_ID IS NULL """758sql = re.sub(r"\bV_DT\b", "'"+V_DT10+"'", sql)759OCRM_F_CI_CUST_SIGN_INNTMP2 = sqlContext.sql(sql)760dfn="OCRM_F_CI_CUST_SIGN/"+V_DT+".parquet"761OCRM_F_CI_CUST_SIGN_INNTMP2=OCRM_F_CI_CUST_SIGN_INNTMP2.unionAll(OCRM_F_CI_CUST_SIGN_INNTMP1)762OCRM_F_CI_CUST_SIGN_INNTMP1.cache()763OCRM_F_CI_CUST_SIGN_INNTMP2.cache()764nrowsi = OCRM_F_CI_CUST_SIGN_INNTMP1.count()765nrowsa = OCRM_F_CI_CUST_SIGN_INNTMP2.count()766OCRM_F_CI_CUST_SIGN_INNTMP2.write.save(path = hdfs + '/' + dfn, mode='overwrite')767OCRM_F_CI_CUST_SIGN_INNTMP1.unpersist()768OCRM_F_CI_CUST_SIGN_INNTMP2.unpersist()769et = datetime.now()770print("Step %d start[%s] end[%s] use %d seconds, insert OCRM_F_CI_CUST_SIGN lines %d, all lines %d") % (V_STEP, st.strftime("%H:%M:%S"), et.strftime("%H:%M:%S"), (et-st).seconds, nrowsi, nrowsa)771#ä»»å¡[12] 001-14::772V_STEP = V_STEP + 1773OCRM_F_CI_CUST_SIGN = sqlContext.read.parquet(hdfs+'/OCRM_F_CI_CUST_SIGN/*')774OCRM_F_CI_CUST_SIGN.registerTempTable("OCRM_F_CI_CUST_SIGN")775sql = """776 SELECT CUST_ID AS CUST_ID 777 ,IF_ELEC AS IF_ELEC 778 ,IF_WATER AS IF_WATER 779 ,IF_TV AS IF_TV 780 ,IF_MOBILE AS IF_MOBILE 781 ,IF_WY AS IF_WY 782 ,IF_MSG AS IF_MSG 783 ,IF_GAS AS IF_GAS 784 ,IF_WIRE AS IF_WIRE 785 ,CONCAT(IF_WY , IF_MOBILE , IF_MSG , IF_ELEC , IF_WATER , IF_GAS , IF_TV , IF_WIRE) AS SIGN_FLAG 786 ,FR_ID AS FR_ID 787 ,ST_DATE AS ST_DATE 788 FROM OCRM_F_CI_CUST_SIGN A --客æ·ç¾çº¦ä¸´æ¶è¡¨789"""790sql = re.sub(r"\bV_DT\b", "'"+V_DT10+"'", sql)791OCRM_F_CI_CUST_SIGN_INNTMP1 = sqlContext.sql(sql)792OCRM_F_CI_CUST_SIGN_INNTMP1.registerTempTable("OCRM_F_CI_CUST_SIGN_INNTMP1")793sql = """794 SELECT DST.CUST_ID --客æ·å·:src.CUST_ID795 ,DST.IF_ELEC --æ¯å¦çµè´¹ç¾çº¦:src.IF_ELEC796 ,DST.IF_WATER --æ¯å¦æ°´è´¹ç¾çº¦:src.IF_WATER797 ,DST.IF_TV --æ¯å¦å¹¿çµç¾çº¦:src.IF_TV798 ,DST.IF_MOBILE --æ¯å¦ææºé¶è¡ç¾çº¦:src.IF_MOBILE799 ,DST.IF_WY --æ¯å¦ç½é¶ç¾çº¦:src.IF_WY800 ,DST.IF_MSG --æ¯å¦çä¿¡ç¾çº¦:src.IF_MSG801 ,DST.IF_GAS --æ¯å¦ä»£ç¼´è´¹çæ°ç¾çº¦:src.IF_GAS802 ,DST.IF_WIRE --æ¯å¦ä»£ç¼´è´¹çµä¿¡ç¾çº¦:src.IF_WIRE803 ,DST.SIGN_FLAG --ç¾çº¦æ±æ»(ç½é¶-ææºé¶è¡-çä¿¡-çµè´¹-æ°´è´¹-çæ°-广çµ-çµä¿¡):src.SIGN_FLAG804 ,DST.FR_ID --æ³äººå·:src.FR_ID805 ,DST.ST_DATE --ETLæ¥æ:src.ST_DATE806 FROM OCRM_F_CI_CUST_SIGN DST 807 LEFT JOIN OCRM_F_CI_CUST_SIGN_INNTMP1 SRC 808 ON SRC.FR_ID = DST.FR_ID 809 AND SRC.CUST_ID = DST.CUST_ID 810 WHERE SRC.FR_ID IS NULL """811sql = re.sub(r"\bV_DT\b", "'"+V_DT10+"'", sql)812OCRM_F_CI_CUST_SIGN_INNTMP2 = sqlContext.sql(sql)813dfn="OCRM_F_CI_CUST_SIGN/"+V_DT+".parquet"814OCRM_F_CI_CUST_SIGN_INNTMP2=OCRM_F_CI_CUST_SIGN_INNTMP2.unionAll(OCRM_F_CI_CUST_SIGN_INNTMP1)815OCRM_F_CI_CUST_SIGN_INNTMP1.cache()816OCRM_F_CI_CUST_SIGN_INNTMP2.cache()817nrowsi = OCRM_F_CI_CUST_SIGN_INNTMP1.count()818nrowsa = OCRM_F_CI_CUST_SIGN_INNTMP2.count()819#è£
è½½æ°æ®820OCRM_F_CI_CUST_SIGN_INNTMP2.write.save(path = hdfs + '/' + dfn, mode='overwrite')821#å é¤822ret = os.system("hdfs dfs -rm -r /"+dbname+"/OCRM_F_CI_CUST_SIGN_BK/"+V_DT+".parquet ")823#å¤ä»½ææ°æ°æ®824ret = os.system("hdfs dfs -cp -f /"+dbname+"/OCRM_F_CI_CUST_SIGN/"+V_DT+".parquet /"+dbname+"/OCRM_F_CI_CUST_SIGN_BK/"+V_DT+".parquet")825OCRM_F_CI_CUST_SIGN_INNTMP1.unpersist()826OCRM_F_CI_CUST_SIGN_INNTMP2.unpersist()827et = datetime.now()...
index.js
Source:index.js
1$(document).ready(function () {2 let botSign = "\u2715"3 let humanSign = "\u25EF"4 let botFirstMove = [4,2,0,8,6]5 let randBotFMove = Math.floor(Math.random() * botFirstMove.length)6 let randWaitTime = Math.floor(Math.random() * (1500-700)+700).toFixed()7 // disable board so bot play first 8 $(".playBox span").css("pointerEvents", "none")9 setTimeout(() => {10 $(".playBox span").eq(botFirstMove[randBotFMove]).text("\u2715").attr("id", "\u2715")11 // $(".playBox span").eq(8).text("\u2715").attr("id", "\u2715")12 addClassActive()13 enablePointerEvent()14 }, 1500);15 // Human playing 16 $(".playBox span").click(function () {17 if ($(this).text() == '') {18 $(this).text("\u25EF").attr("id","\u25EF")19 removeClassActive()20 disablePointerEvent()21 checkWinner("\u25EF")22 setTimeout(() => {23 bot()24 }, randWaitTime);25 }26 })27 // randomize move if player plays center 28 let centerArr = [5,8]29 let centerRand = Math.floor(Math.random() * centerArr.length)30 let cArr = [6,3]31 let cRand = Math.floor(Math.random() * cArr.length)32 let cArr2 = [2,5]33 let cRand2 = Math.floor(Math.random() * cArr2.length)34 let cArr3 = [0,3]35 let cRand3 = Math.floor(Math.random() * cArr3.length)36 // Bot playing 37 function bot() {38 // Winning moves 39 if (getSpanText(0) == botSign && getSpanText(2) == botSign && getSpanText(1) == '') {40 wonMoves(1)41 }42 else if (getSpanText(0) == botSign && getSpanText(1) == botSign && getSpanText(2) == '') {43 wonMoves(2)44 }45 else if (getSpanText(0) == '' && getSpanText(1) == botSign && getSpanText(2) == botSign) {46 wonMoves(0) 47 }48 else if (getSpanText(0) == botSign && getSpanText(3) == botSign && getSpanText(6) == '') {49 wonMoves(6)50 }51 else if (getSpanText(0) == botSign && getSpanText(6) == botSign && getSpanText(3) == '') {52 wonMoves(3)53 }54 else if (getSpanText(0) == '' && getSpanText(6) == botSign && getSpanText(3) == botSign) {55 wonMoves(0) 56 }57 else if (getSpanText(0) == botSign && getSpanText(8) == botSign && getSpanText(4) == '') {58 wonMoves(4)59 }60 else if (getSpanText(0) == botSign && getSpanText(4) == botSign && getSpanText(8) == '') {61 wonMoves(8)62 }63 else if (getSpanText(0) == '' && getSpanText(4) == botSign && getSpanText(8) == botSign) {64 wonMoves(0) 65 }66 else if (getSpanText(1) == botSign && getSpanText(4) == botSign && getSpanText(7) == '') {67 wonMoves(7)68 }69 else if (getSpanText(1) == botSign && getSpanText(4) == '' && getSpanText(7) == botSign) {70 wonMoves(4)71 }72 else if (getSpanText(1) == '' && getSpanText(4) == botSign && getSpanText(7) == botSign) {73 wonMoves(1)74 }75 else if (getSpanText(2) == botSign && getSpanText(5) == botSign && getSpanText(8) == '') {76 wonMoves(8)77 }78 else if (getSpanText(2) == botSign && getSpanText(5) == '' && getSpanText(8) == botSign) {79 wonMoves(5)80 }81 else if (getSpanText(2) == '' && getSpanText(5) == botSign && getSpanText(8) == botSign) {82 wonMoves(2)83 }84 else if (getSpanText(2) == botSign && getSpanText(4) == botSign && getSpanText(6) == '') {85 wonMoves(6)86 }87 else if (getSpanText(2) == botSign && getSpanText(4) == '' && getSpanText(6) == botSign) {88 wonMoves(4)89 }90 else if (getSpanText(2) == '' && getSpanText(4) == botSign && getSpanText(6) == botSign) {91 wonMoves(2)92 }93 else if (getSpanText(3) == '' && getSpanText(4) == botSign && getSpanText(5) == botSign) {94 wonMoves(3)95 }96 else if (getSpanText(3) == botSign && getSpanText(4) == '' && getSpanText(5) == botSign) {97 wonMoves(4)98 }99 else if (getSpanText(3) == botSign && getSpanText(4) == botSign && getSpanText(5) == '') {100 wonMoves(5)101 }102 else if (getSpanText(6) == botSign && getSpanText(7) == botSign && getSpanText(8) == '') {103 wonMoves(8)104 }105 else if (getSpanText(6) == botSign && getSpanText(7) == '' && getSpanText(8) == botSign) {106 wonMoves(7)107 }108 else if (getSpanText(6) == '' && getSpanText(7) == botSign && getSpanText(8) == botSign) {109 wonMoves(6)110 }111 // blocking moves 112 else if (getSpanText(0) == humanSign && getSpanText(2) == humanSign && getSpanText(1) == '') {113 allInOne(1)114 }115 else if (getSpanText(0) == humanSign && getSpanText(1) == humanSign && getSpanText(2) == '') {116 allInOne(2)117 }118 else if (getSpanText(0) == '' && getSpanText(1) == humanSign && getSpanText(2) == humanSign) {119 allInOne(0) 120 }121 else if (getSpanText(0) == humanSign && getSpanText(3) == humanSign && getSpanText(6) == '') {122 allInOne(6)123 }124 else if (getSpanText(0) == humanSign && getSpanText(6) == humanSign && getSpanText(3) == '') {125 allInOne(3)126 }127 else if (getSpanText(0) == '' && getSpanText(6) == humanSign && getSpanText(3) == humanSign) {128 allInOne(0) 129 }130 else if (getSpanText(0) == humanSign && getSpanText(8) == humanSign && getSpanText(4) == '') {131 allInOne(4)132 }133 else if (getSpanText(0) == humanSign && getSpanText(4) == humanSign && getSpanText(8) == '') {134 allInOne(8)135 }136 else if (getSpanText(0) == '' && getSpanText(4) == humanSign && getSpanText(8) == humanSign) {137 allInOne(0) 138 }139 else if (getSpanText(1) == humanSign && getSpanText(4) == humanSign && getSpanText(7) == '') {140 allInOne(7)141 }142 else if (getSpanText(1) == humanSign && getSpanText(4) == '' && getSpanText(7) == humanSign) {143 allInOne(4)144 }145 else if (getSpanText(1) == '' && getSpanText(4) == humanSign && getSpanText(7) == humanSign) {146 allInOne(1)147 }148 else if (getSpanText(2) == humanSign && getSpanText(5) == humanSign && getSpanText(8) == '') {149 allInOne(8)150 }151 else if (getSpanText(2) == humanSign && getSpanText(5) == '' && getSpanText(8) == humanSign) {152 allInOne(5)153 }154 else if (getSpanText(2) == '' && getSpanText(5) == humanSign && getSpanText(8) == humanSign) {155 allInOne(2)156 }157 else if (getSpanText(2) == humanSign && getSpanText(4) == humanSign && getSpanText(6) == '') {158 allInOne(6)159 }160 else if (getSpanText(2) == humanSign && getSpanText(4) == '' && getSpanText(6) == humanSign) {161 allInOne(4)162 }163 else if (getSpanText(2) == '' && getSpanText(4) == humanSign && getSpanText(6) == humanSign) {164 allInOne(2)165 }166 else if (getSpanText(3) == '' && getSpanText(4) == humanSign && getSpanText(5) == humanSign) {167 allInOne(3)168 }169 else if (getSpanText(3) == humanSign && getSpanText(4) == '' && getSpanText(5) == humanSign) {170 allInOne(4)171 }172 else if (getSpanText(3) == humanSign && getSpanText(4) == humanSign && getSpanText(5) == '') {173 allInOne(5)174 }175 else if (getSpanText(6) == humanSign && getSpanText(7) == humanSign && getSpanText(8) == '') {176 allInOne(8)177 }178 else if (getSpanText(6) == humanSign && getSpanText(7) == '' && getSpanText(8) == humanSign) {179 allInOne(7)180 }181 else if (getSpanText(6) == '' && getSpanText(7) == humanSign && getSpanText(8) == humanSign) {182 allInOne(6)183 }184 // fill last space moves 185 else if (getSpanText(0) == '' && getSpanText(1) != '' && getSpanText(2) != '' && getSpanText(3) != '' && getSpanText(4) != '' && getSpanText(5) != '' && getSpanText(6) != '' && getSpanText(7) != '' && getSpanText(8) != '') {186 allInOne(0)187 }188 else if (getSpanText(0) != '' && getSpanText(1) == '' && getSpanText(2) != '' && getSpanText(3) != '' && getSpanText(4) != '' && getSpanText(5) != '' && getSpanText(6) != '' && getSpanText(7) != '' && getSpanText(8) != '') {189 allInOne(1)190 }191 else if (getSpanText(0) != '' && getSpanText(1) != '' && getSpanText(2) == '' && getSpanText(3) != '' && getSpanText(4) != '' && getSpanText(5) != '' && getSpanText(6) != '' && getSpanText(7) != '' && getSpanText(8) != '') {192 allInOne(2)193 }194 else if (getSpanText(0) != '' && getSpanText(1) != '' && getSpanText(2) != '' && getSpanText(3) == '' && getSpanText(4) != '' && getSpanText(5) != '' && getSpanText(6) != '' && getSpanText(7) != '' && getSpanText(8) != '') {195 allInOne(3)196 }197 else if (getSpanText(0) != '' && getSpanText(1) != '' && getSpanText(2) != '' && getSpanText(3) != '' && getSpanText(4) == '' && getSpanText(5) != '' && getSpanText(6) != '' && getSpanText(7) != '' && getSpanText(8) != '') {198 allInOne(4)199 }200 else if (getSpanText(0) != '' && getSpanText(1) != '' && getSpanText(2) != '' && getSpanText(3) != '' && getSpanText(4) != '' && getSpanText(5) == '' && getSpanText(6) != '' && getSpanText(7) != '' && getSpanText(8) != '') {201 allInOne(5)202 }203 else if (getSpanText(0) != '' && getSpanText(1) != '' && getSpanText(2) != '' && getSpanText(3) != '' && getSpanText(4) != '' && getSpanText(5) != '' && getSpanText(6) == '' && getSpanText(7) != '' && getSpanText(8) != '') {204 allInOne(6)205 }206 else if (getSpanText(0) != '' && getSpanText(1) != '' && getSpanText(2) != '' && getSpanText(3) != '' && getSpanText(4) != '' && getSpanText(5) != '' && getSpanText(6) != '' && getSpanText(7) == '' && getSpanText(8) != '') {207 allInOne(7)208 }209 else if (getSpanText(0) != '' && getSpanText(1) != '' && getSpanText(2) != '' && getSpanText(3) != '' && getSpanText(4) != '' && getSpanText(5) != '' && getSpanText(6) != '' && getSpanText(7) != '' && getSpanText(8) == '') {210 allInOne(8)211 }212 else if (getSpanIds(0) == botSign) { 213 // play bottom right if center 214 if (getSpanText(4) == humanSign && getSpanText(centerArr[centerRand]) == '' && getSpanText(2) == '' && getSpanText(3) == '' && getSpanText(7) == '' && getSpanText(1) == '' && getSpanText(6) == '') {215 allInOne(centerArr[centerRand])216 }217 // play side if center 218 else if (getSpanText(5) == botSign && getSpanText(7) == '' && getSpanText(8) == '' && getSpanText(2) == '' && getSpanText(1) == '') {219 allInOne(2)220 }221 else if (getSpanText(5) == botSign && getSpanText(7) == botSign && getSpanText(8) == '' && getSpanText(2) == '' && getSpanText(6) == '') {222 allInOne(8)223 }224 else if (getSpanText(5) == botSign && getSpanText(7) == botSign && getSpanText(2) == '' && getSpanText(3) == '' && getSpanText(6) == '') {225 allInOne(3)226 }227 else if (getSpanText(5) == botSign && getSpanText(6) == botSign && getSpanText(7) == '' && getSpanText(8) == '') {228 allInOne(8)229 }230 else if (getSpanText(5) == botSign && getSpanText(4) == humanSign && getSpanText(8) == humanSign && getSpanText(1) == '' && getSpanText(2) == '') {231 allInOne(2)232 }233 // player plays left edge 234 else if (getSpanText(3) == humanSign && getSpanText(4) == '' && getSpanText(2) == '' && getSpanText(6) == '' && getSpanText(8) == '') {235 allInOne(2)236 }237 else if (getSpanText(3) == humanSign && getSpanText(4) == ''&& getSpanText(6) == '' && getSpanText(8) == '' && getSpanText(1) == humanSign) {238 allInOne(4)239 }240 //player plays bottom corner 241 else if (getSpanText(6) == humanSign && getSpanText(2) == '' && getSpanText(8) == '' && getSpanText(5) == '' && getSpanText(1) == '') {242 allInOne(8)243 }244 // player plays column 2 row 2 245 else if (getSpanText(1) == humanSign && getSpanText(6) == '' && getSpanText(3) == '' && getSpanText(8) == '' && getSpanText(7) == '') {246 allInOne(6)247 }248 else if (getSpanText(1) == humanSign && getSpanText(4) == '' && getSpanText(3) == humanSign && getSpanText(8) == '' && getSpanText(7) == '') {249 allInOne(8)250 }251 // player plays column 2 row 3 252 else if (getSpanText(7) == humanSign && getSpanText(4) == '' && getSpanText(2) == '' && getSpanText(8) == '' && getSpanText(6) == '') {253 allInOne(2)254 }255 // player plays top right corner 256 else if (getSpanText(2) == humanSign && getSpanText(4) == '' && getSpanText(3) == '' && getSpanText(8) == '' && getSpanText(6) == '') {257 allInOne(8)258 }259 // player plays right edge 260 else if (getSpanText(5) == humanSign && getSpanText(2) == '' && getSpanText(1) == '' && getSpanText(4) == '' && getSpanText(6) == '') {261 allInOne(2)262 }263 // player play bottom right corner 264 else if (getSpanText(8) == humanSign && getSpanText(2) == '' && getSpanText(3) == '' && getSpanText(1) == '' && getSpanText(6) == '') {265 allInOne(6)266 }267 else if (getSpanText(8) == humanSign && getSpanText(3) == humanSign && getSpanText(4) == '' && getSpanText(1) == '' && getSpanText(2) == '') {268 allInOne(2)269 }270 // this line is for 4 == botSign 271 else if (getSpanText(8) == humanSign && getSpanText(4) == botSign && getSpanText(3) == humanSign && getSpanText(2) == '' && getSpanText(1) == '' && getSpanText(0) == botSign) {272 allInOne(2)273 }274 else if (getSpanText(8) == humanSign && getSpanText(4) == botSign && getSpanText(6) == humanSign && getSpanText(3) == '' && getSpanText(1) == humanSign && getSpanText(5) == '') {275 allInOne(5)276 }277 else if (getSpanText(8) == humanSign && getSpanText(4) == botSign && getSpanText(1) == humanSign && getSpanText(2) == '' && getSpanText(6) == '') {278 allInOne(6)279 }280 else if (getSpanText(8) == humanSign && getSpanText(4) == botSign && getSpanText(2) == humanSign && getSpanText(1) == '' && getSpanText(7) == '' && getSpanText(3) == humanSign) {281 allInOne(7)282 }283 // this line is for 6 == botSign 284 else if (getSpanText(7) == humanSign && getSpanText(6) == botSign && getSpanText(3) == humanSign && getSpanText(4) == '' && getSpanText(2) == '' && getSpanText(1) == '' && getSpanText(0) == botSign) {285 allInOne(2)286 }287 else if (getSpanText(2) == humanSign && getSpanText(6) == botSign && getSpanText(3) == humanSign && getSpanText(4) == '' && getSpanText(7) == '' && getSpanText(8) == '' && getSpanText(0) == botSign) {288 allInOne(8)289 }290 }291 // bot plays on column 3 row 1292 else if (getSpanIds(2) == botSign) {293 // play bottom left if center 294 if (getSpanText(4) == humanSign && getSpanText(cArr[cRand]) == '' && getSpanText(0) == '' && getSpanText(5) == '' && getSpanText(7) == '' && getSpanText(1) == '' && getSpanText(8) == '') {295 allInOne(cArr[cRand])296 }297 // play edge if center 298 else if (getSpanText(3) == botSign && getSpanText(4) == humanSign && getSpanText(0) == humanSign && getSpanText(1) == '' && getSpanText(7) == '' && getSpanText(6) == '') {299 allInOne(6)300 }301 else if (getSpanText(3) == botSign && getSpanText(4) == humanSign && getSpanText(6) == humanSign && getSpanText(0) == '' && getSpanText(1) == '' && getSpanText(8) == '') {302 allInOne(0)303 }304 else if (getSpanText(3) == botSign && getSpanText(7) == botSign && getSpanText(2) == botSign && getSpanText(5) == '' && getSpanText(8) == '' && getSpanText(0) == '') {305 allInOne(8)306 }307 else if (getSpanText(3) == botSign && getSpanText(2) == botSign && getSpanText(1) == '' && getSpanText(0) == '' && getSpanText(8) == '') {308 allInOne(0)309 }310 // player plays first corner 311 else if (getSpanText(0) == humanSign && getSpanText(2) == botSign && getSpanText(4) == '' && getSpanText(6) == '' && getSpanText(8) == '') {312 allInOne(6)313 }314 // player plays left edge 315 else if (getSpanText(3) == humanSign && getSpanText(2) == botSign && getSpanText(4) == '' && getSpanText(0) == '' && getSpanText(1) == '') {316 allInOne(4)317 }318 // player plays bottom left corner 319 else if (getSpanText(6) == humanSign && getSpanText(2) == botSign && getSpanText(5) == '' && getSpanText(0) == '' && getSpanText(8) == '') {320 allInOne(8)321 }322 else if (getSpanText(6) == humanSign && getSpanText(2) == botSign && getSpanText(5) == humanSign && getSpanText(0) == '' && getSpanText(1) == '' && getSpanText(4) == '') {323 allInOne(0)324 }325 // player plays column 2 row 2 326 else if (getSpanText(1) == humanSign && getSpanText(2) == botSign && getSpanText(5) == '' && getSpanText(8) == '' && getSpanText(4) == '' && getSpanText(6) == '') {327 allInOne(8)328 }329 else if (getSpanText(1) == humanSign && getSpanText(2) == botSign && getSpanText(5) == humanSign && getSpanText(7) == '' && getSpanText(4) == '' && getSpanText(6) == '') {330 allInOne(6)331 }332 // player plays column 2 row 3 333 else if (getSpanText(7) == humanSign && getSpanText(2) == botSign && getSpanText(0) == '' && getSpanText(1) == '' && getSpanText(4) == '' && getSpanText(6) == '') {334 allInOne(0)335 }336 // player plays right edge 337 else if (getSpanText(5) == humanSign && getSpanText(2) == botSign && getSpanText(0) == '' && getSpanText(1) == '' && getSpanText(4) == '' && getSpanText(6) == '') {338 allInOne(0)339 }340 // player plays bottom right corner 341 else if (getSpanText(8) == humanSign && getSpanText(2) == botSign && getSpanText(0) == '' && getSpanText(1) == '' && getSpanText(4) == '' && getSpanText(6) == '') {342 allInOne(6)343 }344 // this line for botSign == 4 345 else if (getSpanText(6) == humanSign && getSpanText(4) == botSign && getSpanText(1) == '' && getSpanText(7) == '' && getSpanText(8) == '' && getSpanText(0) == humanSign && getSpanText(2) == botSign) {346 allInOne(7)347 }348 else if (getSpanText(6) == humanSign && getSpanText(4) == botSign && getSpanText(2) == botSign && getSpanText(5) == humanSign349 && getSpanText(8) == '' && getSpanText(0) == '') {350 allInOne(0)351 }352 else if (getSpanText(6) == humanSign && getSpanText(4) == botSign && getSpanText(2) == botSign && getSpanText(0) == ''353 && getSpanText(3) == '' && getSpanText(5) == '') {354 allInOne(3)355 }356 // this line is for 8 == botSign 357 else if (getSpanText(3) == botSign && getSpanText(8) == botSign && getSpanText(4) == humanSign && getSpanText(1) == '' && getSpanText(0) == '' && getSpanText(2) == botSign) {358 allInOne(0)359 }360 else if (getSpanText(0) == humanSign && getSpanText(5) == humanSign && getSpanText(8) == botSign && getSpanText(2) == botSign && getSpanText(4) == '' && getSpanText(6) == '' && getSpanText(7) == '') {361 allInOne(6)362 }363 }364 365 else if (getSpanText(4) == botSign) {366 // player play first corner 367 if (getSpanText(0) == humanSign && getSpanText(1) == '' && getSpanText(2) == '' && getSpanText(3) == '' && getSpanText(4) == botSign && getSpanText(5) == '' && getSpanText(6) == '' && getSpanText(7) == '' && getSpanText(8) == '') {368 allInOne(8)369 }370 else if (getSpanText(0) == humanSign && getSpanText(4) == botSign && getSpanText(1) == '' && getSpanText(7) == '' && getSpanText(6) == humanSign && getSpanText(8) == botSign) {371 allInOne(1)372 }373 else if (getSpanText(0) == humanSign && getSpanText(4) == botSign && getSpanText(7) == humanSign && getSpanText(2) == '' && getSpanText(5) == '' && getSpanText(8) == botSign) {374 allInOne(2)375 }376 else if (getSpanText(0) == humanSign && getSpanText(4) == botSign && getSpanText(7) == humanSign && getSpanText(2) == humanSign && getSpanText(3) == '' && getSpanText(8) == botSign) {377 allInOne(3)378 }379 else if (getSpanText(0) == humanSign && getSpanText(4) == botSign && getSpanText(2) == '' && getSpanText(6) == '' && getSpanText(5) == humanSign && getSpanText(8) == botSign) {380 allInOne(6)381 }382 // player play left edge383 else if (getSpanText(3) == humanSign && getSpanText(1) == '' && getSpanText(2) == '' && getSpanText(0) == '' && getSpanText(4) == botSign && getSpanText(5) == '' && getSpanText(6) == '' && getSpanText(7) == '' && getSpanText(8) == '') {384 allInOne(6)385 }386 else if (getSpanText(3) == humanSign && getSpanText(4) == botSign && getSpanText(8) == '' && getSpanText(6) == botSign && getSpanText(7) == '' && getSpanText(0) == '') {387 allInOne(8)388 }389 // player play bottom left corner390 else if (getSpanText(6) == humanSign && getSpanText(4) == botSign && getSpanText(2) == '' && getSpanText(1) == '' && getSpanText(8) == '' && getSpanText(0) == '') {391 allInOne(2)392 }393 // player play column 2 row 394 else if (getSpanText(1) == humanSign && getSpanText(4) == botSign && getSpanText(2) == '' && getSpanText(7) == '' && getSpanText(8) == '' && getSpanText(5) == '') {395 allInOne(2)396 }397 // player plays column 2 row 3 398 else if (getSpanText(7) == humanSign && getSpanText(4) == botSign && getSpanText(2) == '' && getSpanText(1) == '' && getSpanText(0) == '' && getSpanText(6) == '') {399 allInOne(6)400 }401 else if (getSpanText(7) == humanSign && getSpanText(4) == botSign && getSpanText(2) == humanSign && getSpanText(8) == '' && getSpanText(0) == '' && getSpanText(3) == '') {402 allInOne(0)403 }404 // player plays top right corner 405 else if (getSpanText(2) == humanSign && getSpanText(4) == botSign && getSpanText(6) == '' && getSpanText(8) == '' && getSpanText(0) == '' && getSpanText(7) == '') {406 allInOne(6)407 }408 else if (getSpanText(2) == humanSign && getSpanText(4) == botSign && getSpanText(7) == humanSign && getSpanText(5) == '' && getSpanText(0) == humanSign && getSpanText(8) == '') {409 allInOne(5)410 }411 else if (getSpanText(2) == humanSign && getSpanText(4) == botSign && getSpanText(8) == humanSign && getSpanText(3) == humanSign && getSpanText(1) == '' && getSpanText(7) == '') {412 allInOne(1)413 }414 // player plays bottom right edge415 else if (getSpanText(5) == humanSign && getSpanText(4) == botSign && getSpanText(6) == '' && getSpanText(2) == '' && getSpanText(1) == '' && getSpanText(0) == '') {416 allInOne(2)417 }418 // player plays bottom right corner 419 else if (getSpanText(8) == humanSign && getSpanText(4) == botSign && getSpanText(6) == '' && getSpanText(2) == '' && getSpanText(1) == '' && getSpanText(0) == '') {420 allInOne(0)421 }422 }423 else if (getSpanIds(6) == botSign) {424 if (getSpanText(4) == humanSign && getSpanText(cArr2[cRand2]) == '' && getSpanText(0) == '' && getSpanText(3) == '' && getSpanText(7) == '' && getSpanText(1) == '' && getSpanText(8) == '') {425 allInOne(cArr2[cRand2])426 }427 else if (getSpanText(4) == humanSign && getSpanText(5) == botSign && getSpanText(3) == humanSign && getSpanText(8) == '' && getSpanText(1) == '' && getSpanText(7) == '') {428 allInOne(8)429 }430 else if (getSpanText(4) == humanSign && getSpanText(5) == botSign && getSpanText(3) == humanSign && getSpanText(8) == '' && getSpanText(1) == '' && getSpanText(7) == '') {431 allInOne(8)432 }433 else if (getSpanText(4) == humanSign && getSpanText(5) == botSign && getSpanText(7) == humanSign && getSpanText(8) == '' && getSpanText(2) == '' && getSpanText(0) == '') {434 allInOne(2)435 }436 else if (getSpanText(4) == humanSign && getSpanText(5) == botSign && getSpanText(2) == humanSign && getSpanText(8) == '' && getSpanText(1) == '' && getSpanText(0) == '') {437 allInOne(8)438 }439 else if (getSpanText(4) == humanSign && getSpanText(5) == botSign && getSpanText(2) == humanSign && getSpanText(7) == humanSign && getSpanText(3) == '' && getSpanText(0) == '') {440 allInOne(0)441 }442 // player plays first corner 443 else if (getSpanText(0) == humanSign && getSpanText(1) == '' && getSpanText(2) == '' && getSpanText(3) == '' && getSpanText(4) == '' && getSpanText(5) == '' && getSpanText(6) == botSign && getSpanText(7) == '' && getSpanText(8) == '') {444 allInOne(2)445 }446 // player plays left edge447 else if (getSpanText(3) == humanSign && getSpanText(1) == '' && getSpanText(2) == '' && getSpanText(0) == '' && getSpanText(4) == '' && getSpanText(5) == '' && getSpanText(6) == botSign && getSpanText(7) == '' && getSpanText(8) == '') {448 allInOne(8)449 }450 else if (getSpanText(3) == humanSign && getSpanText(6) == botSign && getSpanText(7) == humanSign && getSpanText(4) == '' && getSpanText(2) == '' && getSpanText(0) == '') {451 allInOne(4)452 }453 // player plays column 2 row 1454 else if (getSpanText(1) == humanSign && getSpanText(3) == '' && getSpanText(2) == '' && getSpanText(0) == '' && getSpanText(4) == '' && getSpanText(5) == '' && getSpanText(6) == botSign && getSpanText(7) == '' && getSpanText(8) == '') {455 allInOne(8)456 }457 // player plays column 2 row 3458 else if (getSpanText(7) == humanSign && getSpanText(3) == '' && getSpanText(2) == '' && getSpanText(0) == '' && getSpanText(4) == '' && getSpanText(5) == '' && getSpanText(6) == botSign && getSpanText(1) == '' && getSpanText(8) == '') {459 allInOne(0)460 }461 // player plays top right corner 462 else if (getSpanText(2) == humanSign && getSpanText(3) == '' && getSpanText(7) == '' && getSpanText(0) == '' && getSpanText(4) == '' && getSpanText(5) == '' && getSpanText(6) == botSign && getSpanText(1) == '' && getSpanText(8) == '') {463 allInOne(0)464 }465 // player plays right edge466 else if (getSpanText(5) == humanSign && getSpanText(3) == '' && getSpanText(7) == '' && getSpanText(0) == '' && getSpanText(4) == '' && getSpanText(2) == '' && getSpanText(6) == botSign && getSpanText(1) == '' && getSpanText(8) == '') {467 allInOne(8)468 } 469 else if (getSpanText(5) == humanSign && getSpanText(6) == botSign && getSpanText(7) == humanSign && getSpanText(4) == '' && getSpanText(2) == '' && getSpanText(0) == '') {470 allInOne(4)471 }472 // player plays bottom right corner 473 else if (getSpanText(8) == humanSign && getSpanText(3) == '' && getSpanText(7) == '' && getSpanText(0) == '' && getSpanText(4) == '' && getSpanText(2) == '' && getSpanText(6) == botSign && getSpanText(1) == '' && getSpanText(5) == '') {474 allInOne(2)475 } 476 }477 478 else if (getSpanText(8) == botSign) {479 if (getSpanText(4) == humanSign && getSpanText(cArr3[cRand3]) == '' && getSpanText(2) == '' && getSpanText(5) == '' && getSpanText(7) == '' && getSpanText(1) == '' && getSpanText(6) == '') {480 allInOne(cArr3[cRand3])481 }482 else if (getSpanText(0) == humanSign && getSpanText(3) == botSign && getSpanText(8) == botSign && getSpanText(2) == '' && getSpanText(5) == '') {483 allInOne(2)484 }485 else if (getSpanText(4) == humanSign && getSpanText(3) == botSign && getSpanText(8) == botSign && getSpanText(2) == '' && getSpanText(0) == '' && getSpanText(6) == '') {486 allInOne(6)487 }488 // player plays top left corner489 else if (getSpanText(0) == humanSign && getSpanText(3) == '' && getSpanText(7) == '' && getSpanText(2) == '' && getSpanText(4) == '' && getSpanText(5) == '' && getSpanText(6) == '' && getSpanText(1) == '' && getSpanText(8) == botSign) {490 allInOne(2)491 }492 // player plays left edge493 else if (getSpanText(3) == humanSign && getSpanText(0) == '' && getSpanText(7) == '' && getSpanText(2) == '' && getSpanText(4) == '' && getSpanText(5) == '' && getSpanText(6) == '' && getSpanText(1) == '' && getSpanText(8) == botSign) {494 allInOne(6)495 }496 // player plays bottom left corner497 else if (getSpanText(6) == humanSign && getSpanText(0) == '' && getSpanText(7) == '' && getSpanText(2) == '' && getSpanText(4) == '' && getSpanText(5) == '' && getSpanText(3) == '' && getSpanText(1) == '' && getSpanText(8) == botSign) {498 allInOne(2)499 }500 // player plays column 2 row 1 501 else if (getSpanText(1) == humanSign && getSpanText(0) == '' && getSpanText(7) == '' && getSpanText(2) == '' && getSpanText(4) == '' && getSpanText(5) == '' && getSpanText(3) == '' && getSpanText(6) == '' && getSpanText(8) == botSign) {502 allInOne(6)503 }504 // player plays column 2 row 3505 else if (getSpanText(7) == humanSign && getSpanText(0) == '' && getSpanText(1) == '' && getSpanText(2) == '' && getSpanText(4) == '' && getSpanText(5) == '' && getSpanText(3) == '' && getSpanText(6) == '' && getSpanText(8) == botSign) {506 allInOne(2)507 } 508 // player plays top right corner509 else if (getSpanText(2) == humanSign && getSpanText(0) == '' && getSpanText(1) == '' && getSpanText(7) == '' && getSpanText(4) == '' && getSpanText(5) == '' && getSpanText(3) == '' && getSpanText(6) == '' && getSpanText(8) == botSign) {510 allInOne(0)511 } 512 // player plays right edge 513 else if (getSpanText(5) == humanSign && getSpanText(0) == '' && getSpanText(1) == '' && getSpanText(7) == '' && getSpanText(4) == '' && getSpanText(2) == '' && getSpanText(3) == '' && getSpanText(6) == '' && getSpanText(8) == botSign) {514 allInOne(6)515 } 516 }517 }518 // get span id 519 function getSpanIds(n) {520 return $(".playBox span").eq(n).attr("id")521 }522 // get span text523 function getSpanText(x) {524 return $(".playBox span").eq(x).text()525 }526 // set span text527 function setSpanText(n, x, d) {528 return $(".playBox span").eq(x).text(n).attr("id",n)529 }530 // disable pointerEvent 531 function disablePointerEvent() {532 return $(".playBox span").css("pointerEvents", "none")533 }534 // enable pointerEvent535 function enablePointerEvent() {536 return $(".playBox span").css("pointerEvents", "auto")537 }538 // add class active 539 function addClassActive() {540 return $(".players").addClass("active")541 }542 // remove class active 543 function removeClassActive() {544 return $(".players").removeClass("active")545 }546 // Switch slide547 function switchSides(sideSwitch) {548 if (sideSwitch == '\u25EF') {549 return removeClassActive()550 } else {551 return addClassActive()552 }553 }554 // combine repetition function 555 function allInOne(boxNum) {556 return (557 setSpanText(botSign, boxNum),558 checkWinner(botSign),559 switchSides(botSign),560 enablePointerEvent()561 )562 }563 // winning moves to stop sliding 564 function wonMoves(boxNum) {565 return (566 setSpanText(botSign, boxNum),567 checkWinner(botSign)568 )569 }570 // check winner 571 function checkWinner(n) {572 let el = $(".playBox span")573 if (gCondition(el,0) == n && gCondition(el,1) == n && gCondition(el,2) == n) {574 winnerTest(n)575 } else {576 if (gCondition(el,3) == n && gCondition(el,4) == n && gCondition(el,5) == n) {577 winnerTest(n)578 } else {579 if (gCondition(el,6) == n && gCondition(el,7) == n && gCondition(el,8) == n) {580 winnerTest(n)581 } else {582 if (gCondition(el,0) == n && gCondition(el,3) == n && gCondition(el,6) == n) {583 winnerTest(n)584 } else {585 if (gCondition(el,1) == n && gCondition(el,4) == n && gCondition(el,7) == n) {586 winnerTest(n)587 } else {588 if (gCondition(el,2) == n && gCondition(el,5) == n && gCondition(el,8) == n) {589 winnerTest(n)590 } else {591 if (gCondition(el,0) == n && gCondition(el,4) == n && gCondition(el,8) == n) {592 winnerTest(n)593 } else {594 if (gCondition(el,2) == n && gCondition(el,4) == n && gCondition(el,6) == n) {595 winnerTest(n)596 } else {597 if (el.eq(0).text() != '' && el.eq(1).text() != '' && el.eq(2).text() != ''598 && el.eq(3).text() != '' && el.eq(4).text() != '' && el.eq(5).text() != ''599 && el.eq(6).text() != '' && el.eq(7).text() != '' && el.eq(8).text() != ''){600 setTimeout(() => {601 $(".board").hide()602 $(".winner").fadeIn()603 $(".winner h3").text("Game Draw")604 }, 800);605 }606 }607 }608 }609 }610 }611 }612 }613 }614 }615 function gCondition(ele, num) {616 return ele.eq(num).attr("id")617 }618 function winnerTest(n) {619 return (620 $(".playBox span").css("pointerEvents","none"),621 setTimeout(() => {622 $(".board").hide()623 $(".winner").fadeIn()624 $(".winner h3").text(`Player ${n} Won`)625 }, 800)626 )627 }628 // start game again 629 $(".winner button").click(function() {630 location.href = "index.html"631 })632 // play easy level 633 $(".playEasy button").click(function() {634 location.href = "../index.html"635 })636})...
table_zero.py
Source:table_zero.py
1"""Zero_Width table. Created by setup.py."""2# Generated: 2015-09-14T01:48:19.5322173# Source: DerivedGeneralCategory-8.0.0.txt4# Date: 2015-02-13, 13:47:11 GMT [MD]5ZERO_WIDTH = (6 (0x0300, 0x036f,), # Combining Grave Accent ..Combining Latin Small Le7 (0x0483, 0x0489,), # Combining Cyrillic Titlo..Combining Cyrillic Milli8 (0x0591, 0x05bd,), # Hebrew Accent Etnahta ..Hebrew Point Meteg9 (0x05bf, 0x05bf,), # Hebrew Point Rafe ..Hebrew Point Rafe10 (0x05c1, 0x05c2,), # Hebrew Point Shin Dot ..Hebrew Point Sin Dot11 (0x05c4, 0x05c5,), # Hebrew Mark Upper Dot ..Hebrew Mark Lower Dot12 (0x05c7, 0x05c7,), # Hebrew Point Qamats Qata..Hebrew Point Qamats Qata13 (0x0610, 0x061a,), # Arabic Sign Sallallahou ..Arabic Small Kasra14 (0x064b, 0x065f,), # Arabic Fathatan ..Arabic Wavy Hamza Below15 (0x0670, 0x0670,), # Arabic Letter Superscrip..Arabic Letter Superscrip16 (0x06d6, 0x06dc,), # Arabic Small High Ligatu..Arabic Small High Seen17 (0x06df, 0x06e4,), # Arabic Small High Rounde..Arabic Small High Madda18 (0x06e7, 0x06e8,), # Arabic Small High Yeh ..Arabic Small High Noon19 (0x06ea, 0x06ed,), # Arabic Empty Centre Low ..Arabic Small Low Meem20 (0x0711, 0x0711,), # Syriac Letter Superscrip..Syriac Letter Superscrip21 (0x0730, 0x074a,), # Syriac Pthaha Above ..Syriac Barrekh22 (0x07a6, 0x07b0,), # Thaana Abafili ..Thaana Sukun23 (0x07eb, 0x07f3,), # Nko Combining Short High..Nko Combining Double Dot24 (0x0816, 0x0819,), # Samaritan Mark In ..Samaritan Mark Dagesh25 (0x081b, 0x0823,), # Samaritan Mark Epentheti..Samaritan Vowel Sign A26 (0x0825, 0x0827,), # Samaritan Vowel Sign Sho..Samaritan Vowel Sign U27 (0x0829, 0x082d,), # Samaritan Vowel Sign Lon..Samaritan Mark Nequdaa28 (0x0859, 0x085b,), # Mandaic Affrication Mark..Mandaic Gemination Mark29 (0x08e3, 0x0902,), # Arabic Turned Damma Belo..Devanagari Sign Anusvara30 (0x093a, 0x093a,), # Devanagari Vowel Sign Oe..Devanagari Vowel Sign Oe31 (0x093c, 0x093c,), # Devanagari Sign Nukta ..Devanagari Sign Nukta32 (0x0941, 0x0948,), # Devanagari Vowel Sign U ..Devanagari Vowel Sign Ai33 (0x094d, 0x094d,), # Devanagari Sign Virama ..Devanagari Sign Virama34 (0x0951, 0x0957,), # Devanagari Stress Sign U..Devanagari Vowel Sign Uu35 (0x0962, 0x0963,), # Devanagari Vowel Sign Vo..Devanagari Vowel Sign Vo36 (0x0981, 0x0981,), # Bengali Sign Candrabindu..Bengali Sign Candrabindu37 (0x09bc, 0x09bc,), # Bengali Sign Nukta ..Bengali Sign Nukta38 (0x09c1, 0x09c4,), # Bengali Vowel Sign U ..Bengali Vowel Sign Vocal39 (0x09cd, 0x09cd,), # Bengali Sign Virama ..Bengali Sign Virama40 (0x09e2, 0x09e3,), # Bengali Vowel Sign Vocal..Bengali Vowel Sign Vocal41 (0x0a01, 0x0a02,), # Gurmukhi Sign Adak Bindi..Gurmukhi Sign Bindi42 (0x0a3c, 0x0a3c,), # Gurmukhi Sign Nukta ..Gurmukhi Sign Nukta43 (0x0a41, 0x0a42,), # Gurmukhi Vowel Sign U ..Gurmukhi Vowel Sign Uu44 (0x0a47, 0x0a48,), # Gurmukhi Vowel Sign Ee ..Gurmukhi Vowel Sign Ai45 (0x0a4b, 0x0a4d,), # Gurmukhi Vowel Sign Oo ..Gurmukhi Sign Virama46 (0x0a51, 0x0a51,), # Gurmukhi Sign Udaat ..Gurmukhi Sign Udaat47 (0x0a70, 0x0a71,), # Gurmukhi Tippi ..Gurmukhi Addak48 (0x0a75, 0x0a75,), # Gurmukhi Sign Yakash ..Gurmukhi Sign Yakash49 (0x0a81, 0x0a82,), # Gujarati Sign Candrabind..Gujarati Sign Anusvara50 (0x0abc, 0x0abc,), # Gujarati Sign Nukta ..Gujarati Sign Nukta51 (0x0ac1, 0x0ac5,), # Gujarati Vowel Sign U ..Gujarati Vowel Sign Cand52 (0x0ac7, 0x0ac8,), # Gujarati Vowel Sign E ..Gujarati Vowel Sign Ai53 (0x0acd, 0x0acd,), # Gujarati Sign Virama ..Gujarati Sign Virama54 (0x0ae2, 0x0ae3,), # Gujarati Vowel Sign Voca..Gujarati Vowel Sign Voca55 (0x0b01, 0x0b01,), # Oriya Sign Candrabindu ..Oriya Sign Candrabindu56 (0x0b3c, 0x0b3c,), # Oriya Sign Nukta ..Oriya Sign Nukta57 (0x0b3f, 0x0b3f,), # Oriya Vowel Sign I ..Oriya Vowel Sign I58 (0x0b41, 0x0b44,), # Oriya Vowel Sign U ..Oriya Vowel Sign Vocalic59 (0x0b4d, 0x0b4d,), # Oriya Sign Virama ..Oriya Sign Virama60 (0x0b56, 0x0b56,), # Oriya Ai Length Mark ..Oriya Ai Length Mark61 (0x0b62, 0x0b63,), # Oriya Vowel Sign Vocalic..Oriya Vowel Sign Vocalic62 (0x0b82, 0x0b82,), # Tamil Sign Anusvara ..Tamil Sign Anusvara63 (0x0bc0, 0x0bc0,), # Tamil Vowel Sign Ii ..Tamil Vowel Sign Ii64 (0x0bcd, 0x0bcd,), # Tamil Sign Virama ..Tamil Sign Virama65 (0x0c00, 0x0c00,), # Telugu Sign Combining Ca..Telugu Sign Combining Ca66 (0x0c3e, 0x0c40,), # Telugu Vowel Sign Aa ..Telugu Vowel Sign Ii67 (0x0c46, 0x0c48,), # Telugu Vowel Sign E ..Telugu Vowel Sign Ai68 (0x0c4a, 0x0c4d,), # Telugu Vowel Sign O ..Telugu Sign Virama69 (0x0c55, 0x0c56,), # Telugu Length Mark ..Telugu Ai Length Mark70 (0x0c62, 0x0c63,), # Telugu Vowel Sign Vocali..Telugu Vowel Sign Vocali71 (0x0c81, 0x0c81,), # Kannada Sign Candrabindu..Kannada Sign Candrabindu72 (0x0cbc, 0x0cbc,), # Kannada Sign Nukta ..Kannada Sign Nukta73 (0x0cbf, 0x0cbf,), # Kannada Vowel Sign I ..Kannada Vowel Sign I74 (0x0cc6, 0x0cc6,), # Kannada Vowel Sign E ..Kannada Vowel Sign E75 (0x0ccc, 0x0ccd,), # Kannada Vowel Sign Au ..Kannada Sign Virama76 (0x0ce2, 0x0ce3,), # Kannada Vowel Sign Vocal..Kannada Vowel Sign Vocal77 (0x0d01, 0x0d01,), # Malayalam Sign Candrabin..Malayalam Sign Candrabin78 (0x0d41, 0x0d44,), # Malayalam Vowel Sign U ..Malayalam Vowel Sign Voc79 (0x0d4d, 0x0d4d,), # Malayalam Sign Virama ..Malayalam Sign Virama80 (0x0d62, 0x0d63,), # Malayalam Vowel Sign Voc..Malayalam Vowel Sign Voc81 (0x0dca, 0x0dca,), # Sinhala Sign Al-lakuna ..Sinhala Sign Al-lakuna82 (0x0dd2, 0x0dd4,), # Sinhala Vowel Sign Ketti..Sinhala Vowel Sign Ketti83 (0x0dd6, 0x0dd6,), # Sinhala Vowel Sign Diga ..Sinhala Vowel Sign Diga84 (0x0e31, 0x0e31,), # Thai Character Mai Han-a..Thai Character Mai Han-a85 (0x0e34, 0x0e3a,), # Thai Character Sara I ..Thai Character Phinthu86 (0x0e47, 0x0e4e,), # Thai Character Maitaikhu..Thai Character Yamakkan87 (0x0eb1, 0x0eb1,), # Lao Vowel Sign Mai Kan ..Lao Vowel Sign Mai Kan88 (0x0eb4, 0x0eb9,), # Lao Vowel Sign I ..Lao Vowel Sign Uu89 (0x0ebb, 0x0ebc,), # Lao Vowel Sign Mai Kon ..Lao Semivowel Sign Lo90 (0x0ec8, 0x0ecd,), # Lao Tone Mai Ek ..Lao Niggahita91 (0x0f18, 0x0f19,), # Tibetan Astrological Sig..Tibetan Astrological Sig92 (0x0f35, 0x0f35,), # Tibetan Mark Ngas Bzung ..Tibetan Mark Ngas Bzung93 (0x0f37, 0x0f37,), # Tibetan Mark Ngas Bzung ..Tibetan Mark Ngas Bzung94 (0x0f39, 0x0f39,), # Tibetan Mark Tsa -phru ..Tibetan Mark Tsa -phru95 (0x0f71, 0x0f7e,), # Tibetan Vowel Sign Aa ..Tibetan Sign Rjes Su Nga96 (0x0f80, 0x0f84,), # Tibetan Vowel Sign Rever..Tibetan Mark Halanta97 (0x0f86, 0x0f87,), # Tibetan Sign Lci Rtags ..Tibetan Sign Yang Rtags98 (0x0f8d, 0x0f97,), # Tibetan Subjoined Sign L..Tibetan Subjoined Letter99 (0x0f99, 0x0fbc,), # Tibetan Subjoined Letter..Tibetan Subjoined Letter100 (0x0fc6, 0x0fc6,), # Tibetan Symbol Padma Gda..Tibetan Symbol Padma Gda101 (0x102d, 0x1030,), # Myanmar Vowel Sign I ..Myanmar Vowel Sign Uu102 (0x1032, 0x1037,), # Myanmar Vowel Sign Ai ..Myanmar Sign Dot Below103 (0x1039, 0x103a,), # Myanmar Sign Virama ..Myanmar Sign Asat104 (0x103d, 0x103e,), # Myanmar Consonant Sign M..Myanmar Consonant Sign M105 (0x1058, 0x1059,), # Myanmar Vowel Sign Vocal..Myanmar Vowel Sign Vocal106 (0x105e, 0x1060,), # Myanmar Consonant Sign M..Myanmar Consonant Sign M107 (0x1071, 0x1074,), # Myanmar Vowel Sign Geba ..Myanmar Vowel Sign Kayah108 (0x1082, 0x1082,), # Myanmar Consonant Sign S..Myanmar Consonant Sign S109 (0x1085, 0x1086,), # Myanmar Vowel Sign Shan ..Myanmar Vowel Sign Shan110 (0x108d, 0x108d,), # Myanmar Sign Shan Counci..Myanmar Sign Shan Counci111 (0x109d, 0x109d,), # Myanmar Vowel Sign Aiton..Myanmar Vowel Sign Aiton112 (0x135d, 0x135f,), # Ethiopic Combining Gemin..Ethiopic Combining Gemin113 (0x1712, 0x1714,), # Tagalog Vowel Sign I ..Tagalog Sign Virama114 (0x1732, 0x1734,), # Hanunoo Vowel Sign I ..Hanunoo Sign Pamudpod115 (0x1752, 0x1753,), # Buhid Vowel Sign I ..Buhid Vowel Sign U116 (0x1772, 0x1773,), # Tagbanwa Vowel Sign I ..Tagbanwa Vowel Sign U117 (0x17b4, 0x17b5,), # Khmer Vowel Inherent Aq ..Khmer Vowel Inherent Aa118 (0x17b7, 0x17bd,), # Khmer Vowel Sign I ..Khmer Vowel Sign Ua119 (0x17c6, 0x17c6,), # Khmer Sign Nikahit ..Khmer Sign Nikahit120 (0x17c9, 0x17d3,), # Khmer Sign Muusikatoan ..Khmer Sign Bathamasat121 (0x17dd, 0x17dd,), # Khmer Sign Atthacan ..Khmer Sign Atthacan122 (0x180b, 0x180d,), # Mongolian Free Variation..Mongolian Free Variation123 (0x18a9, 0x18a9,), # Mongolian Letter Ali Gal..Mongolian Letter Ali Gal124 (0x1920, 0x1922,), # Limbu Vowel Sign A ..Limbu Vowel Sign U125 (0x1927, 0x1928,), # Limbu Vowel Sign E ..Limbu Vowel Sign O126 (0x1932, 0x1932,), # Limbu Small Letter Anusv..Limbu Small Letter Anusv127 (0x1939, 0x193b,), # Limbu Sign Mukphreng ..Limbu Sign Sa-i128 (0x1a17, 0x1a18,), # Buginese Vowel Sign I ..Buginese Vowel Sign U129 (0x1a1b, 0x1a1b,), # Buginese Vowel Sign Ae ..Buginese Vowel Sign Ae130 (0x1a56, 0x1a56,), # Tai Tham Consonant Sign ..Tai Tham Consonant Sign131 (0x1a58, 0x1a5e,), # Tai Tham Sign Mai Kang L..Tai Tham Consonant Sign132 (0x1a60, 0x1a60,), # Tai Tham Sign Sakot ..Tai Tham Sign Sakot133 (0x1a62, 0x1a62,), # Tai Tham Vowel Sign Mai ..Tai Tham Vowel Sign Mai134 (0x1a65, 0x1a6c,), # Tai Tham Vowel Sign I ..Tai Tham Vowel Sign Oa B135 (0x1a73, 0x1a7c,), # Tai Tham Vowel Sign Oa A..Tai Tham Sign Khuen-lue136 (0x1a7f, 0x1a7f,), # Tai Tham Combining Crypt..Tai Tham Combining Crypt137 (0x1ab0, 0x1abe,), # Combining Doubled Circum..Combining Parentheses Ov138 (0x1b00, 0x1b03,), # Balinese Sign Ulu Ricem ..Balinese Sign Surang139 (0x1b34, 0x1b34,), # Balinese Sign Rerekan ..Balinese Sign Rerekan140 (0x1b36, 0x1b3a,), # Balinese Vowel Sign Ulu ..Balinese Vowel Sign Ra R141 (0x1b3c, 0x1b3c,), # Balinese Vowel Sign La L..Balinese Vowel Sign La L142 (0x1b42, 0x1b42,), # Balinese Vowel Sign Pepe..Balinese Vowel Sign Pepe143 (0x1b6b, 0x1b73,), # Balinese Musical Symbol ..Balinese Musical Symbol144 (0x1b80, 0x1b81,), # Sundanese Sign Panyecek ..Sundanese Sign Panglayar145 (0x1ba2, 0x1ba5,), # Sundanese Consonant Sign..Sundanese Vowel Sign Pan146 (0x1ba8, 0x1ba9,), # Sundanese Vowel Sign Pam..Sundanese Vowel Sign Pan147 (0x1bab, 0x1bad,), # Sundanese Sign Virama ..Sundanese Consonant Sign148 (0x1be6, 0x1be6,), # Batak Sign Tompi ..Batak Sign Tompi149 (0x1be8, 0x1be9,), # Batak Vowel Sign Pakpak ..Batak Vowel Sign Ee150 (0x1bed, 0x1bed,), # Batak Vowel Sign Karo O ..Batak Vowel Sign Karo O151 (0x1bef, 0x1bf1,), # Batak Vowel Sign U For S..Batak Consonant Sign H152 (0x1c2c, 0x1c33,), # Lepcha Vowel Sign E ..Lepcha Consonant Sign T153 (0x1c36, 0x1c37,), # Lepcha Sign Ran ..Lepcha Sign Nukta154 (0x1cd0, 0x1cd2,), # Vedic Tone Karshana ..Vedic Tone Prenkha155 (0x1cd4, 0x1ce0,), # Vedic Sign Yajurvedic Mi..Vedic Tone Rigvedic Kash156 (0x1ce2, 0x1ce8,), # Vedic Sign Visarga Svari..Vedic Sign Visarga Anuda157 (0x1ced, 0x1ced,), # Vedic Sign Tiryak ..Vedic Sign Tiryak158 (0x1cf4, 0x1cf4,), # Vedic Tone Candra Above ..Vedic Tone Candra Above159 (0x1cf8, 0x1cf9,), # Vedic Tone Ring Above ..Vedic Tone Double Ring A160 (0x1dc0, 0x1df5,), # Combining Dotted Grave A..Combining Up Tack Above161 (0x1dfc, 0x1dff,), # Combining Double Inverte..Combining Right Arrowhea162 (0x20d0, 0x20f0,), # Combining Left Harpoon A..Combining Asterisk Above163 (0x2cef, 0x2cf1,), # Coptic Combining Ni Abov..Coptic Combining Spiritu164 (0x2d7f, 0x2d7f,), # Tifinagh Consonant Joine..Tifinagh Consonant Joine165 (0x2de0, 0x2dff,), # Combining Cyrillic Lette..Combining Cyrillic Lette166 (0x302a, 0x302d,), # Ideographic Level Tone M..Ideographic Entering Ton167 (0x3099, 0x309a,), # Combining Katakana-hirag..Combining Katakana-hirag168 (0xa66f, 0xa672,), # Combining Cyrillic Vzmet..Combining Cyrillic Thous169 (0xa674, 0xa67d,), # Combining Cyrillic Lette..Combining Cyrillic Payer170 (0xa69e, 0xa69f,), # Combining Cyrillic Lette..Combining Cyrillic Lette171 (0xa6f0, 0xa6f1,), # Bamum Combining Mark Koq..Bamum Combining Mark Tuk172 (0xa802, 0xa802,), # Syloti Nagri Sign Dvisva..Syloti Nagri Sign Dvisva173 (0xa806, 0xa806,), # Syloti Nagri Sign Hasant..Syloti Nagri Sign Hasant174 (0xa80b, 0xa80b,), # Syloti Nagri Sign Anusva..Syloti Nagri Sign Anusva175 (0xa825, 0xa826,), # Syloti Nagri Vowel Sign ..Syloti Nagri Vowel Sign176 (0xa8c4, 0xa8c4,), # Saurashtra Sign Virama ..Saurashtra Sign Virama177 (0xa8e0, 0xa8f1,), # Combining Devanagari Dig..Combining Devanagari Sig178 (0xa926, 0xa92d,), # Kayah Li Vowel Ue ..Kayah Li Tone Calya Plop179 (0xa947, 0xa951,), # Rejang Vowel Sign I ..Rejang Consonant Sign R180 (0xa980, 0xa982,), # Javanese Sign Panyangga ..Javanese Sign Layar181 (0xa9b3, 0xa9b3,), # Javanese Sign Cecak Telu..Javanese Sign Cecak Telu182 (0xa9b6, 0xa9b9,), # Javanese Vowel Sign Wulu..Javanese Vowel Sign Suku183 (0xa9bc, 0xa9bc,), # Javanese Vowel Sign Pepe..Javanese Vowel Sign Pepe184 (0xa9e5, 0xa9e5,), # Myanmar Sign Shan Saw ..Myanmar Sign Shan Saw185 (0xaa29, 0xaa2e,), # Cham Vowel Sign Aa ..Cham Vowel Sign Oe186 (0xaa31, 0xaa32,), # Cham Vowel Sign Au ..Cham Vowel Sign Ue187 (0xaa35, 0xaa36,), # Cham Consonant Sign La ..Cham Consonant Sign Wa188 (0xaa43, 0xaa43,), # Cham Consonant Sign Fina..Cham Consonant Sign Fina189 (0xaa4c, 0xaa4c,), # Cham Consonant Sign Fina..Cham Consonant Sign Fina190 (0xaa7c, 0xaa7c,), # Myanmar Sign Tai Laing T..Myanmar Sign Tai Laing T191 (0xaab0, 0xaab0,), # Tai Viet Mai Kang ..Tai Viet Mai Kang192 (0xaab2, 0xaab4,), # Tai Viet Vowel I ..Tai Viet Vowel U193 (0xaab7, 0xaab8,), # Tai Viet Mai Khit ..Tai Viet Vowel Ia194 (0xaabe, 0xaabf,), # Tai Viet Vowel Am ..Tai Viet Tone Mai Ek195 (0xaac1, 0xaac1,), # Tai Viet Tone Mai Tho ..Tai Viet Tone Mai Tho196 (0xaaec, 0xaaed,), # Meetei Mayek Vowel Sign ..Meetei Mayek Vowel Sign197 (0xaaf6, 0xaaf6,), # Meetei Mayek Virama ..Meetei Mayek Virama198 (0xabe5, 0xabe5,), # Meetei Mayek Vowel Sign ..Meetei Mayek Vowel Sign199 (0xabe8, 0xabe8,), # Meetei Mayek Vowel Sign ..Meetei Mayek Vowel Sign200 (0xabed, 0xabed,), # Meetei Mayek Apun Iyek ..Meetei Mayek Apun Iyek201 (0xfb1e, 0xfb1e,), # Hebrew Point Judeo-spani..Hebrew Point Judeo-spani202 (0xfe00, 0xfe0f,), # Variation Selector-1 ..Variation Selector-16203 (0xfe20, 0xfe2f,), # Combining Ligature Left ..Combining Cyrillic Titlo204 (0x101fd, 0x101fd,), # Phaistos Disc Sign Combi..Phaistos Disc Sign Combi205 (0x102e0, 0x102e0,), # Coptic Epact Thousands M..Coptic Epact Thousands M206 (0x10376, 0x1037a,), # Combining Old Permic Let..Combining Old Permic Let207 (0x10a01, 0x10a03,), # Kharoshthi Vowel Sign I ..Kharoshthi Vowel Sign Vo208 (0x10a05, 0x10a06,), # Kharoshthi Vowel Sign E ..Kharoshthi Vowel Sign O209 (0x10a0c, 0x10a0f,), # Kharoshthi Vowel Length ..Kharoshthi Sign Visarga210 (0x10a38, 0x10a3a,), # Kharoshthi Sign Bar Abov..Kharoshthi Sign Dot Belo211 (0x10a3f, 0x10a3f,), # Kharoshthi Virama ..Kharoshthi Virama212 (0x10ae5, 0x10ae6,), # Manichaean Abbreviation ..Manichaean Abbreviation213 (0x11001, 0x11001,), # Brahmi Sign Anusvara ..Brahmi Sign Anusvara214 (0x11038, 0x11046,), # Brahmi Vowel Sign Aa ..Brahmi Virama215 (0x1107f, 0x11081,), # Brahmi Number Joiner ..Kaithi Sign Anusvara216 (0x110b3, 0x110b6,), # Kaithi Vowel Sign U ..Kaithi Vowel Sign Ai217 (0x110b9, 0x110ba,), # Kaithi Sign Virama ..Kaithi Sign Nukta218 (0x11100, 0x11102,), # Chakma Sign Candrabindu ..Chakma Sign Visarga219 (0x11127, 0x1112b,), # Chakma Vowel Sign A ..Chakma Vowel Sign Uu220 (0x1112d, 0x11134,), # Chakma Vowel Sign Ai ..Chakma Maayyaa221 (0x11173, 0x11173,), # Mahajani Sign Nukta ..Mahajani Sign Nukta222 (0x11180, 0x11181,), # Sharada Sign Candrabindu..Sharada Sign Anusvara223 (0x111b6, 0x111be,), # Sharada Vowel Sign U ..Sharada Vowel Sign O224 (0x111ca, 0x111cc,), # Sharada Sign Nukta ..Sharada Extra Short Vowe225 (0x1122f, 0x11231,), # Khojki Vowel Sign U ..Khojki Vowel Sign Ai226 (0x11234, 0x11234,), # Khojki Sign Anusvara ..Khojki Sign Anusvara227 (0x11236, 0x11237,), # Khojki Sign Nukta ..Khojki Sign Shadda228 (0x112df, 0x112df,), # Khudawadi Sign Anusvara ..Khudawadi Sign Anusvara229 (0x112e3, 0x112ea,), # Khudawadi Vowel Sign U ..Khudawadi Sign Virama230 (0x11300, 0x11301,), # Grantha Sign Combining A..Grantha Sign Candrabindu231 (0x1133c, 0x1133c,), # Grantha Sign Nukta ..Grantha Sign Nukta232 (0x11340, 0x11340,), # Grantha Vowel Sign Ii ..Grantha Vowel Sign Ii233 (0x11366, 0x1136c,), # Combining Grantha Digit ..Combining Grantha Digit234 (0x11370, 0x11374,), # Combining Grantha Letter..Combining Grantha Letter235 (0x114b3, 0x114b8,), # Tirhuta Vowel Sign U ..Tirhuta Vowel Sign Vocal236 (0x114ba, 0x114ba,), # Tirhuta Vowel Sign Short..Tirhuta Vowel Sign Short237 (0x114bf, 0x114c0,), # Tirhuta Sign Candrabindu..Tirhuta Sign Anusvara238 (0x114c2, 0x114c3,), # Tirhuta Sign Virama ..Tirhuta Sign Nukta239 (0x115b2, 0x115b5,), # Siddham Vowel Sign U ..Siddham Vowel Sign Vocal240 (0x115bc, 0x115bd,), # Siddham Sign Candrabindu..Siddham Sign Anusvara241 (0x115bf, 0x115c0,), # Siddham Sign Virama ..Siddham Sign Nukta242 (0x115dc, 0x115dd,), # Siddham Vowel Sign Alter..Siddham Vowel Sign Alter243 (0x11633, 0x1163a,), # Modi Vowel Sign U ..Modi Vowel Sign Ai244 (0x1163d, 0x1163d,), # Modi Sign Anusvara ..Modi Sign Anusvara245 (0x1163f, 0x11640,), # Modi Sign Virama ..Modi Sign Ardhacandra246 (0x116ab, 0x116ab,), # Takri Sign Anusvara ..Takri Sign Anusvara247 (0x116ad, 0x116ad,), # Takri Vowel Sign Aa ..Takri Vowel Sign Aa248 (0x116b0, 0x116b5,), # Takri Vowel Sign U ..Takri Vowel Sign Au249 (0x116b7, 0x116b7,), # Takri Sign Nukta ..Takri Sign Nukta250 (0x1171d, 0x1171f,), # Ahom Consonant Sign Medi..Ahom Consonant Sign Medi251 (0x11722, 0x11725,), # Ahom Vowel Sign I ..Ahom Vowel Sign Uu252 (0x11727, 0x1172b,), # Ahom Vowel Sign Aw ..Ahom Sign Killer253 (0x16af0, 0x16af4,), # Bassa Vah Combining High..Bassa Vah Combining High254 (0x16b30, 0x16b36,), # Pahawh Hmong Mark Cim Tu..Pahawh Hmong Mark Cim Ta255 (0x16f8f, 0x16f92,), # Miao Tone Right ..Miao Tone Below256 (0x1bc9d, 0x1bc9e,), # Duployan Thick Letter Se..Duployan Double Mark257 (0x1d167, 0x1d169,), # Musical Symbol Combining..Musical Symbol Combining258 (0x1d17b, 0x1d182,), # Musical Symbol Combining..Musical Symbol Combining259 (0x1d185, 0x1d18b,), # Musical Symbol Combining..Musical Symbol Combining260 (0x1d1aa, 0x1d1ad,), # Musical Symbol Combining..Musical Symbol Combining261 (0x1d242, 0x1d244,), # Combining Greek Musical ..Combining Greek Musical262 (0x1da00, 0x1da36,), # Signwriting Head Rim ..Signwriting Air Sucking263 (0x1da3b, 0x1da6c,), # Signwriting Mouth Closed..Signwriting Excitement264 (0x1da75, 0x1da75,), # Signwriting Upper Body T..Signwriting Upper Body T265 (0x1da84, 0x1da84,), # Signwriting Location Hea..Signwriting Location Hea266 (0x1da9b, 0x1da9f,), # Signwriting Fill Modifie..Signwriting Fill Modifie267 (0x1daa1, 0x1daaf,), # Signwriting Rotation Mod..Signwriting Rotation Mod268 (0x1e8d0, 0x1e8d6,), # Mende Kikakui Combining ..Mende Kikakui Combining269 (0xe0100, 0xe01ef,), # Variation Selector-17 ..Variation Selector-256...
transaction.ts
Source:transaction.ts
...10import { FactoryBuilder } from "../factory-builder";11import { FactoryFunctionOptions } from "../types";12const chance: Chance = new Chance();13const randomHash = (): string => createHash("sha256").update(Math.random().toString(36).substring(8)).digest("hex");14const sign = ({ entity, options }: FactoryFunctionOptions) => entity.sign(options.passphrase || secrets[0]);15const secondSign = ({ entity, options }: FactoryFunctionOptions) => entity.secondSign(options.passphrase || secrets[1]);16const multiSign = ({ entity, options }: FactoryFunctionOptions) => {17 Managers.configManager.getMilestone().aip11 = true; // todo: remove this after reworking the crypto package18 const passphrases: string[] = options.passphrases || [secrets[0], secrets[1], secrets[2]];19 for (let i = 0; i < passphrases.length; i++) {20 entity.multiSign(passphrases[i], i);21 }22 return entity;23};24const applyModifiers = (entity, options) => {25 if (options.version) {26 entity.version(options.version);27 }28 if (entity.data.version > 1 && options.nonce) {...
vim_signs.py
Source:vim_signs.py
1# Classes responsible for drawing signs in the Vim user interface.2import vim3class VimSign(object):4 SIGN_TEXT_BREAKPOINT_RESOLVED = "B>"5 SIGN_TEXT_BREAKPOINT_UNRESOLVED = "b>"6 SIGN_TEXT_PC = "->"7 SIGN_HIGHLIGHT_COLOUR_PC = 'darkblue'8 # unique sign id (for ':[sign/highlight] define)9 sign_id = 110 # unique name id (for ':sign place')11 name_id = 112 # Map of {(sign_text, highlight_colour) --> sign_name}13 defined_signs = {}14 def __init__(self, sign_text, buffer, line_number, highlight_colour=None):15 """ Define the sign and highlight (if applicable) and show the sign. """16 # Get the sign name, either by defining it, or looking it up in the map17 # of defined signs18 key = (sign_text, highlight_colour)19 if key not in VimSign.defined_signs:20 name = self.define(sign_text, highlight_colour)21 else:22 name = VimSign.defined_signs[key]23 self.show(name, buffer.number, line_number)24 pass25 def define(self, sign_text, highlight_colour):26 """ Defines sign and highlight (if highlight_colour is not None). """27 sign_name = "sign%d" % VimSign.name_id28 if highlight_colour is None:29 vim.command("sign define %s text=%s" % (sign_name, sign_text))30 else:31 self.highlight_name = "highlight%d" % VimSign.name_id32 vim.command(33 "highlight %s ctermbg=%s guibg=%s" %34 (self.highlight_name, highlight_colour, highlight_colour))35 vim.command(36 "sign define %s text=%s linehl=%s texthl=%s" %37 (sign_name, sign_text, self.highlight_name, self.highlight_name))38 VimSign.defined_signs[(sign_text, highlight_colour)] = sign_name39 VimSign.name_id += 140 return sign_name41 def show(self, name, buffer_number, line_number):42 self.id = VimSign.sign_id43 VimSign.sign_id += 144 vim.command("sign place %d name=%s line=%d buffer=%s" %45 (self.id, name, line_number, buffer_number))46 pass47 def hide(self):48 vim.command("sign unplace %d" % self.id)49 pass50class BreakpointSign(VimSign):51 def __init__(self, buffer, line_number, is_resolved):52 txt = VimSign.SIGN_TEXT_BREAKPOINT_RESOLVED if is_resolved else VimSign.SIGN_TEXT_BREAKPOINT_UNRESOLVED53 super(BreakpointSign, self).__init__(txt, buffer, line_number)54class PCSign(VimSign):55 def __init__(self, buffer, line_number, is_selected_thread):56 super(57 PCSign,58 self).__init__(59 VimSign.SIGN_TEXT_PC,60 buffer,61 line_number,...
navigation.js
Source:navigation.js
1//Need to create the stack navigator 2import { createNativeStackNavigator } from "@react-navigation/native-stack";3//importing pages 4import LogInPage from "../pages/SignUpLogIn/LogInPage";5import SignUpPage from '../pages/SignUpLogIn/SignUpPage';6import SignedInPage from '../pages/SignUpLogIn/SignedInPage';7import SignUpLogInPage from '../pages/SignUpLogIn/SignUpLogInPage';8import SignUpPage1 from "../pages/SignUpLogIn/SignUpPage1";9import SignUpPage2 from '../pages/SignUpLogIn/SignUpPage2';10import SignUpPage3 from '../pages/SignUpLogIn/SignUpPage3';11import SignUpPage4 from '../pages/SignUpLogIn/SignUpPage4';12import SignUpPage5 from '../pages/SignUpLogIn/SignUpPage5';13const Navigation = () =>{14 //creating navigator15const Stack = createNativeStackNavigator();16return (17 <Stack.Navigator>18 <Stack.Screen19 name="SignUpLogInPage"20 component={SignUpLogInPage}21 options={{ headerShown: false }}22 />23 <Stack.Screen24 name="LogInPage"25 component={LogInPage}26 options={{ headerShown: false }}27 />28 <Stack.Screen29 name="SignUpPage"30 component={SignUpPage}31 options={{ headerShown: false }}32 />33 <Stack.Screen34 name="SignedInPage"35 component={SignedInPage}36 options={{ headerShown: false }}37 />38 <Stack.Screen39 name="SignUpPage1"40 component={SignUpPage1}41 options={{ headerShown: false }}42 />43 <Stack.Screen44 name="SignUpPage2"45 component={SignUpPage2}46 options={{ headerShown: false }}47 />48 <Stack.Screen49 name="SignUpPage3"50 component={SignUpPage3}51 options={{ headerShown: false }}52 />53 <Stack.Screen54 name="SignUpPage4"55 component={SignUpPage4}56 options={{ headerShown: false }}57 />58 <Stack.Screen59 name="SignUpPage5"60 component={SignUpPage5}61 options={{ headerShown: false }}62 />63 </Stack.Navigator>64);65};...
Using AI Code Generation
1var bs = require('bestsigner');2var signer = new bs.BestSigner();3var sign = signer.sign('Hello World');4console.log(sign);5var bs = require('bestsigner');6var signer = new bs.BestSigner();7var sign = signer.sign('Hello World');8console.log(signer.verify('Hello World', sign));
Using AI Code Generation
1var bs = require('bestsign');2var fs = require('fs');3var path = require('path');4var config = require('./config');5var sign = new bs.Sign(config);6var data = fs.readFileSync(path.join(__dirname, 'data.txt'));7var signData = sign.sign(data);8console.log(signData);9#### constructor(config)10#### sign(data)11#### verify(data, signData)
Using AI Code Generation
1var BestSigner = require('bestsigner');2var signer = new BestSigner();3signer.sign('test4.js', 'test4.sig', function(err, result) {4 if (err) {5 console.log(err);6 } else {7 console.log(result);8 }9});10var BestSigner = require('bestsigner');11var signer = new BestSigner();12signer.verify('test4.js', 'test4.sig', function(err, result) {13 if (err) {14 console.log(err);15 } else {16 console.log(result);17 }18});19var BestSigner = require('bestsigner');20var signer = new BestSigner();21signer.sign('test5.js', 'test5.sig', function(err, result) {22 if (err) {23 console.log(err);24 } else {25 console.log(result);26 }27});28var BestSigner = require('bestsigner');29var signer = new BestSigner();30signer.verify('test5.js', 'test5.sig', function(err, result) {31 if (err) {32 console.log(err);33 } else {34 console.log(result);35 }36});37var BestSigner = require('bestsigner');38var signer = new BestSigner();39signer.sign('test6.js', 'test6.sig', function(err, result) {40 if (err) {41 console.log(err);42 } else {43 console.log(result);44 }45});46var BestSigner = require('bestsigner');47var signer = new BestSigner();48signer.verify('test6.js', 'test6.sig', function(err, result) {49 if (err) {50 console.log(err);51 } else {52 console.log(result);53 }54});
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!