Skip to content

Instantly share code, notes, and snippets.

2> parser.cpp
2>C:\cygwin\home\Nicolas\Programming\vklang\src\vk\parser.cpp(273): error C2280: 'std::unique_ptr<vk::TypeExpression,std::default_delete<_Ty>>::unique_ptr(const std::unique_ptr<_Ty,std::default_delete<_Ty>> &)' : attempting to reference a deleted function
2> with
2> [
2> _Ty=vk::TypeExpression
2> ]
2> C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\memory(1486) : see declaration of 'std::unique_ptr<vk::TypeExpression,std::default_delete<_Ty>>::unique_ptr'
2> with
2> [
2> _Ty=vk::TypeExpression
@nlguillemot
nlguillemot / gist:add8ef4679581c76e000
Last active August 29, 2015 14:14
updated glsl.xml that handles identifiers. previously, the 3 in the identifier or macro name "vertic3s" would become highlighted. Also fixed "0" not being highlighted in layouts along with hex/octal constants being used in layouts.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE language SYSTEM "language.dtd">
<!-- the version of this file shows the largest supported OpenGL version, second digit is the minor patch level (Y.XP = supports GLSL X.Y0 with patchlevel P -->
<language name="GLSL" section="Sources" extensions="*.glsl;*.vsh;*.vert;*.tcsh;*.tcs;*.tesh;*.tes;*.gsh;*.geo;*.geom;*.fsh;*.frag;*.csh;*.cs" mimetype="text/x-glslsrc" version="4.40" kateversion="2.4" author="Robert Menzel (mail@renderingpipeline.com)" license="LGPL">
<highlighting>
<!-- ####################################################################################################### keywords -->
<list name="keywordsCompatibility">
<!-- compatibility mode, older GLSL versions -->
<item>attribute</item>
@nlguillemot
nlguillemot / main.cpp
Created March 28, 2015 12:27
Polling for changes in a directory
#include <Windows.h>
int main()
{
// Create a file change notification object that can be used to check for file changes.
HANDLE hNotif = FindFirstChangeNotification("C:\\Path\\To\\My\\Directory", TRUE, FILE_NOTIFY_CHANGE_LAST_WRITE);
while (1)
{
// Wait until a file change notification happens.
@nlguillemot
nlguillemot / !What is this?
Last active August 29, 2015 14:20
Transposing a CSV file (with '|' instead of ',')
People these days love to throw GPUs at every problem they can.
Sometimes it works well, other times it's a waste of power.
This program was written to show that you don't need a big high end GPU to parse a CSV file quickly,
in reponse to https://github.com/antonmks/nvParse
Can probably be optimized more. Gotta try running it on a SSD sometime.
Either way, much more competitive than the strawman CPU implementations on the above project page.
@nlguillemot
nlguillemot / to_tstring.hpp
Created June 2, 2015 18:07
to_string based on TCHAR
namespace detail
{
template<class T>
std::string to_tstring(CHAR, const T& x) { return std::to_string(x); }
template<class T>
std::wstring to_tstring(WCHAR, const T& x) { return std::to_wstring(x); }
}
template<class T>
auto to_tstring(const T& x)
@nlguillemot
nlguillemot / output from webcompiler.cloudapp.net
Last active August 29, 2015 14:22
value initializing unions inside a struct
Compiled with /EHsc /nologo /W4
main.cpp
Compilation successful!
Total compilation time: 109ms
0 0 0 0 0 0 0 0 0 0
50790056 50790132 50790220 49536592 -1801320171 -2 49555713 49555747 49683692 6
@nlguillemot
nlguillemot / main.cpp
Last active August 29, 2015 14:22
value initialized member struct
#include <iostream>
using namespace std;
struct X
{
int a,b,c;
};
struct Y
@nlguillemot
nlguillemot / p4vsissues.md
Last active August 29, 2015 14:26
P4VS problems I've encountered

From memory...

  • Periodically freezes Visual Studio for a long period of time while refreshing status.
    • Workaround: Set the refresh period to some obscenely huge number (the status of your files is then never refreshed)
  • Tends to give P4 error pop-ups when opening files outside of your project (eg: stdlib headers, files from other projects...)
  • Deleting files from project (while simultaneously marking for delete) gives an error saying the file doesn't exist (but also deletes it. double delete?)
  • Deleting N files from a project sequentially gives N pop-ups asking if you also want to mark for delete
@nlguillemot
nlguillemot / SConstruct
Created May 28, 2012 03:44
Kinect + Irrlicht prototype
env = Environment()
linked_libs = ['Irrlicht', 'GL', 'freenect']
cpp_flags = ['-std=c++0x']
env.Append(LIBS = linked_libs)
if ARGUMENTS.get("debug",0):
cpp_flags += ['-g']
env.Append(CPPFLAGS = ' '.join(cpp_flags))
@nlguillemot
nlguillemot / O0tmp.s
Created June 20, 2012 05:30
label weirdness cross-compiled with linux arm gcc
.arch armv4t
.fpu softvfp
.eabi_attribute 20, 1
.eabi_attribute 21, 1
.eabi_attribute 23, 3
.eabi_attribute 24, 1
.eabi_attribute 25, 1
.eabi_attribute 26, 2
.eabi_attribute 30, 6
.eabi_attribute 18, 4