Snippets Collections
import java.util.ArrayList;
import java.util.Scanner;

public class StudentInformationSystem {

    private static ArrayList<Student> students = new ArrayList<>();
    private static Scanner scanner = new Scanner(System.in);

    public static void main(String[] args) {
        while (true) {
            displayMenu();
            int choice = scanner.nextInt();
            scanner.nextLine(); // Consume the newline character

            switch (choice) {
                case 1:
                    addStudent();
                    break;
                case 2:
                    viewStudentList();
                    break;
                case 3:
                    searchStudent();
                    break;
                case 4:
                    System.out.println("Exiting program. Goodbye!");
                    System.exit(0);
                default:
                    System.out.println("Invalid choice. Please try again.");
            }
        }
    }

    private static void displayMenu() {
        System.out.println("Student Information System Menu:");
        System.out.println("1. Add Student");
        System.out.println("2. View Student List");
        System.out.println("3. Search for Student");
        System.out.println("4. Exit");
        System.out.print("Enter your choice: ");
    }

    private static void addStudent() {
        System.out.print("Enter student ID: ");
        int id = scanner.nextInt();
        scanner.nextLine(); // Consume the newline character

        System.out.print("Enter student name: ");
        String name = scanner.nextLine();

        students.add(new Student(id, name));
        System.out.println("Student added successfully!");
    }

    private static void viewStudentList() {
        if (students.isEmpty()) {
            System.out.println("No students in the system yet.");
        } else {
            System.out.println("Student List:");
            for (Student student : students) {
                System.out.println("ID: " + student.getId() + ", Name: " + student.getName());
            }
        }
    }

    private static void searchStudent() {
        System.out.print("Enter student ID to search: ");
        int searchId = scanner.nextInt();
        scanner.nextLine(); // Consume the newline character

        boolean found = false;
        for (Student student : students) {
            if (student.getId() == searchId) {
                System.out.println("Student found: ID: " + student.getId() + ", Name: " + student.getName());
                found = true;
                break;
            }
        }

        if (!found) {
            System.out.println("Student with ID " + searchId + " not found.");
        }
    }

    private static class Student {
        private int id;
        private String name;

        public Student(int id, String name) {
            this.id = id;
            this.name = name;
        }

        public int getId() {
            return id;
        }

        public String getName() {
            return name;
        }
    }
}
//////////////////////////////// TESTING USER FETCHING FROM ANOTHER SHEET ////////////////////////////////

function fetchUserData_TEST() {
  var sourceSheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("ResponseSheet TEST");
  var destinationSheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Users_to_WE TEST");

  var sourceData = sourceSheet.getDataRange().getValues();
  var destinationData = destinationSheet.getDataRange().getValues();

  if (destinationData.length < sourceData.length) {
    var newRows = sourceData.slice(destinationData.length);
    for (var i = 0; i < newRows.length; i++) {
      var row = destinationData.length + i + 1; // 1-based index
      var email = newRows[i][1];
      var phone = newRows[i][2];
      phone = (phone.length === 10) ? "91" + phone : phone;
      var name = newRows[i][3];

      if (name && email && phone) {
        var prefix = "test1_"
        var startCounter = 300000
        var uniqueUserId = generateUserId(row, prefix, startCounter);
        destinationSheet.getRange(row, 1).setValue(uniqueUserId);
        destinationSheet.getRange(row, 2).setValue(email);
        destinationSheet.getRange(row, 3).setValue(phone);
        destinationSheet.getRange(row, 4).setValue(name);
        destinationSheet.getRange(row, 5).setValue("TRUE");
      }
    }
  }
  print("Done Test Fetching!");
}

//////////////////////////////// TESTING USER INTEGRATING API ////////////////////////////////

function pushUsersDataToWE_TEST_USERS() {
  var mapper_keys = map_keys('Users_to_WE TEST')
  SpreadsheetApp.flush()

  fetchUserData_TEST();

  var webEngageSheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName('Users_to_WE TEST');

  var StartRow = 2;
  var RowRange = webEngageSheet.getLastRow() - StartRow + 1;
  var WholeRange = webEngageSheet.getRange(StartRow, 1, RowRange, 6);
  var AllValues = WholeRange.getDisplayValues();

  var headers = {
    "Authorization": "Bearer " + webEngageApiKey,
    "Content-Type": "application/json"
  }

  var usersUrl = webEngageUrl + "v1/accounts/" + webEngageLicense + "/bulk-users";

  var userList = [];
  var batchSize = 25;

  for (var idx in AllValues) {
    var currentRow = AllValues[idx];
    var status = currentRow[mapper_keys['status']];

    if (status !== "Success" && status !== "Error" && status !== "User Integrated") {
      var user_id = String(currentRow[mapper_keys['user_id']]);
      var email = String(currentRow[mapper_keys['email']]);
      var mobile = String(currentRow[mapper_keys['phone']]);
      var name = String(currentRow[mapper_keys['first_name']]);

      if (email != "#ERROR!" && mobile != "#ERROR!" && name != "#ERROR!" && mobile.length >= 10) {
        var user = {
          'userId': user_id,
          'email': email,
          'firstName': name,
          'phone': mobile,
          'whatsappOptIn': true,
        };
        userList.push(user)

        if (userList.length === batchSize) {
          var payload = { "users": userList }
          payload = JSON.stringify(payload);

          var [uploadResponse, respStatus] = callApi(usersUrl, "post", payload, headers);

          if (respStatus != 201) {
            print(payload);
            print(respStatus);
          }

          var userList = [];
        }
        if (idx % 100 === 0) {
          Utilities.sleep(5000);
        }
        webEngageSheet.getRange(parseInt(idx) + StartRow, mapper_keys['status'] + 1).setValue('User Integrated');
      }
      else {
        webEngageSheet.getRange(parseInt(idx) + StartRow, mapper_keys['status'] + 1).setValue('Error');
      }
    }
  }
  if (userList.length > 0) {
    var payload = { "users": userList }
    payload = JSON.stringify(payload);

    var [uploadResponse, respStatus] = callApi(usersUrl, "post", payload, headers);

    if (respStatus != 201) {
      print(payload);
      print(respStatus);
    }
    print(uploadResponse)
  }

  print("Done Test Integration!");
}

