Saturday, August 12, 2023

The Top 8 API Architectural Styles You Should Know in 2023


 The Top 8 API Architectural Styles You Should Know in 2023





REST (Representational State Transfer): A champion of simplicity and ubiquity, REST is an architectural style that primarily leverages HTTP methods. It enables easy interaction with resources, making it a go-to pattern for a multitude of applications and modern APIs.

SOAP (Simple Object Access Protocol): SOAP, a heavyweight contender in the API arena, thrives on complexity and power. It employs XML for defining structured communication. Although requiring a SOAP client and server, it compensates with its strength and robustness, much like a well-built off-road vehicle tackling rugged terrains.

GraphQL: A rising star in the API cosmos, GraphQL offers flexibility and precision. It lets clients ask for exactly what they need, reducing redundancy, and improving performance. Think of it as a personal shopper - you get just what you asked for, nothing more, nothing less.

gRPC (Google Remote Procedure Call): gRPC is the speedster of the API universe. Running on HTTP/2 and using binary data, it's all about performance and speed, especially for microservices architectures. It's like a high-speed train, ensuring quick and reliable communication.

WebSockets: If real-time and bi-directional communication is what you need, WebSockets are the answer. Ideal for chat applications, live streaming, and real-time data exchange, it's like having an open telephone line between clients and servers.

Webhooks: Webhooks are the town criers of the digital world. They notify clients when certain server-side events occur, making them perfect for event-driven architectures. Imagine them as your personal alert system, keeping you informed of what matters.

MQTT (Message Queuing Telemetry Transport): MQTT is a lightweight messenger, designed specifically for environments with limited resources, low bandwidth, and unreliable networks. Picture it as a postal worker determined to deliver your mail, come rain or shine.

AMQP (Advanced Message Queuing Protocol): A robust and standardized protocol, AMQP excels in middleware environments with its reliable messaging capabilities. It's like a well-oiled assembly line, efficiently moving messages where they need to go.

Which API architectural style should you use?

The best API architectural style for a particular application will depend on the specific requirements of the application, such as  -


1. The type of data that will be exchanged between the API and the client
   
2. The performance requirements of the API
   
3. The security requirements of the API
   
4. The scalability requirements of the API

Once you have considered these factors, you can start to narrow down your choices and choose the API architectural style that is best suited for your application.

 

 

Friday, August 11, 2023

Problem Solving Steps


 

When facing challenges in life, it can be helpful to follow a problem-solving process to find effective solutions. Here are the steps for problem-solving in life:

1. Identify the problem: Clearly define and understand the issue you are facing. Be specific about what needs to be resolved.

2. Gather information: Collect relevant information and gather facts about the problem. This includes analyzing the causes and understanding the impact it has on your life.

3. Generate possible solutions: Brainstorm and come up with multiple potential solutions. Be open-minded and consider different approaches or perspectives.

4. Evaluate and select the best solution: Assess each potential solution and consider their feasibility, effectiveness, and potential consequences. Choose the solution that has the highest chance of resolving the problem.

5. Create an action plan: Develop a detailed plan of action to implement the chosen solution. Break it down into smaller steps to make it more manageable and set a realistic timeline.

6. Take action: Put your plan into motion and start taking tangible steps towards solving the problem. Stay committed and consistent with your actions.

7. Monitor and evaluate: Continuously evaluate the progress of your solution. Observe any changes or improvements and make necessary adjustments along the way.

8. Seek support if needed: Don't hesitate to seek help or guidance from others if you feel overwhelmed or if the problem requires expertise beyond your capabilities. This can include talking to friends, family, mentors, or professionals.

9. Learn from the experience: Reflect on the problem-solving process and the outcomes. Identify any lessons or insights gained from the experience that can help you handle similar challenges in the future.

Remember, problem-solving is not always a linear process. You may need to revisit some steps or adjust your approach based on new information that arises. Stay resilient, patient, and adaptable as you work towards finding solutions to the challenges that life presents.

 

 

  

Thursday, August 10, 2023

Agile Development with a CI/CD pipeline

 Use this Super Simple Template to Learn How to Implement CI/CD in Your Agile Team.


Often, I see confusion surrounding the integration of Agile Development with a CI/CD pipeline.

This illustration isn't merely a CI/CD workflow, but an agile development process harmoniously intertwined with CI/CD flow. It is just a baseline diagram and the tools/technology used here are examples - feel free to replace them with equivalent tools or technology that suits your team's preferences and requirements.

 


Tuesday, June 6, 2023

Software Quality AssuranceMeasurement through Metric

