Snippets Collections
//login.html

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Login Page</title>
</head>
<body>
    <h2>Login Page</h2>
    <form action="WelcomeServlet" method="get">
        <label for="username">Enter Username:</label>
        <input type="text" id="username" name="username" required>
        <br><br>
        <input type="submit" value="Login">
    </form>
</body>
</html>


//WelcomeServlet.java

import java.io.IOException;
import java.io.PrintWriter;
import jakarta.servlet.ServletException;
import jakarta.servlet.annotation.WebServlet;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

@WebServlet("/WelcomeServlet")
public class WelcomeServlet extends HttpServlet {
    private static final long serialVersionUID = 1L;

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        response.setContentType("text/html");
        PrintWriter out = response.getWriter();

        // Get the username from the request
        String username = request.getParameter("username");

        if (username != null && !username.isEmpty()) {
            // Display the welcome message
            out.println("<h2>Welcome, " + username + "!</h2>");

            // URL Rewriting - Append the username to the next link
            out.println("<a href='DashboardServlet?username=" + username + "'>Go to Dashboard</a>");
        } else {
            out.println("<h2>Username is missing. Please go back and enter your username.</h2>");
        }

        out.close();
    }
}


//DashboardServlet.java

import java.io.IOException;
import java.io.PrintWriter;
import jakarta.servlet.ServletException;
import jakarta.servlet.annotation.WebServlet;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

@WebServlet("/DashboardServlet")
public class DashboardServlet extends HttpServlet {
    private static final long serialVersionUID = 1L;

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        response.setContentType("text/html");
        PrintWriter out = response.getWriter();

        // Retrieve the username from the rewritten URL
        String username = request.getParameter("username");

        if (username != null && !username.isEmpty()) {
            out.println("<h2>Welcome to your dashboard, " + username + "!</h2>");
        } else {
            out.println("<h2>Invalid access. Username not found!</h2>");
        }

        out.close();
    }
}
//login.html

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Login Page</title>
</head>
<body>
    <h2>Login</h2>
    <form action="LoginServlet" method="post">
        <label for="username">Username:</label>
        <input type="text" id="username" name="username" required><br><br>
        
        <label for="password">Password:</label>
        <input type="password" id="password" name="password" required><br><br>
        
        <!-- Hidden field to send a welcome message on successful login -->
        <input type="hidden" name="welcomeMessage" value="Welcome to the site!">
        
        <input type="submit" value="Login">
    </form>
</body>
</html>


//LoginServlet.java

import java.io.IOException;
import java.io.PrintWriter;
import jakarta.servlet.ServletException;
import jakarta.servlet.annotation.WebServlet;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

@WebServlet("/LoginServlet")
public class LoginServlet extends HttpServlet {
    private static final long serialVersionUID = 1L;

    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        response.setContentType("text/html");
        PrintWriter out = response.getWriter();
        
        String username = request.getParameter("username");
        String password = request.getParameter("password");
        String welcomeMessage = request.getParameter("welcomeMessage"); // Getting hidden field data
        
        // Simple login validation (for demonstration only)
        if ("user".equals(username) && "password".equals(password)) {
            out.println("<h2>Login Successful!</h2>");
            out.println("<p>" + welcomeMessage + "</p>");
            out.println("<p>Welcome, " + username + "!</p>");
        } else {
            out.println("<h2>Login Failed</h2>");
            out.println("<p>Invalid username or password. Please try again.</p>");
        }
        
        out.close();
    }
}
MainActivity.kt:
import android.content.Intent
import android.net.Uri
import android.os.Bundle
import androidx.activity.enableEdgeToEdge
import androidx.appcompat.app.AppCompatActivity
import com.google.android.material.floatingactionbutton.FloatingActionButton

class MainActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        enableEdgeToEdge()
        setContentView(R.layout.activity_main)

        //implicit
        val url = "https://www.google.com"
        val implicitButton : FloatingActionButton = findViewById(R.id.floatingActionButton)
        implicitButton.setOnClickListener{
            val implicitIntent =Intent(Intent.ACTION_VIEW, Uri.parse(url))
            startActivity(implicitIntent)
        }
    }
}
activity_main.xml:
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/main"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity">
    <TextView
        android:id="@+id/textView"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Welcome to MAD Lab"
        android:textSize="24sp"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintHorizontal_bias="0.5"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintVertical_bias="0.5"
        tools:ignore="HardcodedText" />

    <com.google.android.material.floatingactionbutton.FloatingActionButton
        android:id="@+id/floatingActionButton"
        android:layout_width="56dp"
        android:layout_height="76dp"
        android:clickable="true"
        app:fabSize="auto"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintHorizontal_bias="0.5"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/textView"
        app:layout_constraintVertical_bias="0.5"
        app:maxImageSize="30dp"
        app:srcCompat="@drawable/baseline_add_24"
        tools:ignore="ContentDescription,KeyboardInaccessibleWidget,SpeakableTextPresentCheck,SpeakableTextPresentCheck"/>

</androidx.constraintlayout.widget.ConstraintLayout>
response = zoho.books.getRecordsByID("Contacts","60027666993","1717348000001708124","zoho_books");
//info response;
contact = response.get("contact").get("bank_accounts");
//info contact;
for each  rec in contact
{
	account_number = rec.get("account_number");
	info account_number;
	IFSC_CODE  = rec.get("routing_number");
}

//////////////
//////////////////////

headers = map();
headers.put("Content-Type", "application/json");
headers.put("api-key", "4c7e1f57-ae9b-411d-bf8a-079b37cd7dab");
headers.put("account-id", "0c85c3939596/9eeccde7-d9ae-4948-845f-3b0286bdad55");


data = map();
data.put("task_id", "task-123");
data.put("group_id", "group-1234");

bank_data = map();
bank_data.put("bank_account_no", "10087431715");
bank_data.put("bank_ifsc_code", "IDFB0080221");
bank_data.put("nf_verification", false);
data.put("data", bank_data);
payload = data.toString();


validate_bank_account = invokeUrl
[
    url : "https://eve.idfy.com/v3/tasks/async/verify_with_source/validate_bank_account"
    type : POST
    parameters : payload
    headers : headers
];

//info validate_bank_account;
request_id = validate_bank_account.get("request_id");
//info request_id;
////////////////////////
/////////////////////////////////////////
get_tasks_data = invokeUrl
[
    url : "https://eve.idfy.com/v3/tasks?request_id="+request_id+""
    type : GET
    headers : headers
];
info get_tasks_data;
 import java.sql.Connection;
 import java.sql.ResultSet;
 import java.sql.Statement;
 import  java.sql.SQLException;
 import java.sql.DriverManager;
  
    public class JdbcExamplePrg1 {
    public static void main(String[] args) throws ClassNotFoundException, SQLException {
  
        String QUERY = "select * from book where id <46";
      
        Class.forName("com.mysql.cj.jdbc.Driver"); 
  
        try {
		
  Connection conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/books","root","ramesh");
        
                Statement statemnt1 = conn.createStatement();
              
          ResultSet rs1 = statemnt1.executeQuery(QUERY); 
                                      
                    while(rs1.next())
                    {
                        int id = rs1.getInt(1);
                        String title = rs1.getString(2);
                        String author = rs1.getString(3);
                        String publisher = rs1.getString(4);
                        int price = rs1.getInt(5);

                    System.out.println(id + ","+title+ ","+author+ ","+publisher +","+price );
                    }
                 
        }
        catch(SQLException e) {
            e.printStackTrace();
        }
       }
    }
MainActivity.kt:
import android.content.Intent
import android.os.Bundle
import android.widget.TextView
import androidx.activity.enableEdgeToEdge
import androidx.appcompat.app.AppCompatActivity
import com.google.android.material.floatingactionbutton.FloatingActionButton

class MainActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        enableEdgeToEdge()
        setContentView(R.layout.activity_main)

        //Explicit Intent
        var t: TextView = findViewById(R.id.textView)
        var f: FloatingActionButton = findViewById(R.id.floatingActionButton)
        f.setOnClickListener()
        {
            var i = Intent(this, MainActivity2::class.java)
            startActivity(i)
        }
    }
}
activity_main.xml:
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/main"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity">
    <TextView
        android:id="@+id/textView"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Welcome to MAD Lab"
        android:textSize="24sp"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintHorizontal_bias="0.5"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintVertical_bias="0.5"
        tools:ignore="HardcodedText" />

    <com.google.android.material.floatingactionbutton.FloatingActionButton
        android:id="@+id/floatingActionButton"
        android:layout_width="56dp"
        android:layout_height="76dp"
        android:clickable="true"
        app:fabSize="auto"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintHorizontal_bias="0.5"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/textView"
        app:layout_constraintVertical_bias="0.5"
        app:maxImageSize="30dp"
        app:srcCompat="@drawable/baseline_add_24"
        tools:ignore="ContentDescription,KeyboardInaccessibleWidget,SpeakableTextPresentCheck,SpeakableTextPresentCheck"/>
</androidx.constraintlayout.widget.ConstraintLayout>
MainActivity2.kt:
import android.os.Bundle
import androidx.activity.enableEdgeToEdge
import androidx.appcompat.app.AppCompatActivity

class MainActivity2 : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        enableEdgeToEdge()
        setContentView(R.layout.activity_main2)
    }
}
activity_main2.xml:
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/main"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity2">
    <TextView
        android:id="@+id/textView2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="CSE-A"
        android:textSize="34sp"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintHorizontal_bias="0.5"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintVertical_bias="0.5"
        tools:ignore="HardcodedText" />
</androidx.constraintlayout.widget.ConstraintLayout>
import java.sql.*;

