Snippets Collections
class employe{
    private String nom;
    private String prenom;
    private int age;
    private float salaire;
    public employe(){
        this.nom="sahar";
        this.prenom="mess";
        this.age=20;
        this.salaire=4000;}
     employe(String nom,String prenom,int age,float salaire){
        this.nom=nom;
        this.prenom=prenom;
        this.age=age;
        this.salaire=salaire;
    }
      employe(employe e){
         this.nom=e.nom;
         this.prenom=e.prenom;
         this.age=e.age;
         this.salaire=e.salaire;
     }   
    public String getNom(){
        return this.nom;
    }
    public String getPrenom(){
        return this.prenom;
    }
     int getAge(){
        return this.age;
    }
    float getSalaire(){
        return this.salaire;
    }
     void setNom(String nom){
        this.nom=nom;
    }
     void setPrenom(String prenom){
        this.prenom=prenom;
    }
     void setAge(int age){
        this.age=age;
    }
     void setSalaire(float salaire){
        this.salaire=salaire;
    }
 void aug(float so){
     this.salaire+=so;
 } 
 public String toString(){
     String ch;
     ch="le nom est :"+this.nom+"| prenom est :"+this.prenom+"| age est :"+this.age+"| le salaire est :"+this.salaire;
     return ch;
 }
 public void affiche(){
     System.out.println(this.toString());
 }}
  class tech extends employe{
     private int grade;
     public tech(){
         this.grade=1;
     }
     public tech(String nom,String prenom,int age,float salaire,int grade){
         super(nom,prenom,age,salaire);
         setGrade(grade);
     }
     public int getGrade(){
         return this.grade;
     } 
     public void setGrade(int grade){
         if(grade>=1 && grade<=3){
             this.grade=grade;
         }else{
             System.out.println("grade invalid il doit contrnir 1,2 ou 3");
         }
     }
     public float prime(){
         switch(grade){
             case 1:return 100;
             case 2:return 200;
             case 3:return 300;
             default:return 0;
         }
     }
     public String toString(){
         String ch;
         ch=super.toString()+", grade:"+this.grade+", prime"+this.prime();
         return ch;
     }
    void augmentation(){
         super.aug(this.prime());
     }
 }
 class equipe{
     tech[] tab=new tech[10];
     equipe(tech[] t){
         tab=t;

         }
     }
  public class Main{
      public static void main(String [] args){
          employe E1=new employe();
          employe E2=new employe("sarsar","messour",19,4000);
          tech t1=new tech();
          tech t2=new tech("ahmed","messaoui",49,3500,1);
          E1.affiche();
          E2.affiche();
          t1.affiche();
          t2.affiche();
          E1.aug(200);
          E1.affiche();
          t1.setGrade(2);
          t1.augmentation();
          t1.affiche();
        tech t22 = new tech("Lemoine", "Claire", 28, 1900, 2);
        tech t3 = new tech("Bernard", "Alice", 32, 2100, 1);
        tech t4 = new tech("Durand", "Eric", 27, 1950, 1);
        tech t5 = new tech("Morel", "Sophie", 26, 1850, 2);
         tech[] tab={t1,t2,t3,t4,t5};
         equipe eq=new equipe(tab);
         Technicien meilleur = techniciens[0];
        for (tech tab : 10) {
            if (t.getSalaire() > meilleur.getSalaire()) {
                meilleur = t;
            }
        }
         tech mei=grmax;
         System.out.println("le plus rande est:");
        System.out.println(mei);
    

         
      }
  }
services:
  webui:
    image: ghcr.io/open-webui/open-webui:main
    ports:
      - 3000:8080/tcp
    volumes:
      - open-webui:/app/backend/data
    extra_hosts:
      - "host.docker.internal:host-gateway"
    depends_on:
      - ollama

  ollama:
    image: ollama/ollama
    expose:
      - 11434/tcp
    ports:
      - 11434:11434/tcp
    healthcheck:
      test: ollama --version || exit 1
    volumes:
      - ollama:/root/.ollama

volumes:
  ollama:
  open-webui:
New-Item -Path 'D:\temp\Test Folder' -ItemType Directory
SELECT
EmailAddress,AMC_Status__c,Job_Role__c,AMC_Last_Activity_Date__c, Industry_Level_2_Master__c, Industry__c, SubscriberKey, Consent_Level_Summary__c,
Business_Unit__c, Region, Cat_Campaign_Most_Recent__c , Mailing_Country__c, LastModifiedDate, Language__c AS LanguageCode, CreatedDate,
FirstName, LastName, UCID

FROM (
SELECT
DISTINCT LOWER(Email__c) AS EmailAddress, i.Region__c AS Region,c.AMC_Status__c,c.Job_Role__c,c.AMC_Last_Activity_Date__c, i.Industry_Level_2_Master__c, i.Industry__c,
c.Id AS SubscriberKey, c.Consent_Level_Summary__c, i.Business_Unit__c,i.Cat_Campaign_Most_Recent__c , i.Mailing_Country__c, i.LastModifiedDate, c.Language__c, i.CreatedDate,
c.FirstName, c.LastName, ec.UCID,

ROW_NUMBER() OVER(PARTITION BY c.ID ORDER BY i.LastModifiedDate DESC) as RowNum

FROM ent.Interaction__c_Salesforce i

JOIN ent.Contact_Salesforce_1 c ON LOWER(c.Email) = LOWER(i.Email__c)
JOIN ent.[Aftermarket eCommerce - Registered Customers – Stage] ec  ON LOWER(c.Email) = LOWER(ec.Email)
INNER JOIN ent.ContactPointConsent_Salesforce AS cpc ON c.Id = cpc.Contact__c
INNER JOIN ent.DataUsePurpose_Salesforce AS dup ON cpc.DataUsePurposeId = dup.Id

WHERE ec.Email IS NOT NULL
    AND Email__c NOT LIKE '%@cat.com'
    AND i.Mailing_Country__c IS NOT NULL
    AND cpc.CaptureContactPointType = 'Email'
    AND cpc.MATM_Owner__c = 'Caterpillar'
    AND dup.Name = 'Caterpillar Marketing'
    AND cpc.PrivacyConsentStatus = 'OptIn' 
    AND (cpc.EffectiveTo IS NULL OR cpc.EffectiveTo < GetDate())
    AND (i.Mailing_State_Province__c != 'QC' OR (i.Mailing_Country__c != 'CA' AND i.Mailing_State_Province__c IS NULL))
    AND  (i.System_Language__c like 'en_%' OR (i.Mailing_Country__c != 'CA' AND i.System_Language__c is null))
        )t2