//////////////////////////////// TESTING EVENT API ////////////////////////////////

function pushUsersDataToWE_TEST_EVENTS() {
  var mapper_keys = map_keys('Users_to_WE TEST')
  SpreadsheetApp.flush()

  var webEngageSheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName('Users_to_WE TEST');

  var StartRow = 2;
  var RowRange = webEngageSheet.getLastRow() - StartRow + 1;
  var WholeRange = webEngageSheet.getRange(StartRow, 1, RowRange, 6);
  var AllValues = WholeRange.getDisplayValues();

  var headers = {
    "Authorization": "Bearer " + webEngageApiKey,
    "Content-Type": "application/json"
  }

  var eventUserList = [];
  var batchSize = 25;

  var eventsUrl = webEngageUrl + "v1/accounts/" + webEngageLicense + "/bulk-events";

  var eventName = "Testing User Event 2";

  for (var idx in AllValues) {
    var currentRow = AllValues[idx];
    var status = currentRow[mapper_keys['status']];

    if (status === "User Integrated") {
      var user_id = String(currentRow[mapper_keys['user_id']]);
      if (user_id) {
        var eventUser = {
          "userId": user_id,
          "eventName": eventName
        };
        eventUserList.push(eventUser)

        if (eventUserList.length === batchSize) {
          var payload = { "events": eventUserList }
          payload = JSON.stringify(payload);

          var [uploadResponse, respStatus] = callApi(eventsUrl, "post", payload, headers);

          if (respStatus != 201) {
            print(payload);
            print(respStatus);
          }

          var eventUserList = [];
        }
        if (idx % 100 === 0) {
          Utilities.sleep(5000);
        }
        webEngageSheet.getRange(parseInt(idx) + StartRow, mapper_keys['status'] + 1).setValue('Success');
      }
      else {
        webEngageSheet.getRange(parseInt(idx) + StartRow, mapper_keys['status'] + 1).setValue('Error');
      }
    }
  }

  if (eventUserList.length > 0) {
    var payload = { "events": eventUserList }
    payload = JSON.stringify(payload);

    var [uploadResponse, respStatus] = callApi(eventsUrl, "post", payload, headers);

    if (respStatus != 201) {
      print(payload);
      print(respStatus);
    }
    print(uploadResponse)
    print(payload)
    print(respStatus)
  }

  print("Done Test Event!")
}
/* Import Google font - Poppins */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600&display=swap');

/* Global styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Poppins", sans-serif;
}

body {
  background: #E3F2FD;
}

/* Chatbot toggler button */
.chatbot-toggler {
  position: fixed;
  bottom: 30px;
  right: 35px;
  outline: none;
  border: none;
  height: 50px;
  width: 50px;
  display: flex;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #724ae8;
  transition: all 0.2s ease;
}

body.show-chatbot .chatbot-toggler {
  transform: rotate(90deg);
}

.chatbot-toggler span {
  color: #fff;
  position: absolute;
}

.chatbot-toggler span:last-child,
body.show-chatbot .chatbot-toggler span:first-child  {
  opacity: 0;
}

body.show-chatbot .chatbot-toggler span:last-child {
  opacity: 1;
}

/* Chatbot container */
.chatbot {
  position: fixed;
  right: 35px;
  bottom: 90px;
  width: 420px;
  background: #fff;
  border-radius: 15px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: scale(0.5);
  transform-origin: bottom right;
  box-shadow: 0 0 128px 0 rgba(0,0,0,0.1),
              0 32px 64px -48px rgba(0,0,0,0.5);
  transition: all 0.1s ease;
}

body.show-chatbot .chatbot {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}

/* Chatbot header */
.chatbot header {
  padding: 16px 0;
  position: relative;
  text-align: center;
  color: #fff;
  background: #724ae8;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

header h2 {
  font-size: 1.4rem;
}

.chatbot header span {
  position: absolute;
  right: 15px;
  top: 50%;
  display: none;
  cursor: pointer;
  transform: translateY(-50%);
}

/* Chatbox styles */
.chatbot .chatbox {
  overflow-y: auto;
  height: 510px;
  padding: 30px 20px 100px;
}

/* Scrollbar styles */
.chatbot :where(.chatbox, textarea)::-webkit-scrollbar {
  width: 6px;
}

.chatbot :where(.chatbox, textarea)::-webkit-scrollbar-track {
  background: #fff;
  border-radius: 25px;
}

.chatbot :where(.chatbox, textarea)::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 25px;
}

/* Chat message styles */
.chatbox .chat {
  display: flex;
  list-style: none;
}

.chatbox .outgoing {
  margin: 20px 0;
  justify-content: flex-end;
}

.chatbox .incoming span {
  width: 32px;
  height: 32px;
  color: #fff;
  cursor: default;
  text-align: center;
  line-height: 32px;
  align-self: flex-end;
  background: #724ae8;
  border-radius: 4px;
  margin: 0 10px 7px 0;
}

.chatbox .chat p {
  white-space: pre-wrap;
  padding: 12px 16px;
  border-radius: 10px 10px 0 10px;
  max-width: 75%;
  color: #fff;
  font-size: 0.95rem;
  background: #724ae8;
}

.chatbox .incoming p {
  border-radius: 10px 10px 10px 0;
}

.chatbox .chat p.error {
  color: #721c24;
  background: #f8d7da;
}

.chatbox .incoming p {
  color: #000;
  background: #f2f2f2;
}

/* Chat input styles */
.chatbot .chat-input {
  display: flex;
  gap: 5px;
  position: absolute;
  bottom: 0;
  width: 100%;
  background: #fff;
  padding: 3px 20px;
  border-top: 1px solid #ddd;
}

.chat-input textarea {
  height: 55px;
  width: 100%;
  border: none;
  outline: none;
  resize: none;
  max-height: 180px;
  padding: 15px 15px 15px 0;
  font-size: 0.95rem;
}