public class UpdateEmpAndAccounts {
    public static void main(String[] args) {
        // Database credentials
        String jdbcURL = "jdbc:mysql://localhost:3306/nehal";
        String username = "root";
        String password = "nehal@123";

        // Stored procedure
        String storedProcedureCall = "{CALL UpdateEmpAndAccounts(?, ?, ?)}";

        // Input values
        int empId = 5; // Employee ID to update
        String newName = "John Updated"; // New name
        int newBalance = 1200; // New account balance (integer)

        try (Connection connection = DriverManager.getConnection(jdbcURL, username, password);
             CallableStatement callableStatement = connection.prepareCall(storedProcedureCall)) {

            // Set parameters for the stored procedure
            callableStatement.setInt(1, empId);
            callableStatement.setString(2, newName);
            callableStatement.setInt(3, newBalance);

            // Execute the stored procedure
            callableStatement.execute();

            System.out.println("Employee name and account balance updated successfully!");

        } catch (SQLException e) {
            e.printStackTrace();
        }
    }
}
//run procedure code in mysql
DELIMITER $$

CREATE PROCEDURE UpdateEmpAndAccounts(
    IN empId INT,           -- Employee ID to identify the record
    IN newName VARCHAR(255), -- New name for the employee
    IN newBalance INT        -- New balance for the account
)
BEGIN
    -- Update the name in the emp table
    UPDATE emp
    SET name = newName
    WHERE id = empId;

    -- Update the balance in the accounts table
    UPDATE accounts
    SET balance = newBalance
    WHERE id = empId;
END $$

DELIMITER ;
//status check for procedure
SHOW PROCEDURE STATUS WHERE Db = 'nehal';
import java.sql.*;

public class TransactionExample {

    public static void main(String[] args) {
        // Database URL and credentials
        String dbUrl = "jdbc:mysql://localhost:3306/nehal";
        String user = "root";
        String password = "nehal@123";

        Connection conn = null;

        try {
            // Establish connection
            conn = DriverManager.getConnection(dbUrl, user, password);

            // Disable auto-commit mode
            conn.setAutoCommit(false);

            // SQL queries
            String deductMoney = "UPDATE accounts SET balance = balance - ? WHERE id = ?";
            String addMoney = "UPDATE accounts SET balance = balance + ? WHERE id = ?";

            try (
                PreparedStatement stmt1 = conn.prepareStatement(deductMoney);
                PreparedStatement stmt2 = conn.prepareStatement(addMoney)
            ) {
                // Deduct money from account 1
                stmt1.setDouble(1, 500.0); // Deduct $500
                stmt1.setInt(2, 1);        // From account ID 1
                stmt1.executeUpdate();

                // Add money to account 2
                stmt2.setDouble(1, 500.0); // Add $500
                stmt2.setInt(2, 2);        // To account ID 2
                stmt2.executeUpdate();

                // Commit the transaction
                conn.commit();
                System.out.println("Transaction successful!");
            } catch (SQLException e) {
                // Rollback the transaction in case of an error
                if (conn != null) {
                    conn.rollback();
                    System.out.println("Transaction rolled back due to an error.");
                }
                e.printStackTrace();
            }

        } catch (SQLException e) {
            e.printStackTrace();
        } finally {
            try {
                if (conn != null) {
                    // Re-enable auto-commit mode
                    conn.setAutoCommit(true);
                    conn.close();
                }
            } catch (SQLException e) {
                e.printStackTrace();
            }
        }
    }
}
import java.sql.*;

public class ScrollableAndUpdatableResultSetExample {

    public static void main(String[] args) {
        // Database URL and credentials
        String dbUrl = "jdbc:mysql://localhost:3306/nehal";
        String user = "root";
        String password = "nehal@123";

        // SQL query
        String sql = "SELECT id, name FROM emp";

        try (Connection conn = DriverManager.getConnection(dbUrl, user, password)) {
            // Create a statement with scrollable and updatable result set
            Statement stmt = conn.createStatement(
                ResultSet.TYPE_SCROLL_INSENSITIVE,  // Scrollable
                ResultSet.CONCUR_UPDATABLE          // Updatable
            );

            // Execute the query and get the result set
            ResultSet rs = stmt.executeQuery(sql);

            // Move to the last row
            if (rs.last()) {
                System.out.println("Last row: " + rs.getInt("id") + ", " + rs.getString("name"));
            }

            // Move to the first row
            if (rs.first()) {
                System.out.println("First row: " + rs.getInt("id") + ", " + rs.getString("name") );
            }

            // Move to the second row (using absolute position)
            if (rs.absolute(2)) {
                System.out.println("Second row: " + rs.getInt("id") + ", " + rs.getString("name") );
            }

            // Update a column in the result set
            if (rs.absolute(1)) {
                rs.updateString("name", "ramesh"); // Update name for the first row
                rs.updateRow(); // Apply the update to the database
                System.out.println("Updated first row: " + rs.getInt("id") + ", " + rs.getString("name"));
            }

        } catch (SQLException e) {
            e.printStackTrace();
        }
    }
}
import java.sql.*;

public class ResultSetMetadataExample {

    public static void main(String[] args) {
        // Database URL and credentials
        String dbUrl = "jdbc:mysql://localhost:3306/nehal";
        String user = "root";
        String password = "nehal@123";

        // SQL query
        String sql = "SELECT id, name FROM emp";

        try (Connection conn = DriverManager.getConnection(dbUrl, user, password);
             Statement stmt = conn.createStatement();
             ResultSet rs = stmt.executeQuery(sql)) {
             
            // Get the ResultSetMetaData
            ResultSetMetaData rsMetaData = rs.getMetaData();
            
            // Get the number of columns in the result set
            int columnCount = rsMetaData.getColumnCount();
            
            System.out.println("Number of Columns: " + columnCount);
            
            // Print column names and types
            for (int i = 1; i <= columnCount; i++) {
                String columnName = rsMetaData.getColumnName(i);
                String columnType = rsMetaData.getColumnTypeName(i);
                
                System.out.println("Column " + i + ": " + columnName + " (" + columnType + ")");
            }
            
            // Iterate through the result set and print data
            while (rs.next()) {
                System.out.println("ID: " + rs.getInt("id") + ", Name: " + rs.getString("name"));
            }

        } catch (SQLException e) {
            e.printStackTrace();
        }
    }
}
const person = {
    name: "Alice",
    age: 25,
    greet: function() {
        console.log(`Hi, I'm ${this.name}.`);
    }
};
console.log(person.name);
person.greet();

const car = new Object();
car.brand = "Toyota";
car.model = "Corolla";
car.year = 2021;
console.log(car.brand);

function Book(title, author) {
    this.title = title;
    this.author = author;
    this.getInfo = function() {
        return `${this.title} by ${this.author}`;
    };
}
const book1 = new Book("1984", "George Orwell");
console.log(book1.getInfo());

class Animal {
    constructor(type, sound) {
        this.type = type;
        this.sound = sound;
    }
    makeSound() {
        console.log(this.sound);
    }
}

const cat = new Animal("Cat", "Meow");
cat.makeSound();

const student = {
    name: "Bob",
    grade: "A",
    subjects: ["Math", "Science"]
};
console.log(student.subjects[0]);
const fruits = ["Apple", "Banana", "Orange", "Mango", "Grapes"];

console.log("Original Array:", fruits);

// Using slice()
const slicedFruits = fruits.slice(1, 4);
console.log("\nUsing slice:");
console.log("Sliced Array:", slicedFruits); 
console.log("After slice, Original Array:", fruits); 

