Wrapping C Code Within a Single Swift Package

Posted on Sat 26 November 2016 in Open Source Swift • Tagged with swift, development, cli, c, swift package manager

Working with C code from Swift always seemed to me to be one of those dark arts that us well to do developers shouldn't need to dabble in. However, it's actually a fairly simple proposition, and the Swift compiler and Swift Package Manager lend a big helping hand ...


Continue reading

OpenMP Examples

Posted on Thu 07 August 2008 in Development • Tagged with C++, OpenMP

Here are some usage examples for the C++ library available in the GNU C++ compiler versions 4.2 and up, and probably others. This first example shows how to use the parallel for construct to iterate over a set of neurons. Each thread here gets an equal share of the ...


Continue reading

C++ Pointers and Incomplete Types

Posted on Sun 24 February 2008 in Development • Tagged with C++

Learned some new things about C++ and pointers today. Namely that you can declare a pointer member variable of the class A in class A. Pretty neat. Take for example the following simple illustration.

#include <iostream>
class A {
    public:
        void setMember(A& m) { this->member = &m; }
        A* member;
        int x ...

Continue reading