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
| {- | |
| Rendering this: | |
| +------+ | |
| | main | | |
| +------+ | |
| | | |
| +-------------+ | |
| | a. Anaglyph | |
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
| #ifndef MIDI_RANDOM_INCLUDE_PLUGIN_H_ | |
| #define MIDI_RANDOM_INCLUDE_PLUGIN_H_ | |
| #include "vst2.x/audioeffectx.h" | |
| #include <cstdlib> // rand | |
| // just one program | |
| #define NUM_PROGRAMS 1 | |
| // no other parameter |
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
| // This is part of a midi generating plugin made with Juce library. | |
| // | |
| // The goal of this thing is simply to generate random midi notes that are on-time | |
| // with sample accuracy. | |
| void MidiRandomAudioProcessor::processBlock (AudioSampleBuffer& buffer, MidiBuffer& midiMessages) | |
| { | |
| // Clear all | |
| for (int i = 0; i < getNumOutputChannels(); ++i) | |
| { |
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 <dlfcn.h> | |
| #include <cstdio> | |
| #include <cstring> // strerror | |
| #include <errno.h> // errno | |
| typedef void(*test_func)(bool); | |
| int main() { | |
| printf("Qt BUG related to dlclose\n=========================\n1. Program starting.\n"); | |
| printf("2. Loading dynamic library 'mod.so' linked to Qt.\n"); |
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 <QtGui/QApplication> | |
| #include <QtCore/QTimer> | |
| #include <qglobal.h> | |
| #include <cstdio> | |
| static int app_argc = 0; | |
| static char *app_argv[] = {}; | |
| static void something() { |
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
| require 'lubyk' | |
| -- Box2D bindings are not yet in published but code will look the same | |
| -- (18.1.2012) | |
| local function makeBody(x, y, r, hue) | |
| -- Define the dynamic body. We set its position and call the body factory. | |
| local bodyDef = b2.BodyDef() | |
| bodyDef.type = b2.dynamicBody | |
| bodyDef.position:Set(x, y) |
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
| // =========================================================== Return value optimization | |
| /** Vect Vect::operator+(const Vect &v) | |
| * test/fixtures/pointers/Vect.h:55 | |
| */ | |
| static int Vect_operator_add(lua_State *L) { | |
| try { | |
| Vect *self = *((Vect**)dub_checksdata(L, 1, "Vect")); | |
| Vect *v = *((Vect**)dub_checksdata(L, 2, "Vect")); | |
| dub_pushudata(L, new Vect(self->operator+(*v)), "Vect"); |
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
| -- luajit simple_jit.lua | |
| ffi = require 'ffi' | |
| simple = ffi.load('simple') | |
| ffi.cdef[[ | |
| typedef struct Simple Simple; | |
| Simple *Simple_Simple(int); | |
| void Simple__gc(Simple *); |
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
| // g++ simple.cpp -shared -o libsimple.dylib | |
| #include <stdio.h> | |
| class Simple { | |
| int id_; | |
| public: | |
| Simple(int id); | |
| ~Simple(); |
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
| -- ============ Create new class | |
| SpecialEdit = {} | |
| setmetatable(SpecialEdit, mimas.LineEdit_mt) | |
| -- calling SpecialEdit() should do the following things | |
| -- 1. create userdata | |
| -- 2. set new table as uservale ---> self | |
| -- 3. create new lua thread and install "self" on the stack | |
| -- 4. set access to userdata from self ---> self.super = userdata | |
| -- 5. set "SpecialEdit" as metatable for "self" ---> setmetatable(self, SpecialEdit) |