// Using splice()
const splicedFruits = fruits.splice(2, 2, "Pineapple", "Strawberry");
console.log("\nUsing splice:");
console.log("Removed Elements:", splicedFruits);
console.log("After splice, Modified Array:", fruits);
//Bookstore.dtd
<!ELEMENT bookstore (book+)>
<!ELEMENT book (title, author, year, price)>
<!ELEMENT title (#PCDATA)>
<!ELEMENT author (#PCDATA)>
<!ELEMENT year (#PCDATA)>
<!ELEMENT price (#PCDATA)>
<!ATTLIST book category CDATA #REQUIRED>
 //anyname.xml
                 <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE bookstore SYSTEM "bookstore.dtd">
<bookstore>
    <book category="fiction">
        <title>Harry Potter</title>
        <author>J.K. Rowling</author>
        <year>1997</year>
        <price>29.99</price>
    </book>
    <book category="non-fiction">
        <title>Sapiens</title>
        <author>Yuval Noah Harari</author>
        <year>2014</year>
        <price>19.99</price>
    </book>
</bookstore>

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE bookstore [
    <!ELEMENT bookstore (book+)>
    <!ELEMENT book (title, author, year, price)>
    <!ELEMENT title (#PCDATA)>
    <!ELEMENT author (#PCDATA)>
    <!ELEMENT year (#PCDATA)>
    <!ELEMENT price (#PCDATA)>
    <!ATTLIST book category CDATA #REQUIRED>
]>
<bookstore>
    <book category="fiction">
        <title>Harry Potter</title>
        <author>J.K. Rowling</author>
        <year>1997</year>
        <price>29.99</price>
    </book>
    <book category="non-fiction">
        <title>Sapiens</title>
        <author>Yuval Noah Harari</author>
        <year>2014</year>
        <price>19.99</price>
    </book>
</bookstore>

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;

public class DatabaseOperations {
    public static void main(String[] args) throws ClassNotFoundException {
        String jdbcUrl = "jdbc:oracle:thin:@//localhost:1521/XE";
        String user = "system";
        String password = "hari123";
        
        try {
            // Load Oracle JDBC Driver
            Class.forName("oracle.jdbc.driver.OracleDriver");

            // Establish connection
            Connection connection = DriverManager.getConnection(jdbcUrl, user, password);
            System.out.println("Connection established successfully");

            // 1. Insert Operation with PreparedStatement
            String insertSQL = "INSERT INTO Users (username, password, email) VALUES (?, ?, ?)";
            PreparedStatement insertStatement = connection.prepareStatement(insertSQL);
            insertStatement.setString(1, "hari");
            insertStatement.setString(2, "secure@123");
            insertStatement.setString(3, "john@example.com");
            int insertResult = insertStatement.executeUpdate();
            System.out.println(insertResult + " row(s) inserted.");
            insertStatement.close();

            // 2. Select Operation with PreparedStatement
            String selectSQL = "SELECT * FROM Users";
            PreparedStatement selectStatement = connection.prepareStatement(selectSQL);
            ResultSet rs = selectStatement.executeQuery();
            while (rs.next()) {
                System.out.println("Username: " + rs.getString("username") +
                                   ", Password: " + rs.getString("password") +
                                   ", Email: " + rs.getString("email"));
            }
            selectStatement.close();

            // 3. Update Operation with PreparedStatement
            String updateSQL = "UPDATE Users SET email = ? WHERE username = ?";
            PreparedStatement updateStatement = connection.prepareStatement(updateSQL);
            updateStatement.setString(1, "john_new@example.com");
            updateStatement.setString(2, "john_doe");
            int updateResult = updateStatement.executeUpdate();
            System.out.println(updateResult + " row(s) updated.");
            updateStatement.close();

            // Close the connection
            connection.close();

        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
const stack = [];

function push(element) {
    stack.push(element);
}

function pop() {
    if (isEmpty()) {
        console.log("Stack is empty.");
        return null;
    }
    return stack.pop();
}

function peek() {
    if (isEmpty()) {
        console.log("Stack is empty.");
        return null;
    }
    return stack[stack.length - 1];
}

function isEmpty() {
    return stack.length === 0;
}

function size() {
    return stack.length;
}

function printStack() {
    console.log(stack);
}

console.log("Push operations:");
push(10);
push(20);
push(30);
printStack();

console.log("\nPeek operation:");
console.log(peek());

console.log("\nPop operations:");
console.log(pop());
console.log(pop());
printStack();

console.log("\nCheck if empty:");
console.log(isEmpty());

console.log("\nStack size:");
console.log(size());
import java.util.*;

public class PotionBrewer {
    private static final Map<String, List<List<String>>> recipes = new HashMap<>();
    private static final Map<String, Integer> memoization = new HashMap<>();
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int numRecipes = scanner.nextInt();
        scanner.nextLine();
        for (int i = 0; i < numRecipes; i++) {
            String[] recipeParts = scanner.nextLine().split("=");
            String potion = recipeParts[0].trim();
            String[] ingredients = recipeParts[1].split("\\+");
            recipes.computeIfAbsent(potion, k -> new ArrayList<>()).add(Arrays.asList(ingredients));
        }
        String targetPotion = scanner.nextLine();
        scanner.close();
        int result = calculateMinimumOrbs(targetPotion);
        System.out.println(result);
    }
    private static int calculateMinimumOrbs(String potion) {
        if(!recipes.containsKey(potion)){
            return 0;
        }
        if(memoization.containsKey(potion)){
            return memoization.get(potion);
        }
        int minOrbs = Integer.MAX_VALUE;
        for (List<String> recipe : recipes.get(potion)){
            int orbsRequired = recipe.size() - 1;
            for(String ingredient : recipe){
                orbsRequired += calculateMinimumOrbs(ingredient);
            }
            minOrbs = Math.min(minOrbs, orbsRequired);
        }
        memoization.put(potion, minOrbs);
        return minOrbs;
    }
}

attachment_resp = zoho.crm.getRelatedRecords("Attachments", "Token_Redemption", record_id);
// 			info attachment_resp;

for each file in attachment_resp
{
  id = file.get("id");
  info id;
  download_attachment = invokeurl
  [
    url: "https://www.zohoapis.eu/crm/v7/Token_Redemption/"+record_id+"/Attachments/"+id
    type: GET
    connection:"zoho_crm"
  ];
  info download_attachment;

  //download_attachment.setParamName("file");
  download_attachment.setParamName("attachment"); /// must include ///

  attach_to_bill = invokeUrl
  [
    url: "https://www.zohoapis.eu/books/v3/bills/412422000007051030/attachment?organization_id="+organization_id
    type: POST
    files: download_attachment
    connection: "zoho_books"
  ];
  info attach_to_bill;
}
attachment_resp = zoho.crm.getRelatedRecords("Attachments", "Token_Redemption", record_id);
// 			info attachment_resp;

for each file in attachment_resp
{
  id = file.get("id");
  info id;
  download_attachment = invokeurl
  [
    url: "https://www.zohoapis.eu/crm/v7/Token_Redemption/"+record_id+"/Attachments/"+id
    type: GET
    connection:"zoho_crm"
  ];
  info download_attachment;
}
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;

public class DatabaseOperations {
    public static void main(String[] args) throws ClassNotFoundException {
        String jdbcUrl = "jdbc:oracle:thin:@//localhost:1521/XE"; // Corrected URL
        String user = "system";
        String password = "hari123";
        
        try {
            // Load Oracle JDBC Driver
            Class.forName("oracle.jdbc.driver.OracleDriver");

            // Establish connection
            Connection connection = DriverManager.getConnection(jdbcUrl, user, password);
            System.out.println("Connection established successfully");

            // Create Statement object
            Statement statement = connection.createStatement();

            // 1. Insert Operation
            String insertSQL = "INSERT INTO Users (username, password, email) VALUES ('hari', 'secure@123', 'john@example.com')";
            int insertResult = statement.executeUpdate(insertSQL);
            System.out.println(insertResult + " row(s) inserted.");

            // 2. Select Operation
            String selectSQL = "SELECT * FROM Users";
            ResultSet rs = statement.executeQuery(selectSQL);
            while (rs.next()) {
                System.out.println("UserName: " + rs.getString("username") + ", Password: " + rs.getString("password") +
                                   ", Email: " + rs.getString("email"));
            }

            // 3. Update Operation
            String updateSQL = "UPDATE Users SET email = 'john_new@example.com' WHERE username = 'john_doe'";
            int updateResult = statement.executeUpdate(updateSQL);
            System.out.println(updateResult + " row(s) updated.");

            // Close the resources
            statement.close();
            connection.close();

        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
import java.util.*;

public class Main {
    
   public static void bst(double[] p, double[] q, int n) {
    double[][] w = new double[n + 1][n + 1];
    double[][] c = new double[n + 1][n + 1];
    int[][] r = new int[n + 1][n + 1];

    // Initialization
    for (int i = 0; i <= n; i++) {
        w[i][i] = q[i];
        c[i][i] = 0;
        r[i][i] = 0;
    }

    // Building matrices
    for (int m = 1; m <= n; m++) {
        for (int i = 0; i <= n - m; i++) {
            int j = i + m;
            w[i][j] = w[i][j - 1] + p[j] + q[j];
            double mincost = Double.MAX_VALUE;
            int root = -1;

            for (int k = (i < j - 1 ? r[i][j - 1] : i); k <= (j > i + 1 ? r[i + 1][j] : j); k++) {
                double cost = (i <= k - 1 ? c[i][k - 1] : 0) + (k <= j ? c[k][j] : 0) + w[i][j];
                if (cost < mincost) {
                    mincost = cost;
                    root = k;
                }
            }

            c[i][j] = mincost;
            r[i][j] = root;
        }
    }

    // Print W, C, R values
    printDiagonalMatrices(w, c, r, n);

    // Final output
    System.out.println("\nMinimum cost: " + c[0][n]);
    System.out.println("Weight : " + w[0][n]);
}

// Helper method to print W, C, R values in the desired format
public static void printDiagonalMatrices(double[][] w, double[][] c, int[][] r, int n) {
    System.out.println("Diagonal Representation of W, C, R Matrices:");

    for (int d = 0; d <= n; d++) { // d = j - i
        System.out.println("\nFor j - i = " + d + ":");
        for (int i = 0; i <= n - d; i++) {
            int j = i + d;
            System.out.printf("W[%d][%d] = %.2f, C[%d][%d] = %.2f, R[%d][%d] = %d\n", 
                              i, j, w[i][j], i, j, c[i][j], i, j, r[i][j]);
        }
    }
}


    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.print("Enter the number of keys: ");
        int n = sc.nextInt();

        double[] p = new double[n + 1];
        double[] q = new double[n + 1];

        System.out.println("Enter probabilities for the keys:");
        for (int i = 1; i <= n; i++) {
            System.out.print("p[" + i + "]: ");
            p[i] = sc.nextDouble();
        }

        System.out.println("Enter probabilities for the dummy keys:");
        for (int i = 0; i <= n; i++) {
            System.out.print("q[" + i + "]: ");
            q[i] = sc.nextDouble();
        }

        bst(p, q, n);
    }
}
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Nested Objects in JavaScript</title>
</head>
<body>
 
<h1>JavaScript Nested Objects</h1>
 
<script>
    const student = {
        name: "John Doe",
        age: 21,
        address: {
            street: "123 Main St",
            city: "Springfield",
            zip: "12345"
        },
        courses: {
            math: {
                teacher: "Mrs. Smith",
                grade: "A"
            },
            science: {
                teacher: "Mr. Brown",
                grade: "B"
            }
        },
        scores: {
            math: 95,
            science: 88,
            english: 92
        }
    };
 
   
    console.log("Student's Name:", student.name);
    console.log("City:", student.address.city);
    console.log("Math Teacher:", student.courses.math.teacher);
 
 
    student.address.zip = "54321";
    console.log("Updated Zip Code:", student.address.zip);
 
    
    student.courses.history = {
        teacher: "Ms. Green",
        grade: "A-"
    };
    console.log("Added History Course:", student.courses.history);
 
 
    delete student.scores.english;
    console.log("Scores after deletion:", student.scores);
</script>
 
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Navbar with Dropdown</title>
  <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
  
  <!-- Navbar -->
  <nav class="navbar navbar-expand-lg navbar-light bg-light">
    <div class="container-fluid">
      <a class="navbar-brand" href="#">Navbar</a>
      <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
        <span class="navbar-toggler-icon"></span>
      </button>
      <div class="collapse navbar-collapse" id="navbarNav">
        <ul class="navbar-nav">
          <li class="nav-item">
            <a class="nav-link active" aria-current="page" href="#">Home</a>
          </li>
          <li class="nav-item">
            <a class="nav-link" href="#">Features</a>
          </li>
          <li class="nav-item">
            <a class="nav-link" href="#">Pricing</a>
          </li>
          
          <!-- Dropdown -->
          <li class="nav-item dropdown">
            <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false">
              Dropdown
            </a>
            <ul class="dropdown-menu" aria-labelledby="navbarDropdown">
              <li><a class="dropdown-item" href="#">Action</a></li>
              <li><a class="dropdown-item" href="#">Another action</a></li>
              <li><hr class="dropdown-divider"></li>
              <li><a class="dropdown-item" href="#">Something else here</a></li>
            </ul>
          </li>
          
        </ul>
      </div>
    </div>
  </nav>

  <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>
$( "p" ).addClass( "myClass yourClass" );
$( "button.continue" ).html( "Next Step..." )
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Mobile First Approach</title>
    <style>
        body, h1, h2, p, ul {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: Arial, sans-serif;
            background-color: #f4f4f4;
            color: #333;
            padding: 20px;
        }

        header {
            background-color: #007bff;
            color: white;
            padding: 15px;
            text-align: center;
        }

        header h1 {
            font-size: 1.8rem;
        }

        nav {
            background-color: #333;
            padding: 10px;
            text-align: center;
        }

        nav ul {
            list-style-type: none;
        }

        nav ul li {
            display: inline;
            margin: 0 15px;
        }

        nav ul li a {
            color: white;
            text-decoration: none;
            font-weight: bold;
            font-size: 1.1rem;
        }

        nav ul li a:hover {
            color: #ffcc00;
        }

        main {
            background-color: white;
            padding: 20px;
            border-radius: 8px;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
            margin-top: 20px;
        }

        main h2 {
            font-size: 1.6rem;
            margin-bottom: 10px;
        }

        main p {
            font-size: 1rem;
            color: #555;
            line-height: 1.6;
        }

        footer {
            text-align: center;
            padding: 10px;
            background-color: #333;
            color: white;
            margin-top: 20px;
        }

   
        @media(min-width: 768px) {
            header h1 {
                font-size: 2.5rem;
            }

            nav ul li {
                margin: 0 25px;
            }

            main h2 {
                font-size: 2rem;
            }

            footer {
                font-size: 1.2rem;
            }
        }

     
        @media(min-width: 1024px) {
            body {
                max-width: 960px;
                margin: 0 auto;
            }

            main {
                padding: 40px;
            }
        }
    </style>
</head>
<body>

    <header>
        <h1>Welcome to Our Website</h1>
    </header>

    <nav>
        <ul>
            <li><a href="#home">Home</a></li>
            <li><a href="#about">About</a></li>
            <li><a href="#services">Services</a></li>
            <li><a href="#contact">Contact</a></li>
        </ul>
    </nav>

    <main>
        <section id="home">
            <h2>Home</h2>
            <p>Welcome to our mobile-first website!</p>
        </section>

        <section id="about">
            <h2>About Us</h2>
            <p>We offer high-quality services to help your business grow.</p>
        </section>

        <section id="services">
            <h2>Our Services</h2>
            <ul>
                <li>Web Design</li>
                <li>Development</li>
                <li>SEO</li>
                <li>Marketing</li>
            </ul>
        </section>
    </main>

    <footer>
        <p>&copy; 2024 Company Name. All Rights Reserved.</p>
    </footer>

</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>CVR</title>
    <style>
        body, h1, h2, p, ul {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: Arial, sans-serif;
            line-height: 1.6;
        }

        header {
            background: #004080;
            color: #fff;
            padding: 1rem 0;
            text-align: center;
        }

        header h1 {
            margin-bottom: 0.5rem;
        }

        header p {
            font-style: italic;
        }

        nav {
            background: #0066cc;
            padding: 0.5rem 0;
        }

        nav ul {
            list-style: none;
            display: flex;
            justify-content: center;
        }

        nav ul li {
            margin: 0 1rem;
        }

        nav ul li a {
            text-decoration: none;
            color: #fff;
            font-weight: bold;
            transition: color 0.3s;
        }

        nav ul li a:hover {
            color: #ffcc00;
        }

        main {
            padding: 2rem;
            background: #f4f4f4;
        }

        main section {
            margin-bottom: 2rem;
        }

        main section h2 {
            color: #004080;
            margin-bottom: 1rem;
        }

        footer {
            background: #333;
            color: #fff;
            text-align: center;
            padding: 1rem 0;
            margin-top: 2rem;
        }
    </style>
</head>
<body>
    <header>
        <div class="header-container">
            <h1>CVR</h1>
            <p>Your Path to Excellence</p>
        </div>
    </header>

    <nav>
        <ul>
            <li><a href="#home">Home</a></li>
            <li><a href="#about">About Us</a></li>
            <li><a href="#programs">Programs</a></li>
            <li><a href="#admissions">Admissions</a></li>
            <li><a href="#contact">Contact</a></li>
        </ul>
    </nav>

    <main>
        <section id="home">
            <h2>Welcome to CVR</h2>
            <p>Discover our programs, vibrant campus life, and opportunities for growth.</p>
        </section>

        <section id="about">
            <h2>About Us</h2>
            <p>We are a leading institution offering world-class education and research opportunities.</p>
        </section>

        <section id="programs">
            <h2>Our Programs</h2>
            <ul>
                <li>Undergraduate Programs</li>
                <li>Postgraduate Programs</li>
                <li>Online Courses</li>
            </ul>
        </section>

        <section id="admissions">
            <h2>Admissions</h2>
            <p>Applications are now open for the upcoming academic year.</p>
        </section>
    </main>

    <footer>
        <p>&copy; 2024 University Name. All rights reserved.</p>
    </footer>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Login Page</title>
</head>
<body>
    <h2>Login</h2>
    <form action="LoginServlet" method="post">
        Username: <input type="text" name="username" required><br><br>
         password: <input type="text" name="pass" required><br><br>
        <input type="submit" value="Login">
    </form>
</body>
</html>
//welcomeservlet.java
package test;

import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

@WebServlet("/WelcomeServlet")
public class WelcomeServlet extends HttpServlet {
    private static final long serialVersionUID = 1L;

    protected void doGet(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        // Retrieve the existing session, if it exists
        HttpSession session = request.getSession(false);
        response.setContentType("text/html");
        PrintWriter out = response.getWriter();

        if (session != null) {
            String username = (String) session.getAttribute("username");
            String pass = (String) session.getAttribute("pass");
            if (username != null) {
                out.println("<html><body>");
                out.println("<h2>Welcome, " + username + "!</h2>");
                out.println("<a href='LogoutServlet'>Logout</a>");
                out.println("</body></html>");
            } else {
                response.sendRedirect("login.html"); // Redirect if no username in session
            }
        } else {
            response.sendRedirect("login.html"); // Redirect if no session exists
        }
    }
}
//loginservlet.java
package test;

import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

@WebServlet("/LoginServlet")
public class LoginServlet extends HttpServlet {
    private static final long serialVersionUID = 1L;

    protected void doPost(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        String username = request.getParameter("username");
        String pass = request.getParameter("pass");
        

        // Create a new session or retrieve the existing one
        HttpSession session = request.getSession();
        
        // Store the username in the session
        session.setAttribute("username", username);
        session.setAttribute("pass", pass);
        // Respond with the welcome page content
        response.setContentType("text/html");
        PrintWriter out = response.getWriter();
        out.println("<html><body>");
        out.println("<h2>Welcome, " + username + "!</h2>");
        out.println("<a href='LogoutServlet'>Logout</a>");
        out.println("</body></html>");
    }
}
//logoutservlet.java
package test;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

@WebServlet("/LogoutServlet")
public class LogoutServlet extends HttpServlet {
    private static final long serialVersionUID = 1L;

    protected void doGet(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        // Get the existing session, if any
        HttpSession session = request.getSession(false);

        if (session != null) {
            // Invalidate the session
            session.invalidate();
        }

        // Redirect to the login page
        response.sendRedirect("login.html");
    }
}
{
	"blocks": [
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": ":cool-cool: Boost Days - Whats On This Week! :cool-cool:"
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "Mōrena Ahuriri & happy Monday! :wave:\n\nWe're excited to kick off another great week in the office with our Boost Day Program! :yay: Please see below for whats on this week :arrow-bounce:"
			}
		},
		{
			"type": "divider"
		},
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": ":calendar-date-15: Wednesday, 15th January",
				"emoji": true
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "\n:coffee: *Café Partnership*: Enjoy coffee and café-style beverages from our cafe partner, *Adoro*, located in our office building *8:00AM - 11:30AM*.\n:sandwich: *Lunch*: Provided by *Mitzi and Twinn* *12:00PM - 1:00PM* in the Kitchen."
			}
		},
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": ":calendar-date-16: Thursday, 16th January",
				"emoji": true
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": ":coffee: *Café Partnership*: Enjoy coffee and café-style beverages from our cafe partner, *Adoro*, located in our office building *8:00AM - 11:30AM*. \n:breakfast: *Breakfast*: Provided by *Roam* *9:30AM - 11:00AM* in the Kitchen."
			}
		},
		{
			"type": "divider"
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "Stay tuned to this channel for more details, check out the <https://calendar.google.com/calendar/u/0?cid=eGVyby5jb21fbXRhc2ZucThjaTl1b3BpY284dXN0OWlhdDRAZ3JvdXAuY2FsZW5kYXIuZ29vZ2xlLmNvbQ|*Hawkes Bay Social Calendar*>, and get ready to Boost your workdays!\n\nWX Team :party-wx:"
			}
		}
	]
}
{
	"blocks": [
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": ":bee: Boost Days - Whats On This Week! :bee:"
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "Mōrena Ahuriri & welcome back! :wave: Hope you all had a lovely break :warm_smile:\n\nWe're excited to kick off the first month of 2025 with our Boost Day Program! :yay: Please see below for whats on this week :arrow-bounce:"
			}
		},
		{
			"type": "divider"
		},
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": ":calendar-date-8: Wednesday, 8th January",
				"emoji": true
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "\n:coffee: *Café Partnership*: Enjoy coffee and café-style beverages from our cafe partner, *Adoro*, located in our office building *8:00AM - 11:30AM*.\n:BREAKFAST: *Breakfast*: Provided by *Mitzi and Twinn* *9:30AM - 11:00AM* in the Kitchen."
			}
		},
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": ":calendar-date-9: Thursday, 9th January",
				"emoji": true
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": ":coffee: *Café Partnership*: Enjoy coffee and café-style beverages from our cafe partner, *Adoro*, located in our office building *8:00AM - 11:30AM*. \n:sandwich: *Lunch*: Provided by *Roam* *12:00PM - 1:00PM* in the Kitchen."
			}
		},
		{
			"type": "divider"
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "Stay tuned to this channel for more details, check out the <https://calendar.google.com/calendar/u/0?cid=eGVyby5jb21fbXRhc2ZucThjaTl1b3BpY284dXN0OWlhdDRAZ3JvdXAuY2FsZW5kYXIuZ29vZ2xlLmNvbQ|*Hawkes Bay Social Calendar*>, and get ready to Boost your workdays!\n\nWX Team :party-wx:"
			}
		}
	]
}
{
	"blocks": [
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": ":Christmas-tree: Boost Days - Whats On This Week! :christmas-tree:"
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "Mōrena Ahuriri & happy Monday! :wave:\n\nWe're excited to kick off the last week of 2024 in the office with our Boost Day Program! :partying_face: Please see below for whats on this week :arrow-bounce:"
			}
		},
		{
			"type": "divider"
		},
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": ":calendar-date-18: Wednesday, 18th December",
				"emoji": true
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "\n:coffee: *Café Partnership*: Enjoy coffee and café-style beverages from our cafe partner, *Adoro*, located in our office building *8:00AM - 11:30AM*.\n:sandwich: *Lunch*: Provided by *Mitzi and Twinn* *12:00PM - 1:00PM* in the Kitchen.\n:xero: *Global All Hands*: Streamed live in *Clearview* *11:00AM - 12:00PM*"
			}
		},
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": ":calendar-date-19: Wednesday, 19th December",
				"emoji": true
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": ":coffee: *Café Partnership*: Enjoy coffee and café-style beverages from our cafe partner, *Adoro*, located in our office building *8:00AM - 11:30AM*. \n:breakfast: *Breakfast*: Provided by *Roam* *9:30AM - 11:00AM* in the Kitchen.\n:newzealand: *Aotearoa All Hands*: Streamed live in Clearview *10:30AM - 11:30AM*"
			}
		},
		{
			"type": "divider"
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": ":exclamation:*OFFICE CLOSEDOWN FROM EOD FRIDAY DEC 20 AND OPEN FROM MONDAY JAN 6*:exclamation:"
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "Have a wonderful and safe Holiday break team, take care and see you in the New Year :party-woohoo:"
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "Stay tuned to this channel for more details, check out the <https://calendar.google.com/calendar/u/0?cid=eGVyby5jb21fbXRhc2ZucThjaTl1b3BpY284dXN0OWlhdDRAZ3JvdXAuY2FsZW5kYXIuZ29vZ2xlLmNvbQ|*Hawkes Bay Social Calendar*>, and get ready to Boost your workdays!\n\nWX Team :party-wx:"
			}
		}
	]
}
package test;

