Snippets Collections
package Questão2B;

public class RecorrenciaInducao {
    static int calcularT(int n, int c, int X) {
        if (n == 0) {
            return X;
        } else {
            return c * calcularT(n - 1, c, X);
        }
    }

    public static void main(String[] args) {
        int n = 5; // Mude o valor de n conforme necessário
        int c = 2; // Constante multiplicativa
        int X = 3; // Valor inicial de T(0)

        int resultado = calcularT(n, c, X);
        System.out.println("O valor de T(" + n + ") é: " + resultado);
    }
}
package Questão2A;

import java.util.Scanner;

public class RecorrenciaInducao {
    // Método para calcular T(n) usando indução
    static int calcularT(int n) {
        if (n == 0) {
            return 1; // Caso Base
        } else {
            return calcularT(n - 1) + (int)Math.pow(2, n);
        }
    }

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("Insira o valor de T(n): ");
        int n = sc.nextInt();

        int resultado = calcularT(n);
        System.out.println("O valor de T(" + n + ") é: " + resultado);
    }
}
$('button.toggle-detail-row').click(function(){
		   
  let rowId = $(this).attr('id');
  console.log(rowId);

  if ($('tr.table-row-details[id="' + rowId + '"]').is(':visible')) {
		   		
    console.log('Case 1');
    $('tr.table-row-details[id="' + rowId + '"]').slideUp("slow");
    $(this).children("i.toggle-button").removeClass("fa fa-minus").addClass("fa fa-plus");
  }
  else {

    console.log('Case 3 : ' + rowId);
    $('tr.table-row-details').hide();
    $("i.toggle-button").removeClass("fa fa-minus").addClass("fa fa-plus");

    $('tr.table-row-details[id="' + rowId + '"]').slideDown("slow");
    $(this).children("i.toggle-button").removeClass("fa fa-plus").addClass("fa fa-minus");
  }
});
#include <iostream>
#include <istream>
#include <string>
#include <vector>

using namespace std;

class Book {
    int BookID;
    std::string Title;
    std::string Author;
    double price;
    static int numOfBooks;
    
  friend class Library; // Declare Library as a friend class

    public:
    Book(int BookID, std::string Title, std::string Author, double price){
        this->BookID = BookID;
        this->Title = Title;
        this->Author = Author;
        this->price = price;
        numOfBooks ++;
    }
    int getBookID() const {
    return BookID;
}

    
    std::string getTitle() const {
    return Title;
}
   std::string getAuthor() const {
    return Author;
}
   double getPrice() const {
    return price;
}
    //Static Function
   static int getTotalNumOfBooks(){
        return numOfBooks;
    };

};

int Book::numOfBooks = 0;


//Class User
class Users{
    
    public:
    std::string name;
    std::string address;
    std::string email;
    int phoneNum;
    
    Users(std::string n, std::string addre,std::string em, int pN){
        name = n;
        address = addre;
        email = em;
        phoneNum = pN;
    }
    
    //Virtual Function & Overiding function
    virtual void display(){
    }
    
};
//Derived Class from Base class User
class Student: public Users{
    
    int studentID;
    public:
    Student(int studentID, std::string name, std::string address, std::string email, int phoneNum):Users(name, address, email, phoneNum){
        this->studentID = studentID;
    }
    
    int getStudentID() const {
    return studentID;
}
    
    //Function Overloading, Same Name but different arguments.
    void print(std::string name){
        cout<<"student Name: "<<name<<endl;
    }
    void print(std::string name, int studentID){
        cout<<"Student Name: "<<name<<endl;
        cout<<"Student ID: "<<studentID<<endl;
    }
    //Default arguments
    void print(std::string name, std::string email, int studentID = 1111){
        cout<<"Student Name: "<<name<<endl;
        cout<<"Student Email: "<<email<<endl;
        cout<<"Student ID: "<<studentID<<endl;
    }
    
    void display(){
        cout<<"\n__Student Info:_ "<<endl;
        cout<<"ID: "<<studentID<<endl;
        cout<<"Name: "<<name<<endl;
        cout<<"Address: "<<address<<endl;
        cout<<"Email: "<<email<<endl;
        cout<<"Phone Number: "<<phoneNum<<endl;
    }
    
    //Friend Function
    friend void globalFunction(Student &stud);
};
class Staff: public Users{
    int staffID;
    public:
    Staff(int staffID, std::string name, std::string address, std::string email, int phoneNum):Users(name, address, email, phoneNum){
        this->staffID = staffID;
    }
    int getStaffID(){
        return staffID;
    }
    
    void display(){
        cout<<"\n___Staff Info:_ "<<endl;
        cout<<"ID: "<<staffID<<endl;
        cout<<"Name: "<<name<<endl;
        cout<<"Address: "<<address<<endl;
        cout<<"Email: "<<email<<endl;
        cout<<"Phone Number: "<<phoneNum<<endl;
    }
    friend void globalFunction(Staff &staf);
};

//Friend Function implementation
void globalFunction(Student &stud, Staff &staf){
    cout<<"\nAccessing Student ID: "<<stud.getStudentID()<<endl;
    cout<<"Accessing Staff ID: "<<staf.getStaffID()<<endl;
}

 class Library{

vector<Book*> books; // Declaration of books vector
vector<Student*> students;
    
    Book *book;
    std::string name;
    std::string address;
    
    public:
    Library(std::string name, std::string address){
        this->name = name;
        this->address = address;
    }
    
    void setBook(Book *book){
        this->book = book;
    }
    Book* getBook(){
        return book;
    }
    std::string getName(){
        return name;
    }
    void setName(std::string name){
        this->name = name;
    }
    std::string getAddress(){
        return address;
    }
    void setAddress(std::string address){
        this->address = address;
    }
    void addBook(const std::string& title, const std::string& author, double price) {
        int id = books.size() + 1; // Generate ID automatically based on the number of books
        books.push_back(new Book(id, title, author, price));
        cout << "Book added successfully with ID: " << id << endl;
    }
    bool deleteBook(int id) {
        auto it = find_if(books.begin(), books.end(), [id](const Book* book) {
            return book->getBookID() == id;
        });
        if (it != books.end()) {
            books.erase(it);
            return true;
        }
        return false;
    }
    void editBook(int id, std::string newTitle, std::string newAuthor, double newPrice) {
        auto it = find_if(books.begin(), books.end(), [id](const Book* book) {
            return book->getBookID() == id;
        });
        if (it != books.end()) {
            (*it)->Title = newTitle;
            (*it)->Author = newAuthor;
            (*it)->price = newPrice;
        }
    }
    void showBookInfo(int id) {
        auto it = std::find_if(books.begin(), books.end(), [id](const Book* book) {
            return book->getBookID() == id;
        });
        if (it != books.end()) {
            std::cout << "Book ID: " << (*it)->getBookID() << std::endl;
            std::cout << "Book Title: " << (*it)->getTitle() << std::endl;
            std::cout << "Book Author: " << (*it)->getAuthor() << std::endl;
            std::cout << "Book Price: " << (*it)->getPrice() << std::endl;
        }
    }

    std::vector<Book*>& getBooks() { // Return a reference to the vector of books
        return books;
    }


    void addStudent(const std::string& name, const std::string& address, const std::string& email, int phoneNum) {
        int id = students.size() + 1; // Generate ID automatically based on the number of students
        students.push_back(new Student(id, name, address, email, phoneNum));
        cout << "Student added successfully with ID: " << id << endl;
    }

    bool deleteStudent(int id) {
        auto it = find_if(students.begin(), students.end(), [id](const Student* student) {
            return student->getStudentID() == id;
        });
        if (it != students.end()) {
            students.erase(it);
            return true;
        }
        return false;
    }

    void editStudent(int id, const string& newName, const string& newAddress, const string& newEmail, int newPhoneNum) {
        auto it = find_if(students.begin(), students.end(), [id](const Student* student) {
            return student->getStudentID() == id;
        });
        if (it != students.end()) {
            (*it)->name = newName;
            (*it)->address = newAddress;
            (*it)->email = newEmail;
            (*it)->phoneNum = newPhoneNum;
        }
    }

    void showStudentInfo(int id) {
    auto it = find_if(students.begin(), students.end(), [id](const Student* student) {
        return student->getStudentID() == id;
    });
    if (it != students.end()) {
        cout << "Student ID: " << (*it)->getStudentID() << endl;
        cout << "Student Name: " << (*it)->name << endl;
        cout << "Student Address: " << (*it)->address << endl;
        cout << "Student Email: " << (*it)->email << endl;
        cout << "Student Phone Number: " << (*it)->phoneNum << endl;
    }
}
};