Measurement through metric i.e., 2 measures and analyze your goal/decision through graph for all the defects identified.



Goal/Decision: My goal is to identify that, at which level, the most defects have been raised. and after that I have to inform the respective team to take some actions to improve the quality in effected area/level.”

Metric: Overall Defect Weightage at Different Levels/Arti-crafts

According to analysis, there are 67% defects are identified in Code Level Testing with weightage 53% among other levels. So I will inform the Coding team to take required actions to improve their works. 






Defect Prevention Techniques

Defect Prevention Techniques

Exemplify techniques/methods/ways through which we can prevent Defect Injection in SRS (Requirement specification) and Design Specification e.g. Activity Diagram.










Click here to download Assignment



Flow chart design checklist

 Flow chart design checklist




1 Clearly define the objective or purpose of the flowchart. Identify what process or system the flowchart represents.
2 Determine the intended audience for the flowchart. Consider their level of knowledge and familiarity with the process to ensure the flowchart is appropriate and understandable for them.
3 Collect all the necessary information about the process or system that will be included in the flowchart. This may involve consulting subject matter experts or reviewing relevant documentation.
4 Decide the appropriate level of detail for the flowchart. It should be comprehensive enough to capture the essential steps and decision points without becoming overly complex or confusing.
5 Follow recognized standards and conventions for flowchart symbols. This ensures consistency and ease of understanding for those familiar with flowcharting.
6 Ensure the flowchart represents the correct sequence of steps and decisions. Verify that the arrows and connectors accurately indicate the flow from one symbol to another.
7 Walk through the flowchart step by step to validate its accuracy. Make sure it reflects the actual process or system accurately and that there are no logical errors or missing steps.
8 Aim for simplicity and clarity in the flowchart design. Avoid excessive complexity, unnecessary symbols, or overcrowding the diagram with too much information.
9 Label each symbol, decision point, and connector clearly and concisely. Use descriptive text that accurately represents the action or decision being made.
10 Have someone else review the flowchart to provide feedback and identify any areas that may need improvement. Make revisions as necessary to enhance clarity and accuracy.
11 Pay attention to the visual layout and formatting of the flowchart. Ensure that the symbols are neatly arranged, the text is readable, and the overall presentation is visually appealing.






Thursday, November 29, 2018

How to get Attendance log from ZKteco Biometric Machine using ZKteco SDK

ZKteco Attendance Device is widely used machine for bio-metric attendance and facial recognition attendance,

Here is the function how to get the device log from Machine using ZKteco SDK.


public DataTable LogTable()

{

            DataTable DT = new DataTable();

            DT.Columns.Add("EmpID");

            DT.Columns.Add("Logtime");

            DT.Columns.Add("LogBranchId");

            DT.Columns.Add("TTYPE");

            DT.Columns.Add("Description");

            return DT;

}





DataTable DTAttLog  = LogTable();





public void GetLogfromMachine(int iMnumber, String MachineIP, String Port,String LogBranchId,String TTYPE)

