This file contains 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
struct vacm_viewEntry * | |
netsnmp_view_create(struct vacm_viewEntry **head, const char *viewName, | |
oid * viewSubtree, size_t viewSubtreeLen) | |
{ | |
struct vacm_viewEntry *vp, *lp, *op = NULL; | |
int cmp, cmp2, glen; | |
glen = (int) strlen(viewName); | |
if (glen < 0 || glen >= VACM_MAX_STRING) | |
return NULL; |
This file contains 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
void | |
netsnmp_view_destroy(struct vacm_viewEntry **head, const char *viewName, | |
oid * viewSubtree, size_t viewSubtreeLen) | |
{ | |
struct vacm_viewEntry *vp, *lastvp = NULL; | |
if ((*head) && !strcmp((*head)->viewName + 1, viewName) | |
&& (*head)->viewSubtreeLen == viewSubtreeLen | |
&& !memcmp((char *) (*head)->viewSubtree, (char *) viewSubtree, | |
viewSubtreeLen * sizeof(oid))) { |
This file contains 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
cat $repFile | cut -d "|" -f2-5 | egrep "[0-9]\|$" | grep -v "None" | sort | gawk ' | |
function getAdjustedTime(startTime) | |
{ | |
split(startTime, splits, ":"); | |
return sprintf("%s:%02d", splits[1], (int(splits[2]/5) * 5)) | |
} | |
BEGIN{ | |
FS="|"; | |
printf("%20s | %6s | %6s | %3s | %3s\n", "TIME", "COUNT", "DUR", "AVG", "MAX") | |
printf("-------------------------------------------------------------\n") |
This file contains 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
#!/bin/bash | |
if [ $# -eq 0 ];then | |
dir=. | |
else | |
dir=$1 | |
fi | |
#Substitute scripts | |
cat > .edit.sed <<- EOF | |
s/\b_GLIBCXX_BEGIN_NAMESPACE\b\s*\(\s*(\w+)\s*\)/namespace \1{/g |
This file contains 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
data Sheep = SheepCreator String (Sheep, Sheep) | NONE | |
deriving Show | |
father:: Sheep -> Maybe Sheep | |
father (SheepCreator name (NONE, _)) = Nothing | |
father (SheepCreator name (f, _)) = Just f | |
mother:: Sheep -> Maybe Sheep | |
mother (SheepCreator name (_, NONE)) = Nothing | |
mother (SheepCreator name (_, m)) = Just m |
This file contains 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
import Control.Exception (bracket, handle, SomeException) | |
import System.IO (IOMode(..), hClose, hFileSize, openFile) | |
{-- snippet getFileSize --} | |
-- To work around the code that doesn't work in Haskell 6.10 | |
-- Control.Exception is changed to allow ploymophism such that | |
-- handle (\_ -> return Nothing) doesn't compile | |
hdl::SomeException -> IO (Maybe a) | |
hdl _ = return Nothing |
This file contains 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
#!/bin/bash | |
for folder in `ls -l | grep "^d" | awk '{print $NF}'`;do | |
echo "counting lines for folder $folder" >> cloc.txt; | |
cloc.pl $folder >> cloc.txt; | |
done | |
filterCloc.awk cloc.txt > cloc_summary.txt |
This file contains 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
santa: santa.hs | |
ghc $^ -package stm -o $@ | |
run: santa | |
./santa | |
clean: | |
rm santa.hi santa.o santa |
This file contains 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
cmake_minimum_required(VERSION 2.6) | |
if (use_llvm) | |
add_definitions(-std=c++11) | |
set(clang_version 3.1) | |
##llvm | |
set(CMAKE_CXX_COMPILER clang++) | |
#set(CMAKE_CXX_FLAGS "-std=c++11") | |
set(CMAKE_C_COMPILER clang) | |
set(CMAKE_AR llvm-ar-${clang_version}) |
OlderNewer