import java.io.IOException;
import java.io.PrintWriter;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@WebServlet("/insertrec")
public class insertrec extends HttpServlet {
    private static final long serialVersionUID = 1L;

    // Database connection parameters
    private final String jdbcUrl = "jdbc:mysql://localhost:3306/nehal";
    private final String dbUser = "root";
    private final String dbPassword = "nehal@123";

    protected void doPost(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        // Get user input from the form
        String id = request.getParameter("id");
        String name = request.getParameter("name");

        // Set up the response content type and output writer
        response.setContentType("text/html");
        PrintWriter out = response.getWriter();

        Connection conn = null;
        PreparedStatement pstmt = null;

        try {
            // Load the JDBC driver
            Class.forName("com.mysql.cj.jdbc.Driver");

            // Establish a connection to the database
            conn = DriverManager.getConnection(jdbcUrl, dbUser, dbPassword);

            // Prepare SQL insert query
            String sql = "INSERT INTO emp (id, name) VALUES (?, ?)";
            pstmt = conn.prepareStatement(sql);
            pstmt.setInt(1, Integer.parseInt(id)); // Set user ID
            pstmt.setString(2, name); // Set user name

            // Execute insert
            int rowsInserted = pstmt.executeUpdate();

            // Generate response to the client
            if (rowsInserted > 0) {
                out.println("<h1>Record inserted successfully for user ID: " + id + "</h1>");
            } else {
                out.println("<h1>Failed to insert the record.</h1>");
            }

        } catch (Exception e) {
            e.printStackTrace();
            out.println("<h1>Error: " + e.getMessage() + "</h1>");
        } finally {
            try {
                if (pstmt != null) pstmt.close();
                if (conn != null) conn.close();
            } catch (SQLException e) {
                e.printStackTrace();
            }
            out.close();
        }
    }

