Skip to content

Instantly share code, notes, and snippets.

View sezRR's full-sized avatar
🖥️
Coding...

Sezer Tetik sezRR

🖥️
Coding...
View GitHub Profile
@sezRR
sezRR / AQ1.cpp
Created May 5, 2024 11:39
LG14_AQ1
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
int main(void)
{
// Declare variables
char wordChar;
char lastChar = 'a';
int queueChecker = 0;
/*
* WRITE A PROGRAM TO DISPLAY THE FOLLOWING TRIANGLE, USING A FUNCTION
*
* OUTPUT:
* *
* ***
* *****
* *******
* **********
*
@sezRR
sezRR / CTIS165_Discussion_Q1.cpp
Last active March 16, 2024 17:36
TC Identity Number Digit Finder
/*
The TC Id numbers are actually 9 digits, the last 2 digits are calculated based on the first 9 digits. These are the steps:
- add digits in positions 1,3,5,7,9 and multiply it by 7.
- subtract from the computed number digits in position 2,4,6,8.
- from the calculated number calculate modulo 10, the result will be your 10th TC Id digit.
- Add all 10 digits now, and calculate modulo 10, the result will be your 11th TC Id digit.
@Component
public class BeanValidation<T> {
private final Validator validator;
private DtoConverterService dtoConverterService;
private BeanValidation(ResourceBundleMessageSourceBean resourceBundleMessageSourceBean) {
ValidatorFactory validatorFactory = resourceBundleMessageSourceBean.validator();
this.validator = validatorFactory.getValidator();
}
@Component
public class ValidationResponseChecker<T> {
private final BeanValidation<T> beanValidation;
@Autowired
public ValidationResponseChecker(BeanValidation<T> beanValidation) {
this.beanValidation = beanValidation;
}
@SuppressWarnings("unchecked")
@sezRR
sezRR / UserHistory.java
Last active December 20, 2022 11:41
Codes for users' update history
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/*
{
"_id": "507f1f77bcf86cd799439011",
"user_id": "507f191e810c19729de860ea",
"changes": [
@sezRR
sezRR / aggregate.txt
Created February 27, 2022 21:00
MongoDB Aggregate for DTO
db.Todos.aggregate([
{
$lookup: {
from: "Tags",
localField: "tags.$id",
foreignField : "_id",
as: "tags"
}
},
{
@sezRR
sezRR / database.sql
Last active May 21, 2021 19:09
HRMS Database SQL
-- This script was generated by a beta version of the ERD tool in pgAdmin 4.
-- Please log an issue at https://redmine.postgresql.org/projects/pgadmin4/issues/new if you find any bugs, including reproduction steps.
BEGIN;
CREATE TABLE public.candidate_users
(
id integer NOT NULL GENERATED ALWAYS AS IDENTITY ( INCREMENT 1 START 1 MINVALUE 1 MAXVALUE 2147483647 CACHE 1 ),
first_name character varying(50) NOT NULL,
last_name character varying(50) NOT NULL,
@sezRR
sezRR / Instructor.java
Last active April 29, 2021 16:28
Java Camp - Day 3 - Homework 2
public class Instructor extends User {
private String biography;
private double averageRating;
public Instructor() {
}
public Instructor(int id, String firstName, String lastName, String email, int birthYear, String city, String biography, double averageRating) {