.chat-input span {
  align-self: flex-end;
  color: #724ae8;
  cursor: pointer;
  height: 55px;
  display: flex;
  align-items: center;
  visibility: hidden;
  font-size: 1.35rem;
}

.chat-input textarea:valid ~ span {
  visibility: visible;
}

/* Responsive styles for smaller screens */
@media (max-width: 490px) {
  .chatbot-toggler {
    right: 20px;
    bottom: 20px;
  }

  .chatbot {
    right: 0;
    bottom: 0;
    height: 100%;
    border-radius: 0;
    width: 100%;
  }

  .chatbot .chatbox {
    height: 90%;
    padding: 25px 15px 100px;
  }

  .chatbot .chat-input {
    padding: 5px 15px;
  }

  .chatbot header span {
    display: block;
  }
}
const chatbotToggler = document.querySelector(".chatbot-toggler");
const closeBtn = document.querySelector(".close-btn");
const chatbox = document.querySelector(".chatbox");
const chatInput = document.querySelector(".chat-input textarea");
const sendChatBtn = document.querySelector(".chat-input span");

let userMessage = null; // Variable to store user's message
const API_KEY = "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"; // Paste your API key here
const inputInitHeight = chatInput.scrollHeight;

const createChatLi = (message, className) => {
    // Create a chat <li> element with passed message and className
    const chatLi = document.createElement("li");
    chatLi.classList.add("chat", `${className}`);
    let chatContent = className === "outgoing" ? `<p></p>` : `<span class="material-symbols-outlined">smart_toy</span><p></p>`;
    chatLi.innerHTML = chatContent;
    chatLi.querySelector("p").textContent = message;
    return chatLi; // return chat <li> element
}

const generateResponse = (chatElement) => {
    const API_URL = "https://api.openai.com/v1/chat/completions";
    const messageElement = chatElement.querySelector("p");

    // Define the properties and message for the API request
    const requestOptions = {
        method: "POST",
        headers: {
            "Content-Type": "application/json",
            "Authorization": `Bearer ${API_KEY}`
        },
        body: JSON.stringify({
            model: "gpt-3.5-turbo",
            messages: [{role: "user", content: userMessage}],
        })
    }

    // Send POST request to API, get response and set the reponse as paragraph text
    fetch(API_URL, requestOptions).then(res => res.json()).then(data => {
        messageElement.textContent = data.choices[0].message.content.trim();
    }).catch(() => {
        messageElement.classList.add("error");
        messageElement.textContent = "Oops! Something went wrong. Please try again.";
    }).finally(() => chatbox.scrollTo(0, chatbox.scrollHeight));
}

const handleChat = () => {
    userMessage = chatInput.value.trim(); // Get user entered message and remove extra whitespace
    if(!userMessage) return;

    // Clear the input textarea and set its height to default
    chatInput.value = "";
    chatInput.style.height = `${inputInitHeight}px`;

    // Append the user's message to the chatbox
    chatbox.appendChild(createChatLi(userMessage, "outgoing"));
    chatbox.scrollTo(0, chatbox.scrollHeight);
    
    setTimeout(() => {
        // Display "Thinking..." message while waiting for the response
        const incomingChatLi = createChatLi("Thinking...", "incoming");
        chatbox.appendChild(incomingChatLi);
        chatbox.scrollTo(0, chatbox.scrollHeight);
        generateResponse(incomingChatLi);
    }, 600);
}

chatInput.addEventListener("input", () => {
    // Adjust the height of the input textarea based on its content
    chatInput.style.height = `${inputInitHeight}px`;
    chatInput.style.height = `${chatInput.scrollHeight}px`;
});

chatInput.addEventListener("keydown", (e) => {
    // If Enter key is pressed without Shift key and the window 
    // width is greater than 800px, handle the chat
    if(e.key === "Enter" && !e.shiftKey && window.innerWidth > 800) {
        e.preventDefault();
        handleChat();
    }
});

sendChatBtn.addEventListener("click", handleChat);
closeBtn.addEventListener("click", () => document.body.classList.remove("show-chatbot"));
chatbotToggler.addEventListener("click", () => document.body.classList.toggle("show-chatbot"));
function prefix_add_footer_styles() {
	wp_enqueue_style( 'child-main-styles', get_stylesheet_directory_uri() . '/style.css' , '', '');
};
add_action( 'get_footer', 'prefix_add_footer_styles' );
I wonder why people choose on-demand applications over traditional business models. With the fact that the market value of the On Demand Services app is predicted to expand by $335 Billion by 2025. It is secure enough to say that the economy of on-demand is drastically enlarging at a rapid pace. 

Here let’s see the popular industries that leverage the On-demand applications.

Food Delivery
E-commerce & Retail
Transportation

When it comes to developing an on-demand application for your business, Maticz provides you the cutting-edge solutions with their On-demand app development. Their team of proficient developers and designers is equipped with the knowledge and talents that are required to develop an innovative and user-friendly app that will assist you in reaching your desired goals. By hiring on-demand app developers in India you can develop an application that provides convenience, saves your precious time, is cost-effective, offers more opportunities, is eco-friendly, and is user-friendly. 
from fastapi import FastAPI, HTTPException, Security, status
from fastapi.security import APIKeyHeader


api_keys = [
    "my_api_key"
]

app = FastAPI()

api_key_header = APIKeyHeader(name="X-API-Key")

def get_api_key(api_key_header: str = Security(api_key_header)) -> str:
    if api_key_header in api_keys:
        return api_key_header
    raise HTTPException(
        status_code=status.HTTP_401_UNAUTHORIZED,
        detail="Invalid or missing API Key",
    )

@app.get("/protected")
def protected_route(api_key: str = Security(get_api_key)):
    # Process the request for authenticated users
    return {"message": "Access granted!"}

if __name__ == "__main__":
    import uvicorn
    uvicorn.run(app, host="0.0.0.0", port=8000)


wget https://blah/blah/stats --header="X-API-Key: key1"
from fastapi import FastAPI
from fastapi.responses import StreamingResponse
import io
import pandas as pd

app = FastAPI()