int main() {
    Library library("University Library", "Uskudar");

    while (true) {
        cout << "\nMenu:" << endl;
        cout << "1. Manage Books" << endl;
        cout << "2. Manage Students" << endl;
        cout << "3. Exit" << endl;
        cout << "Enter your choice: ";

        int choice;
        cin >> choice;

        switch (choice) {
        case 1: {
            cout << "\nBooks Menu:" << endl;
            cout << "1. Add Book" << endl;
            cout << "2. Delete Book" << endl;
            cout << "3. Edit Book" << endl;
            cout << "4. Show Book Information" << endl;
            cout << "5. Book List" << endl;
            cout << "Enter your choice: ";

            int bookChoice;
            cin >> bookChoice;

            switch (bookChoice) {
            case 1: {
              std::string title, author;
              double price;
              cout << "Enter book title: ";
                 cin.ignore();
                 getline(cin, title);
                 cout << "Enter book author: ";
                     getline(cin, author);
                   cout << "Enter book price: ";
                   cin >> price;
                   library.addBook(title, author, price);

                
                break;
            }
            case 2: {
                int id;
                cout << "Enter ID of the book to delete: ";
                cin >> id;
                if (library.deleteBook(id)) {
                    cout << "Book with ID " << id << " deleted successfully." << endl;
                }
                else {
                    cout << "Book with ID " << id << " not found." << endl;
                }
                break;
            }
            case 3: {
                int id;
                string newTitle, newAuthor;
                double newPrice;
                cout << "Enter ID of the book to edit: ";
                cin >> id;
                cout << "Enter new title: ";
                cin.ignore();
                getline(cin, newTitle);
                cout << "Enter new author: ";
                getline(cin, newAuthor);
                cout << "Enter new price: ";
                cin >> newPrice;
                library.editBook(id, newTitle, newAuthor, newPrice);
                cout << "Book edited successfully." << endl;
                break;
            }
            case 4: {
                int id;
                cout << "Enter ID of the book to show information: ";
                cin >> id;
                library.showBookInfo(id);
                break;
            }
           case 5: {
            vector<Book*> books = library.getBooks();
             cout << "\nBook List:" << endl;
            for (Book* book : books) {
    cout << "Book ID: " << book->getBookID() << ", Title: " << book->getTitle() << ", Author: " << book->getAuthor() << ", Price: " << book->getPrice() << endl;
}
                 break;
               }

            default:
                cout << "Invalid choice." << endl;
            }
            break;
        }
            case 2: {
                cout << "\nStudents Menu:" << endl;
                cout << "1. Add Student" << endl;
                cout << "2. Remove Student" << endl;
                cout << "3. Edit Student" << endl;
                cout << "4. Get Student Info" << endl;
                cout << "5. Exit" << endl;
                cout << "Enter your choice: ";

                int studentChoice;
                cin >> studentChoice;

                switch (studentChoice) {
                    case 1: {
                         std::string name, address, email;
                        int phoneNum;
                        cout << "Enter student name: ";
                        cin.ignore();
                        getline(cin, name);
                        cout << "Enter student address: ";
                        getline(cin, address);
                        cout << "Enter student email: ";
                        cin >> email;
                         cout << "Enter student phone number: ";
                        cin >> phoneNum;
                        library.addStudent(name, address, email, phoneNum);
                        
                        break;
                    }
                    case 2: {
                        int id;
                        cout << "Enter ID of the student to remove: ";
                        cin >> id;
                        if (library.deleteStudent(id)) {
                            cout << "Student with ID " << id << " removed successfully." << endl;
                        } else {
                            cout << "Student with ID " << id << " not found." << endl;
                        }
                        break;
                    }
                    case 3: {
                        int id;
                        string newName, newAddress, newEmail;
                        int newPhoneNum;
                        cout << "Enter ID of the student to edit: ";
                        cin >> id;
                        cout << "Enter new name: ";
                        cin.ignore();
                        getline(cin, newName);
                        cout << "Enter new address: ";
                        getline(cin, newAddress);
                        cout << "Enter new email: ";
                        cin >> newEmail;
                        cout << "Enter new phone number: ";
                        cin >> newPhoneNum;
                        library.editStudent(id, newName, newAddress, newEmail, newPhoneNum);
                        cout << "Student edited successfully." << endl;
                        break;
                    }
                    case 4: {
                        int id;
                        cout << "Enter ID of the student to get information: ";
                        cin >> id;
                        library.showStudentInfo(id);
                        break;
                    }
                    case 5: {
                        cout << "Exiting students menu..." << endl;
                        break;
                    }
                    default:
                        cout << "Invalid choice." << endl;
                }
                break;
            }
        case 3:
            cout << "Exiting..." << endl;
            return 0;
        default:
            cout << "Invalid choice. Please enter a number from 1 to 3." << endl;
        }
    }

    return 0;
}
//OUTPUT:


Menu:
1. Manage Books
2. Manage Students
3. Exit
Enter your choice: 1

Books Menu:
1. Add Book
2. Delete Book
3. Edit Book
4. Show Book Information
5. Book List
Enter your choice: 1
Enter book title: The Power
Enter book author: James
Enter book price: 23
Book added successfully with ID: 1

Menu:
1. Manage Books
2. Manage Students
3. Exit
Enter your choice: 1

Books Menu:
1. Add Book
2. Delete Book
3. Edit Book
4. Show Book Information
5. Book List
Enter your choice: 1
Enter book title: Psychology
Enter book author: Mike
Enter book price: 21
Book added successfully with ID: 2

Menu:
1. Manage Books
2. Manage Students
3. Exit
Enter your choice: 1

Books Menu:
1. Add Book
2. Delete Book
3. Edit Book
4. Show Book Information
5. Book List
Enter your choice: 5

Book List:
Book ID: 1, Title: The Power, Author: James, Price: 23
Book ID: 2, Title: Physcology, Author: Mike, Price: 21

Menu:
1. Manage Books
2. Manage Students
3. Exit
Enter your choice: 1

Books Menu:
1. Add Book
2. Delete Book
3. Edit Book
4. Show Book Information
5. Book List
Enter your choice: 2
Enter ID of the book to delete: 2
Book with ID 2 deleted successfully.

Menu:
1. Manage Books
2. Manage Students
3. Exit
Enter your choice: 1

Books Menu:
1. Add Book
2. Delete Book
3. Edit Book
4. Show Book Information
5. Book List
Enter your choice: 5

Book List:
Book ID: 1, Title: The Power, Author: James, Price: 23

Menu:
1. Manage Books
2. Manage Students
3. Exit
Enter your choice: 2

Students Menu:
1. Add Student
2. Remove Student
3. Edit Student
4. Get Student Info
5. Exit
Enter your choice: 1
Enter student name: Mohamed
Enter student address: Istanbul
Enter student email: moha@gmail.com
Enter student phone number: 5544
Student added successfully with ID: 1

Menu:
1. Manage Books
2. Manage Students
3. Exit
Enter your choice: 2

Students Menu:
1. Add Student
2. Remove Student
3. Edit Student
4. Get Student Info
5. Exit
Enter your choice: 1
Enter student name: Nasir
Enter student address: Istanbul
Enter student email: nasir@gmail.com
Enter student phone number: 1122
Student added successfully with ID: 2

Menu:
1. Manage Books
2. Manage Students
3. Exit
Enter your choice: 2

Students Menu:
1. Add Student
2. Remove Student
3. Edit Student
4. Get Student Info
5. Exit
Enter your choice: 2
Enter ID of the student to remove: 2
Student with ID 2 removed successfully.

Menu:
1. Manage Books
2. Manage Students
3. Exit
Enter your choice: 2

Students Menu:
1. Add Student
2. Remove Student
3. Edit Student
4. Get Student Info
5. Exit
Enter your choice: 4
Enter ID of the student to get information: 2

Menu:
1. Manage Books
2. Manage Students
3. Exit
Enter your choice: 2

Students Menu:
1. Add Student
2. Remove Student
3. Edit Student
4. Get Student Info
5. Exit
Enter your choice: 4
Enter ID of the student to get information: 1
Student ID: 1
Student Name: Mohamed
Student Address: Istanbul
Student Email: moha@gmail.com
Student Phone Number: 5544

Menu:
1. Manage Books
2. Manage Students
3. Exit
Enter your choice: 3
Exiting...
 
Normal program termination. Exit status: 0
#include <iostream>

using namespace std;

class Book{
    int BookID;
    string Title;
    string Author;
    double price;
    static int numOfBooks;
    
    public:
    //Parameter Constructor
    Book(int BookID, string Title, string Author, double price){
        this->BookID = BookID;
        this->Title = Title;
        this->Author = Author;
        this->price = price;
        numOfBooks ++;
    }
    int getBookID(){
        return BookID;
    }
    string getTitle(){
        return Title;
    }
    string getAuthor(){
        return Author;
    }
    double getPrice(){
        return price;
    }
    //Static Function
   static int getTotalNumOfBooks(){
        return numOfBooks;
    }
};
int Book::numOfBooks = 0;

class Library{
    Book *book;
    string name;
    string address;
    
    public:
    Library(string name, string address){
        this->name = name;
        this->address = address;
    }
    
