Skip to content

Instantly share code, notes, and snippets.

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

Levent Divilioglu bzdgn

🏠
Working from home
View GitHub Profile
@bzdgn
bzdgn / bpdb.c
Last active November 12, 2015 18:04
BoilerPlate Database Sample On C
/* cl: cl /nologo /W4 bpdb.c */
/* gcc: gcc bpdb.c -Wall -Wextra -pedantic -std=c11 -o bpdb */
#include <stdio.h>
#define OPEN 1
#define CLOSED 0
typedef struct
{
int SomeState;
@bzdgn
bzdgn / bpdb.cpp
Last active November 12, 2015 18:21
BoilerPlate Database Sample with Struct On C++
/* cl: cl /nologo /W4 bpdb.cpp */
/* gcc: g++ bpdb.cpp -Wall -Wextra -pedantic -std=c++11 -o bpdb */
#include <stdio.h>
#define OPEN 1
#define CLOSED 0
struct Connection
{
private:
@bzdgn
bzdgn / bpdb_class.cpp
Created November 12, 2015 18:22
BoilerPlate Database Sample with Class On C++
/* cl: cl /nologo /W4 bpdb_class.cpp */
/* gcc: g++ bpdb_class.cpp -Wall -Wextra -pedantic -std=c++11 -o bpdb_class */
#include <stdio.h>
#define OPEN 1
#define CLOSED 0
class Connection
{
private:
@bzdgn
bzdgn / inlineprint.c
Last active June 22, 2019 01:19
C Inline Asm Printf Example For Visual Studio
#include <stdio.h>
// function declarations
void printInteger(int *);
void printIntegerValue(int);
void printOneString(char []);
char printFormat1[] = "Deger: %x\n";
char printFormat2[] = "Deger: %s\n";
@bzdgn
bzdgn / inlineprint2.c
Last active November 17, 2015 12:44
C Inline Asm Printf Example For Visual Studio #2
#include <stdio.h>
// function declarations
void printInteger(int *, char[]);
void printIntegerValue(int, char[]);
void printOneString(char[], char[]);
// implementations
void printInteger(int *number, char printFormat[])
{
@bzdgn
bzdgn / GenerateDummyCode.java
Last active February 7, 2025 21:18
Dummy Code Generator : 10000 Lines of Useless Code
import java.io.FileNotFoundException;
import java.io.PrintWriter;
public class GenerateDummyCode {
public static void main(String[] args) {
String className = "Eben";
String newLine = "\n";
String tab = "\t";
String classStart = "public class " + className + " {";
String closeBracket = "}";
@bzdgn
bzdgn / AdvancedDocumentBuilderFactoryDemo.java
Created December 9, 2015 21:22
JAVA DocumentBuilderFactory Example Code
package com.levo.abstractfactory.example;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import org.w3c.dom.Document;
@bzdgn
bzdgn / DelegationClasses.java
Created December 17, 2015 19:58
ClassLoader Hierarchy
package com.levent;
import java.net.URL;
import java.net.URLClassLoader;
public class DelegationClasses {
public static void main(String[] args) {
URLClassLoader classLoader = (URLClassLoader) ClassLoader.getSystemClassLoader();
do{
@bzdgn
bzdgn / ObjectPropAttr.html
Last active January 13, 2016 22:41
JavaScript Demo For Displaying Object Properties and Attributes
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
</head>
<body>
<h1>Object Properties Example #3</h1>
<br>
<h3>Displaying Object Attributes per Object Properties</h3>
<button onclick="showPropertyAttributes()">Show Property Attributes</button><br>
@bzdgn
bzdgn / ObjectMethod.html
Last active January 13, 2016 23:17
JavaScript Demo For Using Method As A Function And As A Property
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
</head>
<body>
<h1>Object Methods Example #1</h1>
<br>
<h3>Demonstrating method as a function and as a property</h3>
<button onclick="fullName()">Full Name of Person</button><br>