Tuesday, August 11, 2009

function pointer to class methods

C++ function pointer to a class method:

class Giant {
public:
void method();
};

typedef void (Giant::*Action)();


Taken from Command - Design Pattern
http://www.vincehuston.org/dp/command.html

Monday, August 10, 2009

software design

Excellent descriptions of design patterns, antipatterns, refactoring methods and uml :
http://sourcemaking.com/

Here is another one, restricted to design patterns:
http://www.vincehuston.org/dp/

Tuesday, January 20, 2009

mashups

Here are some mashup sites I created in 2007 to experiment with youtube api, flickr api:

flickr: http://foto.web-cafe.ro/
youtube: http://www.cafetv.ro/
blogs/rss/atom: http://web-cafe.ro/

Scrum, XP, Agile

Lots of Scrum, XP, Agile, Lean, TOC, TQM resources:
http://www.scrumlabs.com/

A Free InfoQ book on Scrum and XP:
http://www.infoq.com/minibooks/scrum-xp-from-the-trenches

Thursday, April 03, 2008

Wordpress Plugin: Simple Sticky Posts

Plugin features:
Adds simple sticky posts feature to WordPress blogs.

Download:
Simple Sticky Posts 0.1 For WordPress 2.x.x

Installation:
1. Go to 'wp-content/plugins' folder
2. Copy 'simple-sticky-posts.php' to 'wp-content/plugins' folder
3. Activate the 'Simple Sticky Posts' plugin
4. You are ready.

Usage:
1. Open the post to be marked sticky in wordpress editor.
2. Add a Custom Field named 'sticky' and set its value to '1'
3. You are ready.

Screenshots:
available soon.

Demo:
available soon.

Version history:
4/3/2008 - version 0.1 - created

Any bug reports, feature requests are welcome.

Thursday, March 27, 2008

simple bash stuff

Run applications from the linux terminal, as a new process:

> apptorun &


Other linux bash command line tips:

http://www.arachnoid.com/linux/shell_programming.html

Wednesday, April 18, 2007

dev-c++ / wxdev-c++

dev-cpp and wxdev-cpp: the best c++ IDE for open source programming / cross platform programming on windows.

http://www.bloodshed.net/devcpp.html

Has an version for developing wxWidgets based GUI for applications.
http://wxdsgn.sourceforge.net/

Try the check for updates feature, where you can select tons of c++ open source libraries to be reused in your applications.

Other places to find extensions:
http://www.bloodshed.net/dev/devcpp.html
http://devpaks.org/
http://blog.weinachter.com/en
http://sourceforge.net/project/showfiles.php?group_id=94270

Monday, November 06, 2006

stl fstream and macros on vs7

while working with visual studio 2003 / 7, c++, fstream, log files and macros, like the following:

#define LOGMACRO (format_string, ...) log (__FILE__, __LINE__, format_string, __VA_ARGS__)


got some errors:
error C2059: syntax error : '...'
error C2061: syntax error: identifier '_DebugHeapTag'
xdebug(29): _CRTIMP2 void * __cdecl operator new(size_t, const std::_DebugHeapTag_t&, char *, int)
_THROW1(std::bad_alloc); // allocate from the debug CRT heap


the solution was in 4 steps:

1. replacing all stl include files matching the pattern:
#include <string.h>
#include <fstream.h>

with header files without '.h' in their names, ex:
#include <string>
#include <fstream>


2. putting some parantheses around the parameters in the macro def. value, like:
#define LOGMACRO (format_string, ...) log (__FILE__, __LINE__, (format_string), __VA_ARGS__)


3. replacing '...' and '__VA_ARGS__' with a simple parameter. vs7 does not support varargs in macros.
#define LOGMACRO (format_string, args) log (__FILE__, __LINE__, (format_string), (args))


4. putting the fstream include in the last line of stdafx.h, removing from any other location in the source code like below.
#include <fstream>
using namespace std;


In addition to the things described above, here is a nice macro tutorial: http://en.wikipedia.org/wiki/C_preprocessor