    void setBook(Book *book){
        this->book = book;
    }
    Book* getBook(){
        return book;
    }
    string getName(){
        return name;
    }
    void setName(string name){
        this->name = name;
    }
    string getAddress(){
        return address;
    }
    void setAddress(string address){
        this->address = address;
    }
};

//Class User
class Users{
    
    public:
    string name;
    string address;
    string email;
    int phoneNum;
    
    Users(string n, string addre,string em, int pN){
        name = n;
        address = addre;
        email = em;
        phoneNum = pN;
    }
    
    //Virtual Function & Overiding function
    virtual void display(){
    }
    
};
//Derived Class from Base class User
class Student: public Users{
    
    int studentID;
    public:
    Student(int studentID, string name, string address, string email, int phoneNum):Users(name, address, email, phoneNum){
        this->studentID = studentID;
    }
    
    int getStudentID(){
        return studentID;
    }
    
    //Function Overloading, Same Name but different arguments.
    void print(string name){
        cout<<"student Name: "<<name<<endl;
    }
    void print(string name, int studentID){
        cout<<"Student Name: "<<name<<endl;
        cout<<"Student ID: "<<studentID<<endl;
    }
    //Default arguments
    void print(string name, string email, int studentID = 1111){
        cout<<"Student Name: "<<name<<endl;
        cout<<"Student Email: "<<email<<endl;
        cout<<"Student ID: "<<studentID<<endl;
    }
    
    void display(){
        cout<<"\n_____Student Info:____ "<<endl;
        cout<<"ID: "<<studentID<<endl;
        cout<<"Name: "<<name<<endl;
        cout<<"Address: "<<address<<endl;
        cout<<"Email: "<<email<<endl;
        cout<<"Phone Number: "<<phoneNum<<endl;
    }
    
    //Friend Function
    friend void globalFunction(Student &stud);
};
class Staff: public Users{
    int staffID;
    public:
    Staff(int staffID, string name, string address, string email, int phoneNum):Users(name, address, email, phoneNum){
        this->staffID = staffID;
    }
    int getStaffID(){
        return staffID;
    }
    
    void display(){
        cout<<"\n______Staff Info:____ "<<endl;
        cout<<"ID: "<<staffID<<endl;
        cout<<"Name: "<<name<<endl;
        cout<<"Address: "<<address<<endl;
        cout<<"Email: "<<email<<endl;
        cout<<"Phone Number: "<<phoneNum<<endl;
    }
    friend void globalFunction(Staff &staf);
};

//Friend Function implementation
void globalFunction(Student &stud, Staff &staf){
    cout<<"\nAccessing Student ID: "<<stud.getStudentID()<<endl;
    cout<<"Accessing Staff ID: "<<staf.getStaffID()<<endl;
}

int main() {

    cout<<"_____Library Management System._____"<<endl;
    
    Library lib("University Library","Uskudar");
    cout<<"\n____Library Info____"<<endl;
    cout<<"Name: "<<lib.getName()<<endl;
    cout<<"Address: "<<lib.getAddress()<<endl;
    
    lib.setBook(new Book(1, "Java", "James", 20.99));
    cout<<"____Book Info____"<<endl;
    cout<<"Book ID: "<<lib.getBook()->getBookID()<<endl;
    cout<<"Book Title: "<<lib.getBook()->getTitle()<<endl;
    cout<<"Book Author: "<<lib.getBook()->getAuthor()<<endl;
    cout<<"Book Price: "<<lib.getBook()->getPrice()<<endl;
    //Calling static function in the Book class
    cout<<"Total Books in the Library are: "<<Book::getTotalNumOfBooks()<<endl;
    
    lib.setBook(new Book(2, "Math", "Mike", 24.99));
    cout<<"____Book Info____"<<endl;
    cout<<"Book ID: "<<lib.getBook()->getBookID()<<endl;
    cout<<"Book Title: "<<lib.getBook()->getTitle()<<endl;
    cout<<"Book Author: "<<lib.getBook()->getAuthor()<<endl;
    cout<<"Book Price: "<<lib.getBook()->getPrice()<<endl;
    
    cout<<"Total Books in the Library are: "<<Book::getTotalNumOfBooks()<<endl;
    
    Student s1(2023, "Mohamed","Istanbul","Student@gmail.com", 11111);
    Users *user;
    user = & s1;
    user->display();
    
    Staff stff(3034,"Staff1","Istnabul","Staff@gmail.com", 9999);
    user = &stff;
    user->display();
    
    //Friend Function
    globalFunction(s1,stff);
    
    //Calling Overloading Function in the Student class
    cout<<"_____"<<endl;
    s1.print("Musa");
    s1.print("Musa",5555);
    //Calling default arguments in the student class
    s1.print("Yahya", "yahya@emial.com");

    return 0;
}
___________________________________________________________________________
//OUTPUT:

_____Library Management System._____

____Library Info____
Name: University Library
Address: Uskudar
____Book Info____
Book ID: 1
Book Title: Java
Book Author: James
Book Price: 20.99
Total Books in the Library are: 1
____Book Info____
Book ID: 2
Book Title: Math
Book Author: Mike
Book Price: 24.99
Total Books in the Library are: 2

_____Student Info:____ 
ID: 2023
Name: Mohamed
Address: Istanbul
Email: Student@gmail.com
Phone Number: 11111

______Staff Info:____ 
ID: 3034
Name: Staff1
Address: Istnabul
Email: Staff@gmail.com
Phone Number: 9999

Accessing Student ID: 2023
Accessing Staff ID: 3034
_____
student Name: Musa
Student Name: Musa
Student ID: 5555
Student Name: Yahya
Student Email: yahya@emial.com
Student ID: 1111
getRoles = invokeurl
	[
	url: "https://www.zohoapis.com/crm/v3/Contacts/roles/"+contact.get("Contact_Role")
	type: GET
	connection:"zoho_crm"
	];
	info getRoles;
	contact_role_name = getRoles.get("contact_roles").get(0).get("name");

<?php
// Connessione al database (sostituisci con le tue credenziali)
$servername = "localhost";
$username = "username";
$password = "password";
$dbname = "nome_database";

// Crea una connessione
$conn = new mysqli($servername, $username, $password, $dbname);

// Verifica la connessione
if ($conn->connect_error) {
    die("Connessione fallita: " . $conn->connect_error);
}

// Verifica che la richiesta sia in POST
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
    // Verifica e processa i dati ricevuti
    $campi_validi = 0;
    $valori = array();
    foreach ($_POST as $campo => $valore) {
        // Puoi effettuare qui ulteriori controlli sui dati, se necessario
        if (!empty($valore)) {
            $campi_validi++;
            // Prepara i valori per l'aggiornamento
            $valori[] = "$campo = '" . $conn->real_escape_string($valore) . "'";
        }
    }

    // Verifica se almeno un campo è stato compilato
    if ($campi_validi > 0 && $campi_validi <= 5) {
        // Assicurati di sostituire 'id' con il nome del campo ID effettivo nella tua tabella
        $id = $_POST['id'];
        
        // Costruisci la query di aggiornamento con la clausola WHERE per l'ID
        $sql = "UPDATE tabella_dati SET " . implode(", ", $valori) . " WHERE id = $id";

        // Esegui la query di aggiornamento
        if ($conn->query($sql) === TRUE) {
            echo "Dati aggiornati con successo.";
        } else {
            echo "Errore durante l'aggiornamento dei dati: " . $conn->error;
        }
    } else {
        // Se non ci sono campi compilati o se ce ne sono troppi, restituisci un messaggio di errore
        http_response_code(400); // Bad Request
        echo "Errore: Compilare almeno un campo ma non più di 5 campi.";
    }
} else {
    // Se la richiesta non è in POST, restituisci un errore
    http_response_code(405); // Method Not Allowed
    echo "Errore: Metodo non consentito.";
}

// Chiudi la connessione al database
$conn->close();
?>
Configure
Add to config file (config/web.php or common\config\main.php)

    'modules' => [
        'redactor' => 'yii\redactor\RedactorModule',
    ],
php composer.phar require --prefer-dist yiidoc/yii2-redactor "*"

ejemplo:
     <?php $form->field($model, 'resumen_reporte')->widget(\yii\redactor\widgets\Redactor::className(), [
    'clientOptions' => [
        'imageManagerJson' => ['/redactor/upload/image-json'],
        'imageUpload' => ['/redactor/upload/image'],
        'fileUpload' => ['/redactor/upload/file'],
        'lang' => 'zh_cn',
        'plugins' => ['clips', 'fontcolor','imagemanager']
    ]
]); ?>
php composer.phar require --prefer-dist 2amigos/yii2-ckeditor-widget": "*"

ejemplo ckeditor-widget:
 <?php $form->field($model, 'resumen_reporte')->widget(CKEditor::className(), [
    'options' => ['rows' => 6],
    'preset' => 'basic'
]); ?>
$('#myButton').on('click', function () {
  // Esegui azioni quando il bottone viene cliccato
  console.log('Bottone cliccato');
  // Chiudi il modale
  $('#exampleModal').modal('hide');
});
// path = "https://forms.zoho.com/api/form/OnboardingForm/formperma/RcHkbHGBh8_5yjVX6sSfhb2OfIHid-3SyJAZVPOuZns/resthookdownload?filepath=/OnboardingForm/FileUpload11/1715686347747_Legal_Rep_Rep1_first_Proof_of_address.png";