@app.get("/get_csv")
async def get_csv():
    df = pd.DataFrame(dict(col1 = 1, col2 = 2), index=[0])
    stream = io.StringIO()
    df.to_csv(stream, index = False)
    response = StreamingResponse(iter([stream.getvalue()]),
                                 media_type="text/csv"
                                )
    response.headers["Content-Disposition"] = "attachment; filename=export.csv"
    return response
  const updateHandler = async () => {
    const code = tabs[activeIndex]?.code;

    const updateQueryData = {
      queryName: tabs[activeIndex]?.name,
      query: code,
      email: user.email,
    };
    const updatedQuery = await QueryDataService.updateQuery(
      tabs[activeIndex].id,
      updateQueryData,
    );
    console.log('A========>', savedQueryList);
    const findSavedIndex = savedQueryList.findIndex(
      (query) => query.id === updatedQuery.id,
    );
    tabs[activeIndex] = {
      ...tabs[activeIndex],
      code: updatedQuery.query,
      name: updatedQuery.queryName,
      email: updatedQuery.email,
      id: updatedQuery.id,
      ismodified: false 
    };
    if (findSavedIndex > -1) {
      savedQueryList[findSavedIndex] = {
        ...updatedQuery,
      };
    }
    setSavedQueryList([...savedQueryList]);
    setTabs([...tabs]);
    // showUpdate();
  };
//{ Driver Code Starts
// C++ program to remove recurring digits from
// a given number
#include <bits/stdc++.h>
using namespace std;


// } Driver Code Ends
    

class Solution{
    //Function to find the leaders in the array.
    public:
    vector<int> leaders(int a[], int n)
    {
        vector<int>ans;
      for(int i=0 ; i<n ; i++)
      {
          int j;
          for( j=i+1 ; j<n ; j++)
          {
              if(a[i]<a[j])
              {
                  break;
              }
            
          }
           if(j==n)
              {
                  ans.push_back(a[i]);
              }
      }
    return ans;
        
    }
};

//{ Driver Code Starts.

int main()
{
   long long t;
   cin >> t;//testcases
   while (t--)
   {
       long long n;
       cin >> n;//total size of array
        
        int a[n];
        
        //inserting elements in the array
        for(long long i =0;i<n;i++){
            cin >> a[i];
        }
        Solution obj;
        //calling leaders() function
        vector<int> v = obj.leaders(a, n);
        
        //printing elements of the vector
        for(auto it = v.begin();it!=v.end();it++){
            cout << *it << " ";
        }
        
        cout << endl;

   }
}

// } Driver Code Ends



//{ Driver Code Starts
// C++ program to remove recurring digits from
// a given number
#include <bits/stdc++.h>
using namespace std;


// } Driver Code Ends
    

class Solution{
    //Function to find the leaders in the array.
    public:
   vector<int> leaders(int a[], int n)
    {
        vector<int>v;
        int maxi=INT_MIN;
        for(int i=n-1 ; i>=0 ; i--)
        {
            if(a[i]>=maxi)
            {
                maxi=a[i];
                v.push_back(maxi);
            }
        }
        reverse(v.begin(),v.end());
        return v;
    }
};

//{ Driver Code Starts.

int main()
{
   long long t;
   cin >> t;//testcases
   while (t--)
   {
       long long n;
       cin >> n;//total size of array
        
        int a[n];
        
        //inserting elements in the array
        for(long long i =0;i<n;i++){
            cin >> a[i];
        }
        Solution obj;
        //calling leaders() function
        vector<int> v = obj.leaders(a, n);
        
        //printing elements of the vector
        for(auto it = v.begin();it!=v.end();it++){
            cout << *it << " ";
        }
        
        cout << endl;

   }
}

// } Driver Code Ends
@import url('https://fonts.googleapis.com/css2?family=Montserrat&family=Nunito+Sans:opsz@6..12&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    outline: none;
    text-decoration: none;
    color: var(--text-color);
    font-family: 'Nunito Sans', sans-serif;
    user-select: none;
}

:root{
    /* --primary-color: #3498db; */
    --primary-color: #1e90ff;
    --secondary-color: #f5f5f5;
    --white:#fefefe;
    --dark:#303030;
    --text-color:#4a4a4a;
    --border:#eee;
    --border-focus:#bbb;
}

*::selection {
    background-color: var(--primary-color);
    color: var(--white);
}

*::-webkit-scrollbar {
    height: .5rem;
    width: 4px;
}

*::-webkit-scrollbar-track {
    /* background-color: var(--secondary-color); */
    background-color: transparent;
}

*::-webkit-scrollbar-thumb {
    background-color: var(--primary-color);
    border-radius: 0;
}

html {
    /* font-size: 62.5%; */
    overflow-x: hidden;
    scroll-behavior: smooth;
    scroll-padding-top: 10rem;
}
Alternate command for 1 GPU:

sockeye-train \
    --prepared-data prepared --validation-source dev.en.bpe \
    --validation-target dev.de.bpe --output model --num-layers 6 \
    --transformer-model-size 1024 --transformer-attention-heads 16 \
    --transformer-feed-forward-num-hidden 4096 --amp --batch-type max-word \
    --batch-size 5000 --update-interval 80 --checkpoint-interval 500 \
    --max-updates 15000 --optimizer-betas 0.9:0.98 \
    --initial-learning-rate 0.06325 \
    --learning-rate-scheduler-type inv-sqrt-decay --learning-rate-warmup 4000 \
    --seed 1
<?php

/**

 * The template for displaying the footer.

 *

 * @package GeneratePress

 */

​

if ( ! defined( 'ABSPATH' ) ) {

    exit; // Exit if accessed directly.

}

?>

​

    </div>

</div>

​

<?php

/**

 * generate_before_footer hook.

 *

 * @since 0.1

 */

do_action( 'generate_before_footer' );

?>

​

<div <?php generate_do_attr( 'footer' ); ?>>

    <?php

    /**

     * generate_before_footer_content hook.

     *

     * @since 0.1

     */

    do_action( 'generate_before_footer_content' );

​

    /**

     * generate_footer hook.

     *

     * @since 1.3.

     *

     * @hooked generate_construct_footer_widgets - 5

     * @hooked generate_construct_footer - 10

     */
42
    do_action( 'generate_footer' );

​

    /**

     * generate_after_footer_content hook.

     *
let iframe = document.createElement("iframe");
iframe.src = "https://en.wikipedia.org/wiki/Main_Page";
document.body.appendChild(iframe);
//{ Driver Code Starts
#include <iostream>
using namespace std;


// } Driver Code Ends
class Solution{
    public:
    // Function to find equilibrium point in the array.
    // a: input array
    // n: size of array
    int equilibriumPoint(long long a[], int n) 
    {
        int i=0;
        int curr=0;
        int sum=0;
        for(int i=0 ; i<n ; i++)
        {
            sum+=a[i];
        }
        while(i<n)
        {
            curr+=a[i];
            if(curr==sum)
            {
                return i+1;
            }
            else
            {
                sum-=a[i];
            }
            i++;
        }
        return -1;
    }

};

//{ Driver Code Starts.


int main() {

    long long t;
    
    //taking testcases
    cin >> t;

    while (t--) {
        long long n;
        
        //taking input n
        cin >> n;
        long long a[n];

        //adding elements to the array
        for (long long i = 0; i < n; i++) {
            cin >> a[i];
        }
        
        Solution ob;

        //calling equilibriumPoint() function
        cout << ob.equilibriumPoint(a, n) << endl;
    }
    return 0;
}

// } Driver Code Ends
 if(n<m) return "No";
    
    map<int,int> mp;
    for(int i=0;i<n;i++)
    {
        mp[a1[i]]++;
    }
    
    for(int i=0;i<m;i++)
    {
        if(mp.find(a2[i]) != mp.end())
        {
            if(mp[a2[i]] == 0)
            {
                return "No";
            }
            
            mp[a2[i]]--;
            
            continue;
        }else{
            return "No";
        }
    }
    return "Yes";
}





string isSubset(int a1[], int a2[], int n, int m)
{
      int i=0;
      int count=0;
	int j=0;
	sort(a1,a1+n);

    sort(a2,a2+m);
	while(i<n and j<m)
		{
			if(a1[i]==a2[j])
			{
			    i++;
				j++;
				count++;
		
			}
			else if(a1[i]<a2[j])
			{
			    i++;
			}
			else
			{
			    return "No";
			}
		
		}
	if(count==m)
	{
		return "Yes";
	}
	return "No";
}
add_filter( 'elementor_pro/custom_fonts/font_display', function( $current_value, $font_family, $data ) {
	if ( 'Lobster' === $font_family ) {
		$current_value = 'block';
	}
	return $current_value;
}, 10, 3 );
add_filter( 'elementor_pro/custom_fonts/font_display', function( $current_value, $font_family, $data ) {
	return 'swap';
}, 10, 3 );
// App.js

import React from 'react';
import Header from './landing/Header'; // welcome, mrs. header component
import Bed from './landing/Bed'; // and welcome, mr. bed component, to your beautiful new home
import './App.css'; // we'll talk about CSS soon

function App() {
  return (
    <div className="App">
      <Header />
      <Bed />
    </div>
  );
}

export default App; 
def is_staircase(nums):
    col_length = 0
    staircase = []
    input_list = nums.copy()

    while len(input_list) > 0:
        col_length = col_length + 1
        column = []

        for i in range(0, col_length):
            column.append(input_list.pop(0))

            if (len(input_list) == 0):
                if i < col_length - 1:
                    return False
                staircase.append(column)
                return staircase
        staircase.append(column)
#include <stdio.h>
#include <stdlib.h>
 
/* A binary tree node has data, pointer to left child
   and a pointer to right child */
struct node {
    char data;
    struct node* left;
    struct node* right;
};
 
/* Prototypes for utility functions */
int search(char arr[], int strt, int end, char value);
struct node* newNode(char data);
 
/* Recursive function to construct binary of size len from
   Inorder traversal in[] and Preorder traversal pre[].  Initial values
   of inStrt and inEnd should be 0 and len -1.  The function doesn't
   do any error checking for cases where inorder and preorder
   do not form a tree */
struct node* buildTree(char in[], char pre[], int inStrt, int inEnd)
{
    static int preIndex = 0;
 
    if (inStrt > inEnd)
        return NULL;
 
    /* Pick current node from Preorder traversal using preIndex
    and increment preIndex */
    struct node* tNode = newNode(pre[preIndex++]);
 
    /* If this node has no children then return */
    if (inStrt == inEnd)
        return tNode;
 
    /* Else find the index of this node in Inorder traversal */
    int inIndex = search(in, inStrt, inEnd, tNode->data);
 
    /* Using index in Inorder traversal, construct left and
     right subtress */
    tNode->left = buildTree(in, pre, inStrt, inIndex - 1);
    tNode->right = buildTree(in, pre, inIndex + 1, inEnd);
 
    return tNode;
}
 
/* UTILITY FUNCTIONS */
/* Function to find index of value in arr[start...end]
   The function assumes that value is present in in[] */
int search(char arr[], int strt, int end, char value)
{
    int i;
    for (i = strt; i <= end; i++) {
        if (arr[i] == value)
            return i;
    }
}
 
/* Helper function that allocates a new node with the
   given data and NULL left and right pointers. */
struct node* newNode(char data)
{
    struct node* node = (struct node*)malloc(sizeof(struct node));
    node->data = data;
    node->left = NULL;
    node->right = NULL;
 
    return (node);
}
 
/* This function is here just to test buildTree() */
void printInorder(struct node* node)
{
    if (node == NULL)
        return;
 
    /* first recur on left child */
    printInorder(node->left);
 
    /* then print the data of node */
    printf("%c ", node->data);
 
    /* now recur on right child */
    printInorder(node->right);
}
 
/* Driver program to test above functions */
int main()
{
    char in[] = { 'D', 'G', 'B', 'A', 'H', 'E', 'I', 'C', 'F' };
    char pre[] = { 'A', 'B', 'D', 'G', 'C', 'E', 'H', 'I', 'F' };
    int len = sizeof(in) / sizeof(in[0]);
    struct node* root = buildTree(in, pre, 0, len - 1);
 
    /* Let us test the built tree by printing Inorder traversal */
    printf("Inorder traversal of the constructed tree is \n");
    printInorder(root);
    getchar();
}
//OUTPUT:

Inorder traversal of the constructed tree is 
D G B A H E I C F 
const { id, version } = await document.interestCohort();
console.log('FLoC ID:', id);
console.log('FLoC version:', version);
cohort = await document.interestCohort();
url = new URL("https://ads.example/getCreative");
url.searchParams.append("cohort", cohort);
creative = await fetch(url);
defmodule GraphQL.GraphqlSchema do
  use Absinthe.Schema

  alias GraphQL.Book

  @desc "A Book"
  object :book do
    field :id, :integer
    field :name, :string
    field :author, :string

  end

# Example fake data
@book_information %{
  "book1" => %{id: 1, name: "Harry Potter", author: "JK Rowling"},
  "book2" => %{id: 2, name: "Charlie Factory", author: "Bernard"},
  "book3" => %{id: 3, name: "Sherlock Holmes", author: "Sheikhu"}
}

@desc "hello world"
query do
 import_fields(:book_queries)
end

object :book_queries do
  field :book_info, :book do
    arg :id, non_null(:id)
    resolve fn %{id: book_id}, _ ->
      {:ok, @book_information[book_id]}
    end
  end

  field :get_book, :book do
    arg(:id, non_null(:id))
    resolve fn %{id: bookId}, _ ->
      {:ok, Book.get_info!(bookId)}
    end
  end

  field :get_all_books, non_null(list_of(non_null(:book))) do
    resolve fn _, _, _ ->
      {:ok, Book.list_information()}
    end
  end
end

mutation do
  import_fields(:mutations)
end

object :mutations do
  field :create_book, :book do
    arg(:name, non_null(:string))
    arg(:author, non_null(:string))
    resolve fn args, _ ->
       Book.create_info(args)
    end
  end
end
end

# mix.ex
{:absinthe, "~> 1.7"},
{:absinthe_plug, "~> 1.5"},
{:cors_plug, "~> 3.0"}

# For that go to endpoint.ex file. In the file right above plug MyBlogApiWeb.Router add this line plug CORSPlug, origin:"*". The option origin means, what origin we should allow traffic from.
# Adding "*" means we are allowing traffic from everywhere. If we want to be specific for our ember application. We can add origin: "localhost:4200".
plug CORSPlug, origin: "*"
plug CORSPlug, origin: ~r/^https?:\/\/localhost:\d{4}$/

# router.ex

scope "/api", GraphQLWeb do
  pipe_through :api
  forward("/", Absinthe.Plug, schema: GraphQL.Grapha)
end

scope "/" do
  forward "/GraphiQL", Absinthe.Plug.GraphiQL, schema: GraphQL.Grapha
end

# Or endpoint.ex

plug Absinthe.Plug.GraphiQL, schema: App.GraphQL.Schema
import { ApolloClient, InMemoryCache, gql } from '@apollo/client';

// Initialize Apollo Client
const client = new ApolloClient({
  uri: 'http://localhost:4000/GraphiQL',
  cache: new InMemoryCache(),
});

// GraphQL query
const GET_BOOKS = gql`
  query {
  getBook(id: 6) {
    author
    name
  }
  getAllBooks {
    name
  }
  bookInfo(id:"book1"){
  name
  author
  }
}
`;

// Function to fetch data
export async function getBooks() {
  const { data } = await client.query({
    query: GET_BOOKS,
  });
  return data;
}


// GraphQL mutation
const CREATE_BOOKS = gql`
mutation{
  createBook(author: "mohsin khan", name: "allah akbar"){
 author
 name
 id
}
}
`;

// Function to fetch data
export async function getBooks() {
  const { data } = await client.mutate({
    mutation: CREATE_BOOKS,
  });
  return data;
}


// call this in page.js

import { getBooks } from './apollo-client';

const graphql = () => {
  getBooks().then((data) => {
    console.log(data);
  });
}

graphql()
select * from information_schema.columns 
where table_name='table1'and column_name like'a%'
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import javax.swing.JFrame;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;


public class VisualizadorCSV extends JFrame{
    
    //los graficos
    public JTextArea areaTexto;
    public JScrollPane barraDesplazamiento;
    
    public VisualizadorCSV(String archivo) throws FileNotFoundException, IOException {
        
        FileReader ruta_archivo_lectura=new FileReader(archivo);
        BufferedReader lector = new BufferedReader(ruta_archivo_lectura);
        
        String linea_archivo="", contenido_archivo="";
        int cont=0;
        
        while ((linea_archivo = lector.readLine()) != null ) 
            contenido_archivo+=linea_archivo+"\n";
         
        
        
        areaTexto=new JTextArea();
        barraDesplazamiento=new JScrollPane(areaTexto);
        getContentPane().add(barraDesplazamiento);
        this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
        setSize(500,500);
        
        areaTexto.setText(contenido_archivo);
        
        //lector.close();
        
    }
    
}
import java.util.ArrayList;


public class Surtidor {
    
    public int id;
    public int cantidadActual;
    public double facturado;
    public ArrayList<Operacion> operaciones;
    
    public Surtidor(int id) {
        this.id=id;
        cantidadActual=100000;
        facturado=0.0;
        operaciones=new ArrayList<>();
    }
    
    public void echarGasolina(Empleado e,int cantidad,Auto a) {
        //se realiza nueva operacion
        operaciones.add(new Operacion(e,cantidad));
        //lo descontamos del surtidor
        cantidadActual-=cantidad;
        //se la anadimos al auto
        a.cantidadActual+=cantidad;
        //facturamos
        facturado+=(cantidad*1000);
    }
    
    //modificamos toString para que escriba info tipo csv
    
    @Override
    public String toString() {
        String cadena="s_"+id+"; c_"+cantidadActual+"; facturado:"+facturado+"; ";
        cadena+="operaciones; ";
        for(int i=0; i < operaciones.size(); i++)
            cadena+=operaciones.toString();
        
        cadena+="\n";
        return cadena;
    }
    
}
public class Operacion {
    //una operacion la realiza un empleado y echa una cantidad
    public Empleado empleado;
    public int cantidad;
    
