Skip to content

Instantly share code, notes, and snippets.

View antic183's full-sized avatar

Antic Marjan antic183

View GitHub Profile
@antic183
antic183 / Car.h
Last active May 9, 2020 17:24
C++ oop playground. The pattern doesn't have to make sense. Below the extendet factory with singleton per type.
#pragma once
#include <string>
#include "IMotoVehicle.h";
using namespace std;
class Car: public IMotoVehicle {
int doors;
public:
public class FloatingPointProblem {
public static void main(String []args) {
float f = 3.1f;
double d = 3.1;
System.out.println(Float.floatToRawIntBits(f) + "\n"); // 1078355558
System.out.println(Double.doubleToRawLongBits(d) + "\n"); //4614162998222441677
if (d == f) {
System.out.println("f == d");
dim speachobject
set speachobject=createobject("sapi.spvoice")
speachobject.speak "corona"
@antic183
antic183 / mysql-random-character.sql
Created November 17, 2020 08:27
mysql, mariadb generate random character
select elt(( FLOOR(1 + (RAND() * 26)) ),'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z');
@antic183
antic183 / howto
Last active March 14, 2024 09:06
work with several openjdk version on windows
1.) download your desired jdk version --> https://jdk.java.net/archive/
2.) unzip the and move the jdk folder on the desired place
3.) add java/bin/ folder to the PATH env.-variable permamently
- open powershell as admin !important
- $env:Path+=";C:\_YOUR-DESIRED-JAVA-PATH_\jdk-xx.xx.xx\bin"
- [Environment]::SetEnvironmentVariable("Path", $env:Path, [System.EnvironmentVariableTarget]::Machine)
@antic183
antic183 / ftp.py
Last active April 12, 2024 10:55
run a simple Python FTP Server on windows as a system service
from pyftpdlib.handlers import FTPHandler
from pyftpdlib.servers import ThreadedFTPServer
from pyftpdlib.authorizers import DummyAuthorizer
class FtpServer:
def start(self):
authorizer = DummyAuthorizer()
authorizer.add_user('user', '12345', 'C:\\..wathever...\\ftp-public', perm='elradfmwMT')
handler = FTPHandler
handler.authorizer = authorizer