passport_files = rep.get("FileUpload10");
			for each  file in passport_files
			{
				path = file.get("path");
				getFile = invokeurl
				[
					url :path
					type :GET
					connection:"zoho_form"
				];
				info "Getting file = " + getFile;
				getFile.setParamName("file");
				attach_file = invokeurl
				[
					url :"https://www.zohoapis.com/crm/v3/Contacts/" + contact_id + "/Attachments"
					type :POST
					files:getFile
					connection:"zoho_crm"
				];
				info "Attaching files = " + attach_file;
			}
import React from 'react';

const Form = ({ formData, setFormData }) => {
  const handleChange = (e) => {
    const { name, value } = e.target;
    setFormData({ ...formData, [name]: value });
  };

  return (
    <form>
      <label>
        Name:
        <input
          type="text"
          name="name"
          value={formData.name}
          onChange={handleChange}
        />
      </label>
      <br />
      <label>
        Email:
        <input
          type="email"
          name="email"
          value={formData.email}
          onChange={handleChange}
        />
      </label>
      <br />
      <label>
        Age:
        <input
          type="number"
          name="age"
          value={formData.age}
          onChange={handleChange}
        />
      </label>
    </form>
  );
};

export default Form;
import React, { useState } from 'react';
import ReactDOM from 'react-dom';

const App = () => {
  // State variables for different input elements
  const [textInput, setTextInput] = useState('');
  const [checkboxInput, setCheckboxInput] = useState(false);
  const [radioInput, setRadioInput] = useState('');
  const [textareaInput, setTextareaInput] = useState('');
  const [selectInput, setSelectInput] = useState('');

  return (
    <div>
      {/* Text Input */}
      <input
        type="text"
        value={textInput}
        onChange={(e) => setTextInput(e.target.value)}
        placeholder="Enter text"
      />
      <p>Text Input Value: {textInput}</p>

      {/* Checkbox Input */}
      <input
        type="checkbox"
        checked={checkboxInput}
        onChange={(e) => setCheckboxInput(e.target.checked)}
      />
      <label>Checkbox Input</label>
      <p>Checkbox Input Value: {checkboxInput ? 'Checked' : 'Unchecked'}</p>

      {/* Radio Input */}
      <div>
        <input
          type="radio"
          id="option1"
          value="option1"
          checked={radioInput === 'option1'}
          onChange={() => setRadioInput('option1')}
        />
        <label htmlFor="option1">Option 1</label>
        <br />
        <input
          type="radio"
          id="option2"
          value="option2"
          checked={radioInput === 'option2'}
          onChange={() => setRadioInput('option2')}
        />
        <label htmlFor="option2">Option 2</label>
      </div>
      <p>Radio Input Value: {radioInput}</p>

      {/* Textarea Input */}
      <textarea
        value={textareaInput}
        onChange={(e) => setTextareaInput(e.target.value)}
        placeholder="Enter text"
      />
      <p>Textarea Input Value: {textareaInput}</p>

      {/* Select Input */}
      <select
        value={selectInput}
        onChange={(e) => setSelectInput(e.target.value)}
      >
        <option value="">Select an option</option>
        <option value="option1">Option 1</option>
        <option value="option2">Option 2</option>
        <option value="option3">Option 3</option>
      </select>
      <p>Select Input Value: {selectInput}</p>
    </div>
  );
};

ReactDOM.render(<App />, document.getElementById('root'));
import React, { useState } from 'react';
import ReactDOM from 'react-dom';

const Modal = ({ isOpen, onClose, children }) => {
  if (!isOpen) return null;

  return ReactDOM.createPortal(
    <div className="modal-overlay">
      <div className="modal">
        <button className="close-button" onClick={onClose}>Close</button>
        {children}
      </div>
    </div>,
    document.getElementById('modal-root')
  );
};

const App = () => {
  const [isModalOpen, setIsModalOpen] = useState(false);

  const openModal = () => {
    setIsModalOpen(true);
  };

  const closeModal = () => {
    setIsModalOpen(false);
  };

  return (
    <div>
      <button onClick={openModal}>Open Modal</button>
      <Modal isOpen={isModalOpen} onClose={closeModal}>
        <h2>Modal Content</h2>
        <p>This is a simple modal</p>
      </Modal>
    </div>
  );
};

ReactDOM.render(<App />, document.getElementById('root'));
import React, { useRef } from 'react';

function App() {
  // Step 1: Create a ref named inputRef using useRef()
  const inputRef = useRef(null);

  // Step 2: Define a function focusInput to focus the input element
  const focusInput = () => {
    // Step 3: Access the current property of inputRef to focus the input element
    inputRef.current.focus();
  };

  return (
    <div>
      <h1>Focus Input Example</h1>
      {/* Step 4: Attach inputRef to an input element using the ref attribute */}
      <input type="text" ref={inputRef} />
      {/* Step 5: Call focusInput function when the button is clicked */}
      <button onClick={focusInput}>Focus Input</button>
    </div>
  );
}

export default App;
import React, { useContext, createContext } from 'react';

// Step 1: Create a context with createContext()
const ThemeContext = createContext();

// Step 2: Create a ThemedComponent to consume the theme value
function ThemedComponent() {
  // Step 3: Use useContext hook to consume the theme value from the context
  const theme = useContext(ThemeContext);

  return (
    <div style={{ backgroundColor: theme.background, color: theme.text }}>
      <h2>Themed Component</h2>
      <p>This component consumes the theme value from the context.</p>
    </div>
  );
}

// Step 4: Wrap the ThemedComponent with ThemeContext.Provider in the App component
function App() {
  const themeValue = {
    background: 'lightblue',
    text: 'black'
  };

  return (
    <div>
      <h1>App Component</h1>
      {/* Provide the value of the theme */}
      <ThemeContext.Provider value={themeValue}>
        {/* ThemedComponent is wrapped with ThemeContext.Provider */}
        <ThemedComponent />
      </ThemeContext.Provider>
    </div>
  );
}

export default App;
import { useState } from 'react';

// Custom hook to manage a counter
function useCounter(initialValue = 0) {
  const [count, setCount] = useState(initialValue);

  // Function to increment the count
  const increment = () => {
    setCount(count + 1);
  };

  // Function to decrement the count
  const decrement = () => {
    setCount(count - 1);
  };

  // Return the count value and functions to update it
  return {
    count,
    increment,
    decrement
  };
}

// Example usage:
function Counter() {
  // Use the custom hook to manage the counter
  const { count, increment, decrement } = useCounter(0);

  return (
    <div>
      <p>Count: {count}</p>
      <button onClick={increment}>Increment</button>
      <button onClick={decrement}>Decrement</button>
    </div>
  );
}
// src/components/TableComponent.js
import React from 'react';

const TableComponent = () => {
  const data = [
    { id: 1, name: 'John Doe', age: 28 },
    { id: 2, name: 'Jane Smith', age: 34 },
    { id: 3, name: 'Sam Johnson', age: 45 },
  ];

  return (
    <div>
      <h2>Table Component</h2>
      <table border="1">
        <thead>
          <tr>
            <th>ID</th>
            <th>Name</th>
            <th>Age</th>
          </tr>
        </thead>
        <tbody>
          {data.map((item) => (
            <tr key={item.id}>
              <td>{item.id}</td>
              <td>{item.name}</td>
              <td>{item.age}</td>
            </tr>
          ))}
        </tbody>
      </table>
    </div>
  );
};

export default TableComponent;
dotnet restore --packages .\package\
import React from 'react';

const ListComponent = () => {
  const items = ['Item 1', 'Item 2', 'Item 3', 'Item 4'];

  return (
    <div>
      <h2>List Component</h2>
      <ul>
        {items.map((item, index) => (
          <li key={index}>{item}</li>
        ))}
      </ul>
    </div>
  );
};

export default ListComponent;
import mysql.connector
import pandas as pd
import matplotlib.pyplot as plt

# Establish connection to MySQL
mydb = mysql.connector.connect(
    host="localhost",
    user="root",
    password="Eimaipolykala1",
    database="twitter_db"
)

# Create cursor
cursor = mydb.cursor()

# Execute SQL query to retrieve data
cursor.execute("SELECT JSON_VALUE(data, '$.extended_tweet.display_text_range[1]') AS text_length FROM data_db")

# Fetch data
data = cursor.fetchall()

# Close the connection
mydb.close()

# Create DataFrame
df = pd.DataFrame(data, columns=['Text_Length'])

# Convert Text_Length to numeric
df['Text_Length'] = pd.to_numeric(df['Text_Length'], errors='coerce')

# Drop NaN values
df = df.dropna()