WHERE RowNum = 1
Are you looking for effective solution to build your resume online then utilize top rated online resume builder, which makes your resume building process simple and easy. It is user-friendly and completely professional tool. It helps individuals create professional resumes quickly and easily. The tool offers customizable templates, pre-written content suggestions, and formatting options to enhance visual appeal. Users can input their information, adjust layouts, and download finished resumes in various formats like Word or PDF. 
import { compareDesc, parseISO } from "date-fns";

import { allPortfolioExamplesPosts } from "contentlayer/generated";
import { sortBlogs } from "@/lib/onehour/utils";
import BlogMain from "@/components/onehoursite/blog/BlogMain";

export default async function InspirationHomePage() {
  const allPosts = allPortfolioExamplesPosts
    .filter((post) => post.isPublished)
    .sort((a, b) => {
      return compareDesc(parseISO(a.updatedAt), parseISO(b.updatedAt));
    });
  return (
    <div className="container-large ">
      <div className=" left-0 top-0 min-h-full w-full">
        <div className=" min-h-full w-full bg-[#f9fafc]">
          <div className="section mx-auto mt-0 max-w-[1440px] bg-[#f7fcfd] ">
            <section className=" relative flex flex-col bg-[url('/oneHour/marketer/marketer_hero.png')] bg-contain bg-[50%_0%]  bg-repeat pb-24 pt-0 font-garamond_normal sm:pb-40">
              <div className="container relative mx-auto flex max-w-[1440px] flex-wrap  px-4 py-0 md:px-8">
                <div className="row flex w-full flex-wrap justify-center lg:-mx-5">
                  <div className="column flex w-full max-w-full flex-shrink-0 flex-grow-0 basis-full break-words px-5 pt-4 md:w-[75%] md:max-w-[75%] md:basis-3/4 md:pt-16  xl:pt-32">
                    <div className="content-wrapper w-full">
                      <div className="column-content1 w-full">
                        <div>
                          <h1 className="pb-8 text-center text-[2.5rem] font-bold leading-[2.75rem] text-midnightBlue md:text-[3rem] md:leading-[3rem] xl:text-[4.25rem] xl:leading-[5rem]">
                            <span>Portfolio Inspirations</span>
                          </h1>
                          <p className="pb-8 text-center  text-[1.25rem] font-medium leading-[1.75rem] text-midnightBlue   md:text-[1.5rem] md:leading-[1.75] xl:text-[1.75rem] xl:leading-[2.5rem]">
                            <span>
                              Browse top portfolio examples across professions
                              to inspire your next project and showcase your
                              unique skills
                            </span>
                          </p>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            </section>
          </div>
        </div>
      </div>

      <div className="relative bg-[#f7fcfd] pb-24 pt-[10px] md:pt-[20px] lg:pt-[30px]">
        <div className="px-2 md:px-5 lg:px-20">
          <section>
            <div className="mx-2 pb-8 md:mx-3 md:pb-12 lg:mx-5 lg:pb-16">
              <div className="flex flex-col items-center justify-center px-1 md:px-2 lg:px-5">
                <h2 className="font-garamond_normal  text-[1.5rem]  font-extrabold leading-[1.75rem] text-midnightBlue md:text-[1.75rem] md:leading-[1.5rem] xl:text-[2.5rem] xl:leading-[3.75rem]">
                  All Posts
                </h2>
              </div>
            </div>

            <div>
              <BlogMain allblogposts={allPosts} />
            </div>
          </section>
        </div>
      </div>
    </div>
  );
}
/**
 *
 * @param {string[]} names - an array of ids
 * @param {string[]} names - an array of ids
 * @param {string[]} names - a blank array to push into
 *
 * This function will compare array1 with array2 and if the items dont match then they are pushed to array3
 */
