Sunday, March 27, 2022

techtoolsweb Website

A website has been launched which will be dedicated to providing digital tools to all users.  

The website is still in its initial phases and at present a PDF metadata viewer is available.  

Please click here to visit the website.  

Its URL is https://bsite.net/allispossibleteam/PDFTools


Sunday, January 9, 2022

A simplified Tic-Tac-Toe implementation in Python

Introduction

A simplified version of the TicTacToe game has been written in Python. This was done as part of a lab in the "PCAP - Programming Essentials In Python" course on Cisco Networking Academy (https://www.netacad.com/portal/learning).

The program showcases the use of:
    1. Tuples
    2. Dictionaries
    3. Two Dimensional Lists
    4. while Loop
    5. if statement
    6. functions

Assumption: The computer always starts with an X in the middle of the board.

Also, the board of the game is numbered from 1 to 9 with position 5 containing the X that represents the first move of the computer.  The initial state of the board will be as per Figure 1.

Figure 1: Initial state of the board.


Algorithm

Taking into consideration the above assumption, the steps to be executed are as follows:
    1. The board is displayed.
    2. User enters a number between 1 to 9 where the 'O' is to be placed.
    3. The updated board is displayed.
    4. If user has won or there is a tie, stop the game.
    5. The computer plays its move.
    6. The updated board is displayed.
    7.  If the computer has won or there is a tie, stop the game.

Note: Steps 2 to 7 are executed in an infinite loop until there is a winner or there is a tie.

Implementation

The board of the game is represented as a two dimensional list called "board".  It is a 3 by 3 array.

A dictionary, "dict_num_to_tup", is used to translate each position (1 to 9) in the board to its corresponding indices in the 2D array.

The following five functions have been defined:
    1. display_board(board)
            - It displays the current state of the board.
    2. enter_move(board)
            - It allows the user to enter a move.  Some basic validations have been included in the function.
    3. make_list_of_free_fields(board)
            - It determines and build a list of free cells in the board.  The list stores the indices of the free cells in the form of tuples.
    4. victory_for(board, sign)
            - It determines whether the "sign" passed as argument to the function has won the game or not.
    5. draw_move(board)
            - It allows the computer to play a move.  A random number generator function has been used to simulate the move of the computer.

Code

Below is the python code.  Same can also be executed by pressing the "play" button.

Monday, April 4, 2011

EIM IF_ROW_STAT: REQUIRED_COLS

ISSUE: After executing EIM, the IF_ROW_STAT field becomes REQUIRED_COLS and rows are not imported.

CAUSE: We get REQUIRED_COLS in IF_ROW_STAT when one or more of the required columns are not populated in EIM table.

ISSUE RESOLUTION: To resolve the issue, go through the log file of the eim process.  In log file file you should find the following section if the log level has been set to the appropriate level.  (Please note in our case, we had the above issue with EIM_PROD_INT.)  The log file will give you the list of required fields. Please check which of the required fields are not being populated in the EIM table and supply a value for same.  Then run the eim process again and it should work fine this time.

Extract from log file follows:

EIMTrace EIMTraceSubEvent 3 000000034d8c0740:0 2011-03-25 11:53:21 3/25/11 11:53 Warning: Inserting new rows into S_PROD_INT failed 44 rows.



EIMError EIMErrorSubEvent 0 000000034d8c0740:0 2011-03-25 11:53:21


EIMError EIMErrorSubEvent 0 000000034d8c0740:0 2011-03-25 11:53:21 -------------------------------------------------------------------------------


EIMError EIMErrorSubEvent 0 000000034d8c0740:0 2011-03-25 11:53:21


EIMError EIMErrorSubEvent 0 000000034d8c0740:0 2011-03-25 11:53:21 Process [Import EIM_PROD_INT] had 44 rows fail


EIMError EIMErrorSubEvent 0 000000034d8c0740:0 2011-03-25 11:53:21 on EIM_PROD_INT for batch 1000000 in step 9, pass 113:


EIMError EIMErrorSubEvent 0 000000034d8c0740:0 2011-03-25 11:53:21 NULL values in IF table for required base table columns. (severity 6, rows eliminated)


EIMError EIMErrorSubEvent 0 000000034d8c0740:0 2011-03-25 11:53:21


EIMError EIMErrorSubEvent 0 000000034d8c0740:0 2011-03-25 11:53:21 Interface table:


EIMError EIMErrorSubEvent 0 000000034d8c0740:0 2011-03-25 11:53:21 EIM_PROD_INT (EIM_PROD_INT)


EIMError EIMErrorSubEvent 0 000000034d8c0740:0 2011-03-25 11:53:21 ------------


EIMError EIMErrorSubEvent 0 000000034d8c0740:0 2011-03-25 11:53:21 ACTIVE_FLG (Active Flag)


EIMError EIMErrorSubEvent 0 000000034d8c0740:0 2011-03-25 11:53:21 ADD_TO_QUOTE_FLG (Add To Quote Flg)


EIMError EIMErrorSubEvent 0 000000034d8c0740:0 2011-03-25 11:53:21 APPROVAL_FLG (APPROVAL_FLG)


EIMError EIMErrorSubEvent 0 000000034d8c0740:0 2011-03-25 11:53:21 AUTO_UNGROUP_FLG (Automatic Ungroup Flag)


EIMError EIMErrorSubEvent 0 000000034d8c0740:0 2011-03-25 11:53:21 BILLABLE_FLG (Billable Flag)


EIMError EIMErrorSubEvent 0 000000034d8c0740:0 2011-03-25 11:53:21 CMPND_FLG (Compound Flag)


EIMError EIMErrorSubEvent 0 000000034d8c0740:0 2011-03-25 11:53:21 COMMISIONED_FLG (Commisioned Flg)


EIMError EIMErrorSubEvent 0 000000034d8c0740:0 2011-03-25 11:53:21 COMPENSATABLE_FLG (Compensatable Flag)


EIMError EIMErrorSubEvent 0 000000034d8c0740:0 2011-03-25 11:53:21 NAME (Name)


EIMError EIMErrorSubEvent 0 000000034d8c0740:0 2011-03-25 11:53:21 PROD_BI (Name)


EIMError EIMErrorSubEvent 0 000000034d8c0740:0 2011-03-25 11:53:21 CG_COMPETITOR_FLG (Cg Competitor Flg)


EIMError EIMErrorSubEvent 0 000000034d8c0740:0 2011-03-25 11:53:21 CRT_AGREEMENT_FLG (Create Agreement Flag)


EIMError EIMErrorSubEvent 0 000000034d8c0740:0 2011-03-25 11:53:21 CRT_AST_REC_FLG (Crt Ast Rec Flg)


EIMError EIMErrorSubEvent 0 000000034d8c0740:0 2011-03-25 11:53:21 CRT_INST_FLG (Create Instance Flag)


EIMError EIMErrorSubEvent 0 000000034d8c0740:0 2011-03-25 11:53:21 DESIGN_REG_FLG (Design Registration Flag)


EIMError EIMErrorSubEvent 0 000000034d8c0740:0 2011-03-25 11:53:21 ENTERPRISE_FLG (Enterprise-Visible Flag)


EIMError EIMErrorSubEvent 0 000000034d8c0740:0 2011-03-25 11:53:21 FEATURED_FLG (Featured Flag)


EIMError EIMErrorSubEvent 0 000000034d8c0740:0 2011-03-25 11:53:21 INCLSV_ELIG_RL_FLG (Inclusive Eligibility Rule Flag)


EIMError EIMErrorSubEvent 0 000000034d8c0740:0 2011-03-25 11:53:21 LEAF_LEVEL_FLG (Leaf level flag)


EIMError EIMErrorSubEvent 0 000000034d8c0740:0 2011-03-25 11:53:21 MODEL_PROD_FLG (Model Prod Flg)


EIMError EIMErrorSubEvent 0 000000034d8c0740:0 2011-03-25 11:53:21 NEED_PH_NUM_FLG (Need Phone Number Flag)


EIMError EIMErrorSubEvent 0 000000034d8c0740:0 2011-03-25 11:53:21 ORDERABLE_FLG (Orderable Flag)


EIMError EIMErrorSubEvent 0 000000034d8c0740:0 2011-03-25 11:53:21 POSTN_BL_PROD_FLG (Position Billing Product Flag)


EIMError EIMErrorSubEvent 0 000000034d8c0740:0 2011-03-25 11:53:21 PRD_INCLALLCRSEFLG (Include All Course Flag)


EIMError EIMErrorSubEvent 0 000000034d8c0740:0 2011-03-25 11:53:21 PRODAPPLYECRULEFLG (Apply Eligibility Compatibility Rule Flag)


EIMError EIMErrorSubEvent 0 000000034d8c0740:0 2011-03-25 11:53:21 SALES_PROD_FLG (Sales product flag)


EIMError EIMErrorSubEvent 0 000000034d8c0740:0 2011-03-25 11:53:21 SALES_SRVC_FLG (Sales/Service flag)


EIMError EIMErrorSubEvent 0 000000034d8c0740:0 2011-03-25 11:53:21 SERVICE_FLG (Service Flg)


EIMError EIMErrorSubEvent 0 000000034d8c0740:0 2011-03-25 11:53:21 SERV_INST_FLG (Serv Inst Flg)


EIMError EIMErrorSubEvent 0 000000034d8c0740:0 2011-03-25 11:53:21 SHIP_FLG (Ship Flg)


EIMError EIMErrorSubEvent 0 000000034d8c0740:0 2011-03-25 11:53:21 TARGET_VRSN_FLG (Target Vrsn Flg)


EIMError EIMErrorSubEvent 0 000000034d8c0740:0 2011-03-25 11:53:21 TAX_SUBCOMP_FLG (Tax Subcomp Flg)


EIMError EIMErrorSubEvent 0 000000034d8c0740:0 2011-03-25 11:53:21 TRANSFERABLE_FLG (Transferable Flg)


EIMError EIMErrorSubEvent 0 000000034d8c0740:0 2011-03-25 11:53:21 TWOBARCODES_FLG (TWOBARCODES_FLG)


EIMError EIMErrorSubEvent 0 000000034d8c0740:0 2011-03-25 11:53:21 UNIQUE_ASSET_FLG (UNIQUE_ASSET_FLG)


EIMError EIMErrorSubEvent 0 000000034d8c0740:0 2011-03-25 11:53:21


EIMError EIMErrorSubEvent 0 000000034d8c0740:0 2011-03-25 11:53:21 Base table:


EIMError EIMErrorSubEvent 0 000000034d8c0740:0 2011-03-25 11:53:21 S_PROD_INT (Internal Product)


EIMError EIMErrorSubEvent 0 000000034d8c0740:0 2011-03-25 11:53:21 ----------


EIMError EIMErrorSubEvent 0 000000034d8c0740:0 2011-03-25 11:53:21 ACTIVE_FLG (Active Flag)


EIMError EIMErrorSubEvent 0 000000034d8c0740:0 2011-03-25 11:53:21 ADD_TO_QUOTE_FLG (Add To Quote Flg)


EIMError EIMErrorSubEvent 0 000000034d8c0740:0 2011-03-25 11:53:21 APPROVAL_FLG (APPROVAL_FLG)


EIMError EIMErrorSubEvent 0 000000034d8c0740:0 2011-03-25 11:53:21 AUTO_UNGROUP_FLG (Automatic Ungroup Flag)


EIMError EIMErrorSubEvent 0 000000034d8c0740:0 2011-03-25 11:53:21 BILLABLE_FLG (Billable Flag)


EIMError EIMErrorSubEvent 0 000000034d8c0740:0 2011-03-25 11:53:21 CMPND_FLG (Compound Flag)


EIMError EIMErrorSubEvent 0 000000034d8c0740:0 2011-03-25 11:53:21 COMMISIONED_FLG (Commisioned Flg)


EIMError EIMErrorSubEvent 0 000000034d8c0740:0 2011-03-25 11:53:21 COMPENSATABLE_FLG (Compensatable Flag)


EIMError EIMErrorSubEvent 0 000000034d8c0740:0 2011-03-25 11:53:21 NAME (Name)


EIMError EIMErrorSubEvent 0 000000034d8c0740:0 2011-03-25 11:53:21 BU_ID (Business Unit Id)


EIMError EIMErrorSubEvent 0 000000034d8c0740:0 2011-03-25 11:53:21 CG_COMPETITOR_FLG (Cg Competitor Flg)


EIMError EIMErrorSubEvent 0 000000034d8c0740:0 2011-03-25 11:53:21 CRT_AGREEMENT_FLG (Create Agreement Flag)


EIMError EIMErrorSubEvent 0 000000034d8c0740:0 2011-03-25 11:53:21 CRT_AST_REC_FLG (Crt Ast Rec Flg)


EIMError EIMErrorSubEvent 0 000000034d8c0740:0 2011-03-25 11:53:21 CRT_INST_FLG (Create Instance Flag)


EIMError EIMErrorSubEvent 0 000000034d8c0740:0 2011-03-25 11:53:21 DESIGN_REG_FLG (Design Registration Flag)


EIMError EIMErrorSubEvent 0 000000034d8c0740:0 2011-03-25 11:53:21 ENTERPRISE_FLG (Enterprise-Visible Flag)


EIMError EIMErrorSubEvent 0 000000034d8c0740:0 2011-03-25 11:53:21 FEATURED_FLG (Featured Flag)


EIMError EIMErrorSubEvent 0 000000034d8c0740:0 2011-03-25 11:53:21 INCLSV_ELIG_RL_FLG (Inclusive Eligibility Rule Flag)


EIMError EIMErrorSubEvent 0 000000034d8c0740:0 2011-03-25 11:53:21 LEAF_LEVEL_FLG (LEAF_LEVEL_FLG)


EIMError EIMErrorSubEvent 0 000000034d8c0740:0 2011-03-25 11:53:21 MODEL_PROD_FLG (Model Prod Flg)


EIMError EIMErrorSubEvent 0 000000034d8c0740:0 2011-03-25 11:53:21 NEED_PH_NUM_FLG (Need Phone Number Flag)


EIMError EIMErrorSubEvent 0 000000034d8c0740:0 2011-03-25 11:53:21 ORDERABLE_FLG (Orderable Flag)


EIMError EIMErrorSubEvent 0 000000034d8c0740:0 2011-03-25 11:53:21 POSTN_BL_PROD_FLG (Position Billing Product Flag)


EIMError EIMErrorSubEvent 0 000000034d8c0740:0 2011-03-25 11:53:21 INCL_ALL_CRSE_FLG (Include All Course Flag)


EIMError EIMErrorSubEvent 0 000000034d8c0740:0 2011-03-25 11:53:21 APPLY_EC_RULE_FLG (Apply Eligibility Compatibility Rule Flag)


EIMError EIMErrorSubEvent 0 000000034d8c0740:0 2011-03-25 11:53:21 SALES_PROD_FLG (Sales product flag)


EIMError EIMErrorSubEvent 0 000000034d8c0740:0 2011-03-25 11:53:21 SALES_SRVC_FLG (Sales/Service flag)


EIMError EIMErrorSubEvent 0 000000034d8c0740:0 2011-03-25 11:53:21 SERVICE_FLG (Service Flg)


EIMError EIMErrorSubEvent 0 000000034d8c0740:0 2011-03-25 11:53:21 SERV_INST_FLG (Serv Inst Flg)


EIMError EIMErrorSubEvent 0 000000034d8c0740:0 2011-03-25 11:53:21 SHIP_FLG (Ship Flg)


EIMError EIMErrorSubEvent 0 000000034d8c0740:0 2011-03-25 11:53:21 TARGET_VRSN_FLG (Target Vrsn Flag)


EIMError EIMErrorSubEvent 0 000000034d8c0740:0 2011-03-25 11:53:21 TAX_SUBCOMP_FLG (Tax Subcomp Flag)


EIMError EIMErrorSubEvent 0 000000034d8c0740:0 2011-03-25 11:53:21 TRANSFERABLE_FLG (Transferable Flg)


EIMError EIMErrorSubEvent 0 000000034d8c0740:0 2011-03-25 11:53:21 TWOBARCODES_FLG (TWOBARCODES_FLG)


EIMError EIMErrorSubEvent 0 000000034d8c0740:0 2011-03-25 11:53:21 UNIQUE_ASSET_FLG (UNIQUE_ASSET_FLG)


EIMError EIMErrorSubEvent 0 000000034d8c0740:0 2011-03-25 11:53:21 CONFLICT_ID (Conflict Id)


EIMError EIMErrorSubEvent 0 000000034d8c0740:0 2011-03-25 11:53:21 CREATED (Created)


EIMError EIMErrorSubEvent 0 000000034d8c0740:0 2011-03-25 11:53:21 CREATED_BY (Created By)


EIMError EIMErrorSubEvent 0 000000034d8c0740:0 2011-03-25 11:53:21 DB_LAST_UPD (Last Updated - This Database)


EIMError EIMErrorSubEvent 0 000000034d8c0740:0 2011-03-25 11:53:21 DB_LAST_UPD_SRC (Source of Last Update - This Database)


EIMError EIMErrorSubEvent 0 000000034d8c0740:0 2011-03-25 11:53:21 LAST_UPD (Last Updated)


EIMError EIMErrorSubEvent 0 000000034d8c0740:0 2011-03-25 11:53:21 LAST_UPD_BY (Last Updated By)


EIMError EIMErrorSubEvent 0 000000034d8c0740:0 2011-03-25 11:53:21 MODIFICATION_NUM (Modification Number)


EIMError EIMErrorSubEvent 0 000000034d8c0740:0 2011-03-25 11:53:21


EIMError EIMErrorSubEvent 0 000000034d8c0740:0 2011-03-25 11:53:21 These rows could not be inserted into the destination base table because some


EIMError EIMErrorSubEvent 0 000000034d8c0740:0 2011-03-25 11:53:21 of the required columns did not have values. Check that all columns which are


EIMError EIMErrorSubEvent 0 000000034d8c0740:0 2011-03-25 11:53:21 required in the base table have values in the interface table.


EIMError EIMErrorSubEvent 0 000000034d8c0740:0 2011-03-25 11:53:21


EIMError EIMErrorSubEvent 0 000000034d8c0740:0 2011-03-25 11:53:21 This failure caused the rows to be eliminated from further processing for the


EIMError EIMErrorSubEvent 0 000000034d8c0740:0 2011-03-25 11:53:21 target base table. This failure will prevent these rows from being imported at


EIMError EIMErrorSubEvent 0 000000034d8c0740:0 2011-03-25 11:53:21 all.


EIMError EIMErrorSubEvent 0 000000034d8c0740:0 2011-03-25 11:53:21


EIMError EIMErrorSubEvent 0 000000034d8c0740:0 2011-03-25 11:53:21 SQL query to return rows which were eliminated:


EIMError EIMErrorSubEvent 0 000000034d8c0740:0 2011-03-25 11:53:21 SELECT ROW_ID


EIMError EIMErrorSubEvent 0 000000034d8c0740:0 2011-03-25 11:53:21 FROM SIEBEL.EIM_PROD_INT


EIMError EIMErrorSubEvent 0 000000034d8c0740:0 2011-03-25 11:53:21 WHERE (T_PROD_INT__STA = 113 AND


EIMError EIMErrorSubEvent 0 000000034d8c0740:0 2011-03-25 11:53:21 IF_ROW_BATCH_NUM = 1000000)


EIMTrace EIMTraceSubEvent 3 000000034d8c0740:0 2011-03-25 11:53:21 > Step 9: inserting new rows S_PROD_INT 1s


SQLTraceAll SQLTraceAll 4 000000034d8c0740:0 2011-03-25 11:53:21 (SQLSetConnectOption) Conn Handle: 35461664, Time: 0s


SQLConnectOptions Set Connection Option 4 000000034d8c0740:0 2011-03-25 11:53:21 (SQLSetConnectOption) Handle: 35461664, Time: 0s


SQLConnectOptions Set Connection Option Detail 5 000000034d8c0740:0 2011-03-25 11:53:21 (SQLSetConnectOption) Option: 102, Param: 1


SQLTraceAll SQLTraceAll 4 000000034d8c0740:0 2011-03-25 11:53:21 (SQLTransact) Env Handle: 35461496, Conn Handle: 35461664, Time: 0s


SQLConnectOptions Transaction 4 000000034d8c0740:0 2011-03-25 11:53:21 (SQLTransact) Env Handle: 35461496, Conn Handle: 35461664, Time: 0s


SQLConnectOptions Transaction Detail 5 000000034d8c0740:0 2011-03-25 11:53:21 (SQLTransact) Type: SQL_COMMIT


EIMSQL EIMSQLSubEvent 4 000000034d8c0740:0 2011-03-25 11:53:21