    protected void doGet(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        // Redirect to doPost for GET requests
        doPost(request, response);
    }
}
/*
<!DOCTYPE html>
<html>
<head>
    <title>Insert New User</title>
</head>
<body>
    <h2>Insert New User Information</h2>
    <form action="insertrec" method="post">
        <label for="id">User ID:</label>
        <input type="text" id="id" name="id" required><br><br>

        <label for="name">Name:</label>
        <input type="text" id="name" name="name" required><br><br>

        <input type="submit" value="Insert">
    </form>
</body>
</html>
*/
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Name and Age Form</title>
</head>
<body>
    <h1>Enter Your Details</h1>
    <form action="process.jsp" method="get">
        <label for="name">Name:</label>
        <input type="text" id="name" name="name" required>
        <br><br>
        <label for="age">Age:</label>
        <input type="number" id="age" name="age" required>
        <br><br>
        <input type="submit" value="Submit">
    </form>
</body>
</html>


process.jsp
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Processed Details</title>
</head>
<body>
    <h1>Processed Details</h1>
    <%
        // Retrieve the name and age parameters
        String name = request.getParameter("name");
        String age = request.getParameter("age");
    %>

    <p>Name: <%= name %></p>
    <p>Age: <%= age %></p>
</body>
</html>
{
	"blocks": [
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": ":star: Boost Days - Whats On This Week! :star:"
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "Mōrena Ahuriri & happy Monday! :wave:\n\nWe're excited to kick off another great week in the office with our Boost Day Program! :yay: Please see below for whats on this week :arrow-bounce:"
			}
		},
		{
			"type": "divider"
		},
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": ":calendar-date-11: Wednesday, 11th December",
				"emoji": true
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "\n:coffee: *Café Partnership*: Enjoy coffee and café-style beverages from our cafe partner, *Adoro*, located in our office building *8:00AM - 11:30AM*.\n:BREAKFAST: *Breakfast*: Provided by *Mitzi and Twinn* *9:30AM - 11:00AM* in the Kitchen."
			}
		},
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": ":calendar-date-12: Thursday, 12th December",
				"emoji": true
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": ":coffee: *Café Partnership*: Enjoy coffee and café-style beverages from our cafe partner, *Adoro*, located in our office building *8:00AM - 11:30AM*. \n:ham: *Christmas Lunch Social*: Provided by *Roam* from *12:00PM* in the Kitchen. Secret Santa, Christmas Crackers & some delish drinks to enjoy :clinking_glasses:"
			}
		},
		{
			"type": "divider"
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "*LATER THIS WEEK/MONTH:*"
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "*Wednesday, 18th December*\n:xero: *Global All Hands*: Streamed live in *Clearview* *11:00AM - 12:00PM* \n\n*Thursday, 19th December*\n:newzealand: *Aotearoa All Hands*: Streamed live in Clearview *10:30AM - 11:30AM*"
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "Stay tuned to this channel for more details, check out the <https://calendar.google.com/calendar/u/0?cid=eGVyby5jb21fbXRhc2ZucThjaTl1b3BpY284dXN0OWlhdDRAZ3JvdXAuY2FsZW5kYXIuZ29vZ2xlLmNvbQ|*Hawkes Bay Social Calendar*>, and get ready to Boost your workdays!\n\nWX Team :party-wx:"
			}
		}
	]
}
<%@ page import="java.text.SimpleDateFormat" %>
<%@ page import="java.util.Date" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>