const compareIds = (array1, array2, array3) => {
    array1.forEach((id) => {
        if (!array2.includes(id)) {
            array3.push(id);
        }
    });
};
class compte{
    private int solde;
    //constructeur
    public compte(int solde){
        this.solde=solde;
    }
    public int getSolde(){
        return solde;
    }
    public void retirer(int montant){
        if(montant>0 && montant <=solde){
            solde=solde-montant;
            System.out.println("Retrait de "+montant+"effectue.nouveau solde"+solde);
        }else{
            System.out.println("Retrait impossible. Solde insuffisant ou montant invalide.");
        }
    }
    public void deposer(int mon){
        if(mon>0){
            solde=solde+mon;
            System.out.println("la desposition de montant "+mon+ "avec succes"+solde);
        }else{
             System.out.println("Dépôt impossible. Montant invalide.");
        }
    }
    public void transfere(int arg,compte c2){
        if(arg>0 && arg<=solde){
            this.retirer(arg);
            c2.deposer(arg);
            System.out.println("le transfer est succes c2:"+c2);
        }else{
            System.out.println("la transfer est invalid");
        }
    }
 public class Main{
   public static void main(String[] args){
       compte c1=new compte(500);
       c1.retirer(100);
       c1.deposer(200);
       compte c2=new compte(0);
       c1.transfere(300,c2);
       System.out.println("solde final de c1:"+c1.getSolde()+"d");
       System.out.println("solde final de c2:"+c2.getSolde()+"d");
   } 
    }
}
class compte{
    private int solde;
    //constructeur
    public compte(int solde){
        this.solde=solde;
    }
    public int getSolde(){
        return solde;
    }
    public void retirer(int montant){
        if(montant>0 && montant <=solde){
            solde=solde-montant;
            System.out.println("Retrait de "+montant+"effectue.nouveau solde"+solde);
        }else{
            System.out.println("Retrait impossible. Solde insuffisant ou montant invalide.");
        }
    }
    public void deposer(int mon){
        if(mon>0){
            solde=solde+mon;
            System.out.println("la desposition de montant "+mon+ "avec succes"+solde);
        }else{
             System.out.println("Dépôt impossible. Montant invalide.");
        }
    }
    public void transfere(int arg,compte c2){
        if(arg>0 && arg<=solde){
            this.retirer(arg);
            c2.deposer(arg);
            System.out.println("le transfer est succes c2:"+c2);
        }else{
            System.out.println("la transfer est invalid");
        }
    }
 public class Main{
   public static void main(String[] args){
       compte c1=new compte(500);
       c1.retirer(100);
       c1.deposer(200);
       compte c2=new compte(0);
       c1.transfere(300,c2);
       System.out.println("solde final de c1:"+c1.getSolde()+"d");
       System.out.println("solde final de c2:"+c2.getSolde()+"d");
   } 
    }
}
<script>
    window.onscroll = function() {
        var button = document.getElementById("scrollToTop");
        if (document.body.scrollTop > 800 || document.documentElement.scrollTop > 800) {
            button.style.display = "block";
        } else {
            button.style.display = "none";
        }
    };
</script>
// config.xml
<?xml version='1.0' encoding='utf-8'?>
<widget id="com.example.fingerprintauth" version="1.0.0" xmlns="http://www.w3.org/ns/widgets">
    <name>FingerprintAuth</name>
    <description>Aplicación de autenticación por huella digital</description>
    <author email="dev@example.com" href="http://example.com">
        Tu Nombre
    </author>
    <content src="index.html" />
    <plugin name="cordova-plugin-fingerprint-aio" spec="^4.0.0" />
    <access origin="*" />
</widget>

// www/index.html
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Autenticación por Huella Digital</title>
    <link rel="stylesheet" href="css/style.css">
</head>
<body>
    <div class="container">
        <h1>Bienvenido</h1>
        <button id="authenticateButton">Autenticar con Huella Digital</button>
        <p id="status"></p>
    </div>
    <script type="text/javascript" src="cordova.js"></script>
    <script type="text/javascript" src="js/index.js"></script>
</body>
</html>

// www/css/style.css
.container {
    padding: 20px;
    text-align: center;
}

button {
    padding: 15px 30px;
    font-size: 16px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 5px;
    margin: 20px 0;
    cursor: pointer;
}

#status {
    margin-top: 20px;
    font-weight: bold;
}

// www/js/index.js
document.addEventListener('deviceready', onDeviceReady, false);

function onDeviceReady() {
    document.getElementById('authenticateButton').addEventListener('click', authenticate);
    
    // Verificar si el dispositivo soporta la autenticación biométrica
    Fingerprint.isAvailable(function(result) {
        // result contiene el tipo de biometría disponible
        console.log("Tipo de biometría: " + result);
    }, function(error) {
        console.error("Error al verificar biometría: " + error);
        document.getElementById('status').textContent = 
            "Tu dispositivo no soporta autenticación por huella digital";
    });
}

function authenticate() {
    Fingerprint.show({
        title: 'Autenticación Biométrica', // título opcional
        subtitle: 'Por favor, autentícate usando tu huella digital', // subtítulo opcional
        description: 'Toca el sensor de huella digital', // descripción opcional
        fallbackButtonTitle: 'Usar alternativa', // título del botón alternativo
        disableBackup: false // permitir autenticación alternativa
    }, successCallback, errorCallback);
}

function successCallback() {
    document.getElementById('status').textContent = 
        "¡Autenticación exitosa!";
    // Aquí puedes agregar la lógica para después de una autenticación exitosa
}

function errorCallback(error) {
    document.getElementById('status').textContent = 
        "Error en la autenticación: " + error.message;
}
// Online C++ compiler to run C++ program online
#include <iostream>
#include <vector>
#include <queue>

using namespace std ;

struct Node
{
    int data ;
    Node* left;
    Node* right;
    
    Node(int x){
        data = x;
        left = right = NULL; 
    }
}

vector <int> levelOrder(Node* root){
    vector<int> ans;
    if(!root) 
    {
        return ans; // means no root (base case )
    }
    
    queue<Node*> q ;
    q.push(root);
    while(!q.empty()){
        Node* t= q.front();
        ans.push_back(t->data);
        if(t->left) {
            q.push(t->left);
        }
        if(t->right) {
            q.push(t->right);
        }
        q.pop();
    }
    return ans;
    
}
#include<bits/stdc++.h>
using namespace std;

int main()
{
    int n,m;
    cout<<"Please enter the number";
    cin>>n;
    cout<<"please enter the bit u want to manipulate";
    cin>>m;
    cout<<"we are printing all the bits in this number";
    int bits = sizeof(n) * 4;
    for(int i=bits-1;i>=0;i--)
    {
        int bit = (n>>i)&1;
        cout<<bit;
    }
    cout<<endl;
    cout<<"now we want to manipulate bit";
    n = n^(1<<m);
    cout<<"the main vlue    "<<n<<endl;
    for(int i=bits-1;i>=0;i--)
    {
        int bit = (n>>i)&1;
        cout<<bit;
    }
    
}
<#
.SYNOPSIS
Synopsis Here

.DESCRIPTION
Description Here

.PARAMETER <parameterNameHere>
Parameter Description Here

.EXAMPLE

Example Here

.NOTES
Notes Here

