Skip to content

Instantly share code, notes, and snippets.

View bananu7's full-sized avatar
🏍️

Bartek Banachewicz bananu7

🏍️
View GitHub Profile
@bananu7
bananu7 / gist:4397796
Created December 28, 2012 13:21
Trivial OpenGL 4.0 code
#include <GL/glew.h>
#include <GL/glut.h>
#include <GL/freeglut.h>
#include <GL/GL.h>
#include <string>
#include <iostream>
#include <array>
#include <vector>
#include <type_traits>
#include <vector>
namespace io {
using byte = unsigned char;
using sbyte = signed char;
template<class T>
struct is_byte : std::integral_constant<bool, false> {};
@bananu7
bananu7 / resource_problem.cpp
Created January 17, 2013 18:02
I have an issue
class ILoader
{
public:
virtual boost::optional<std::string const&> GetParam(std::string const& name) const = 0;
virtual boost::optional<std::istream> GetDataStream(std::string const& name) = 0;
};
class CSimpleFileLoader :
public ILoader
{
@bananu7
bananu7 / async_task.cpp
Created January 18, 2013 12:15
Sample of async_task class, which allows creating unified threaded workers easily.
#include <future>
#include <thread>
#include <functional>
template <typename Signature>
class async_task;
template <typename Result, typename... Args>
class async_task<Result(Args...)> {
public:
@bananu7
bananu7 / arrays.h
Created January 30, 2013 13:56 — forked from rmartinho/arrays.h
// begin() and end() functions for arrays (C++03)
//
// Written in 2012 by Martinho Fernandes
//
// To the extent possible under law, the author(s) have dedicated all copyright and related
// and neighboring rights to this software to the public domain worldwide. This software is
// distributed without any warranty.
//
// You should have received a copy of the CC0 Public Domain Dedication along with this software.
// If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
@bananu7
bananu7 / bit_ops.cpp
Created February 15, 2013 20:32
Bit operations from Robot
template <int Size>
struct uint_least : uint_least<Size+1> {};
template <>
struct uint_least<8> : identity<u8> {};
template <>
struct uint_least<16> : identity<u16> {};
template <>
struct uint_least<32> : identity<u32> {};
template <>
struct uint_least<64> : identity<u64> {};
@bananu7
bananu7 / config.h++
Created February 21, 2013 22:01
draft of config
#pragma once
#ifdef _WIN32
#define MINICRAFT_WINDOWS
#else
#define MINICRAFT_LINUX
#endif
#ifdef MINICRAFT_WINDOWS
#define BREAKPOINT() _CrtDbgBreak()
CXX := g++
CXXFLAGS := -g -std=c++11 -fPIC -Wall
CXXFLAGS += -I include/
CXXFLAGS += -I ../dependencies/glm-0.9.4.1
CXXFLAGS += -I ../dependencies/
CXXFLAGS += -DGLEW_STATIC -DGLEW_NO_GLU
OBJDIR := build
#deps
# C++ coder in a Java world, part 1.
### Disclaimer
These are my personal opinions and feelings that arose from very limited exposure to Java. Whilst I am fairly experienced with C++, the Java world is new for me. Whilst it is very hard to keep an unbiased opinion in such case, I have tried my best. So here, as-is, hands-on, are written my thoughts.
### Intro
I wouldn't even pick up Java if not for mandatory university classes. I was of course aware of its existence, but it always stayed for far-enough comfort zone I haven't even had to touch. No more running away, though, the situation got real and I have launched the IDE.
I have worked with fairly new NetBeans IDE. AFAIR, it is written in Java and *for* Java, so I expected at least nice integration (my experiences in coding Python or C++ in NetBeans were at most "Meh."). The project creation is fairly simple, and allows you to choose from variety of targets. I suspect they actually work, contrary to Visual Studio project targets - anything different than
@bananu7
bananu7 / java_1.md
Last active December 15, 2015 02:29

C++ coder in a Java world, part 1.

Disclaimer

These are my personal opinions and feelings that arose from very limited exposure to Java. Whilst I am fairly experienced with C++, the Java world is new for me. Whilst it is very hard to keep an unbiased opinion in such case, I have tried my best. So here, as-is, hands-on, are written my thoughts.

Intro

I wouldn't even pick up Java if not for mandatory university classes. I was of course aware of its existence, but it always stayed for far-enough comfort zone I haven't even had to touch. No more running away, though, the situation got real and I have launched the IDE.

I have worked with fairly new NetBeans IDE. AFAIR, it is written in Java and for Java, so I expected at least nice integration (my experiences in coding Python or C++ in NetBeans were at most "Meh."). The project creation is fairly simple, and allows you to choose from variety of targets. I suspect they actually work, contrary to Visual Studio project targets - anything different t