<%
    // Hard-coded credentials
    String validUsername = "pk";
    String validPassword = "123";
    
    // Variables for handling login state
    boolean loginAttempt = request.getParameter("username") != null && request.getParameter("password") != null;
    boolean loginSuccess = false;
    boolean loginError = false;

    // Check if login form was submitted
    if (loginAttempt) {
        String username = request.getParameter("username");
        String password = request.getParameter("password");

        // Validate credentials
        if (validUsername.equals(username) && validPassword.equals(password)) {
            loginSuccess = true;
        } else {
            loginError = true;
        }
    }
%>

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="ISO-8859-1">
    <title>Login Page</title>
</head>
<body>

<% if (!loginAttempt || loginError) { %>
    <!-- Display login form if not logged in or login failed -->
    <h2>Login Page</h2>
    <form action="loginjsp.jsp" method="post">
        Username:
        <input type="text" name="username" required><br><br>
        Password:
        <input type="password" name="password" required><br><br>
        <input type="submit" value="Login">
    </form>

    <!-- Display error message if login failed -->
    <% if (loginError) { %>
        <p style="color: red;">Invalid username or password! Please try again.</p>
    <% } %>

<% } else if (loginSuccess) { %>
    <!-- Display welcome message if login was successful -->
    <h1>Welcome, <%= request.getParameter("username") %>!</h1>
    <%
        // Display current date and time
        SimpleDateFormat formatter = new SimpleDateFormat("dd-MM-yyyy HH:mm:ss");
        Date date = new Date();
    %>
    <p>Current Date and Time: <%= formatter.format(date) %></p>
<% } %>

</body>
</html>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@ page import="java.sql.*, javax.sql.*" %>


    <h2>Update Department for Employee</h2>
    <form action="updatejsp.jsp" method="post">
        <label for="id">Employee ID:</label>
        <input type="text" id="id" name="id" required><br><br>

        <label for="name">New name:</label>
        <input type="text" id="name" name="name" required><br><br>

        <input type="submit" value="Update Department">
    </form>


    <h1>Updating Department</h1>

    <%
        // Get form parameters
        String id = request.getParameter("id");
        String name = request.getParameter("name");

        // MySQL connection details
        String dbURL = "jdbc:mysql://localhost:3306/nehal"; 
        String dbUser = "root"; 
        String dbPassword = "nehal@123";

        Connection conn = null;
        PreparedStatement pstmt = null;

        try {
            // Load MySQL JDBC Driver
            Class.forName("com.mysql.cj.jdbc.Driver");

            // Establish connection
            conn = DriverManager.getConnection(dbURL, dbUser, dbPassword);

            // SQL query to update department
            String sql = "UPDATE emp SET name = ? WHERE id = ?";

            // Create PreparedStatement object
            pstmt = conn.prepareStatement(sql);

            // Set parameters
            pstmt.setString(1, name); // Set department value
            pstmt.setInt(2, Integer.parseInt(id)); // Set id value

            // Execute update query
            int rowsUpdated = pstmt.executeUpdate();

            if (rowsUpdated > 0) {
                out.println("<p>Employee department updated successfully!</p>");
            } else {
                out.println("<p>Error: Employee with ID " + id + " not found.</p>");
            }

        } catch (Exception e) {
            out.println("Error: " + e.getMessage());
        } finally {
            try {
                if (pstmt != null) pstmt.close();
                if (conn != null) conn.close();
            } catch (SQLException ex) {
                out.println("Error closing resources: " + ex.getMessage());
            }
        }
    %>
    
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@ page import="java.sql.*, javax.sql.*" %>


    <h2>Update Department for Employee</h2>
    <form action="jspinsert.jsp" method="post">
        <label for="id">Employee ID:</label>
        <input type="text" id="id" name="id" required><br><br>
 <label for="name">Employee Name:</label>
        <input type="text" id="name" name="name" required><br><br>
 
        <input type="submit" value="Insert Employee Record">
    </form>


    <h1>Inserting Employee Record</h1>

    <%
    //code snippets
        // Get form parameters
        String id = request.getParameter("id");
        String name = request.getParameter("name");
        

        // MySQL connection details
        String dbURL = "jdbc:mysql://localhost:3306/nehal"; 
        String dbUser = "root"; 
        String dbPassword = "nehal@123";

        Connection conn = null;
        PreparedStatement pstmt = null;

        try {
            // Load MySQL JDBC Driver
            Class.forName("com.mysql.cj.jdbc.Driver");

            // Establish connection
            conn = DriverManager.getConnection(dbURL, dbUser, dbPassword);

            // SQL query to update department
           String sql = "INSERT INTO emp (id,name) VALUES (?, ?)";

            // Create PreparedStatement object
            pstmt = conn.prepareStatement(sql);

            // Set parameters
            
            pstmt.setInt(1, Integer.parseInt(id)); // Set id value
            pstmt.setString(2, name); // Set department value
            
            // Execute update query
            int rowsUpdated = pstmt.executeUpdate();

            if (rowsUpdated > 0) {
                out.println("<p>Employee row inserted successfully!</p>");
            } else {
                out.println("<p>Error: Employee row cannot be inserted.</p>");
            }

        } catch (Exception e) {
            out.println("Error: " + e.getMessage());
        } finally {
            try {
                if (pstmt != null) pstmt.close();
                if (conn != null) conn.close();
            } catch (SQLException ex) {
                out.println("Error closing resources: " + ex.getMessage());
            }
        }
    %>
    
<%@ page import="java.sql.*" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Username Check</title>
</head>
<body>
<%
    String username = request.getParameter("name");

    String jdbcUrl = "jdbc:mysql://localhost:3306/nehal";
    String dbUser = "root";
    String dbPassword = "nehal@123";

    Connection conn = null;
    PreparedStatement pstmt = null;
    ResultSet rs = null;

    try {
        Class.forName("com.mysql.cj.jdbc.Driver");
        conn = DriverManager.getConnection(jdbcUrl, dbUser, dbPassword);

        String sql = "SELECT * FROM emp WHERE name = ?";
        pstmt = conn.prepareStatement(sql);
        pstmt.setString(1, username);

        rs = pstmt.executeQuery();

        if (rs.next()) {
            out.println("<h2>Success: Username '" + username + "' exists in the database.</h2>");
        } else {
            out.println("<h2>Failure: Username '" + username + "' does not exist.</h2>");
        }

    } catch (Exception e) {
        out.println("<h2>Error: " + e.getMessage() + "</h2>");
      
    } finally {
        try {
            if (rs != null) rs.close();
            if (pstmt != null) pstmt.close();
            if (conn != null) conn.close();
        } catch (SQLException e) {
           
        }
    }
%>
</body>
</html>
--html
<!DOCTYPE html>
<html>
<head>
    <title>Update User</title>
</head>
<body>
    <h2>Update User Information</h2>
    <form action="updateUser.jsp" method="post">
        <label for="id">User ID:</label>
        <input type="text" id="id" name="id" required><br><br>

        <label for="name">New Name:</label>
        <input type="text" id="name" name="name" required><br><br>

        <input type="submit" value="Update">
    </form>
</body>
</html>
  <p><?php the_field("testi-designation"); ?></p>   
Why Choose Dappfort?
  
Tailored Solutions: Dappfort works closely with clients to understand their unique needs, providing bots that are custom-built to fit specific trading goals and risk profiles.
Scalability: Whether you're a small trader or a large financial institution, Dappfort’s bots are built to scale, handling large volumes of trades across multiple exchanges with ease.

Advanced Analytics: Dappfort’s bots come with built-in analytics tools that track and display performance metrics, helping users make data-driven decisions and optimize strategies over time.

Ongoing Support: Dappfort provides continuous support and updates, ensuring that the bots remain effective and secure as market conditions evolve.

Whether you're an individual trader looking to automate your personal portfolio or a business seeking a fully integrated trading solution, Dappfort's crypto trading bot development company are designed to meet the needs of today's fast-paced cryptocurrency markets.

For more information or to get started, visit Dappfort's website or contact their team for a personalized consultation.
Crear el Archivo composer.json con Composer
Para crear un archivo composer.json en tu proyecto utilizando Composer, puedes seguir estos pasos:
1. Abre la Terminal
Navega hasta el directorio de tu proyecto donde deseas crear el archivo composer.json.
2. Ejecuta el Comando composer init
Ejecuta el siguiente comando en la terminal:

composer init

Este comando iniciará un asistente interactivo que te guiará a través del proceso de creación del archivo composer.json. Durante este proceso, se te pedirá que ingreses información como:
Nombre del paquete: El nombre de tu proyecto (por ejemplo, vendor/nombre-del-proyecto).
Descripción: Una breve descripción de lo que hace tu proyecto.
Autor: Tu nombre o el nombre del autor del proyecto.
Licencia: La licencia bajo la cual se distribuye tu proyecto (por ejemplo, MIT).
Dependencias: Puedes agregar dependencias que tu proyecto necesita. Si no estás seguro, puedes omitir este paso y agregar dependencias más tarde.
3. Completa el Asistente
Sigue las instrucciones en pantalla y completa el asistente. Al finalizar, Composer generará el archivo composer.json en el directorio actual.
4. Verifica el Archivo composer.json
Una vez que el asistente haya terminado, puedes abrir el archivo composer.json con un editor de texto para verificar que se haya creado correctamente y que contenga la información que proporcionaste.
Conclusión
Con estos pasos, habrás creado un archivo composer.json para tu proyecto utilizando Composer. Si necesitas más ayuda sobre cómo agregar dependencias o configurar tu proyecto, ¡no dudes en preguntar!
Requisitos Previos
Antes de instalar Laravel, asegúrate de tener instalados los siguientes componentes:
PHP (versión 8.0 o superior).
Composer (gestor de dependencias para PHP).
Servidor web (como Apache o Nginx).
Base de datos (como MySQL o PostgreSQL).
1. Instalar PHP y Extensiones Necesarias
Abre una terminal y ejecuta los siguientes comandos para instalar PHP y las extensiones necesarias:

sudo apt update
sudo apt install php php-cli php-mbstring php-xml php-zip php-curl php-mysql

2. Instalar Composer
Si aún no tienes Composer instalado, puedes hacerlo ejecutando:

sudo apt install composer

Verifica la instalación de Composer con:

composer --version

4. Configurar el Servidor Web
Si estás utilizando Apache, asegúrate de habilitar el módulo de reescritura:

sudo a2enmod rewrite

Luego, configura el archivo de host virtual para tu proyecto. Crea un nuevo archivo en /etc/apache2/sites-available/:

sudo nano /etc/apache2/sites-available/nombre-del-proyecto.conf

Agrega la siguiente configuración:

<VirtualHost *:80>
    ServerName nombre-del-proyecto.local
    DocumentRoot /ruta/a/tu/proyecto/public

    <Directory /ruta/a/tu/proyecto/public>
        AllowOverride All
    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>


Reemplaza /ruta/a/tu/proyecto con la ruta real a tu proyecto Laravel.
Luego, habilita el nuevo sitio y reinicia Apache:

sudo a2ensite nombre-del-proyecto
sudo systemctl restart apache2

5. Configurar el Archivo .env
Navega a la carpeta de tu proyecto y copia el archivo de ejemplo .env:

cd nombre-del-proyecto
cp .env.example .env

Luego, edita el archivo .env para configurar la conexión a la base de datos y otras configuraciones necesarias:

nano .env

6. Generar la Clave de Aplicación
Finalmente, genera la clave de aplicación de Laravel ejecutando:

php artisan key:generate


: Uncaught ArgumentCountError: Too few arguments to function CFMH_Hosting_Front::title_filter(), 1 passed in /home/1273079.cloudwaysapps.com/yrztksabwm/public_html/wp-includes/class-wp-hook.php on line 324 and exactly 2 expected in /home/1273079.cloudwaysapps.com/yrztksabwm/public_html/wp-content/plugins/captivatesync-trade/inc/class-captivate-sync-front.php:246 Stack trace: #0 /home/1273079.cloudwaysapps.com/yrztksabwm/public_html/wp-includes/class-wp-hook.php(324): CFMH_Hosting_Front::title_filter() #1 /home/1273079.cloudwaysapps.com/yrztksabwm/public_html/wp-includes/plugin.php(205): WP_Hook->apply_filters() #2 /home/1273079.cloudwaysapps.com/yrztksabwm/public_html/wp-content/themes/Divi-Child/templates/main/posts/include/prev-next-post.php(8): apply_filters() #3 /home/1273079.cloudwaysapps.com/yrztksabwm/public_html/wp-content/themes/Divi-Child/shortcodes.php(150): include('/home/1273079.c...') #4 /home/1273079.cloudwaysapps.com/yrztksabwm/public_html/wp-includes/shortcodes.php(434): prev_next_post() #5 [internal function]: do_shortcode_tag() #6 /home/1273079.cloudwaysapps.com/yrztksabwm/public_html/wp-includes/shortcodes.php(273): preg_replace_callback() #7 /home/1273079.cloudwaysapps.com/yrztksabwm/public_html/wp-content/themes/Divi/includes/builder/class-et-builder-element.php(3122): do_shortcode() #8 /home/1273079.cloudwaysapps.com/yrztksabwm/public_html/wp-includes/shortcodes.php(434): ET_Builder_Element->_render() #9 [internal function]: do_shortcode_tag() #10 /home/1273079.cloudwaysapps.com/yrztksabwm/public_html/wp-includes/shortcodes.php(273): preg_replace_callback() #11 /home/1273079.cloudwaysapps.com/yrztksabwm/public_html/wp-content/themes/Divi/includes/builder/main-structure-elements.php(3784): do_shortcode() #12 /home/1273079.cloudwaysapps.com/yrztksabwm/public_html/wp-content/themes/Divi/includes/builder/class-et-builder-element.php(3441): ET_Builder_Column->render() #13 /home/1273079.cloudwaysapps.com/yrztksabwm/public_html/wp-includes/shortcodes.php(434): ET_Builder_Element->_render() #14 [internal function]: do_shortcode_tag() #15 /home/1273079.cloudwaysapps.com/yrztksabwm/public_html/wp-includes/shortcodes.php(273): preg_replace_callback() #16 /home/1273079.cloudwaysapps.com/yrztksabwm/public_html/wp-content/themes/Divi/includes/builder/main-structure-elements.php(2274): do_shortcode() #17 /home/1273079.cloudwaysapps.com/yrztksabwm/public_html/wp-content/themes/Divi/includes/builder/class-et-builder-element.php(3441): ET_Builder_Row->render() #18 /home/1273079.cloudwaysapps.com/yrztksabwm/public_html/wp-includes/shortcodes.php(434): ET_Builder_Element->_render() #19 [internal function]: do_shortcode_tag() #20 /home/1273079.cloudwaysapps.com/yrztksabwm/public_html/wp-includes/shortcodes.php(273): preg_replace_callback() #21 /home/1273079.cloudwaysapps.com/yrztksabwm/public_html/wp-content/themes/Divi/includes/builder/main-structure-elements.php(1606): do_shortcode() #22 /home/1273079.cloudwaysapps.com/yrztksabwm/public_html/wp-content/themes/Divi/includes/builder/class-et-builder-element.php(3441): ET_Builder_Section->render() #23 /home/1273079.cloudwaysapps.com/yrztksabwm/public_html/wp-includes/shortcodes.php(434): ET_Builder_Element->_render() #24 [internal function]: do_shortcode_tag() #25 /home/1273079.cloudwaysapps.com/yrztksabwm/public_html/wp-includes/shortcodes.php(273): preg_replace_callback() #26 /home/1273079.cloudwaysapps.com/yrztksabwm/public_html/wp-includes/class-wp-hook.php(324): do_shortcode() #27 /home/1273079.cloudwaysapps.com/yrztksabwm/public_html/wp-includes/plugin.php(205): WP_Hook->apply_filters() #28 /home/1273079.cloudwaysapps.com/yrztksabwm/public_html/wp-content/themes/Divi/includes/builder/core.php(46): apply_filters() #29 /home/1273079.cloudwaysapps.com/yrztksabwm/public_html/wp-content/themes/Divi/includes/builder/frontend-builder/theme-builder/frontend.php(347): et_builder_render_layout() #30 /home/1273079.cloudwaysapps.com/yrztksabwm/public_html/wp-content/themes/Divi/includes/builder/frontend-builder/theme-builder/frontend.php(506): et_theme_builder_frontend_render_layout() #31 /home/1273079.cloudwaysapps.com/yrztksabwm/public_html/wp-content/themes/Divi/includes/builder/frontend-builder/theme-builder/frontend-body-template.php(10): et_theme_builder_frontend_render_body() #32 /home/1273079.cloudwaysapps.com/yrztksabwm/public_html/wp-includes/template-loader.php(106): include('/home/1273079.c...') #33 /home/1273079.cloudwaysapps.com/yrztksabwm/public_html/wp-blog-header.php(19): require_once('/home/1273079.c...') #34 /home/1273079.cloudwaysapps.com/yrztksabwm/public_html/index.php(17): require('/home/1273079.c...') #35 {main} thrown in
/home/1273079.cloudwaysapps.com/yrztksabwm/public_html/wp-content/plugins/captivatesync-trade/inc/class-captivate-sync-front.php
on line
246
<script>
jQuery(document).ready(function($){
    // Define the HTML structure of the fhButton
    const fhButtonTemplate = `
        <div class="fhButton">
            <a href="" style="font-size:1.15em !important; font-family: news_bold, sans-serif !important; font-weight:bold !important; letter-spacing: .7px !important; border: 2px solid #FFFFFF !important; box-shadow:none !important; padding: .2em 3.5em !important;" class="fh-lang-1 fh-button-true-flat-color">RESERVA ARA</a>
        </div>`;

    // Define hrefs and target elements for each button
    const buttonMappings = [
        {
            target: 'body > div.contenidor_centrat > div > div:nth-child(2) > div.botons_curs > a',
            href: 'https://fareharbor.com/embeds/book/unisub/?full-items=yes&flow=1283248'
        },
        {
            target: 'body > div.contenidor_centrat > div > div:nth-child(4) > div.botons_curs > a',
            href: 'https://fareharbor.com/embeds/book/unisub/items/588279/?full-items=yes&flow=1284556'
        },
        {
            target: 'body > div.contenidor_centrat > div > div:nth-child(5) > div.botons_curs > a',
            href: 'https://fareharbor.com/embeds/book/unisub/items/588275/?full-items=yes&flow=1284567'
        },
        {
            target: 'body > div.contenidor_centrat > div > div:nth-child(6) > div.botons_curs > a',
            href: 'https://fareharbor.com/embeds/book/unisub/items/588289/?full-items=yes&flow=1284557'
        },
        {
            target: 'body > div.contenidor_centrat > div > div:nth-child(7) > div.botons_curs > a',
            href: 'https://fareharbor.com/embeds/book/unisub/items/588292/?full-items=yes&flow=1284557'
        },
        {
            target: 'body > div.contenidor_centrat > div > div:nth-child(8) > div.botons_curs > a',
            href: 'https://fareharbor.com/embeds/book/unisub/items/588288/?full-items=yes&flow=1284558'
        },
        {
            target: 'body > div.contenidor_centrat > div > div:nth-child(9) > div.botons_curs > a',
            href: 'https://fareharbor.com/embeds/book/unisub/items/588344/?full-items=yes'
        }
    ];

    // Loop through button mappings to replace each target with customized fhButton
    buttonMappings.forEach(function(mapping) {
        // Create a jQuery object from the button template
        const fhButton = $(fhButtonTemplate);
        // Set the href attribute for the button's anchor tag
        fhButton.find('a').attr('href', mapping.href);
        // Replace the target element with the customized button
        $(mapping.target).replaceWith(fhButton);
    });

    // Language-based text translation for buttons
    const path = window.location.pathname;
    const translations = {
        '/ca/': 'RESERVA ARA',
        '/it/': 'PRENOTA ORA',
        '/pt/': 'RESERVE AGORA',
        '/es/': 'RESERVA AHORA',
        '/de/': 'JETZT BUCHEN',
        '/nl/': 'BOEK NU',
        '/fr/': 'RÉSERVEZ MAINTENANT',
        '/en/': 'BOOK NOW'
    };

    // Find the correct translation based on the path
    for (const [langPath, text] of Object.entries(translations)) {
        if (path.includes(langPath)) {
            $('a.fh-lang-1').text(text);
            break;
        }
    }
});
</script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz" crossorigin="anonymous"></script>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
import com.atlassian.jira.component.ComponentAccessor