#>
<strong title="Following" data-e2e="following-count">1k</strong>
<strong title="Likes" data-e2e="likes-count">55879</strong>
Integrating mapping services into a taxi booking app like Gett is essential for providing accurate navigation and real-time tracking. Here's a breakdown of how to achieve this using Gett clone:

1. Choose a reliable mapping service:
Majorly two service providers can avail of mapping services for their project demands like Google Maps, Here Maps, and OpenStreetMap. To utilize any one of the tools APIs to utilize it for your platform.

2. Get API keys and credentials
sign up for your official mail address to your chosen mapping service provider and obtain API keys and credentials.

3. Integrate the Mapping API
Utilize your purchased API to set up the display map with things like the user's current location, nearby taxis, and the route to the destination. Leverage the API for routing capabilities to calculate the shortest and most efficient routes for taxis. Incorporate real-time traffic data to avoid congestion and optimize routes. Analyze the past user activity to predict and suggest the point of interest nearby places depending upon the user's interest.

4. Optimize Map Performance
Cache frequently accessed map data to reduce API calls and improve performance. Avail offline map features for the user's convenience with limited or no network connectivity.

5.  Handle Errors and Exceptions
Incorporate robust bugs and error handling, specifically the cause of using APIs and network issues. Provide informative error messages to users and developers.

Above, these are the steps you should follow to get a far better taxi booking platform for your targeted audience. If you're seeking a taxi booking platform like Gett, then Appticz is the choice for your business demands because we have experience in providing taxi-related apps for our clients.
import java.util.*;

