Skip to content

Instantly share code, notes, and snippets.

View embedded4ever's full-sized avatar
🚀
Working from home

V embedded4ever

🚀
Working from home
View GitHub Profile
@embedded4ever
embedded4ever / SingletonTasarimKalibi.cpp
Last active March 27, 2022 15:02 — forked from bunyamintamar/SingletonTasarimKalibi.cpp
Singleton Tasarım Kalıbı Örneği - Singleton Design Pattern
/* Singleton Tasarım Kalıbı Örneği - Singleton Design Pattern */
/*
Bir nesnenin sadece bir kez yaratılması isteniyorsa,
başka bir tane yaratılsa da yine aynı nesneyi işaret etmesi ve böylece
teklik sağlanmak isteniyorsa bu yöntem kullanılır.
*/
#include <iostream>
#include <string>
@embedded4ever
embedded4ever / rosinstall.sh
Last active December 4, 2021 08:04
Ros installation script for ubuntu 20.04
#!/bin/bash
check_lsb() {
echo "Checking your current ubuntu version..."
VERSION=$(lsb_release -rs)
if [[ $VERSION == "18.04" ]]
then
echo "->Ubuntu Version $VERSION"
import QtQuick 2.0
Rectangle{
width: parent.width
height: 1
border.width: 1
border.color: "gray"
color: "gray"
anchors.horizontalCenter: parent.horizontalCenter
}
import QtQuick 2.9
import QtQuick.Controls 2.4
import QtQuick.Window 2.2
import QtQuick.Layouts 1.11
Window {
id: root
visible: true
maximumWidth: 720
#include <stdio.h>
#include <string.h>
#include <stdint.h>
/*
Time interface:
Witdh : 32 bits
Bit Range Name Desciription
//NOT : SIZE verilen dizideki en yüksek değerden daha yüksek seçilmiştir.
#include <stdio.h>
#include <stdlib.h>
#define SIZE 10
const int test_array[SIZE] = {-2, 5, 1, -1, -3, -7, 7, 2, 3, 5};
int main(void) {
@embedded4ever
embedded4ever / tftp.ino
Last active June 28, 2020 11:51
ESP8266 Tftp Implementation
//[email protected] wrote this file
/*
2 bytes string 1 byte string 1 byte
-----------------------------------------------
RRQ/ | 01/02 | Filename | 0 | Mode | 0 |
WRQ -----------------------------------------------
@embedded4ever
embedded4ever / climbing_the_leaderboard.c
Created March 31, 2019 12:53
Climbing the Leaderboard C Solution
int* climbingLeaderboard(int scores_count, int* scores, int alice_count, int* alice, int* result_count)
{
static unsigned int temp_arraycount=1;
static unsigned int i = 0;
static unsigned int *temp_array;
static unsigned int *rank_array;
temp_array = malloc(sizeof(int) * scores_count);
rank_array = malloc(sizeof(int) * alice_count);
@embedded4ever
embedded4ever / Atmega328p_300BaudSERIAL7E1.ino
Last active February 19, 2019 13:18
Atmega328p_300BaudSERIAL7E1
//Description video : https://www.youtube.com/watch?v=2s4W6sOT0mU
typedef struct uconfig
{
uint32_t baud;
uint8_t _UBRR0H;
uint8_t _UBRR0L;
uint8_t _UCSR0B;
uint8_t _UCSR0C;
} baud_registers;
@embedded4ever
embedded4ever / matlab.m
Last active November 5, 2018 13:44
Load .mat file and save image as png in matlab
%open .mat file and saveas .png in matlab
% you must edit load(sprintf('%d.mat',i))
% i have file like 1.mat , 2.mat , 3.mat ,4.mat ,5.mat ,6.mat
for i=1:6
load(sprintf('%d.mat',i))
x = cjdata.image;
imshow (x,maps);
h=figure(1);
saveas(h,sprintf('%d.png',i));
end