Skip to content

Instantly share code, notes, and snippets.

View itay-grudev's full-sized avatar

Itay Grudev itay-grudev

View GitHub Profile
@itay-grudev
itay-grudev / codewordanalyzer.cpp
Created May 29, 2015 16:51
CodeWord Frequency Analyzer written with Qt
#include <QCoreApplication>
#include <QFile>
#include <QHash>
struct CodeWord {
CodeWord() { count = 0; }
CodeWord(QString word, unsigned int count) : word(word), count(count) {}
QString word;
unsigned int count;
};
@itay-grudev
itay-grudev / getlnw.h
Last active July 3, 2016 13:58
Get data from a stream until EOF ignoring whitespace
#include <cstdio>
#include <cstdlib>
/**
* @brief getlnw Get data from a stream until EOF ignoring whitespace
* @param input the given input stream
* @return returns a pointer to the string.
* @note you have to free() the string manually
*/
char* getlnw( FILE *input = stdin )
@itay-grudev
itay-grudev / letter_frequency_analyzer.rb
Last active June 23, 2017 12:44
A simple script that calculates letter frequency for any language by analysing given subset of articles on the internet. This script is provided with a list of English Wikipedia articles.
# The MIT License (MIT)
# Copyright (c) 2014 Itay Grudev
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions: