Skip to content

Instantly share code, notes, and snippets.

View thinkphp's full-sized avatar
💭
If I have seen further it is only by standing on the shoulders of giants. NEWTON

Adrian Statescu thinkphp

💭
If I have seen further it is only by standing on the shoulders of giants. NEWTON
View GitHub Profile
@thinkphp
thinkphp / concret-table.txt
Last active May 25, 2026 19:33
Motivatii Alegere Concret Table
. Inheritance Strategy: Concrete Table Inheritance
The scenario requires managing sport-specific player statistics that vary significantly in structure between sports. For example, a football player accumulates yellow and red cards and shots on target, while a swimmer is measured by stroke type and best time in seconds, and an athletics competitor has a personal best distance or time per event type.
https://martinfowler.com/eaaCatalog/inheritanceMappers.html
Three primary strategies exist for mapping object inheritance to relational tables: Single Table Inheritance, Class Table (Joined) Inheritance, and Concrete Table Inheritance.
1 Strategies Considered
Single Table Inheritance
All subtypes are merged into one table with nullable columns for subtype-specific attributes. This was rejected because it would require storing NULL values for every column irrelevant to a given sport. With three sports and six to eight unique columns each, the resulting table would contain a large number of NULL entries per row,
@thinkphp
thinkphp / Hamiltonian Cycle.cpp
Last active May 23, 2026 09:15
Hamiltonian Cycle
/*
Ciclul hamiltonian se poate determina folosind spatiul permutarilor filtrate de matricea de adiacenta a grafului.
Input:
numar de noduri si nodul de start
5 1
0 1 0 0 1
1 0 1 1 0
0 1 0 1 1
0 0 1 0 1
@thinkphp
thinkphp / Grafuri Teorie.txt
Created May 23, 2026 08:42
Grafuri Teorie
Un graf este reprezentare abstracta a conectivitatii folosind Nodes si Edges;
- 1...N
- Nodurile si Muchiile sau arcele au informatii
- grafurile : orientate si neorientate
- edges conecteaza m perechi de noduri
Graf = orice multime finita V (Vertices), prevazuta cu o relatie binara interna E
@thinkphp
thinkphp / Doubly-Linked-List
Created May 23, 2026 08:09
Doubly-Linked-List (creare, adaugare dupa si inainte, stergere, afisare si reverse)
#include <iostream>
class DoublyLinkedList {
struct Node {
int data;
struct Node *next;
struct Node *prev;
Node(int d): data(d), next(nullptr), prev(nullptr){}
};
I'm a highly skilled Front End / Back End Developer coupled with a keen enthusiasm for Design Patterns, learning and using new technologies. I have a passion for breaking down complex technical concepts and presenting them in an understandable format to various audiences. My interests lie at the intersection of algorithm design techniques and optimization, where I am passionate about developing efficient solutions to complex computational problems. I'm Interested in design and implementation of programming languages , categorical semantics, theory of computation ( Big O Notation, Computability), Distributed Processing, Data Mining, Advanced Topics in Machine Learning, Deep Learning, IaaS, PaaS, SaaS, functional programming, Natural Language Processing (parsing, mathematical developments and applications, pattern interpretation, tree-controlled grammars), statistics.
I contributed to MooTools Plugins as part of the development of the MooTools Forge package repository https://mootools.net/forge/profile/thinkp
@thinkphp
thinkphp / tic-tac-toe.java
Created May 23, 2026 07:37
Tic Tac Toe Cu AI
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class Main extends JFrame implements ActionListener {
int choice = 0, choice1 = 0, choice2 = 0;
JFrame f1, f2;
JPanel p1, p2, p3;
@thinkphp
thinkphp / grafuri-citire.java
Created May 17, 2026 15:22
Graf/Citire/DFS
import java.util.*;
public class Graf {
private final int[][] mat;
public final boolean[] vizitat;
private final int n;
@thinkphp
thinkphp / Hamilton.java
Created May 17, 2026 14:57
generare Cicluri Hamiltoniene; graful este memorat prin matricea de adiacenta
/*
Grafuri
-------
Graf <=> orice multime finita V, prevazuta cu o relatie binara interna E
G = (V,E)
V = numarul de noduri
E = numarul de muchii
@thinkphp
thinkphp / edit-distance-CSES.java
Last active May 17, 2026 13:36
edit-distance-CSES.java
import java.io.*;
public class editDistance {
static void main(String[] args) {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in)) ;
BufferedReader s = br.readLine();
BufferedReader d = br.readLine();
@thinkphp
thinkphp / Edit Distance.java
Created May 17, 2026 13:14
Edit Distance.java
import java.util.*;
/*
-------------------------------------
Edit Distance = Distanta Levenshstein
-------------------------------------
Distanta Levenshtein este o masura care cuantifica cat de diferite sunt doua siruri de caractere
prin numarul minim de operatii necesare ptrneu a transforma un sir in altil.