Skip to content

Instantly share code, notes, and snippets.

View Eboubaker's full-sized avatar
🐐

Eboubaker Bekkouche Eboubaker

🐐
  • Soft-lines LLC
  • Eloued, Algeria
  • 13:39 (UTC +01:00)
View GitHub Profile
@Eboubaker
Eboubaker / icon.png
Last active May 18, 2024 12:16
TP dernier BDD
One of them is the last revision i dont have time to check now...
icon.png in images folder
#include <Arduino.h>
#include <SoftwareSerial.h>
#define ON HIGH
#define OFF LOW
SoftwareSerial SIM900A(10, 11); // RX, TX pins
String textMessage;
String pumpState;
const int pumpPin = 12; // pump connected to pin 12
<style>.VueHoverfade-enter-active, .VueHoverfade-leave-active {
transition: opacity .5s
}
.VueHoverfade-enter, .VueHoverfade-leave-to {
opacity: 0
}
.vh--outer[v-cloak] {
display: none
@Eboubaker
Eboubaker / Daily backup of local database.md
Last active July 30, 2023 12:26
Windows Daily backup of local database.

Create a file daily-backup.bat with contents:

@echo off
setlocal

:: set the variables

set DATABASE_SERVICE_NAME=MariaDB
set DB_USER=root
set DB_PASSWORD=gpassword
@Eboubaker
Eboubaker / read_write_lock.py
Last active August 3, 2024 12:42
Python Reentrant Read Write Lock: Allowing Multithreaded Read Access While Maintaining a Write Lock
import threading
from typing import List
class ReentrantRWLock:
"""
A lock object that allows many simultaneous "read locks", but only one "write lock."
it also allows multiple write locks from the same thread
"""
@Eboubaker
Eboubaker / f.md
Created September 21, 2022 13:13
Auto answer "Terminate batch job (Y/N)" message on windows terminal

the message is very annoying but can be handled using clink.
install clink and open file C:\Users\<username>\AppData\Local\clink\settings and set property terminate_autoanswer to 1

# name: Auto-answer terminate prompt
# type: enum
# Automatically answers cmd.exe's 'Terminate batch job (Y/N)?' prompts. 0 =
# disabled, 1 = answer 'Y', 2 = answer 'N'.
terminate_autoanswer = 1
https://www.aaai.org/Papers/JAIR/Vol21/JAIR-2119.pdf
https://www.aaai.org/Papers/JAIR/Vol21/JAIR-2119.pdf
Below are the Big O performance of common functions of different Java Collections.
List | Add | Remove | Get | Contains | Next | Data Structure
---------------------|------|--------|------|----------|------|---------------
ArrayList | O(1) | O(n) | O(1) | O(n) | O(1) | Array
LinkedList | O(1) | O(1) | O(n) | O(n) | O(1) | Linked List
CopyOnWriteArrayList | O(n) | O(n) | O(1) | O(n) | O(1) | Array