Skip to content

Instantly share code, notes, and snippets.

View iluxonchik's full-sized avatar
😉

Illya Gerasymchuk iluxonchik

😉
View GitHub Profile
V E V + E Time Space
100 100 200 2 301832
1000 1000 2000 5 346624
10000 15000 25000 22 788248
100000 150000 250000 118 5198408
500000 550000 1050000 1808 24797504
1000000 1100000 2100000 3624 49297504
2000000 2500000 4500000 9438 98298272
3000000 3000000 6000000 10022 147298544
package poof.core;
import java.util.HashMap;
public class Directory extends FileSystemEntitiy {
/**
*
*/
private static final long serialVersionUID = -1968533951935404039L;
#ifndef __BENEFICIARY_H__
#define __BENEFICIARY_H__
// Abstarct class
class Beneficiary {
public:
Beneficiary() { }
virtual int totalHelpRecieved() = 0;
virtual void addHelpRecieved(int value) = 0;
@iluxonchik
iluxonchik / Animal.cpp
Created October 8, 2014 21:12
PO Practical Class 3 C++ Exercise
#include "Dog.h"
#include <iostream>
#include <string>
Dog::Dog(int age, std::string name, int weight) : Animal(age, name), _weight(weight) {}
Dog::~Dog() {};
void Dog::bark()
{ std::cout << ((Animal*)this)->name() + " says: \"ruff, ruff!\"" << std::endl; }
#include "Animal.h"
#include <string>
#include<iostream>
Animal::Animal(int age, std::string name) : _name(name), _age(age) { }
Animal::~Animal() { }
void Animal::sleep(){ printf("Shhh! %s is sleeping...\n", this->name); }
// Works
std::ostream &operator<<(std::ostream &o, const Cat cat){
o << (Animal&)cat << " Weight: " << cat.weight();
return o;
}
//Doesn't work
std::ostream &operator<<(std::ostream &o, const Cat cat){
o << (Animal*)cat << " Weight: " << cat.weight();
return o;
@iluxonchik
iluxonchik / Animal.cpp
Created October 5, 2014 11:18
Everything works fine here
#include "Animal.h"
#include <string>
#include<iostream>
Animal::Animal(int age, std::string name) : name(name), age(age) { }
Animal::~Animal() { }
void Animal::sleep(){ printf("Shhh! %s is sleeping...\n", this->name); }
public AndGateTwo() { gateOne = gateTwo = false; }
public AndGateTwo(boolean bool) { gateOne = gateTwo = bool; }
public AndGateTwo(boolean gOneBool, boolean gTwoBool) { gateOne = gOneBool; gateTwo = gTwoBool; }
@iluxonchik
iluxonchik / TODO.md
Created April 26, 2014 07:50
TODO list prolog-project.

##Clues To Implement

  • trioLeft(Peca, Linha, Coluna, Tabuleiro)
  • trioRight(Peca, Linha, Coluna, Tabuleiro)
  • cobra(Peca, Linha, Coluna, Tabuleiro)
  • tSimples(Peca, Linha, Coluna, Tabuleiro)
  • tLeft(Peca, Linha, Coluna, Tabuleiro)
  • tRight(Peca, Linha, Coluna, Tabuleiro)
  • tInvertido(Peca, Linha, Coluna, Tabuleiro)
  • cantoTopLeft(Peca, Linha, Coluna, Tabuleiro)
  • cantoTopRight(Peca, Linha, Coluna, Tabuleiro)
@iluxonchik
iluxonchik / textToASCII.php
Created April 24, 2014 15:07
Convert text to ASCII (returns an integer).
function textToASCII($text){
/* recieves a chunk of text and returns the number resulting from converting all of the caharacters to ASCII */
$asciified = 0; // stores the "asciified" text
for ($i = 0; $i<strlen($text); $i++){
if (ord($text[$i]) < 10)
// if the character's ASCII code is less than 10, multiplay by 10, so that that integer can be "concatenated"
$asciified *= 10;
else if (ord($text[$i]) < 100)
// if the character's ASCII code is less than 100, multiplay by 100, so that that integer can be "concatenated"
$asciified *= 100;