def groupManager = ComponentAccessor.getGroupManager()
def groups = groupManager.getAllGroups()
def sb = []
//Define a string buffer to hold the results

sb.add("<br>Group Name, Active User Count, Inactive User Count, Total User Count")
//Add a header to the buffer
groups.each{ group ->

 def activeUsers = 0
 def inactiveUsers = 0
 Each time we iterate over a new group, the count of active/inactive users gets set back to zero
 def groupMembers = groupManager.getUsersInGroup(group)
 //For each group, fetch the members of the group
    
    groupMembers.each{ member ->
    //Process each member of each group
        
    def memberDetails = ComponentAccessor.getUserManager().getUserByName(member.name)
    //We have to fetch the full user object, using the *name* attribute of the group member
        
        if(memberDetails.isActive()){
            activeUsers += 1 
        }else{
            inactiveUsers += 1
        }
    }//Increment the count of inactive or active users, depending on the current user's status
    
sb.add("<br>"+group.name + ", " + activeUsers + ", " + inactiveUsers+ ", " + (activeUsers + inactiveUsers))
//Add the results to the buffer
}
return sb
//Return the results
star

Fri Nov 15 2024 14:42:59 GMT+0000 (Coordinated Universal Time)

@signup_returns

star

Fri Nov 15 2024 14:34:58 GMT+0000 (Coordinated Universal Time)

@signup_returns

star

Fri Nov 15 2024 14:26:12 GMT+0000 (Coordinated Universal Time)

@varuntej #kotlin

star

Fri Nov 15 2024 14:16:10 GMT+0000 (Coordinated Universal Time)

@usman13

star

Fri Nov 15 2024 14:06:25 GMT+0000 (Coordinated Universal Time)

@login123

star

Fri Nov 15 2024 14:03:45 GMT+0000 (Coordinated Universal Time)

@varuntej #kotlin

star

Fri Nov 15 2024 14:00:52 GMT+0000 (Coordinated Universal Time)

@wtlab

star

Fri Nov 15 2024 13:48:34 GMT+0000 (Coordinated Universal Time)

@wtlab

star

Fri Nov 15 2024 13:27:15 GMT+0000 (Coordinated Universal Time)

@wtlab

star

Fri Nov 15 2024 13:26:53 GMT+0000 (Coordinated Universal Time)

@wtlab

star

Fri Nov 15 2024 13:18:09 GMT+0000 (Coordinated Universal Time)

@login123

star

Fri Nov 15 2024 12:45:57 GMT+0000 (Coordinated Universal Time)

@login123

star

Fri Nov 15 2024 12:31:50 GMT+0000 (Coordinated Universal Time)

@wtlab

star

Fri Nov 15 2024 12:30:38 GMT+0000 (Coordinated Universal Time)

@wtlab

star

Fri Nov 15 2024 12:27:51 GMT+0000 (Coordinated Universal Time)

@wtlab

star

Fri Nov 15 2024 12:27:24 GMT+0000 (Coordinated Universal Time)

@login123

star

Fri Nov 15 2024 12:18:54 GMT+0000 (Coordinated Universal Time) https://codevita.tcsapps.com/OpenCodeEditor?problemid

@Akshatjoshi #undefined

star

Fri Nov 15 2024 12:18:14 GMT+0000 (Coordinated Universal Time)

@RehmatAli2024 #deluge

star

Fri Nov 15 2024 11:55:08 GMT+0000 (Coordinated Universal Time)

@RehmatAli2024 #deluge

star

Fri Nov 15 2024 11:27:38 GMT+0000 (Coordinated Universal Time)

@wtlab

star

Fri Nov 15 2024 10:46:39 GMT+0000 (Coordinated Universal Time)

@prasanna

star

Fri Nov 15 2024 10:33:46 GMT+0000 (Coordinated Universal Time)

@login123

star

Fri Nov 15 2024 09:13:35 GMT+0000 (Coordinated Universal Time)

@signup1

star

Fri Nov 15 2024 08:42:12 GMT+0000 (Coordinated Universal Time) https://api.jquery.com/addClass/

@nagarjun

star

Fri Nov 15 2024 08:39:16 GMT+0000 (Coordinated Universal Time) https://jquery.com/

@nagarjun

star

Fri Nov 15 2024 08:23:40 GMT+0000 (Coordinated Universal Time) https://community.dynamics.com/blogs/post/?postid

@pavankkm

star

Fri Nov 15 2024 08:17:18 GMT+0000 (Coordinated Universal Time)

@login123

star

Fri Nov 15 2024 08:03:32 GMT+0000 (Coordinated Universal Time)

@login123

star

Fri Nov 15 2024 07:22:49 GMT+0000 (Coordinated Universal Time) https://majestic.com/account/register

@motaztellawi

star

Fri Nov 15 2024 07:21:36 GMT+0000 (Coordinated Universal Time)

@wtlab

star

Fri Nov 15 2024 06:56:38 GMT+0000 (Coordinated Universal Time)

@FOHWellington

star

Fri Nov 15 2024 06:53:33 GMT+0000 (Coordinated Universal Time)

@FOHWellington

star

Fri Nov 15 2024 06:48:07 GMT+0000 (Coordinated Universal Time)

@FOHWellington

star

Fri Nov 15 2024 06:47:18 GMT+0000 (Coordinated Universal Time)

@wtlab

star

Fri Nov 15 2024 06:41:26 GMT+0000 (Coordinated Universal Time)

@wtlab

star

Fri Nov 15 2024 06:39:42 GMT+0000 (Coordinated Universal Time)

@FOHWellington

star

Fri Nov 15 2024 06:34:14 GMT+0000 (Coordinated Universal Time)

@wtlab

star

Fri Nov 15 2024 06:16:20 GMT+0000 (Coordinated Universal Time)

@wtlab

star

Fri Nov 15 2024 06:07:05 GMT+0000 (Coordinated Universal Time)

@wtlab

star

Fri Nov 15 2024 05:08:42 GMT+0000 (Coordinated Universal Time)

@signup1

star

Fri Nov 15 2024 00:01:10 GMT+0000 (Coordinated Universal Time)

@shahmeeriqbal

star

Thu Nov 14 2024 20:19:23 GMT+0000 (Coordinated Universal Time) https://www.dappfort.com/crypto-trading-bot-development/

@shakthichinnah #javascript #dappfort #cryptocurrencyexchange #crypto #trading #cryptocurrency #blockchain

star

Thu Nov 14 2024 18:26:55 GMT+0000 (Coordinated Universal Time)

@jrg_300i #undefined

star

Thu Nov 14 2024 18:23:46 GMT+0000 (Coordinated Universal Time)

@jrg_300i #undefined

star

Thu Nov 14 2024 17:11:32 GMT+0000 (Coordinated Universal Time) https://pharmacyedge.com/considering-selling-discover-the-impact-of-new-capital-gains-rules-on-your-profits/

@Jaidanammar

star

Thu Nov 14 2024 15:58:38 GMT+0000 (Coordinated Universal Time)

@Shira

star

Thu Nov 14 2024 15:17:12 GMT+0000 (Coordinated Universal Time) https://cs50.harvard.edu/web/2020/projects/0/search/

@SamiraYS

star

Thu Nov 14 2024 14:44:55 GMT+0000 (Coordinated Universal Time) https://getbootstrap.com/

@SamiraYS

star

Thu Nov 14 2024 14:44:49 GMT+0000 (Coordinated Universal Time) https://getbootstrap.com/

@SamiraYS

star

Thu Nov 14 2024 13:27:34 GMT+0000 (Coordinated Universal Time)

@belleJar #groovy

Save snippets that work with our extensions

Available in the Chrome Web Store Get Firefox Add-on Get VS Code extension