# Plotting
plt.figure(figsize=(10, 6))
plt.boxplot(df['Text_Length'])
plt.xlabel('Text Length')
plt.ylabel('Number of Characters')
plt.title('Distribution of Text Length in Extended Tweets')
plt.show()
//Regular 
import React, { useState, useEffect } from 'react';
import { View, FlatList, ListItem, Button, Avatar } from 'react-native';
import firestore from '@react-native-firebase/firestore';

// Assuming filteredData is your initial data source
const YourComponent = () => {
  const [visibleData, setVisibleData] = useState([]);
  const [isLoading, setIsLoading] = useState(false);
  const [lastVisible, setLastVisible] = useState(null);

  useEffect(() => {
    fetchData();
  }, []);

  const fetchData = async () => {
    setIsLoading(true);
    try {
      const querySnapshot = await firestore()
        .collection('your_collection')
        .orderBy('createdAt', 'desc')
        .limit(10)
        .get();

      const newData = querySnapshot.docs.map((doc) => ({
        id: doc.id,
        ...doc.data(),
      }));
      
      setVisibleData(newData);
      setLastVisible(querySnapshot.docs[querySnapshot.docs.length - 1]);
    } catch (error) {
      console.error('Error fetching data: ', error);
    } finally {
      setIsLoading(false);
    }
  };

  const fetchMoreData = async () => {
    setIsLoading(true);
    try {
      const querySnapshot = await firestore()
        .collection('your_collection')
        .orderBy('createdAt', 'desc')
        .startAfter(lastVisible)
        .limit(10)
        .get();

      const newData = querySnapshot.docs.map((doc) => ({
        id: doc.id,
        ...doc.data(),
      }));
      
      setVisibleData((prevData) => [...prevData, ...newData]);
      setLastVisible(querySnapshot.docs[querySnapshot.docs.length - 1]);
    } catch (error) {
      console.error('Error fetching more data: ', error);
    } finally {
      setIsLoading(false);
    }
  };

  const handleEndReached = () => {
    if (!isLoading) {
      fetchMoreData();
    }
  };

  return (
    <FlatList
      data={visibleData}
      keyExtractor={(item) => item.id}
      ListEmptyComponent={() =>
        isLoading ? <EventMenuProduct /> : <NoData />
      }
      onEndReached={handleEndReached}
      onEndReachedThreshold={0.1} // Adjust this threshold as needed
      renderItem={({ item, index }) => (
        <View
          key={index}
          style={{
            alignContent: 'center',
            alignSelf: 'center',
          }}
        >
          {/* Your existing renderItem logic */}
        </View>
      )}
    />
  );
};

export default YourComponent;


/// With my code
import React, { useState, useEffect } from 'react';
import { View, FlatList, ListItem, Button, Avatar } from 'react-native';
import { collection, getDocs, onSnapshot } from 'firebase/firestore';
import { db } from 'your-firebase-config-file'; // Import your Firebase database config

// Assuming filteredData is your initial data source
const YourComponent = ({ category }) => {
  const [products, setProducts] = useState([]);
  const [isLoading, setIsLoading] = useState(false);
  const [lastDoc, setLastDoc] = useState(null);

  useEffect(() => {
    fetchMenuData();
  }, []);

  const fetchMenuData = async () => {
    setIsLoading(true);
    try {
      const subCollectionNames = getCategorySubCollectionNames(category);

      const allProducts = [];

      const subCollectionPromises = subCollectionNames.map(async (subCollectionName) => {
        const subCollectionRef = collection(db, `vehicles/${category}/${subCollectionName}`);
        const subCollectionSnapshot = await getDocs(subCollectionRef);

        subCollectionSnapshot.forEach((doc) => {
          allProducts.push({ id: doc.id, ...doc.data() });
        });

        const unsubscribe = onSnapshot(subCollectionRef, (snapshot) => {
          snapshot.docChanges().forEach((change) => {
            if (change.type === 'added') {
              setProducts((prevProducts) => [...prevProducts, { id: change.doc.id, ...change.doc.data() }]);
            }
          });
        });

        return () => unsubscribe();
      });

      await Promise.all(subCollectionPromises);
      setIsLoading(false);
    } catch (error) {
      console.error('Error fetching menu data:', error);
      setIsLoading(false);
    }
  };

  const getCategorySubCollectionNames = (category) => {
    switch (category) {
      case 'Buying':
        return ['subCollectionName1', 'subCollectionName2']; // Adjust with your subcollection names
      case 'Renting':
        return ['subCollectionName3', 'subCollectionName4']; // Adjust with your subcollection names
      default:
        return [];
    }
  };

  const handleEndReached = () => {
    if (!isLoading) {
      fetchMoreData();
    }
  };

  const fetchMoreData = async () => {
    setIsLoading(true);
    try {
      const subCollectionNames = getCategorySubCollectionNames(category);

      const allProducts = [];

      const subCollectionPromises = subCollectionNames.map(async (subCollectionName) => {
        const subCollectionRef = collection(db, `vehicles/${category}/${subCollectionName}`);

        const query = lastDoc ? subCollectionRef.startAfter(lastDoc) : subCollectionRef;

        const subCollectionSnapshot = await getDocs(query);

        subCollectionSnapshot.forEach((doc) => {
          allProducts.push({ id: doc.id, ...doc.data() });
        });

        const lastDocument = subCollectionSnapshot.docs[subCollectionSnapshot.docs.length - 1];
        setLastDoc(lastDocument);

        return allProducts;
      });

      const productsArray = await Promise.all(subCollectionPromises);
      const mergedProducts = productsArray.reduce((acc, curr) => acc.concat(curr), []);

      setProducts((prevProducts) => [...prevProducts, ...mergedProducts]);
      setIsLoading(false);
    } catch (error) {
      console.error('Error fetching more data:', error);
      setIsLoading(false);
    }
  };

  return (
    <FlatList
      data={products}
      keyExtractor={(item) => item.id}
      ListEmptyComponent={() => isLoading ? <EventMenuProduct /> : <NoData />}
      onEndReached={handleEndReached}
      onEndReachedThreshold={0.1}
      renderItem={({ item }) => (
        <View style={{ /* Your styling */ }}>
          {/* Your rendering logic */}
        </View>
      )}
    />
  );
};

export default YourComponent;

#Latest tnsnames.ora
https://tns2web.dev.oci.bonprix.de/tnsnames.ora

wget https://tns2web.dev.oci.bonprix.de/tnsnames.ora
sudo cp -v tnsnames.ora /etc/oracle/
import React, { useState, useEffect } from 'react';
import { View, FlatList, ListItem, Button, Avatar } from 'react-native';
import firestore from '@react-native-firebase/firestore';

// Assuming filteredData is your initial data source
const YourComponent = () => {
  const [visibleData, setVisibleData] = useState([]);
  const [isLoading, setIsLoading] = useState(false);
  const [lastVisible, setLastVisible] = useState(null);

  useEffect(() => {
    fetchData();
  }, []);

  const fetchData = async () => {
    setIsLoading(true);
    try {
      const querySnapshot = await firestore()
        .collection('your_collection')
        .orderBy('createdAt', 'desc')
        .limit(10)
        .get();

      const newData = querySnapshot.docs.map((doc) => ({
        id: doc.id,
        ...doc.data(),
      }));
      
      setVisibleData(newData);
      setLastVisible(querySnapshot.docs[querySnapshot.docs.length - 1]);
    } catch (error) {
      console.error('Error fetching data: ', error);
    } finally {
      setIsLoading(false);
    }
  };

  const fetchMoreData = async () => {
    setIsLoading(true);
    try {
      const querySnapshot = await firestore()
        .collection('your_collection')
        .orderBy('createdAt', 'desc')
        .startAfter(lastVisible)
        .limit(10)
        .get();

      const newData = querySnapshot.docs.map((doc) => ({
        id: doc.id,
        ...doc.data(),
      }));
      
      setVisibleData((prevData) => [...prevData, ...newData]);
      setLastVisible(querySnapshot.docs[querySnapshot.docs.length - 1]);
    } catch (error) {
      console.error('Error fetching more data: ', error);
    } finally {
      setIsLoading(false);
    }
  };

  const handleEndReached = () => {
    if (!isLoading) {
      fetchMoreData();
    }
  };

  return (
    <FlatList
      data={visibleData}
      keyExtractor={(item) => item.id}
      ListEmptyComponent={() =>
        isLoading ? <EventMenuProduct /> : <NoData />
      }
      onEndReached={handleEndReached}
      onEndReachedThreshold={0.1} // Adjust this threshold as needed
      renderItem={({ item, index }) => (
        <View
          key={index}
          style={{
            alignContent: 'center',
            alignSelf: 'center',
          }}
        >
          {/* Your existing renderItem logic */}
        </View>
      )}
    />
  );
};

export default YourComponent;
#COMPLETE
#!/bin/bash

