This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <unistd.h> | |
| #include <stdio.h> | |
| /* | |
| My litle contibution to the world of obfuscated code | |
| */ | |
| int main() { | |
| const char* a = "FizzBuzz Fizz BuzzFizz FizzBuzz Fizz 089:>?CGHIMQRVW "; | |
| for(int i = 0; i < (a[0] + ' ') - 1; i++) { | |
| const char* t = a + a[i%15 + 40] - a[40]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** Debug vector class extended from std vector class for range checking in random access operations | |
| */ | |
| template <typename T> | |
| struct debug_vector : public std::vector<T> | |
| { | |
| debug_vector(size_t size = 0) : std::vector<T>(size) { } | |
| debug_vector(size_t size,const T& fill) : std::vector<T>(size,fill) { } | |
| debug_vector(std::initializer_list<T> values) : std::vector<T>(values) { } | |
| inline const T& operator[](size_t idx) const { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| template<typename T> | |
| struct super_ptr: public std::shared_ptr<T> | |
| { | |
| constexpr super_ptr() : std::shared_ptr<T>(new T()) { } | |
| template<typename... Args> | |
| constexpr super_ptr(Args&&... args) : std::shared_ptr<T>(std::make_shared<T>(args...)) { } | |
| constexpr super_ptr(const super_ptr<T>& other) : std::shared_ptr<T>(other) { } | |
| constexpr super_ptr(super_ptr<T>& other) : std::shared_ptr<T>(other) { } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #pragma once | |
| #include <unistd.h> | |
| #include <fcntl.h> | |
| #ifdef DEBUG | |
| #include <cstdio> | |
| #endif | |
| class FD | |
| { | |
| int fd; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| #include <time.h> | |
| using namespace std; | |
| /* | |
| * BinaryTree difined using raw pointers for convenience, so need to pay attention to deallocate memory!*/ | |
| struct node | |
| { | |
| int val = 0; | |
| struct node* a = nullptr; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Made by David Garcia ©, Jutge P9 Repeated words, accepted. | |
| * Tested with Unabomber manifesto, 34k words 0.01s | |
| */ | |
| #include <iostream> | |
| #include <vector> | |
| using namespace std; | |
| int HASH_SIZE; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #STRING="Process runing mem=546M (143%) low mem=2" | |
| STRING="$(heroku logs -n 12 --source heroku -a bullnexmc)" | |
| CUT1=${STRING#*mem=} | |
| CUT2=${CUT1%%)*} | |
| echo "mem=$CUT2)" | |
| echo `expr match "$STRING" '\(.[a-z]\)'` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //Prints all parenthesis combinations of a given lenght using catalan numbers | |
| #include <vector> | |
| #include <iostream> | |
| using namespace std; | |
| struct Node { | |
| int _val; | |
| Node* _father; | |
| vector<Node*> vector; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class Main { | |
| static interface Func{ | |
| float func(float f); | |
| } | |
| public static void main(String[] args) { | |
| Func f = (x)->{return x*x - 4*x*x + 2;}; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class Factorial { | |
| public static void main(String[] args) { | |
| System.out.println(Factorial(5)); //It gives 120 | |
| } | |
| //The most beutyful way of calculating the factorial of a number! | |
| public static int Factorial(int i){ | |