    public Operacion(Empleado empleado, int cantidad) {
        this.empleado=empleado;
        this.cantidad=cantidad;
    }
    
     @Override
    public String toString() {
        return "operacion; empleado "+empleado+";"
                + " cantidad "+cantidad+"; ";
    }
    
}
public class Empleado {
    
    public int id;
    
    public Empleado(int id) {
        this.id=id;
    }
    
    @Override
    public String toString() {
        return "Empleado "+id;
    }
    
}
import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;

/**
 *
 * @author clemente
 */
public class Copec {
    //la copec es de un lugar y tiene surtidores y empleados
    public String direccion;
    public Surtidor[] surtidores;
    public Empleado[] empleados;
    //creamos una nueva copec
    public Copec(String direccion) {
        surtidores=new Surtidor[6];
        for(int i=0; i < surtidores.length; i++)
           surtidores[i]=new Surtidor(i);
        empleados=new Empleado[2];
        for(int i=0; i < empleados.length; i++)
           empleados[i]=new Empleado(i);
          
    }
    //el empleado e, echa en a, la cantidad del surtidor
    public void echar(int e,Auto a,int cantidad,int s) {
        surtidores[s].echarGasolina(empleados[e], cantidad,a);
    }
    //imprime la informacion de surtidores
    @Override
    public String toString() {
        String cadena="";
        for(int i=0; i < surtidores.length; i++) {
            cadena+=surtidores[i].toString();
            //cadena+="\n";
        }
        return cadena;
    }
    
    public void guardarInfoCSV() {
        try(FileWriter fw = new FileWriter("copec.csv", true);
            BufferedWriter bw = new BufferedWriter(fw);
            PrintWriter out = new PrintWriter(bw)) {
            
            out.println(toString());
           
        } catch (IOException e) {
    
        }   
    }
    
}import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;

/**
 *
 * @author clemente
 */
public class Copec {
    //la copec es de un lugar y tiene surtidores y empleados
    public String direccion;
    public Surtidor[] surtidores;
    public Empleado[] empleados;
    //creamos una nueva copec
    public Copec(String direccion) {
        surtidores=new Surtidor[6];
        for(int i=0; i < surtidores.length; i++)
           surtidores[i]=new Surtidor(i);
        empleados=new Empleado[2];
        for(int i=0; i < empleados.length; i++)
           empleados[i]=new Empleado(i);
          
    }
    //el empleado e, echa en a, la cantidad del surtidor
    public void echar(int e,Auto a,int cantidad,int s) {
        surtidores[s].echarGasolina(empleados[e], cantidad,a);
    }
    //imprime la informacion de surtidores
    @Override
    public String toString() {
        String cadena="";
        for(int i=0; i < surtidores.length; i++) {
            cadena+=surtidores[i].toString();
            //cadena+="\n";
        }
        return cadena;
    }
    
    public void guardarInfoCSV() {
        try(FileWriter fw = new FileWriter("copec.csv", true);
            BufferedWriter bw = new BufferedWriter(fw);
            PrintWriter out = new PrintWriter(bw)) {
            
            out.println(toString());
           
        } catch (IOException e) {
    
        }   
    }
    
}
public class Auto {
    
    public String id;
    public int cantidadActual;
    
    public Auto(String id,int ca) {
        this.id=id;
        cantidadActual=ca;
    }
    
    public void echar(int temp) {
        cantidadActual=+temp;
    }
    
    @Override
    public String toString() {
        return "Auto ( id "+id+";"
                + "         con combustible "+cantidadActual+" ) ";
    }
    
    
}
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;


public class Main {
    
    public static void main (String[]args) {
        Copec copec=new Copec("Chillan");
        Auto a1=new Auto("AUTO1",30);
        //empleado 0 echa en el a1 50 litros del surtido 1
        copec.echar(0, a1, 50, 1);
        //como queda la copec
        System.out.println(copec.toString());
        //como queda el auto
        System.out.println(a1.toString());
        
        copec.guardarInfoCSV();
        
        try {
            //una vez creado el csv lo voy a mostrar

            VisualizadorCSV visualizador=new VisualizadorCSV("copec.csv");
            visualizador.setVisible(true);
        } catch (IOException ex) {
            System.out.println(ex.toString());
        }
        
    }
    
}
star

Fri Dec 22 2023 15:21:46 GMT+0000 (Coordinated Universal Time)

@Fahrine #java

star

Fri Dec 22 2023 14:00:26 GMT+0000 (Coordinated Universal Time)

@aatish

star

Fri Dec 22 2023 11:51:05 GMT+0000 (Coordinated Universal Time)

@rajat

star

Fri Dec 22 2023 11:49:55 GMT+0000 (Coordinated Universal Time)

@rajat

star

Fri Dec 22 2023 10:27:50 GMT+0000 (Coordinated Universal Time)

@mubashir_aziz

star

Fri Dec 22 2023 10:10:35 GMT+0000 (Coordinated Universal Time) https://maticz.com/how-to-create-a-crypto-trading-bot

@jamielucas #drupal

star

Fri Dec 22 2023 09:37:50 GMT+0000 (Coordinated Universal Time) https://medium.com/@valerio.uberti23/a-beginners-guide-to-using-api-keys-in-fastapi-and-python-256fe284818d

@quaie #python #fastapi

star

Fri Dec 22 2023 09:11:04 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/61140398/fastapi-return-a-file-response-with-the-output-of-a-sql-query

@quaie #python #fastapi #pandas

star

Fri Dec 22 2023 06:45:21 GMT+0000 (Coordinated Universal Time)

@Jevin2090

star

Fri Dec 22 2023 06:22:52 GMT+0000 (Coordinated Universal Time) https://www.reddit.com/r/Netsuite/comments/11auah6/border_radius_in_advanced_htmlpdf_templates_is/

@mdfaizi

star

Fri Dec 22 2023 06:22:14 GMT+0000 (Coordinated Universal Time) https://bfo.com/products/report/docs/userguide.pdf

