Skip to content

Instantly share code, notes, and snippets.

View codebreaker0001's full-sized avatar

Adarsh Yadav codebreaker0001

View GitHub Profile
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define ll long long
#define ull unsigned long long
#define modd 1e9 + 7
#define pb(e) push_back(e)
#define sv(a) sort(a.begin(), a.end())
@codebreaker0001
codebreaker0001 / movingAverage.cpp
Created April 16, 2025 07:22
block for moving average
#include <iostream>
#include <vector>
#include <stdexcept>
#include <iomanip> // for std::setprecision
// Function to calculate the Simple Moving Average (SMA)
// Parameters:
// prices: a vector of historical price data (double)
// window: the number of periods over which to calculate the average (int)
// Returns:
ll findmx(vector<ll> a){
ll n = a.size();
ll ans = 0;
ll sum =0 ;
fo(i,0,n){
if(sum+a[i]>0){
sum+=a[i];
ans= max(sum,ans);
}
else{
import bcrypt from 'bcrypt';
import * as argon2 from "argon2";
import jwt from 'jsonwebtoken';
import User from '../modles/user.js';
import { configDotenv } from 'dotenv'
A version control system (VCS) is typically used for tracking changes in text-based files, such as source code and documentation. However, you can still use a VCS for managing changes to photo editing projects if you structure your project in a way that allows it. Here's how you can adapt version control for a photo editing project:
Directory Structure: Organize your project into a directory structure. For example, you could have a "Photos" directory where you store your original and edited photos, and a separate directory for any text-based files related to the project.
Text Files: Keep notes, descriptions, or metadata related to the project in text files. This might include details about edits, versions, or any other information you want to track.
Use a VCS: Choose a VCS such as Git, Mercurial, or Subversion, and initialize a repository in the project's root directory. Version control will primarily track changes in text-based files, so you'll commit changes to text files, not the images themselves.
Com
"use client"
import { Link, NavLink } from 'react-router-dom';
// import Link from 'next/link'
import './header.css'
// import MetmaskConnect from './metamaskConnection/metamask'
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
.main {
display: flex;