if ! grep -q 'REQUESTS_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt' ~/.bashrc; then \
	wget http://pki.bonprix.de/aia/bpRootCA01.crt; \
	openssl x509 -inform der -outform pem -in bpRootCA01.crt -out bpRootCA01-pem.crt; \
	sudo cp bpRootCA01-pem.crt /usr/local/share/ca-certificates/bpRootCA01.crt; \
	sudo update-ca-certificates --fresh; \
	if [ -x "$(command -v python)" ]; then
		python -m pip config set global.cert /etc/ssl/certs/ca-certificates.crt; \
	fi;
	echo 'export REQUESTS_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt' >> ~/.bashrc; \
	source ~/.bashrc; \
	export REQUESTS_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt; \
fi;
if [ ! -L /opt/oracle/instantclient ]; then \
	sudo rm -f /etc/profile.d/bp_envs.sh; \
	echo 'export ORACLE_HOME="/opt/oracle/instantclient"' | sudo tee /etc/profile.d/bp_envs.sh; \
	echo 'export TNS_ADMIN="/etc/oracle"' | sudo tee -a /etc/profile.d/bp_envs.sh; \
	echo 'export DYLD_LIBRARY_PATH="/opt/oracle/instantclient"' | sudo tee -a /etc/profile.d/bp_envs.sh; \
	echo 'export LD_LIBRARY_PATH="/opt/oracle/instantclient"' | sudo tee -a /etc/profile.d/bp_envs.sh; \
	echo 'export SQLPATH="/opt/oracle/instantclient"' | sudo tee -a /etc/profile.d/bp_envs.sh; \
	echo 'export PATH=$PATH:"/opt/oracle/instantclient"' | sudo tee -a /etc/profile.d/bp_envs.sh; \
	sh /etc/profile.d/bp_envs.sh; \
	sudo apt-get update && sudo apt-get install -q -y libaio1 gcc libc-dev; \
	cd /opt; \
	sudo curl -o oracle.tgz https://digistyle.bonprix.net/artifactory/docker-external/oracle/instantclient/19.3.0.0.0/instantclient-19.3.0.0.0.tar.gz; \
	sudo tar -xf oracle.tgz; \
	sudo rm -f oracle.tgz; \
	cd; \
	if [ ! -x "$(command -v git)" ]; then
		sudo apt-get update && sudo apt-get install git -y -q; \
	fi;
 	git clone https://ai-squad-fetch-token:glpat-H8y665Wgn9vhYuRE-eMG@gitlab-es.bonprix.work/em-ps-admin/tnsnames; \
	sudo mkdir -p /etc/oracle; \
	sudo mv tnsnames/tnsnames.ora /etc/oracle/; \
	sudo rm -r tnsnames; \
	sudo reboot; \
fi;
void setup() {
  // put your setup code here, to run once:
  pinMode(13, OUTPUT);
  pinMode(3, INPUT);
  Serial.begin(9600);
}

void loop() {
  // put your main code here, to run repeatedly:
  if (digitalRead(3) == LOW)
  {
    digitalWrite(13, HIGH);
    delay(10);
  }
  else
  {
    digitalWrite(13, LOW);
    delay(10);
  }
}
Cypress.on('uncaught:exception', (err, runnable) => {
    // returning false here prevents Cypress from
    // failing the test
    return false
})
html, body{
	width:100%;
	overflow-x:hidden;
	font-family: "Montserrat", Sans-serif;
}
.embed-footer{
	display:none !Important;
}
.embed-container .embed-header .embed-title {
	display:none !Important;
}
.entry-content p {
    margin-bottom: 15px !important;
}
.header-main-layout-2 .site-branding {
    text-align: center;
    padding-bottom:0 !important;
}
.ast-site-identity {
    padding: 1em 0 0 0 !Important;
}
@media(max-width:767px){
	.ast-site-identity {
    padding: 0 !Important;
}
	.ast-mobile-menu-buttons{
		position:relative;
		top:8px;
		right: -10px;
	}
	.ast-header-break-point .ast-above-header-mobile-inline .above-header-2 .ast-above-header-section-1, .ast-header-break-point .ast-above-header-mobile-stack .above-header-2 .ast-above-header-section-1 {
    padding: 0 0 0 0 !important;
}
	.ast-above-header {
    padding-top: 0 !Important;
}
	.above-header-user-select .ast-custom-html{
		line-height:30px;
	}
}
.ast-logo-title-inline .site-logo-img {
    padding-right: 0 !important;
}
a{
	outline:0 !important;
}
a:hover, a:focus{
	outline:0 !Important;
}
/* .elementor-icon-list-text{
	color: #3b4651 !important;
} */
.ct-ultimate-gdpr-cookie-content a{
	color:#000000 !important;
}
.mp_wrapper{
display:none;
}
.ele-mp .mp_wrapper{
	display:block;
}

/** Start Block Kit CSS: 72-3-34d2cc762876498c8f6be5405a48e6e2 **/

.envato-block__preview{overflow: visible;}

/*Kit 69 Custom Styling for buttons */
.envato-kit-69-slide-btn .elementor-button,
.envato-kit-69-cta-btn .elementor-button,
.envato-kit-69-flip-btn .elementor-button{
	border-left: 0px !important;
	border-bottom: 0px !important;
	border-right: 0px !important;
	padding: 15px 0 0 !important;
}
.envato-kit-69-slide-btn .elementor-slide-button:hover,
.envato-kit-69-cta-btn .elementor-button:hover,
.envato-kit-69-flip-btn .elementor-button:hover{
	margin-bottom: 20px;
}
.envato-kit-69-menu .elementor-nav-menu--main a:hover{
	margin-top: -7px;
	padding-top: 4px;
	border-bottom: 1px solid #FFF;
}
/* Fix menu dropdown width */
.envato-kit-69-menu .elementor-nav-menu--dropdown{
	width: 100% !important;
}

/** End Block Kit CSS: 72-3-34d2cc762876498c8f6be5405a48e6e2 **/