{

            //Setup columns and other UI stuff

            //Set datasource of grid

            //axCZKEM1 = new zkemkeeper.CZKEMClass();

            //Cursor = Cursors.WaitCursor;

            int idwErrorCode = 0;

            setstatus("Connecting to device " + MachineIP + ":" + Port + ", please wait...");

            bIsConnected = axCZKEM1.Connect_Net(MachineIP, Convert.ToInt32(Port));



            if (bIsConnected)

            {

                //c1TrueDBGrid1[iMnumber - 1, "Status"] = "Connected";

                c1TrueDBGrid1[iMnumber - 1, "F.Attempts"] = "0";

                c1TrueDBGrid1[iMnumber - 1, "LSTime"] = DateTime.Now;

                setstatus("Connected to device " + MachineIP + ":" + Port + "");

                OutPut(MachineIP + ":" + Port + " Current State:Connected");

                c1TrueDBGrid1.Refresh();

                axCZKEM1.RegEvent(iMachineNumber, 65535);



                #region GetLog



                string sdwEnrollNumber = "";

                //int idwTMachineNumber=0;

                //int idwEMachineNumber=0;

                int idwVerifyMode = 0;

                int idwInOutMode = 0;

                int idwYear = 0;

                int idwMonth = 0;

                int idwDay = 0;

                int idwHour = 0;

                int idwMinute = 0;

                int idwSecond = 0;

                int idwWorkcode = 0;



                idwErrorCode = 0;

                int iGLCount = 0;

                int iIndex = 0;



                //Cursor = Cursors.WaitCursor;





                int LogRecivedCount = 0;







                //axCZKEM1.EnableDevice(iMachineNumber, false);//disable the device

                setstatus("Fetching log from device " + MachineIP + ":" + Port + ", please wait...");

                if (axCZKEM1.ReadGeneralLogData(iMachineNumber))//read all the attendance records to the memory

                {

                    LogRecivedCount = 0;

                    while (axCZKEM1.SSR_GetGeneralLogData(iMnumber, out sdwEnrollNumber, out idwVerifyMode,

                               out idwInOutMode, out idwYear, out idwMonth, out idwDay, out idwHour, out idwMinute, out idwSecond, ref idwWorkcode))//get records from the memory

                    {



                        //iGLCount++;

                        //lvLogs.Items.Add(iGLCount.ToString());

                        //lvLogs.Items[iIndex].SubItems.Add(sdwEnrollNumber);//modify by Darcy on Nov.26 2009

                        //lvLogs.Items[iIndex].SubItems.Add(idwVerifyMode.ToString());

                        //lvLogs.Items[iIndex].SubItems.Add(idwInOutMode.ToString());

                        //lvLogs.Items[iIndex].SubItems.Add(idwYear.ToString() + "-" + idwMonth.ToString() + "-" + idwDay.ToString() + " " + idwHour.ToString() + ":" + idwMinute.ToString() + ":" + idwSecond.ToString());

                        //lvLogs.Items[iIndex].SubItems.Add(idwWorkcode.ToString());

                        //iIndex++;

                        try

                        {

                            DTAttLog.Rows.Add(sdwEnrollNumber, idwYear.ToString() + "-" + idwMonth.ToString() + "-" + idwDay.ToString() + " " + idwHour.ToString() + ":" + idwMinute.ToString() + ":" + idwSecond.ToString(), LogBranchId, TTYPE, MachineIP+":"+Port);

                      

                        }

                        catch (Exception)

                        {

                            // throw;

                        }



                        LogRecivedCount++;

                        setstatus("Fetching log from device " + MachineIP + ":" + Port + ", log fetched = " + LogRecivedCount + ",                                 please wait...");

                    }



                    OutPut("Fetch Record from Machine Total Count was " + LogRecivedCount);

                    setstatus("Fetching log completed from device " + MachineIP + ":" + Port + ", log fetched = "                +                                                LogRecivedCount + "");

                    LogRecivedCount = 0;

                }

                else

                {

                    //Cursor = Cursors.Default;

                    axCZKEM1.GetLastError(ref idwErrorCode);



                    if (idwErrorCode != 0)

                    {

                        OutPut("Reading data from terminal failed,ErrorCode: " + idwErrorCode.ToString());

                        setstatus("Reading data from terminal failed,ErrorCode: " + idwErrorCode.ToString() + " from device " + MachineIP + ":" + Port + "");

                    }

                    else

                    {

                        OutPut("No data from terminal returns!");

                        setstatus("No data from returns from device " + MachineIP + ":" + Port + "");



                    }

                }



                axCZKEM1.ClearGLog(iMachineNumber);

                axCZKEM1.RefreshData(iMachineNumber);

                //axCZKEM1.EnableDevice(iMachineNumber, true);//enable the device

              



                #endregion



                axCZKEM1.Disconnect();

            }

            else

            {

                axCZKEM1.GetLastError(ref idwErrorCode);

                //c1TrueDBGrid1[iMnumber - 1, "Status"] = "ErrorCode=" + idwErrorCode.ToString();

                OutPut("Unable to connect the device " + MachineIP + ":" + Port + ", ErrorCode=" + idwErrorCode.ToString());

                c1TrueDBGrid1[iMnumber - 1, "LSTime"] = DateTime.Now;

                setstatus("Unable to connect, ErrorCode: " + idwErrorCode.ToString() + " from device " + MachineIP + ":" + Port +               "");

                if (idwErrorCode == -7)

                {

                    try

                    {

                        int ConAttempts = Convert.ToInt32(c1TrueDBGrid1[iMnumber - 1, "F.Attempts"]);

                        ConAttempts = ConAttempts + 1;

                        c1TrueDBGrid1[iMnumber - 1, "F.Attempts"] = ConAttempts;

                        c1TrueDBGrid1[iMnumber - 1, "LSTime"] = DateTime.Now;



                        if (ConAttempts >= 3)

                        {

                            TerminalActivateDeactivate(iMnumber, "InActive");

                           

                        }

                    }

                    catch (Exception)

                    {

                        //throw;

                    }



                }

                axCZKEM1.Disconnect();

            }



        }