Mount JFFS2 Image
Saturday, October 25, 2008
Example of how to mount a JFFS2 image using mtdblock.
Clay Shirky: Institutions vs. collaboration
Monday, July 14, 2008
This is a rather interesting talk that takes some very foundational ideas from open source software development, P2P networks, and social networking and implies that these paradigms can apply to a lot more.
The only thing constant is change itself.
Debug Macros
Wednesday, May 18, 2005 by digitalpeer
The following code snippet demonstrates how I use debug macros during development (along with common ones like assert). These things are a time saver during debugging. When DEBUG isn't defined they simply go away. One of the macros demonstrates how to use variable list arguments in macros. This is useful for doing exactly what I'm showing- wrapping fprintf or printf with a macro. Forgive the mixture of cout and printf - wanted to demonstrate using both.
#include <cstdio>
#include <iostream>
#ifdef DEBUG
/* just a helper for code location */
#define LOC std::cout << "debug:" << __FILE__ << ":" << __LINE__ << " ";
/* macro using var args */
#define DEBUG_PRINT(fmt,...) LOC printf(fmt,__VA_ARGS__);
/* macro for general debug print statements. */
#define DEBUG_VAL(text) LOC std::cout << text << std::endl;
/* macro that dumps a variable name and its actual value */
#define DEBUG_VAR(text) LOC std::cout << (#text) << "=" << text << std::endl;
#else
/* when debug isn't defined all the macro calls do absolutely nothing */
#define DEBUG_PRINT(fmt,...)
#define DEBUG_VAL(text)
#define DEBUG_VAR(text)
#endif
int main()
{
int x = 10;
DEBUG_PRINT("hello %s times %dn","world",x)
DEBUG_VAL(x)
DEBUG_VAR(x)
return 0;
}