Skip to content

Instantly share code, notes, and snippets.

View tkaczenko's full-sized avatar
🎯
Focusing

Andrii Tkachenko tkaczenko

🎯
Focusing
View GitHub Profile
@tkaczenko
tkaczenko / main.cpp
Last active September 27, 2021 06:49
Чтение .wav файла (С++ / СPP) / Reading .wav file (C++ / CPP)
#include <iostream>
#include <cstdio>
#include <cmath>
#include "string.h"
#include "mem.h"
//Wav Header
struct wav_header_t
{
char chunkID[4]; //"RIFF" = 0x46464952
@tkaczenko
tkaczenko / main.cpp
Last active May 26, 2017 09:20
Чтение .wav файла Qt / Reading .wav file (Qt)
#include <iostream>
#include <cstdio>
#include <cmath>
#include "string.h"
#include "mem.h"
//Wav Header
struct wav_header_t
{
char chunkID[4]; //"RIFF" = 0x46464952
@tkaczenko
tkaczenko / main.cpp
Last active May 1, 2016 06:29
Вычисление асимметрии и эксцесса C++ (Qt) / Calculating asymmetry and kurtosis written in C++ (Qt)
#include <QCoreApplication>
#include <QVector>
#include <iostream>
#include "qmath.h"
using namespace std;
// Abs data of vector
void absVector (QVector <qint16> v, quint32 n)
{
@tkaczenko
tkaczenko / MyMap.java
Last active February 5, 2023 13:36
Custom java implementation of HashMap with Stream API
package MyMap;
import java.util.*;
import java.util.stream.Collectors;
import static java.util.Objects.requireNonNull;
/**
* Custom implementation of HashMap with Stream API
* @author tkacz-
@tkaczenko
tkaczenko / MetaReader.java
Last active July 27, 2020 10:44
Console utility for reading Wave format (.wav) header written in Java
import wave.WavHeader;
import wave.WavHeaderReader;
import java.io.FileNotFoundException;
import java.io.IOException;
/**
* Console utility for reading meta data of the wave files
*/
public class MetaReader {
@tkaczenko
tkaczenko / Card.java
Last active July 29, 2016 12:39
Simple example of using Stream API and Collections Framework (Java) for demonstration purposes.
package models;
import enumerations.Grade;
/**
* Model of information about the discipline
*/
public class Card {
/**
* Teacher who teach the discipline
@tkaczenko
tkaczenko / CopyFile.java
Last active July 16, 2016 15:45
Console utility for copying files written in Java
import java.io.*;
/**
* Console utility for copying file from source path to destination path
*/
public class CopyFile {
public static void main(String[] args) {
if (args.length != 2) {
System.out.println("Illegal command line agruments!\n" +
"Usage: \n\t java CopyFile <source file path> <destination file path");
@tkaczenko
tkaczenko / RandomString.java
Last active February 22, 2021 09:43
Generate random String in Java using Stream API
import java.util.*;
public final class RandomString {
public static String generateRandomString(Random random, int length) {
return random.insts(48, 122)
.filter(i -> (i < 57 || i > 65) && (i < 90 || i > 97))
.mapToObj(i -> (char) i)
.limit(length)
.collect(StringBuilder::new, StringBuilder::append, StringBuilder::append)
.toString();
@tkaczenko
tkaczenko / Profile.cpp
Last active August 22, 2016 14:33
Serialization with Qt. This class calculates several personal norms for healthy lifestyle.
#include "Profile.h"
Profile::Profile()
{
}
Profile::Profile(float w, short h, short age, QString g, float a, int calorie)
{
setWeigth(w);
@tkaczenko
tkaczenko / Binary.java
Created October 15, 2016 09:03
Utility classes are written in Java for converting to binary, hex, octal and addition, subtraction using algorithms.
package converter;
/**
* Class utility for converting numbers to binary and back
* Addition and subtraction works for positive numbers
* Converter works right. Converter use two's complement for negative numbers
* <b>Functions:</b>
* <ul>
* <li>Converting integer to binary string</li>
* <li>Converting floating point (double) to binary string</li>