September 24, 2012

To Arxiv or not to Arxiv

To be honest, I had never cared about the copyright transfer forms and just blindly signed and submitted them while submitting the camera ready of my papers. I only hope that this does not change the next time I submit a paper. My concerns are based on the discussions in the networks lab (at the University of Washington) regarding the copyright held by ACM.

Based on the discussions I believe that I may have violated some of the ACM copyrights by maintaining author versions of my papers on HAL, an arxiv equivalent from INRIA. I personally prefer these author versions. The author versions give me the flexibility to update a future date if some additional text is required based on the discussions during conferences. Now based on the verdict, as reported by wired, against Aaron Schwartz I am worried.

Federal prosectors added nine new felony counts against well-known coder and activist Aaron Swartz, who was charged last year for allegedly breaching hacking laws by downloading millions of academic articles from a subscription database via an open connection at MIT.

“JSTOR authorizes users to download a limited number of journal articles at a time,” according to the latest indictment. “Before being given access to JSTOR’s digital archive, each user must agree and acknowledge that they cannot download or export content from JSTOR’s computer servers with automated programs such as web robots, spiders, and scrapers. JSTOR also uses computerized measures to prevent users from downloading an unauthorized number of articles using automated techniques.”
I do not know if ACM or IEEE will start suing authors who have only a few publications but authors like me are an easy target. In this regards, The Cost of Knowledge is a site that discourages the use of Elsevier as a publication platform. I believe that in the next few years a similar initiative might come up that discourages the submission to ACM. In the meantime I will still continue to use HAL and make my author versions available on arxiv as tech/research reports.

September 6, 2012

A variable length macro for logging in C++ without format specifiers

I wanted to write a simple logging module for c++. My requirements were simple
  • Nothing fancy but a simple macro to log variables. 
  • No format specifiers like "%s %d" and so on. 
  • Variable argument list
  • Use cout to dump the log messages. Later on this should support logging to syslog if required.
  • Easy to enable and disable with #if 0 and #if 1 declarations.
I did a couple of searches but then most of the implementations were heavy to use and I just wanted a macro that I could enable and disable before compilations.
The following is the simplest I could think of and come up with.
#include <iostream>

#if 1
#define LOG_DEBUG(param) do {     \
  std::cout << param << std::endl;\
} while(0); 
#define LOG_DEBUG(param) do { } while(0);

int main()
  int v1 = 10;
  double v2 = 100223.1212313;
  LOG_DEBUG(1<< " " << 3.5 << " " << "hello" << " " << v1 << " " << v2);
Output is as follows
$> ./a.out 
1 3.5 hello 10 100223