Fix comments not showing in WordPress page

If you have “magazine-basic” wordpress theme, and with recent updates or for any reason; if comment is not showing up in individual posts, follow this change. Navigate from your hosting panel to file:  …/ wp-content / themes / magazine-basic / functions.php. Edit this file. Around line 351, change case statement as below: function bavotasan_comment( $comment, $args, $depth ) {$GLOBALS[‘comment’] = $comment; switch अतिरिक्त Read More

CMake 101

(From https://stackoverflow.com/questions/31037882/whats-the-cmake-syntax-to-set-and-use-variables) When writing CMake scripts there is a lot you need to know about the syntax and how to use variables in CMake. The Syntax Strings using set(): set(MyString “Some Text”) set(MyStringWithVar “Some other Text: ${MyString}”) set(MyStringWithQuot “Some quote: \”${MyStringWithVar}\””) Or with string(): string(APPEND MyStringWithContent ” ${MyString}”) Lists using set(): set(MyList “a” “b” “c”) set(MyList ${MyList} “d”) Or अतिरिक्त Read More

Android NDK console print C/C++ – Chirag Patel

When your Android app has C/C++ code using NDK tools and you want printing output to serial port console, here’s the solution. // change sharing first chmod(“/dev/console”, S_IRWXG | S_IRWXO | S_IRWXU); // open file int serialFd = open(“/dev/console”, O_RDWR | O_NONBLOCK | O_NDELAY | O_NOCTTY | O_APPEND); __android_log_print(ANDROID_LOG_DEBUG, “Serial”, “Serial console fd=%d errno=%d(%s)”, serialFd, अतिरिक्त Read More

Memory Thrashing compiled by Chirag Patel December 27, 2008

Memory Thrashing compiled by Chirag Patel December 27, 2008 (Ref: Embedded Systems Design June 2008) Memory threshing is a typical problem that goes unnotices while programming time-critical systems. Translation Look-aside Buffers (TLB) are used for data and instruction cache. There are two main cache-replacement schemes: 1) Least Frequently Used (LFU) and 2) Least Recently Used अतिरिक्त Read More

double precision comparison in c++ – chirag patel

Checking double precision value for limits is tricky. Say, double x = 1.0; if ( x == 1.0 ) do_something();   This comparison can fail as double precision value when converted to hexadecimal (what computer can do only) representation, looses some least significant bits or positions beyond double precision digits. So, in above example if अतिरिक्त Read More