class Ae {

int x;

void getAe() {

System.out.println("Enter the value of x"); Scanner sc = new Scanner(System.in); x = sc.nextInt(); }

class B extends Ae {

int y:

void getB() {

System.out.println("Enter the value of y"); Scanner sc = new Scanner(System.in); y = sc.nextInt(); }

}

class C extends B {

void result() {

System.out.println("Result:=" .println("Result:=\t" + (x + y)); }

public class W2_iii_MultiLevellnheritance {

public static void main(String[] args) {

C c1 = new C();

c1.getAe();

c1.getB();

c1.result();
package csd.java.lab;

class ParentClass{

int a;

void SetData(int x) {

a=x;

}

}

class ChildClass extends ParentClass{

void ShowData() {

System.out.println("Value of a is\t"+a);

}

}

public class W2_ii_SInheritance {

public static void main(String[] args) {

ChildClass c1=new ChildClass();

c1.SetData(25);

c1.ShowData();

}

}
import java.util.Scanner;

public class EvenOddChecker {

    public static void main(String[] args) {

        Scanner scanner = new Scanner(System.in);

        int[] numbers = new int[20];

        // Input 20 numbers from the user

        System.out.println("Enter 20 numbers:");

        for (int i = 0; i < 20; i++) {

            numbers[i] = scanner.nextInt();

        }

        // Check if each number is even or odd

        for (int i = 0; i < 20; i++) {

            if (numbers[i] % 2 == 0) {

                System.out.println(numbers[i] + " is even.");

            } else {

                System.out.println(numbers[i] + " is odd.");

            }

        }

        scanner.close();

    }

}
// ExampleShader.usf

// Include common material functions
#include "Common.usf"

// Vertex shader input structure
struct VertexInput
{
    float4 Position : ATTRIBUTE0; // Vertex position
    float2 UV : ATTRIBUTE1;       // Texture coordinates
};

// Vertex shader output structure
struct VertexOutput
{
    float4 Position : SV_POSITION; // Clip-space position
    float2 UV : TEXCOORD0;         // Texture coordinates passed to the pixel shader
};

// Vertex shader function
VertexOutput MainVS(VertexInput In)
{
    VertexOutput Out;
    
    // Transform the vertex position to clip space
    Out.Position = mul(In.Position, View.WorldToClip);
    
    // Pass the UV coordinates to the pixel shader
    Out.UV = In.UV;
    
    return Out;
}

// Pixel shader function
float4 MainPS(VertexOutput In) : SV_Target
{
    // Define a constant color (e.g., blue)
    float3 BaseColor = float3(0.0, 0.0, 1.0);
    
    // Return the color with full opacity
    return float4(BaseColor, 1.0);
}

// Register the shaders
VS_Main(MainVS); // Register the vertex shader
PS_Main(MainPS); // Register the pixel shader
#include <Servo.h>

// Declare servo objects
Servo servo1; // Right leg - top
Servo servo2; // Left leg - top
Servo servo3; // Left leg - bottom
Servo servo4; // Right leg - bottom

// Servo neutral positions
int servo1Neutral = 90; // Right leg - top neutral position
int servo2Neutral = 90; // Left leg - top neutral position
int servo3Neutral = 90; // Left leg - bottom neutral position
int servo4Neutral = 90; // Right leg - bottom neutral position

// Movement parameters
int stepAngle = 20; // Angle to move for a step
int delayTime = 300; // Delay between movements (ms)

void setup() {
  // Attach servos to pins
  servo1.attach(3); // Pin for right leg top
  servo2.attach(5); // Pin for left leg top
  servo3.attach(6); // Pin for left leg bottom
  servo4.attach(9); // Pin for right leg bottom

  // Set servos to neutral positions
  resetToNeutral();
}

void loop() {
  takeStep(); // Make Otto take a step
  delay(500); // Short pause between steps
}

// Function to reset all servos to their neutral positions
void resetToNeutral() {
  servo1.write(servo1Neutral);
  servo2.write(servo2Neutral);
  servo3.write(servo3Neutral);
  servo4.write(servo4Neutral);
  delay(500); // Allow servos to move to position
}

// Function for a walking step
void takeStep() {
  // Step 1: Lift left leg
  servo3.write(servo3Neutral + stepAngle); // Move left bottom servo up
  delay(delayTime);

  // Step 2: Swing left leg forward
  servo2.write(servo2Neutral - stepAngle); // Move left top servo forward
  delay(delayTime);

  // Step 3: Place left leg down
  servo3.write(servo3Neutral); // Return left bottom servo to neutral
  delay(delayTime);

  // Step 4: Lift right leg
  servo4.write(servo4Neutral + stepAngle); // Move right bottom servo up
  delay(delayTime);

  // Step 5: Swing right leg forward
  servo1.write(servo1Neutral - stepAngle); // Move right top servo forward
  delay(delayTime);

  // Step 6: Place right leg down
  servo4.write(servo4Neutral); // Return right bottom servo to neutral
  delay(delayTime);

  // Reset to neutral after each step
  resetToNeutral();
}
// Register Custom Post Type
function custom_post_type() {

	$labels = array(
		'name'                  => _x( 'Post Types', 'Post Type General Name', 'text_domain' ),
		'singular_name'         => _x( 'Post Type', 'Post Type Singular Name', 'text_domain' ),
		'menu_name'             => __( 'Post Types', 'text_domain' ),
		'name_admin_bar'        => __( 'Post Type', 'text_domain' ),
		'archives'              => __( 'Item Archives', 'text_domain' ),
		'attributes'            => __( 'Item Attributes', 'text_domain' ),
		'parent_item_colon'     => __( 'Parent Item:', 'text_domain' ),
		'all_items'             => __( 'All Items', 'text_domain' ),
		'add_new_item'          => __( 'Add New Item', 'text_domain' ),
		'add_new'               => __( 'Add New', 'text_domain' ),
		'new_item'              => __( 'New Item', 'text_domain' ),
		'edit_item'             => __( 'Edit Item', 'text_domain' ),
		'update_item'           => __( 'Update Item', 'text_domain' ),
		'view_item'             => __( 'View Item', 'text_domain' ),
		'view_items'            => __( 'View Items', 'text_domain' ),
		'search_items'          => __( 'Search Item', 'text_domain' ),
		'not_found'             => __( 'Not found', 'text_domain' ),
		'not_found_in_trash'    => __( 'Not found in Trash', 'text_domain' ),
		'featured_image'        => __( 'Featured Image', 'text_domain' ),
		'set_featured_image'    => __( 'Set featured image', 'text_domain' ),
		'remove_featured_image' => __( 'Remove featured image', 'text_domain' ),
		'use_featured_image'    => __( 'Use as featured image', 'text_domain' ),
		'insert_into_item'      => __( 'Insert into item', 'text_domain' ),
		'uploaded_to_this_item' => __( 'Uploaded to this item', 'text_domain' ),
		'items_list'            => __( 'Items list', 'text_domain' ),
		'items_list_navigation' => __( 'Items list navigation', 'text_domain' ),
		'filter_items_list'     => __( 'Filter items list', 'text_domain' ),
	);
	$args = array(
		'label'                 => __( 'Post Type', 'text_domain' ),
		'description'           => __( 'Post Type Description', 'text_domain' ),
		'labels'                => $labels,
		'supports'              => false,
		'taxonomies'            => array( 'category', 'post_tag' ),
		'hierarchical'          => false,
		'public'                => true,
		'show_ui'               => true,
		'show_in_menu'          => true,
		'menu_position'         => 5,
		'show_in_admin_bar'     => true,
		'show_in_nav_menus'     => true,
		'can_export'            => true,
		'has_archive'           => true,
		'exclude_from_search'   => false,
		'publicly_queryable'    => true,
		'capability_type'       => 'page',
	);
	register_post_type( 'post_type', $args );

}
add_action( 'init', 'custom_post_type', 0 );
#include <iostream>
using namespace std;

class Queue {
public:
    int *arr;     // Pointer for dynamically allocated array
    int front;    // Index of the front element
    int rear;     // Index of the rear element
    int size;     // Maximum size of the queue

    // Constructor to initialize the queue
    Queue(int size) {
        this->size = size;
        arr = new int[size];
        front = 0; // Initially, front is 0
        rear = 0;  // Initially, rear is 0
    }

    // Enqueue: Add an element to the rear of the queue
    void enqueue(int element) {
        // Check if the queue is full
        if (rear == size) {
            cout << "Queue is full (Overflow)" << endl;
        } else {
            arr[rear] = element; // Add element at the rear
            rear++;              // Increment the rear index
            cout << element << " added to the queue" << endl;
        }
    }

    // Dequeue: Remove an element from the front of the queue
    void dequeue() {
        // Check if the queue is empty
        if (front == rear) {
            cout << "Queue is empty (Underflow)" << endl;
        } else {
            cout << arr[front] << " removed from the queue" << endl;
            front++; // Increment the front index to the next element
        }
    }

    // isEmpty: Check if the queue is empty
    bool isEmpty() {
        return front == rear;
    }

    // Front: Retrieve the front element without removing it
    int getFront() {
        if (isEmpty()) {
            cout << "Queue is empty (No front element)" << endl;
            return -1; // Return an invalid value as the queue is empty
        } else {
            return arr[front]; // Return the front element
        }
    }
};

int main() {
    // Create a queue of size 5
    Queue q(5);

    // Enqueue elements
    q.enqueue(10);
    q.enqueue(20);
    q.enqueue(30);

    // Display the front element
    cout << "Front element: " << q.getFront() << endl;

    // Dequeue elements
    q.dequeue();
    cout << "Front element after dequeue: " << q.getFront() << endl;

    // Check if the queue is empty
    if (q.isEmpty()) {
        cout << "The queue is empty" << endl;
    } else {
        cout << "The queue is not empty" << endl;
    }

    return 0;
}
#include <iostream>
using namespace std;

class Stack {
public:
    int *arr; // properties
    int top;
    int size;

    // constructor
    Stack(int size) {
        this->size = size;
        arr = new int[size];
        top = -1;
    }

    // push function
    void push(int element) {
        if (size - top > 1) { // Check for empty space 
            top++;
            arr[top] = element;
        } else {
            cout << "Stack overflow" << endl;
        }
    }

    // pop function
    void pop() {
        if (top >= 0) {
            top--;
        } else {
            cout << "Stack underflow" << endl;
        }
    }

    // peek function
    int peek() {
        if (top >= 0) {
            return arr[top];
        } else {
            cout << "Stack is empty" << endl;
            return -1;
        }
    }

    // isEmpty function
    bool isEmpty() {
        return top == -1;
    }

    // delete stack function
    void deleteStack() {
        delete[] arr; // Free the allocated memory
        arr = nullptr; // Reset the pointer
        top = -1; // Reset the top
        size = 0; // Reset the size
        cout << "Stack has been deleted" << endl;
    }
};

int main() {
    Stack st(5);

    st.push(20);
    st.push(30);
    st.push(50);
    cout << "Top element before deletion: " << st.peek() << endl;

    st.deleteStack();

    // After deletion, trying to access the stack
    if (st.arr == nullptr) {
        cout << "Stack array is nullptr after deletion." << endl;
    }

    return 0;
}
import pendulum

def calc_expire_date(prodact_date, expiry):
    prodact_date = pendulum.parse('{:0>2}-{:0>2}-{:0>2}'.format(*prodact_date))
    target_date = pendulum.duration(**expiry) + prodact_date
    days_to_expire = (target_date.date() - pendulum.now().date()).days
    print(f'Product vaild until : {target_date} You have {days_to_expire} days')


calc_expire_date((2024, 11, 15), expiry = {'days': 15})
import tkinter as tk

root = tk.Tk()
root.geometry('200x200')

def close_window():
    root.destroy()

close_bt = tk.Button(root, text = 'close', command = close_window)
close_bt.pack()

def disable_close_bt():
    return

root.protocol('WM_DELETE_WINDOW', disable_close_bt)
root.mainloop()
lang = "en"  # language code for ENGLISH
project_name = "wiki"  # wikipedia namespace
namespace = 0  # 0 for Main/ Articles
date = "20220420"
DUMP_DIR = "/public/dumps/public/other/enterprise_html/runs"  # directory on PAWS server that holds Wikimedia dumps
HTML_DUMP_FN = os.path.join(
    DUMP_DIR,
    date,
    f"{lang+project_name}-NS{namespace}-{date}-ENTERPRISE-HTML.json.tar.gz",
)  # final file path

print(
    f"Reading {HTML_DUMP_FN} of size {os.path.getsize(HTML_DUMP_FN)/(1024*1024*1024)} GB"
)

article_list = []
with tarfile.open(HTML_DUMP_FN, mode="r:gz") as tar:
    html_fn = tar.next()
    print(
        f"We will be working with {html_fn.name} ({html_fn.size / 1000000000:0.3f} GB)."
    )
    # extract the first article from the first tar chunk
    with tar.extractfile(html_fn) as fin:
        for line in fin:
            article = json.loads(line)
            break
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class EnemyAttack : MonoBehaviour
{
    public int attackDamage = 10; // Damage dealt by the enemy
    public Transform attackPoint; // The point from which the attack originates
    public float attackRange = 1f; // Range of the attack
    public LayerMask playerLayer; // Layer to detect the player
    public float attackCooldown = 2f; // Time between attacks
    Animator animator;

    private Enemy enemy; // Reference to the enemy's state
    private bool canAttack = true; // Cooldown flag for attacks

    private void Awake()
    {
        animator = GetComponent<Animator>();

        // Reference to the Enemy script on the same GameObject
        enemy = GetComponent<Enemy>();
    }

    public void PerformAttack()
    {
        // Ensure the enemy is alive and can attack
        if (!enemy.isAlive || !canAttack) return;

        // Check for player within attack range
        Collider2D playerCollider = Physics2D.OverlapCircle(attackPoint.position, attackRange, playerLayer);
        if (playerCollider != null)
        {
            // Damage the player if detected
            HealthSystem playerHealth = playerCollider.GetComponent<HealthSystem>();
            if (playerHealth != null)
            {
                playerHealth.TakeDamage(attackDamage);
                Debug.Log("Enemy hit the player: " + playerCollider.name);
            }
        }

        // Trigger attack animation
        if (animator != null)
        {
            animator.SetTrigger("attack");
        }

        // Start cooldown
        StartCoroutine(AttackCooldown());
    }

    private IEnumerator AttackCooldown()
    {
        canAttack = false; // Prevent further attacks
        yield return new WaitForSeconds(attackCooldown); // Wait for cooldown duration
        canAttack = true; // Allow attacking again
    }

    // Debugging: Visualize the attack range in the editor
    private void OnDrawGizmosSelected()
    {
        if (attackPoint == null) return;
        Gizmos.color = Color.red;
        Gizmos.DrawWireSphere(attackPoint.position, attackRange);
    }
}
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using TMPro;

public class HealthBar : MonoBehaviour
{
    public Slider healthSlider;
    public TMP_Text healthBarText;

    HealthSystem playerHealthSystem;
    // Start is called before the first frame update

    private void Awake()
    {
        GameObject player = GameObject.FindGameObjectWithTag("Player");

        if(player == null)
        {
            Debug.Log("player not found or missing tag on player");
        }

        playerHealthSystem = player.GetComponent<HealthSystem>();
    }
    void Start()
    {
        healthSlider.value = CalculateSliderPercentage(playerHealthSystem.currentHealth, playerHealthSystem.maxHealth);
        healthBarText.text = "HP " + playerHealthSystem.currentHealth + " / " + playerHealthSystem.maxHealth;
    }

    private void OnEnable()
    {
        playerHealthSystem.OnHealthChanged.AddListener(OnPlayerHealthChanged);
    }

    private void OnDisable()
    {
        playerHealthSystem.OnHealthChanged.RemoveListener(OnPlayerHealthChanged);
    }

    private float CalculateSliderPercentage(int currentHealth, int maxHealth)
    {
        return currentHealth / maxHealth;
    }

    private void OnPlayerHealthChanged(int newHealth, int maxHealth)
    {
        healthSlider.value = CalculateSliderPercentage(newHealth, maxHealth);
        healthBarText.text = "HP " + newHealth + " / " + maxHealth;
    }

    // Update is called once per frame
    void Update()
    {
        
    }
}
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class HealthSystem : MonoBehaviour
{
    public int maxHealth = 100;
    public int currentHealth;

    public delegate void OnHealthChanged(int currentHealth, int maxHealth);
    public event OnHealthChanged onHealthChanged;
    public delegate void OnDeath();
    public event OnDeath onDeath;

    public void Start()
    {
        currentHealth = maxHealth; // Initialize health
        onHealthChanged?.Invoke(currentHealth, maxHealth); // Notify UI or other systems
    }

    public void TakeDamage(int damage)
    {
        currentHealth -= damage;
        if (currentHealth <= 0)
        {
            currentHealth = 0;
            Die();
        }
        onHealthChanged?.Invoke(currentHealth, maxHealth); // Update health bar or UI
    }

    public void Heal(int amount)
    {
        currentHealth = Mathf.Min(currentHealth + amount, maxHealth); // Ensure health doesn't exceed max
        onHealthChanged?.Invoke(currentHealth, maxHealth); // Update health bar or UI
    }

    public void Die()
    {
        onDeath?.Invoke(); // Trigger death event
        // You can trigger death-related logic here or in the subscribed listener
    }

    public int GetCurrentHealth()
    {
        return currentHealth;
    }

    public int GetMaxHealth()
    {
        return maxHealth;
    }
}
#include <iostream>
using namespace std;
​
int main() {
  cout << "Hello World!";
  return 0;
}
​
Id recordTypeId =
  [SELECT Id FROM RecordType
    WHERE DeveloperName = 'Wholesale_Partner' AND sObjectType = 'Account'].Id;
Id recordTypeId =
  Schema.SObjectType.Account.getRecordTypeInfosByName()
    .get('Wholesale Partner').getRecordTypeId();
#include <iostream>
#include <vector>
#include <stack>
using namespace std;

// Function to perform DFS on a vertex
void topologicalSortUtil(int node, vector<bool>& visited, stack<int>& result, vector<vector<int>>& adj) {
    visited[node] = true; // Mark the current node as visited
    
    // Visit all adjacent vertices (neighbors) of the current node
    for (int neighbor : adj[node]) {
        if (!visited[neighbor]) {
            topologicalSortUtil(neighbor, visited, result, adj); // Recursively perform DFS
        }
    }
    
    // After visiting all neighbors, push the current node onto the stack
    // This ensures that the node is added after all its dependencies
    result.push(node);
}

// Function to perform Topological Sort on the graph
void topologicalSort(int vertices, vector<vector<int>>& adj) {
    vector<bool> visited(vertices, false); // To keep track of visited nodes
    stack<int> result; // To store the topological order (nodes are pushed here)
    
    // Perform DFS for every unvisited node
    for (int i = 0; i < vertices; i++) {
        if (!visited[i]) {
            topologicalSortUtil(i, visited, result, adj); // Perform DFS for the node
        }
    }
    
    // Print the topological order (from stack)
    cout << "Topological Sort: ";
    while (!result.empty()) {
        cout << result.top() << " "; // Output nodes in topological order
        result.pop();
    }
    cout << endl;
}

// Main function
int main() {
    int vertices = 6; // Number of vertices in the graph
    vector<vector<int>> adj(vertices); // Adjacency list representation of the graph
    
    // Add edges to the graph
    adj[5].push_back(2);
    adj[5].push_back(0);
    adj[4].push_back(0);
    adj[4].push_back(1);
    adj[2].push_back(3);
    adj[3].push_back(1);
    
    // Call the topological sort function
    topologicalSort(vertices, adj);
    
    return 0;
}
cordova plugin add cordova-plugin-browsersync-gen2

cordova run browser --live-reload
cordova run android --live-reload
cordova run ios --live-reload
cordova run --live-reload (will run project using all platforms)

cordova serve --livre-reload
<a href="https://css-speed-dating.vercel.app/" target="blank">https://css-speed-dating.vercel.app/
</a>

<h2>Codepen Collection</h2>
<a href="https://codepen.io/collection/ZQbzRQ" target="blank">https://codepen.io/collection/ZQbzRQ</a>
-- Online SQL Editor to Run SQL Online.
-- Use the editor to create new tables, insert data and all other SQL operations.
  
SELECT first_name, age
FROM Customers;
star

Wed Nov 27 2024 01:02:17 GMT+0000 (Coordinated Universal Time)

@saharmess #mysql

star

Tue Nov 26 2024 20:04:40 GMT+0000 (Coordinated Universal Time) https://a-chacon.com/en/docker/2024/09/16/run-llm-locally.html

@Shex #ollama #docker-compose #ai #webui

star

Tue Nov 26 2024 18:57:37 GMT+0000 (Coordinated Universal Time) https://www.tutorialspoint.com/powershell/powershell_files_create_folders.htm

@acassell

star

Tue Nov 26 2024 17:29:25 GMT+0000 (Coordinated Universal Time)

@shirnunn

star

Tue Nov 26 2024 10:08:43 GMT+0000 (Coordinated Universal Time) https://www.linkedin.com/pulse/discover-best-online-resume-builder-build-within-5-adam-gilchrist-g40zc/

@adamsmith #resumebuilder #buildyourresume #resume

star

Tue Nov 26 2024 06:14:43 GMT+0000 (Coordinated Universal Time)

@asha #react

star

Mon Nov 25 2024 23:46:51 GMT+0000 (Coordinated Universal Time)

@davidmchale

star

Mon Nov 25 2024 22:05:13 GMT+0000 (Coordinated Universal Time)

@saharmess #mysql

star

Mon Nov 25 2024 22:05:12 GMT+0000 (Coordinated Universal Time)

@saharmess #mysql

star

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

@webisko #javascript

star

Mon Nov 25 2024 20:41:03 GMT+0000 (Coordinated Universal Time)

@marcopinero #html #javascript #cordova

star

Mon Nov 25 2024 19:16:39 GMT+0000 (Coordinated Universal Time)

@E23CSEU1151

star

Mon Nov 25 2024 18:03:23 GMT+0000 (Coordinated Universal Time)

@Narendra

star

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

@rick_m #powershell

star

Mon Nov 25 2024 15:23:52 GMT+0000 (Coordinated Universal Time)

@khairo0311

star

Mon Nov 25 2024 13:47:36 GMT+0000 (Coordinated Universal Time) https://appticz.com/gett-clone

@aditi_sharma_

star

Mon Nov 25 2024 12:11:16 GMT+0000 (Coordinated Universal Time) https://maticz.com/real-estate-tokenization-services

@jamielucas

star

Mon Nov 25 2024 10:34:06 GMT+0000 (Coordinated Universal Time) https://jsdev.space/directional-hover-effect/?ref=dailydev

@rstringa

star

Mon Nov 25 2024 08:51:27 GMT+0000 (Coordinated Universal Time)

@javalab

star

Mon Nov 25 2024 08:48:45 GMT+0000 (Coordinated Universal Time)

@javalab

star

Mon Nov 25 2024 08:44:26 GMT+0000 (Coordinated Universal Time)

@javalab

star

Mon Nov 25 2024 06:54:33 GMT+0000 (Coordinated Universal Time) https://chatgpt.com/c/67441edb-cd9c-8004-823a-3e9415658214

@ergergergerg

star

Mon Nov 25 2024 06:23:20 GMT+0000 (Coordinated Universal Time)

@iliavial

star

Mon Nov 25 2024 04:55:43 GMT+0000 (Coordinated Universal Time) https://generatewp.com/post-type/

@bbexperience

star

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

@lahi2010

star

Sun Nov 24 2024 23:20:17 GMT+0000 (Coordinated Universal Time)

@E23CSEU1151

star

Sun Nov 24 2024 21:42:50 GMT+0000 (Coordinated Universal Time)

@E23CSEU1151

star

Sun Nov 24 2024 21:00:54 GMT+0000 (Coordinated Universal Time) https://support.hivebrite.com/hc/en-us/articles/12765100278428-User-fields-Standard-and-Custom-Customization-and-creation

@ackt

star

Sun Nov 24 2024 15:27:26 GMT+0000 (Coordinated Universal Time) https://appledora.hashnode.dev/outreach-bw3?source

@SamiraYS

star

Sun Nov 24 2024 14:53:12 GMT+0000 (Coordinated Universal Time) https://pastecode.io/

@censored #c#

star

Sun Nov 24 2024 14:43:48 GMT+0000 (Coordinated Universal Time) https://pastecode.io/

@censored #c#

star

Sun Nov 24 2024 14:43:16 GMT+0000 (Coordinated Universal Time) https://pastecode.io/

@censored

star

Sun Nov 24 2024 13:02:32 GMT+0000 (Coordinated Universal Time) https://www.w3schools.com/cpp/trycpp.asp?filename

@mohmmed #undefined

star

Sun Nov 24 2024 12:50:34 GMT+0000 (Coordinated Universal Time) https://www.w3schools.com/cpp/trycpp.asp?filename

@mohmmed

star

Sun Nov 24 2024 11:48:34 GMT+0000 (Coordinated Universal Time)

@seb_prjcts_be

star

Sun Nov 24 2024 09:09:24 GMT+0000 (Coordinated Universal Time) https://learn.javascript.ru/object-methods

@kseniya #javascript

star

Sun Nov 24 2024 08:53:27 GMT+0000 (Coordinated Universal Time) https://www.vitalrep.com/

@Unknown

star

Sun Nov 24 2024 08:44:11 GMT+0000 (Coordinated Universal Time) https://evisatraveller.mfa.ir/fa/login/

@asadullah #html

star

Sun Nov 24 2024 08:43:47 GMT+0000 (Coordinated Universal Time) https://evisatraveller.mfa.ir/fa/login/

@asadullah

star

Sun Nov 24 2024 07:43:54 GMT+0000 (Coordinated Universal Time) https://evisatraveller.mfa.ir/fa/login/

@asadullah #html

star

Sun Nov 24 2024 07:42:46 GMT+0000 (Coordinated Universal Time) https://evisatraveller.mfa.ir/fa/login/

@asadullah #html

star

Sun Nov 24 2024 07:39:30 GMT+0000 (Coordinated Universal Time) https://evisatraveller.mfa.ir/fa/login/

@asadullah #html

star

Sat Nov 23 2024 20:34:41 GMT+0000 (Coordinated Universal Time) https://smukov.github.io/blog/2018/06/09/Record-Type-Id-By-Developer-Name/

@redflashcode

star

Sat Nov 23 2024 20:34:36 GMT+0000 (Coordinated Universal Time) https://smukov.github.io/blog/2018/06/09/Record-Type-Id-By-Developer-Name/

@redflashcode

star

Sat Nov 23 2024 19:43:23 GMT+0000 (Coordinated Universal Time)

@E23CSEU1151

star

Sat Nov 23 2024 17:36:20 GMT+0000 (Coordinated Universal Time)

@marcopinero #html #javascript #cordova

star

Sat Nov 23 2024 14:14:49 GMT+0000 (Coordinated Universal Time)

@rstringa

star

Sat Nov 23 2024 14:12:48 GMT+0000 (Coordinated Universal Time) https://www.programiz.com/sql/online-compiler/

@ashwin_07 #undefined

Save snippets that work with our extensions

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