/* Contact Page -> Form Submit Button */
.elementor-27075 .elementor-element.elementor-element-90f53f5 .elementor-button[type="submit"]{
    background: transparent linear-gradient(90deg, #ec028b, #f9423a) 0 0 no-repeat padding-box;
}

.elementor-2036 .elementor-element.elementor-element-8454f52 .elementor-button[type="submit"] {
	    background: transparent linear-gradient(90deg, #ec028b, #f9423a) 0 0 no-repeat padding-box;
}

/* FAQ section */
.elementor-toggle-item {
/*     box-shadow: 0 0.58824rem 1.17647rem rgba(0,0,0,.05); */
    border-radius: .35rem;
/*     padding-top: 8px;
    padding-bottom: 8px;
	padding-left: 10px;
	  padding-right: 10px; */
/*     border: .01px solid #EBEBEB ; */
/* 	padding: 1.05882rem 2.94118rem 1.11765rem 2.35294rem; */
	border: 2px solid #f6f7f7;
	transition: border, color, outline, box-shadow, border-color .15s ease-in-out;
	will-change: border, color, outline, box-shadow, border-color;
}

.elementor-toggle-item > div > p > a {
    font-family: Montserrat, sans-serif !important;
	font-size: 15px;
	color: #f35a21;
	
    font-weight: 600 !important;

}

.elementor-toggle-item:hover {
	border: 2px solid #00aeaa;
}

input[type="password"]:focus,input[type="text"]:focus,input[type="email"]:focus,
input[type="tel"]:focus,input[type="textarea"]:focus, .elementor-field-textual:focus{
    border: 2px solid #00aeaa !important;
}


.mp_wrapper input[type="password"]:focus {
	 border: 2px solid #00aeaa !important;
}



.mp-form-label{
	font-family: "Montserrat", Sans-serif;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4em;
}

.mp-form-label label {
	line-height: 1.4em !important;
}

.mp_wrapper input[type="text"], .mp_wrapper input[type="url"], .mp_wrapper input[type="email"], .mp_wrapper input[type="tel"], .mp_wrapper input[type="number"], .mp_wrapper input[type="password"]{
background-color: #FFFFFF;
    border-color: var(--e-global-color-844b050);
    border-width: 2px 2px 2px 2px;
    border-radius: .35rem .35rem .35rem .35rem;
	font-family: "Montserrat", Sans-serif;
    font-size: 15px;
    font-weight: 500;
	color:#000000;
}

.elementor-kit-37 input[type="submit"] {
	background: transparent linear-gradient(90deg, #ec028b, #f9423a) 0 0 no-repeat padding-box;
	font-family: "Montserrat", Sans-serif;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-style: none;
    padding: 1.2rem 4rem 1.2rem 4rem;
	border-radius: 2px;
}

.mepr-login-actions a {
	font-size: 14px;
}


.elementor-page-1757 {
	font-family: "Montserrat", Sans-serif;
}

.mepr-stripe-card-element, .mp_wrapper .mepr-payment-method .spc input {
	background-color: #FFFFFF;
    border-color: #F0F0F0 !important;
    border-width: 2px 2px 2px 2px !important;
    border-radius: .35rem .35rem .35rem .35rem;
	font-family: "Montserrat", Sans-serif;
    font-size: 15px;
    font-weight: 500;
	color:#000000;
	line-height: 1.8rem ;
}
function year_shortcode() {
  $year = date('Y');
  return $year;
}
add_shortcode('year', 'year_shortcode');
function combinations(arr, len) {
    let tempArry = []
    let final = []
    for (let i = 0; i < arr.length; i++) {
        console.log("i ", i)
        if ((arr.length - i) == (len - 1)) {
            break
        }
        tempArry.push(arr[i])
        for (let j = i + 1; j < arr.length; j++) {
            console.log("j ", j)
            tempArry.push(arr[j])
            console.log("tempArry ", tempArry)
            if (tempArry.length == len) {
                console.log("tempArry inside if ", tempArry)
                final.push([...tempArry])
                console.log("final inside if ", final)
                tempArry.pop()
            }
        }
        tempArry = []
    }
    console.log("final ", final)
    return final
}
combinations([1, 2, 3, 4, 5], 3)
function flatten(array) {
  var l = array.length;
  while (l--) {
    if (Array.isArray(array[l])) {
      flatten(array[l]);
      array.splice(l, 1, ...array[l]);
    }
  }
}


var array = [['1', '2', '3'], ['4', '5', ['6'], ['7', '8']]];

flatten(array);

console.log(array);
/**
 * This is a test to see how much CPU time it takes to generate
 * 100k Cell object instances in a referenceable way and find the most efficient 
 * way to do so.
 * Also calculate how long it takes to then reference each Object instance based
 * on the object x,y,z indexes.
 * Note: the generation of 100 records and adding to the map takes about 240ms
 *       so that needs to be deducted from the instantiation, but is still part
 *       of the calculation required for the solution
 */
// Test Settings
Integer numberOfSheets  = 10;   // wsi
Integer numberOfRows    = 100;  // ri
Integer numberOfColumns = 100;  // ci

// Multidimentional array for storing the cells
Cell[][][] cells = new Cell[][][]{};

// Register start time
Decimal st = Limits.getCpuTime();

// Iterate the number of worksheets
for(Integer wsi=0; wsi < numberOfSheets; wsi++){

    // Add a column / row array for each worksheet
    cells.add(new Cell[][]{});
    
    // Iterate the number of columns
    for(Integer ri=0; ri < numberOfRows; ri++){
        
        // Add a column array for each row
        cells[wsi].add(new Cell[]{});

        // Add Cells to the row
        for(Integer ci = 0; ci < numberOfColumns; ci++){
            cells[wsi][ri].add(new Cell(wsi,ri,ci));
        }
    }
}

// Register end time
Decimal et = Limits.getCpuTime();

// Loop through xyz
for(Integer wsi = 0; wsi < numberOfSheets; wsi++){
    for(Integer ri=0; ri < numberOfRows; ri++){
        for(Integer ci = 0; ci < numberOfColumns; ci++){
            getCell(wsi, ri,ci);
        }
    }
}

// Register final end time
Decimal fet = Limits.getCpuTime();

// Output metrics
System.debug('Generation Time: ' + (et-st)  + ' (' + (numberOfSheets * numberOfRows * numberOfColumns) + ' cells)');
System.debug('Reference  Time: ' + (fet-et) + ' (' + (numberOfSheets * numberOfRows * numberOfColumns) + ' cells)');

/**
 * Method to reference a cell at a certain position
 */
Cell getCell(Integer wsi, Integer ci, Integer ri){
    return cells[wsi][ci][ri];
}


/**
 * Basic class example of a cell
 */
class Cell{
    Integer wsi;
    Integer ri;
    Integer ci;

    Cell(Integer wsi, Integer ri, Integer ci){
        this.wsi = wsi;
        this.ri  = ri;
        this.ci  = ci;
    }
}
helm install aws-load-balancer-controller eks/aws-load-balancer-controller \            
  -n kube-system \
  --set clusterName=<your-cluster-name> \
  --set serviceAccount.create=false \
  --set serviceAccount.name=aws-load-balancer-controller \
  --set region=<region> \
  --set vpcId=<your-vpc-id>
eksctl create iamserviceaccount \
  --cluster=<your-cluster-name> \
  --namespace=kube-system \
  --name=aws-load-balancer-controller \
  --role-name AmazonEKSLoadBalancerControllerRole \
  --attach-policy-arn=arn:aws:iam::<your-aws-account-id>:policy/AWSLoadBalancerControllerIAMPolicy \
  --approve
aws iam create-policy \
    --policy-name AWSLoadBalancerControllerIAMPolicy \
    --policy-document file://iam_policy.json
aws iam create-policy \
    --policy-name AWSLoadBalancerControllerIAMPolicy \
    --policy-document file://iam_policy.json
.elementor-post__read-more {background:#993333;
    padding-right: 25px;
    padding-left:25px; 
    padding-bottom: 10px;
    padding-top: 10px;
}
.elementor-post__thumbnail {  
 margin-left: 20px;
  margin-right: 20px;
  

}
rupert
.Su04.Po03

email
Rt=05?Qp04
// Test Config
String strX = 'value';
Integer itr = 100000;

/**
 * METHOD 01 Simple String Concat
 * Heap Size 24, CPU Time 5803 (100k iterations)
 */
// Add values to the simpleConcatString string
Integer heapStart = limits.getHeapSize();
Integer cpuStart  = limits.getCpuTime();
basicConcatMethod('');
Integer cpuEnd  = limits.getCpuTime();
Integer heapEnd = limits.getHeapSize();


/**
 * METHOD 02 XML StreamWriter Concat Method Cheat 
 * Heap Size 24, CPU Time 721 (100k iterations)
 */
Integer heapCheatStart = limits.getHeapSize();
Integer cpuCheatStart  = limits.getCpuTime();
xmlCheatMethod(new XmlStreamWriter());
Integer cpuCheatEnd    = limits.getCpuTime();
Integer heapCheatEnd   = limits.getHeapSize();

// Let's run it again with an example usage and also validate the results are the same
Assert.areEqual(
	basicConcatMethod(''),
    xmlCheatMethod(new XmlStreamWriter())
);

// Add the debugs at the end as we have a huge debug log with 100k iterations
System.debug('');
System.debug('HEAP string concat: ' + (heapEnd      - heapStart      ));
System.debug('CPUT string concat: ' + (cpuEnd       - cpuStart       ));
System.debug('');
System.debug('HEAP XML Cheat:     ' + (heapCheatEnd - heapCheatStart ));
System.debug('CPUT XML Cheat:     ' + (cpuCheatEnd  - cpuCheatStart  ));
System.debug('');


/**
 * Put your concatenation logic in here
 */
static String basicConcatMethod(String input){
    for(Integer i =0; i<itr; i++){
        input+=strX;
    }
    return input;
}


/**
 * or here
 */
static String xmlCheatMethod(XmlStreamWriter xsw){
    for(Integer i =0; i<itr; i++){
        xsw.writeCharacters(strX);
    }
    return xsw.getXmlString();
}

---
apiVersion: v1
kind: Namespace
metadata:
  name: game-2048
---
apiVersion: apps/v1
kind: Deployment
metadata:
  namespace: game-2048
  name: deployment-2048
spec:
  selector:
    matchLabels:
      app.kubernetes.io/name: app-2048
  replicas: 5
  template:
    metadata:
      labels:
        app.kubernetes.io/name: app-2048
    spec:
      containers:
      - image: public.ecr.aws/l6m2t8p7/docker-2048:latest
        imagePullPolicy: Always
        name: app-2048
        ports:
        - containerPort: 80
---
apiVersion: v1
kind: Service
metadata:
  namespace: game-2048
  name: service-2048
spec:
  ports:
    - port: 80
      targetPort: 80
      protocol: TCP
  type: NodePort
  selector:
    app.kubernetes.io/name: app-2048
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  namespace: game-2048
  name: ingress-2048
  annotations:
    alb.ingress.kubernetes.io/scheme: internet-facing
    alb.ingress.kubernetes.io/target-type: ip
spec:
  ingressClassName: alb
  rules:
    - http:
        paths:
        - path: /
          pathType: Prefix
          backend:
            service:
              name: service-2048
              port:
                number: 80
eksctl create fargateprofile \
    --cluster demo-cluster \
    --region us-east-1 \
    --name alb-sample-app \
    --namespace game-2048
aws eks update-kubeconfig --name demo-cluster  --region us-east-1
InitInsert; New implementation
            if "No." = '' then begin
                TestNoSeries();
                NoSeriesCode := GetNoSeriesCode();
#if not CLEAN24
                NoSeriesMgt.RaiseObsoleteOnBeforeInitSeries(NoSeriesCode, xRec."No. Series", "Posting Date", "No.", "No. Series", IsHandled);
                if not IsHandled then begin
#endif
                    "No. Series" := NoSeriesCode;
                    if NoSeries.AreRelated("No. Series", xRec."No. Series") then
                        "No. Series" := xRec."No. Series";
                    "No." := NoSeries.GetNextNo("No. Series", "Posting Date");
                    SalesHeader2.ReadIsolation(IsolationLevel::ReadUncommitted);
                    SalesHeader2.SetLoadFields("No.");
                    while SalesHeader2.Get("Document Type", "No.") do
                        "No." := NoSeries.GetNextNo("No. Series", "Posting Date");
#if not CLEAN24
                    NoSeriesMgt.RaiseObsoleteOnAfterInitSeries("No. Series", NoSeriesCode, "Posting Date", "No.");
                end;
#endif
OPTION 1 - to include only the below in cypress.json:

"reporter": "cypress-multi-reporters",
"reporterOptions": {
  "configFile": "reporter-config.json"
}
 Save
Then to create a new file called reporter-config.json, and add the config for each reporter in there:

{
  "reporterEnabled": "mochawesome, autoset-status-cypress-testrail-reporter",
  "mochawesomeReporterOptions": {
    "reportDir": "cypress/reports",
    "overwrite": false,
    "html": true,
    "json": false
  },
  "autosetStatusCypressTestrailReporterReporterOptions": {
    "host": "https://xxxxxx/",
    "username": "xxxxx",
    "password": "xxxx",
    "projectId": 1,
    "runId": 1234
  }
}
cd\
cd "G:\My Drive\_My_projects\_Snippets\export_monday_defects_data"
cls
python export_monday_defects_data.py
cd\
cd "G:\My Drive\_My_projects\_Snippets\indent_json"
cls
python indent_json4.py input.json output.json 4
cd\
cd "G:\My Drive\_My_projects\_Snippets\Convert md_to_docx (Pandoc)"
cls
pandoc --highlight-style=zenburn input.md -f markdown -t docx -s -o output.docx
star

Wed May 15 2024 22:59:38 GMT+0000 (Coordinated Universal Time) https://github.com/S4-2024/Lista2/tree/main/src

@gabriellesoares

star

Wed May 15 2024 22:45:25 GMT+0000 (Coordinated Universal Time) https://github.com/gabriellesote

@gabriellesoares

star

Wed May 15 2024 22:44:26 GMT+0000 (Coordinated Universal Time) https://github.com/S4-2024/Lista2/blob/main/src/Questão2A/RecorrenciaInducao.java

@gabriellesoares

star

Wed May 15 2024 21:22:33 GMT+0000 (Coordinated Universal Time)

@FXA #javascript

star

Wed May 15 2024 17:32:15 GMT+0000 (Coordinated Universal Time)

@Mohamedshariif #c++

star

Wed May 15 2024 17:30:46 GMT+0000 (Coordinated Universal Time)

@Mohamedshariif #c++

star

Wed May 15 2024 16:39:39 GMT+0000 (Coordinated Universal Time)

@RehmatAli2024 #deluge

star

Wed May 15 2024 16:18:37 GMT+0000 (Coordinated Universal Time)

@StefanoGi

star

Wed May 15 2024 16:12:55 GMT+0000 (Coordinated Universal Time)

@jrg_300i #undefined

star

Wed May 15 2024 14:11:44 GMT+0000 (Coordinated Universal Time)

@StefanoGi

star

Wed May 15 2024 11:22:42 GMT+0000 (Coordinated Universal Time)

@RehmatAli2024 #deluge

star

Wed May 15 2024 10:38:40 GMT+0000 (Coordinated Universal Time) https://chatgpt.com/c/be637bfa-4b91-4dd6-aedf-0664dd65725c

@beyza

star

Wed May 15 2024 10:35:17 GMT+0000 (Coordinated Universal Time) https://chatgpt.com/c/be637bfa-4b91-4dd6-aedf-0664dd65725c

@beyza

star

Wed May 15 2024 10:33:47 GMT+0000 (Coordinated Universal Time) https://chatgpt.com/c/be637bfa-4b91-4dd6-aedf-0664dd65725c

@beyza

star

Wed May 15 2024 10:26:25 GMT+0000 (Coordinated Universal Time) https://chatgpt.com/c/3e4f5a44-577a-4ca4-970d-80b8a2a76efa

@beyza

star

Wed May 15 2024 10:24:16 GMT+0000 (Coordinated Universal Time) https://chatgpt.com/c/3e4f5a44-577a-4ca4-970d-80b8a2a76efa

@beyza

star

Wed May 15 2024 10:22:12 GMT+0000 (Coordinated Universal Time) https://chatgpt.com/c/3e4f5a44-577a-4ca4-970d-80b8a2a76efa

@beyza

star

Wed May 15 2024 10:04:04 GMT+0000 (Coordinated Universal Time) https://chatgpt.com/c/3e4f5a44-577a-4ca4-970d-80b8a2a76efa

@beyza

star

Wed May 15 2024 10:01:15 GMT+0000 (Coordinated Universal Time)

@Samarmhamed78

star

Wed May 15 2024 10:01:10 GMT+0000 (Coordinated Universal Time) https://chatgpt.com/c/3e4f5a44-577a-4ca4-970d-80b8a2a76efa

@beyza

star

Wed May 15 2024 09:44:03 GMT+0000 (Coordinated Universal Time) https://blocksentinels.com/blockchain-game-development-company

@harsha98 #blockchain #gamedevelopment

star

Wed May 15 2024 09:08:03 GMT+0000 (Coordinated Universal Time) https://blocksentinels.com/blockchain-game-development-company

@harsha98 #blockchain #gamedevelopment

star

Wed May 15 2024 08:50:05 GMT+0000 (Coordinated Universal Time)

@madgakantara

star

Wed May 15 2024 05:35:47 GMT+0000 (Coordinated Universal Time)

@hardikraja #commandline #linux

star

Wed May 15 2024 05:33:48 GMT+0000 (Coordinated Universal Time)

@hardikraja #commandline #linux

star

Wed May 15 2024 04:13:15 GMT+0000 (Coordinated Universal Time)

@iliavial #c#

star

Wed May 15 2024 03:36:16 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/53845493/cypress-uncaught-assertion-error-despite-cy-onuncaughtexception

@al.thedigital #exception #false

star

Wed May 15 2024 00:14:25 GMT+0000 (Coordinated Universal Time) https://testing.profitbusters.com/

@batman12050

star

Tue May 14 2024 22:39:20 GMT+0000 (Coordinated Universal Time) https://css-tricks.com/snippets/wordpress/year-shortcode/

@systemsroncal #php #wordpress

star

Tue May 14 2024 19:17:01 GMT+0000 (Coordinated Universal Time)

@Akhil_preetham #javascript

star

Tue May 14 2024 17:36:13 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/38031719/making-an-array-flat-understanding-the-solution

@RobertoSilvaZ #javascript #array

star

Tue May 14 2024 15:56:57 GMT+0000 (Coordinated Universal Time)

@Justus

star

Tue May 14 2024 15:00:29 GMT+0000 (Coordinated Universal Time)

@Vivekstyn

star

Tue May 14 2024 14:49:27 GMT+0000 (Coordinated Universal Time)

@Vivekstyn

star

Tue May 14 2024 14:46:47 GMT+0000 (Coordinated Universal Time)

@Vivekstyn

star

Tue May 14 2024 14:38:46 GMT+0000 (Coordinated Universal Time)

@Vivekstyn

star

Tue May 14 2024 13:34:43 GMT+0000 (Coordinated Universal Time)

@odesign

star

Tue May 14 2024 13:22:53 GMT+0000 (Coordinated Universal Time) https://pwpush.com/en/p/ulty-fwrovdinjqycyy

@tianzonrupert

star

Tue May 14 2024 12:17:47 GMT+0000 (Coordinated Universal Time)

@Justus

star

Tue May 14 2024 11:38:24 GMT+0000 (Coordinated Universal Time) https://medium.com/@priscillashamin/how-to-install-and-configure-nvm-on-mac-os-43e3366c75a6

@temp

star

Tue May 14 2024 11:29:32 GMT+0000 (Coordinated Universal Time)

@Vivekstyn

star

Tue May 14 2024 11:27:01 GMT+0000 (Coordinated Universal Time)

@Vivekstyn

star

Tue May 14 2024 11:17:24 GMT+0000 (Coordinated Universal Time)

@Vivekstyn

star

Tue May 14 2024 08:46:32 GMT+0000 (Coordinated Universal Time) https://kepty.cz/2024/02/18/replace-noseriesmanagement-with-the-new-bc-foundation-no-series-app-1-2/

@obaidullahjadun #al

star

Tue May 14 2024 08:21:21 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/73729492/cypress-multi-reporters-using-mochawesome-with-autoset-status-cypress-testrail

@al.thedigital #cypress #config #plugins #add

star

Tue May 14 2024 08:21:21 GMT+0000 (Coordinated Universal Time)

@lavil80

star

Tue May 14 2024 08:20:37 GMT+0000 (Coordinated Universal Time)

@lavil80

star

Tue May 14 2024 08:10:19 GMT+0000 (Coordinated Universal Time)

@lavil80

Save snippets that work with our extensions

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