Skip to content

Instantly share code, notes, and snippets.

View berkayakcay's full-sized avatar
🍀
Knockin’ On Heaven’s Door

Berkay Akçay berkayakcay

🍀
Knockin’ On Heaven’s Door
View GitHub Profile
@berkayakcay
berkayakcay / ActiveDirectoryCSVExport.cs
Last active July 20, 2016 08:24
Active Directory CSV Export C#
string domainName = "YOUR_DOMAIN_NAME";
string cvspath = Environment.GetFolderPath(Environment.SpecialFolder.Desktop) + "\\ActiveDirectoryList_" + Guid.NewGuid().ToString() + ".csv";
StringBuilder cvscontent = new StringBuilder();
cvscontent.AppendLine("SAMAccountName, givenName, sn, title, department, samAccountName, userPrincipalName");
using (var context = new PrincipalContext(ContextType.Domain, domainName))
{
using (var searcher = new PrincipalSearcher(new UserPrincipal(context)))
{
foreach (var result in searcher.FindAll())
@berkayakcay
berkayakcay / RequestHurriyetApi.cs
Created September 10, 2016 16:44
Hürriyet Api C#
try
{
string uri = "https://api.hurriyet.com.tr/v1/newsphotogalleries;
HttpWebRequest request = WebRequest.Create(uri) as HttpWebRequest;
request.Method = "GET";
request.Headers.Add("apikey: YOUR_API_KEY");
string stringResponse = string.Empty;
using (HttpWebResponse response = request.GetResponse() as HttpWebResponse)
clc; clear; close all;
%ream images
firstImg = imread('c.png');
firstImg = double(firstImg);
secondImg = imread('c2.png');
secondImg = double(secondImg);
%define distance from pixel
distance2point = 5;
%{ Filters
% near 2 | 4 | 6
%
% mean
% (4,4) (4,5) (4,6)
% (5,4) (5,5) (5,6)
% (6,4) (6,5) (6,6)
%
% %}
@berkayakcay
berkayakcay / Readme.md
Last active September 4, 2017 00:36
Readme Template

Project Name

TODO: Write a project description

Screenshot software

Installation

TODO: Describe the installation process

Usage

TODO: Write usage instructions

Contributing

@berkayakcay
berkayakcay / postgres-update-and-insert-into-with-returning.sql
Created September 13, 2018 11:28
PostgreSQL UPDATE table and get ids from UPDATED rows then INSERT INTO another table
/*
PostgreSQL
If you want to insert any column retaled with update query you can use this.
It gets ids from updated tables and then inter them into another table.
*/
with rows AS (
UPDATE product SET price = price * 1.10
RETURNING id
)
@berkayakcay
berkayakcay / cpp-factorial.cpp
Created May 1, 2019 12:17
C++'da Faktöriyel Hesaplama
#include
#include
using namespace std;
unsigned long faktoriyelHesapla(unsigned long);
int main()
{
int sayi;
unsigned long faktoriyel;
cout << “Sayi Giriniz “; cin >> sayi;
faktoriyel = faktoriyelHesapla(sayi);
@berkayakcay
berkayakcay / cpp-square.cpp
Last active May 1, 2019 12:24
C++’da Dörtgen Çizimi
#include
#include
#include
using namespace std;
class Dortgen
{
public:
Dortgen();
void ciz();
void solaGit();
@berkayakcay
berkayakcay / cpp-pyramid.cpp
Created May 1, 2019 12:28
C++'da Piramit Çizimi
#include
using namespace std;
class Piramit
{
public:
Piramit();
void ciz();
void piramitGir();
int satirSayisi;
char karakter;
@berkayakcay
berkayakcay / matlab-mean-algorithm.m
Last active May 13, 2019 17:45
Image Processing MATLAB Mean Algoritması
clc; clear; close all;
I= imread('p.jpg');
I = rgb2gray(I);
[R,C] = size(I);
SI = uint8(zeros(R,C));
for r=1:R
for c=1:C
total = 0.0;
counter = 0;
for i=-1:1