Skip to content

Instantly share code, notes, and snippets.

@ismailkocacan
ismailkocacan / main.cpp
Last active March 31, 2024 13:37
LIST_ENTRY - CONTAINING_RECORD
#include <iostream>
#include <Windows.h>
typedef struct tagPERSON {
char name[255];
PLIST_ENTRY link;
} PERSON, * PPERSON;
int main()
{
@ismailkocacan
ismailkocacan / program.cs
Last active June 4, 2021 12:35
simple array based hash table implementation
using System;
unsafe class Program
{
static KeyValue[] hashTable = new KeyValue[10];
static int Hash(string key, int count)
{
int total = 0;
fixed (char* pbegin = key)
@ismailkocacan
ismailkocacan / SoapLogger.pas
Last active April 9, 2021 09:53
Simple http request and response soap logger.
unit SoapLogger;
interface
uses
System.SysUtils,
System.Classes,
Web.HTTPApp,
Soap.InvokeRegistry,
Soap.WSDLIntf,
@ismailkocacan
ismailkocacan / SuperJSONMarshall.pas
Created April 3, 2021 15:16
Serialization-De-serialization support for primitive types, TObject and class array
{
author: isocan
date: 03-04-2021
}
unit SuperJSONMarshall;
interface
uses
@ismailkocacan
ismailkocacan / fixed_pointer_math.cs
Created January 4, 2021 11:09
How to use, pointer math with C# fixed keyword.
/*
Author: isocan
Date : 04-01-2021
*/
using System;
unsafe class Program
{
static void Main(string[] args)
{
@ismailkocacan
ismailkocacan / bitbucket-pipelines.yml
Created May 17, 2020 02:01
my bitbucket pipeline
# This is a sample build configuration for .NET Core.
# Check our guides at https://confluence.atlassian.com/x/5Q4SMw for more examples.
# Only use spaces to indent your .yml configuration.
# -----
# You can specify a custom docker image from Docker Hub as your build environment.
#image: microsoft/dotnet:3.1-sdk
#image: microsoft/dotnet:sdk
#image: microsoft/dotnet:latest
image: mcr.microsoft.com/dotnet/core/sdk:3.1
pipelines:
@ismailkocacan
ismailkocacan / Startup.cs
Last active April 11, 2020 18:54
.net core dynamically register typeinfos to container
// This method gets called by the runtime. Use this method to add services to the container.
public void ConfigureServices(IServiceCollection services)
{
services.AddControllers();
// Repositoryler register ediliyor.
TypeInfo[] typeInfoRepositories = Assembly
.GetEntryAssembly()
.GetReferencedAssemblies()
.Select(Assembly.Load)
program Project2;
{$APPTYPE CONSOLE}
uses
SysUtils,
Dialogs,
Windows;
procedure ProcA;
/*
Author : isocan
Purpose : How to implement dimensional dynamic array using pointers.
DateTime : 18.11.2019
Write Great Code: Volume 1: Understanding the Machine
Composite Data Types and Memory Objects
Type variable[Col_Size][Row_Size]
Element_Adress = Base_Adress + (Col_Index * Row_Size + Row_Index) * Element_Size
/*
Author : isocan
Purpose : How to implement Three-dimensional dynamic array using pointers.
DateTime : 21.11.2019
Write Great Code: Volume 1: Understanding the Machine
Composite Data Types and Memory Objects
Type variable[Depth_Size][Col_Size][Row_Size];
Element_Adress = Base_Adress + ( (Depth_Index * Col_Size + Col_Index) * Row_Size + Row_Index) * Element_Size