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 / 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 / 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 / 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 / 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 / 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 / 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 / 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.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 / GradeBook.c
Created November 11, 2015 11:00
A simple Grade Array Example
#include <stdio.h>
#include <stdlib.h>
#define MAX_STUDENT 10
#define MAX_GRADE 100
int main(void)
{
int arr[MAX_STUDENT];
int option = -1; /* initial value */
@bzdgn
bzdgn / strtolDemo.c
Last active November 10, 2015 15:23
strtol Demo
#include <stdio.h>
#include <stdlib.h>
int main()
{
char * numbers = "12 0x123 101";
printf("\n%s %s", "before :", numbers);
// first token transformed
int first = strtol(numbers, &numbers, 10);