This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #pragma once | |
| #include <string> | |
| using std::string; | |
| #include "http_protocol.h" | |
| class Foo { | |
| public: | |
| int RunHandler(request_rec *req) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| " Vim syntax file | |
| " Language: My Log Processor | |
| " Maintainer: Vishal Jain | |
| " Latest Revision: 24 September 2014 | |
| if exists("b:current_syntax") | |
| finish | |
| endif | |
| syn match String /="[^"]*"&/hs=s+1,he=e-1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ## usage awk -F',' -v FieldToIgnore=2 -f ignoreField.awk datafile | |
| ## This just gives the basic idea. More error detection can be done. | |
| { | |
| if (FieldToIgnore == "" || FieldToIgnore <= 0) { | |
| print "Incorrect/Missing field" | |
| print "usage: awk -F',' -v FieldToIgnore=<FieldumnToIgnore> -f ignoreField.awk datafile" | |
| exit | |
| } | |
| for (i = 1; i <= NF; i++) | |
| if (i == FieldToIgnore) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Signal Hanlder | |
| Handle_Exit_Safely() | |
| { | |
| rm -f $lockfile | |
| exit | |
| } | |
| # Main body | |
| if [ ! -e $lockfile ]; then | |
| # Arm the handler |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * This code displays the timing issue in mutex locking as exhibited by GCC 4.8. | |
| * Parent/main function locks a mutex then starts the thread. This thread tries | |
| * to lock the same mutex for a specified duration (5 second in this example). | |
| * Once lock succeed (because main is expected to unlock mutex in 2 seconds), | |
| * thread waits for another 5 seconds on a conditional variable. | |
| * | |
| * Using gcc 4.6 behaviour is following showing right timeline of events. | |
| * 1410448076263 M mutex locked | |
| * 1410448076264 T lock try |