Catatan

Tunjukkan catatan dari Mei, 2024

Compiler : Finite State Machine code sample

Sample 0 :  import java.io.*; import java.util.*; /* String containing an even number of one     0   1 ------------ A*  A   B B   B   A ------------ */ public class FSM {     final static int STATES=2, INPUTS=2;         public static void main (String[] args) throws IOException{                 boolean [] accept = new boolean[STATES];         int [][] fsm = new int[STATES][INPUTS];         accept[0] = true;         accept[1] = false;                 fsm[0][0] = 0;         fsm[0][1] = 1;         fsm[1][0] = 1;         fsm[1][1] = 0;                 // State A = 0, State B = 1         int inp = 0;         int state = 0;                 try{             inp = System.in.read() - '0';                         while(inp >= 0 && inp < INPUTS){                 state = fsm[state][inp];                 inp = System.in.read() - '0';             }         }         catch(IOException ioe){             System.out.println("IO error " + ioe);         }           

Trigger synchronization between two tables in Microsoft SQL Server

To trigger synchronization between two tables in Microsoft SQL Server when the source table is updated, you can use SQL Server triggers. Triggers are special stored procedures that are automatically executed or fired in response to specific events, such as INSERT, UPDATE, or DELETE operations on a table. Here's an example of how you can create a trigger to synchronize updates from a source table (SourceTable) to a destination table (DestinationTable):\ CREATE TRIGGER SyncTrigger ON SourceTable AFTER INSERT, UPDATE, DELETE AS BEGIN     SET NOCOUNT ON;     -- Check if the operation is an INSERT or UPDATE     IF EXISTS(SELECT 1 FROM inserted)     BEGIN         -- Perform synchronization for INSERT or UPDATE         MERGE INTO DestinationTable AS dest         USING inserted AS src         ON (dest.PrimaryKey = src.PrimaryKey)  -- Replace PrimaryKey with actual primary key column(s)         WHEN MATCHED THEN             UPDATE SET dest.Column1 = src.Column1,  -- Replace Column1 with act

JAVA EE : Servlet notes

Imej
  References : Servlet RequestDispatcher forward vs include https://codersathi.com/servlet-requestdispatcher-forward-vs-include/ CRUD in Servlet https://www.javatpoint.com/crud-in-servlet

How to check port used by other application

Imej
  1. Open command prompt as Administrator 2. Type command below; > netstat -aon | findstr 8080 > tasklist | findstr <PID>  Refer this article : https://dzone.com/articles/how-to-check-which-process-is-using-port-8080-or-a

How to Do Web Forms in VS 2022 (Even Though Microsoft Recommends Blazor/.NET 6)

Imej
  https://visualstudiomagazine.com/articles/2022/05/16/vs2022-web-forms-tip.aspx