Skip to content

Instantly share code, notes, and snippets.

View dyigitpolat's full-sized avatar
🌛

Yigit Polat dyigitpolat

🌛
View GitHub Profile
#include "stdio.h"
#include "stdlib.h"
long int parse()
{
long int bytes;
char str[4096];
int indexes[10];
char* c;
char* pat = "RX bytes:";
#include "stdio.h"
#include "stdlib.h"
long int parse()
{
long int bytes;
char str[4096];
int indexes[10];
char* c;
FILE* f = fopen( "output", "r");
read_stdin_to_list() ->
case io:fread("","~d") of
{ok,[A]} -> [ A | read_stdin_to_list() ];
_ -> []
end.
print_list([]) -> true;
print_list(A) ->
[ Head | Tail ] = A,
io:fwrite("~p~n", [Head]),
print_list(Tail).
@dyigitpolat
dyigitpolat / basic_io.erl
Created January 18, 2018 14:10
basic io for erlang
read_stdin_to_list() ->
case io:fread("","~d") of
{ok,[A]} -> [ A | read_stdin_to_list() ];
_ -> []
end.
print_list([]) -> true;
print_list(A) ->
[ Head | Tail ] = A,
#include "stdio.h"
#include "stdlib.h"
#include "math.h"
#define N 5000000L
float rand_1()
{
float x = (float)rand()/(float)(RAND_MAX/1);
}
@dyigitpolat
dyigitpolat / fulladder.sv
Last active October 21, 2018 14:28
system verilog fulladder
module fulladder(A, B, Cin, S, Cout);
input A, B, Cin;
output S, Cout;
assign S = (A^B)^C;
assign Cout = ((A^B)&C) | (A&B);
endmodule
module two_bit_fulladder(A, B, Cin, S, Cout);
input [1:0] A, B;
input Cin;
import logging
from telegram.ext import Updater, CommandHandler, MessageHandler, Filters
from telegram import Bot
# Enable logging
logging.basicConfig(format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
level=logging.INFO)
logger = logging.getLogger(__name__)
@dyigitpolat
dyigitpolat / CMakeLists.txt
Last active January 29, 2021 23:00
simplistic c++ CMakeLists.txt
# only for cmake --version >= 3.5.1
cmake_minimum_required(VERSION 3.5.1)
# project name
project(learncpp)
# creates the variable EXEC as executable name
set(EXEC learncpp)
# set the C++ standard