@mdfaizi

star

Fri Dec 22 2023 04:05:18 GMT+0000 (Coordinated Universal Time)

@nistha_jnn #c++

star

Thu Dec 21 2023 21:43:19 GMT+0000 (Coordinated Universal Time) https://web.telegram.org/k/

@fathulla666

star

Thu Dec 21 2023 16:28:02 GMT+0000 (Coordinated Universal Time)

@Gift_Jackson #css

star

Thu Dec 21 2023 15:48:02 GMT+0000 (Coordinated Universal Time) https://awslabs.github.io/sockeye/tutorials/wmt_large.html

@mzeid #python

star

Thu Dec 21 2023 13:06:23 GMT+0000 (Coordinated Universal Time) https://fr.ldplayer.net/support/catalog?tab

@bhlotfi

star

Thu Dec 21 2023 13:05:03 GMT+0000 (Coordinated Universal Time) https://fr.ldplayer.net/support/catalog?tab

@bhlotfi

star

Thu Dec 21 2023 12:05:36 GMT+0000 (Coordinated Universal Time) https://www.addustechnologies.com/p2e-nft-game-platform-development-company

@jonathandaveiam #p2egamedevelopment #p2e #playtoearn

star

Thu Dec 21 2023 10:01:01 GMT+0000 (Coordinated Universal Time) https://machinelearningmastery.com/feature-selection-with-real-and-categorical-data/

@elham469

star

Thu Dec 21 2023 09:11:03 GMT+0000 (Coordinated Universal Time) https://edgeburg.com/wp-admin/theme-editor.php?file

@ZXCVBN #undefined

star

Thu Dec 21 2023 06:48:53 GMT+0000 (Coordinated Universal Time) https://microsoftedge.github.io/edgevr/posts/attacking-the-devtools/

@jakez

star

Thu Dec 21 2023 06:48:20 GMT+0000 (Coordinated Universal Time) https://microsoftedge.github.io/edgevr/posts/attacking-the-devtools/

@jakez

star

Thu Dec 21 2023 06:24:23 GMT+0000 (Coordinated Universal Time)

@nistha_jnn #c++

star

Thu Dec 21 2023 05:59:20 GMT+0000 (Coordinated Universal Time)

@nistha_jnn #c++

star

Thu Dec 21 2023 05:12:31 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/75700830/ability-to-choose-between-multiple-pdf-templates-on-a-netsuite-transaction-form

@mdfaizi

star

Thu Dec 21 2023 05:08:09 GMT+0000 (Coordinated Universal Time) https://www.knightsofthenet.com/contact

@mdfaizi

star

Thu Dec 21 2023 03:57:19 GMT+0000 (Coordinated Universal Time) https://www.30minutetowing.com/

@tony513

star

Thu Dec 21 2023 03:24:13 GMT+0000 (Coordinated Universal Time) https://developers.elementor.com/elementor-pro-2-7-custom-fonts-font-display-support/

@naunie

star

Thu Dec 21 2023 03:23:43 GMT+0000 (Coordinated Universal Time) https://developers.elementor.com/elementor-pro-2-7-custom-fonts-font-display-support/

@naunie #font-web #woff

star

Thu Dec 21 2023 02:02:45 GMT+0000 (Coordinated Universal Time) undefined

@mikeee

star

Thu Dec 21 2023 00:21:22 GMT+0000 (Coordinated Universal Time) https://bs2web2.at/blacksprut/

@fathulla666

star

Thu Dec 21 2023 00:21:01 GMT+0000 (Coordinated Universal Time) https://bs2web.at/

@fathulla666

star

Wed Dec 20 2023 22:03:15 GMT+0000 (Coordinated Universal Time) https://www.tinkoff.ru/mybank/accounts/debit/5787321206/?internal_source

@Majorka_Lampard

star

Wed Dec 20 2023 20:37:48 GMT+0000 (Coordinated Universal Time) https://tripleten.com/trainer/web/lesson/9130d953-0d59-4802-b145-4139af0112da/

@Marcelluki

star

Wed Dec 20 2023 20:34:29 GMT+0000 (Coordinated Universal Time)

@KCashwell1

star

Wed Dec 20 2023 19:11:48 GMT+0000 (Coordinated Universal Time)

@Mohamedshariif #java

star

Wed Dec 20 2023 18:25:56 GMT+0000 (Coordinated Universal Time) https://web.dev/articles/floc

@Spsypg #text #+js

star

Wed Dec 20 2023 18:24:29 GMT+0000 (Coordinated Universal Time) https://web.dev/articles/floc

@Spsypg #javascript

star

Wed Dec 20 2023 18:14:19 GMT+0000 (Coordinated Universal Time) https://github.com/WICG/floc

@Spsypg

star

Wed Dec 20 2023 18:12:35 GMT+0000 (Coordinated Universal Time) https://github.com/WICG/floc

@Spsypg

star

Wed Dec 20 2023 16:10:02 GMT+0000 (Coordinated Universal Time)

@devbymohsin #elixir

star

Wed Dec 20 2023 15:50:34 GMT+0000 (Coordinated Universal Time)

@devbymohsin #javascript

star

Wed Dec 20 2023 15:28:47 GMT+0000 (Coordinated Universal Time)

@darshcode #sql

star

Wed Dec 20 2023 13:03:03 GMT+0000 (Coordinated Universal Time)

@javcaves

star

Wed Dec 20 2023 13:02:29 GMT+0000 (Coordinated Universal Time)

@javcaves

star

Wed Dec 20 2023 13:02:05 GMT+0000 (Coordinated Universal Time)

@javcaves

star

Wed Dec 20 2023 13:01:44 GMT+0000 (Coordinated Universal Time)

@javcaves

star

Wed Dec 20 2023 13:01:23 GMT+0000 (Coordinated Universal Time)

@javcaves

star

Wed Dec 20 2023 13:01:02 GMT+0000 (Coordinated Universal Time)

@javcaves

star

Wed Dec 20 2023 13:00:40 GMT+0000 (Coordinated Universal Time)

@javcaves

Save snippets that work with our extensions

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