Skip to content

Instantly share code, notes, and snippets.

View lSelectral's full-sized avatar
🏠
Working from home

Recep Çiftçi lSelectral

🏠
Working from home
View GitHub Profile
@lSelectral
lSelectral / excel_string_randomizer_for_data_generation.bas
Created December 7, 2021 21:25
This Excel VBA code, randomly add array selected array values to the specified cell range. It is useful for sampling data for surveys. Used in real world project.
Public Function Slc(arr As Variant, length As Integer, customRange As range)
Dim limit As Integer
Dim arrLength As Integer
For Each cell In customRange
limit = WorksheetFunction.RandBetween(0, length - 1)
cell.Value = arr(limit)
Next cell
End Function
Open High Low Close Volume
timestamp
2018-01-07 13832.0 17248.0 12752.0 15160.0 5.870507e+05
2018-01-14 16192.0 17200.0 11400.0 14208.0 6.955388e+05
2018-01-21 13592.0 14440.0 9008.0 11920.0 1.305213e+06
2018-01-28 11536.0 12272.0 9904.0 11144.0 8.355390e+05
2018-02-04 11736.0 11976.0 7540.0 9704.0 1.146677e+06
We can make this file beautiful and searchable if this error is corrected: It looks like row 10 should actually have 11 columns, instead of 9. in line 9.
timestamp,Asset_ID,Count,Open,High,Low,Close,Volume,VWAP,Target,Asset_Name
2018-01-01 00:01:00,0,5.0,8.53,8.53,8.53,8.53,78.38,8.53,-0.01439666748046875,Binance Coin
2018-01-01 00:01:00,7,5.0,25.92,25.92,25.88,25.88,121.08731,25.89136300520674,-0.00826263427734375,Ethereum Classic
2018-01-01 00:01:00,11,7.0,329.0,330.0,329.0,329.5,6.6357102,329.4541176122712,-0.01365705614567525,Monero
2018-01-01 00:01:00,6,173.0,738.5,746.0,732.5,738.5,335.98785,738.839291493523,-0.004810333251953125,Ethereum
2018-01-01 00:01:00,5,32.0,7.66,7.66,7.656,7.656,6626.7134,7.6577128940558925,-0.01392364501953125,EOS.IO
2018-01-01 00:01:00,2,40.0,2376.0,2400.0,2358.0,2374.0,19.233006,2373.1163915061647,-0.00421905517578125,Bitcoin Cash
2018-01-01 00:01:00,1,229.0,13830.0,14020.0,13660.0,13850.0,31.550062,13827.062092689883,-0.01464080810546875,Bitcoin
2018-01-01 00:01:00,9,167.0,225.4,227.8,223.0,225.2,411.89664,225.1979435524601,-0.00978851318359375,Litecoin
2018-01-01 00:02:00,1,235.0,13830.0,14056.0,13680.0,13830.0,31.046432,138
We can make this file beautiful and searchable if this error is corrected: It looks like row 10 should actually have 11 columns, instead of 9. in line 9.
timestamp,Asset_ID,Count,Open,High,Low,Close,Volume,VWAP,Target,Asset_Name
2018-01-01 00:01:00,0,5.0,8.53,8.53,8.53,8.53,78.38,8.53,-0.01439666748046875,Binance Coin
2018-01-01 00:01:00,7,5.0,25.92,25.92,25.88,25.88,121.08731,25.89136300520674,-0.00826263427734375,Ethereum Classic
2018-01-01 00:01:00,11,7.0,329.0,330.0,329.0,329.5,6.6357102,329.4541176122712,-0.01365705614567525,Monero
2018-01-01 00:01:00,6,173.0,738.5,746.0,732.5,738.5,335.98785,738.839291493523,-0.004810333251953125,Ethereum
2018-01-01 00:01:00,5,32.0,7.66,7.66,7.656,7.656,6626.7134,7.6577128940558925,-0.01392364501953125,EOS.IO
2018-01-01 00:01:00,2,40.0,2376.0,2400.0,2358.0,2374.0,19.233006,2373.1163915061647,-0.00421905517578125,Bitcoin Cash
2018-01-01 00:01:00,1,229.0,13830.0,14020.0,13660.0,13850.0,31.550062,13827.062092689883,-0.01464080810546875,Bitcoin
2018-01-01 00:01:00,9,167.0,225.4,227.8,223.0,225.2,411.89664,225.1979435524601,-0.00978851318359375,Litecoin
2018-01-01 00:02:00,1,235.0,13830.0,14056.0,13680.0,13830.0,31.046432,138
@lSelectral
lSelectral / insertion_sort.md
Created March 25, 2022 07:47
insertion_sort_project - Proje 1

[22,27,16,2,18,6] -> Insertion Sort

1. ÖRNEK

1. Yukarı verilen dizinin sort türüne göre aşamalarını yazınız.

  1. Adım --> 22 | 27 16 2 18 6
  2. Adım --> 22 27 | 16 2 18 6
  3. Adım --> 22 27 16 | 2 18 6
  4. Adım --> 16 22 27 | 2 18 6

Bu diziyi Merge Sort'a göre düzenleyiniz

[16,21,11,8,12,22]


16,21,11 8,12,22

16 21,11 8 12,22

##Proje 3

[7, 5, 1, 8, 3, 6, 0, 9, 4, 2] dizisinin Binary-Search-Tree aşamalarını yazınız.

Örnek: root x'dir. root'un sağından y bulunur. Solunda z bulunur vb.

Root chosen as 7

@lSelectral
lSelectral / MovieWebAPI-UML-Diagram.mm
Created April 3, 2022 16:00
UML Diagram for Movie Web API. Created by Mermaid.JS
classDiagram
Movie *-- Director
Actor <|-- Director
Movie : +string name
Movie : +int year
Movie : +enum genre
Movie : +string director
Movie : +List~string~ actors
@lSelectral
lSelectral / Postgres_Function.sql
Created April 12, 2022 23:58
PostgreSQL sql function queries for restaurant database.
---------------------------------------------------------------
-- Function without parameter
/*
create or replace function func_get_food_count()
returns int
language plpgsql
as
$$
declare food_count int;
begin
@lSelectral
lSelectral / Postman_Response_Test.js
Last active August 8, 2022 22:33
Response and Statue test in Postman Test
pm.test('Should get 200 status code with JSON response', () => {
pm.response.to.have.status(200);
pm.response.to.be.ok;
pm.response.to.be.json;
})