revert 9d28808 (due to inconsistency of calling `tput cols`)

--- include/Main.awk
+++ include/Main.awk
@@ -31,12 +31,7 @@
     Option["debug"] = 0

     Option["verbose"] = 1
-    if (ENVIRON["COLUMNS"])
-        Option["width"] = ENVIRON["COLUMNS"]
-    else {
-        "tput cols 2>/dev/null" |& getline Option["width"]
-        if (!Option["width"]) Option["width"] = 64
-    }
+    Option["width"] = ENVIRON["COLUMNS"] ? ENVIRON["COLUMNS"] : 64

     Option["browser"] = ENVIRON["BROWSER"]


remove tab

remove tab

Oops. Missed one tab whie removing tabs previously.

--- fetchAcorn-episodes.awk
+++ fetchAcorn-episodes.awk
@@ -30,7 +30,7 @@
     gsub (/  */," ")
     sub (/ *$/,"")
     # fix funky HTML characters
-	gsub (/'/,"'")
+    gsub (/'/,"'")
     print >> DESCRIPTION_FILE
 }


Change assignments.

Change assignments.

git-svn-id: 293778eaa97c8c94097d610b1bd5133a8f478f36@26794 4f837ed2-42f5-46e7-a7a5-fa17313484d4


Only process content from 2010 forward.

Only process content from 2010 forward.

--- scripts/tdb/statuses_gln.awk
+++ scripts/tdb/statuses_gln.awk
@@ -11,12 +11,12 @@
 #$3>date

 {
-  # add a loop to add line only if either [status is _not_ manifest] OR [journal_year (or journal end year) is gt or eq to 2005 && journal year (or journal end year) is lt or eq to the current year we are testing]
+  # add a loop to add line only if either [status is _not_ manifest] OR [journal_year (or journal end year) is gt or eq to 2010 && journal year (or journal end year) is lt or eq to the current year we are testing]
   current_year = 2016
   end_year = 0
   incontract = 0
   test_year = ""
-  test_year = 2005
+  test_year = 2010
   if (length($5) > 3) {
     end_year = substr($5,length($5)-3,4)
   }


INTEGRATION: CWS locdat30 (1.6.20); FILE MERGED 2008/06/15 11:51:30 erack 1.6.20.2: check if CurrencyID resembles ISO 4217 code and equals BankSymbol 2008/06/14 18:46:37 erack 1.6.20.1: continue lookup for compatible symbol

--- i18npool/source/localedata/data/currency-check.awk
+++ i18npool/source/localedata/data/currency-check.awk
@@ -23,9 +23,7 @@
     file = FILENAME
     line = 0
     nFormats = 0
-    nSymbols = 0
-    bSymbolDefault = 0
-    bSymbolCompati = 0
+    nCurrencies = 0
     bFormatAuto = 0
     sReplaceFrom = ""
     sReplaceTo = ""
@@ -136,30 +134,51 @@

 function getCurrencyParams() {
+    # Assumes that each element is on a line on its own!
     if ( $1 ~ /^<Currency(>|$)/ )
     {
         if ( $0 ~ /default="true"/ )
-            bSymbolDefault = 1
-        else
-            bSymbolDefault = 0
+            SymbolDefault[nCurrencies] = 1
+        else
+            SymbolDefault[nCurrencies] = 0
         if ( $0 ~ /usedInCompatibleFormatCodes="true"/ )
-            bSymbolCompati = 1
-        else
-            bSymbolCompati = 0
-    }
-    else if ( $0 ~ /^[[:blank:]]*<CurrencySymbol>/ )
+            SymbolCompati[nCurrencies] = 1
+        else
+            SymbolCompati[nCurrencies] = 0
+    }
+    else if ( $0 ~ /^[[:blank:]]*<CurrencyID>/ )
     {
         split( $0, arr, /<|>/ )
         if ( sRefCurrencyFromLocale )
-            SymbolLine[nSymbols] = file " line " line \
+            IDLine[nCurrencies] = file " line " line \
                 " (referenced from " sRefCurrencyFromLocale ")"
         else
-            SymbolLine[nSymbols] = file " line " line
-        SymbolDefault[nSymbols] = bSymbolDefault
-        SymbolCompati[nSymbols] = bSymbolCompati
-        Symbols[nSymbols++] = arr[3]
-        bSymbolDefault = 0
-        bSymbolCompati = 0
+            IDLine[nCurrencies] = file " line " line
+        IDs[nCurrencies] = arr[3]
+    }
+    else if ( $0 ~ /^[[:blank:]]*<CurrencySymbol>/ )
+    {
+        split( $0, arr, /<|>/ )
+        if ( sRefCurrencyFromLocale )
+            SymbolLine[nCurrencies] = file " line " line \
+                " (referenced from " sRefCurrencyFromLocale ")"
+        else
+            SymbolLine[nCurrencies] = file " line " line
+        Symbols[nCurrencies] = arr[3]
+    }
+    else if ( $0 ~ /^[[:blank:]]*<BankSymbol>/ )
+    {
+        split( $0, arr, /<|>/ )
+        if ( sRefCurrencyFromLocale )
+            BankSymbolLine[nCurrencies] = file " line " line \
+                " (referenced from " sRefCurrencyFromLocale ")"
+        else
+            BankSymbolLine[nCurrencies] = file " line " line
+        BankSymbols[nCurrencies] = arr[3]
+    }
+    else if ( $1 ~ /^<\/Currency>/ )
+    {
+        ++nCurrencies
     }
 }

@@ -187,7 +206,7 @@
     }
     if ( bad )
     {
-        for ( j=0; j<nSymbols; ++j )
+        for ( j=0; j<nCurrencies; ++j )
         {
             bDef = 0
             if ( Symbols[j] == "\xc2\xa4" )
@@ -210,7 +229,7 @@
     {
         bHasDefault = 0
         bHasCompati = 0
-        for ( j=0; j<nSymbols; ++j )
+        for ( j=0; j<nCurrencies; ++j )
         {
             if ( Symbols[j] == "\xc2\xa4" )
             {
@@ -249,23 +268,51 @@
             print "  no compati: (" file ")"
         }
     }
+    for ( j=0; j<nCurrencies; ++j )
+    {
+        # Check if CurrencyID at least resembles some ISO 4217 code.
+        # The only exception is zh_MO that had an erroneous original data set
+        # with BankSymbol="P" (stored as ISO code in documents, hence copied to
+        # CurrencyID now) and needs that entry for legacy documents.
+        # There is a strange bug in gawk 3.1.4 that does a match of [A-Z] on
+        # lower case except 'a', regardless of IGNORECASE setting, hence this
+        # ugly notation. [[:upper:]] wouldn't be correct since we want only
+        # ASCII to match.
+        if ( IDs[j] !~ /^[ABCDEFGHIJKLMNOPQRSTUVWXYZ][ABCDEFGHIJKLMNOPQRSTUVWXYZ][ABCDEFGHIJKLMNOPQRSTUVWXYZ]$/ \
+              && !(file == "zh_MO.xml" && IDs[j] == "P") )
+        {
+            bad = 1
+            print "no ISO 4217 code: `" IDs[j] "'   (" IDLine[j] ")"
+        }
+        # CurrencyID should equal BankSymbol for now.
+        if ( IDs[j] != BankSymbols[j] )
+        {
+            bad = 1
+            print "not equal: CurrencyID `" IDs[j] "' != BankSymbol `" BankSymbols[j] \
+                  "'   (" IDLine[j] " and " BankSymbolLine[j] ")"
+        }
+    }
     if ( bad )
         print ""
 }

 function FormatInSymbol( format ) {
-    for ( nSym=0; nSym<nSymbols; ++nSym )
+    state = 0
+    for ( nSym=0; nSym<nCurrencies; ++nSym )
     {
         if ( format == Symbols[nSym] )
         {
+            # Two currencies can have the same symbol (e.g. az_AZ.xml 'man.'
+            # for AZM and AZN), continue to lookup if the match isn't the
+            # compatible one.
             if ( SymbolCompati[nSym] )
                 return 2
             else
-                return 1
-        }
-    }
-    return 0
+                state = 1
+        }
+    }
+    return state
 }

 # vim: ts=4 sw=4 expandtab


minor edits

minor edits

--- scripts/ntriple2dot.awk
+++ scripts/ntriple2dot.awk
@@ -11,7 +11,7 @@
 #  This may over generalize in some cases because I do not have
 #  a handy way to differentiate uri for subjects and objects
 #  which may belong to a "structural" ontology as opposed to
-# a data uri.
+#  a data uri.

 #  Post processing to augment predicate identifiers
 #  with their labels seems to improve usefulness.
@@ -62,7 +62,7 @@
 # this passes valid node labels from dot's perspective
 function simplify(str){
 	gsub(/[^[:alpha:][:digit:]_]+/,"_",str)
-	gsub(/^_+|_+$/, "",str)
+	gsub(/^_*|_*$/, "",str)
 	gsub(/__*/,"_",str)
 	return str
 }
@@ -193,7 +193,7 @@

 # print anything else so it makes itself known
 (FNR != NR) && (done[NR]<1) && (NF>1){
-	printf("ERROR? in %s at line %i  %s",FILENAME,FNR,$0) > "/dev/stderr"
+	printf("ERROR? in %s at line %i:  %s\n",FILENAME,FNR,$0) > "/dev/stderr"
 }

 # output dot file, include edge counts


Use waas cache on Status page

Use waas cache on Status page


devtools: fix path in forbidden token check

Fix displayed filename by adjusting the extraction from the patch.

Before:
Warning in /lib/librte_eal/linux/eal.c:

After:
Warning in lib/librte_eal/linux/eal.c:

Fixes: 7413e7f2aeb3 ("devtools: alert on new calls to exit from libs")
Cc: stable@dpdk.org

Signed-off-by: David Marchand <f28529695cfa9e3e1eb84e7072aa626af4abb18e@redhat.com>

--- devtools/check-forbidden-tokens.awk
+++ devtools/check-forbidden-tokens.awk
@@ -62,7 +62,7 @@
 }
 END {
 	if (count > 0) {
-		print "Warning in " substr(last_file,6) ":"
+		print "Warning in " substr(last_file,7) ":"
 		print MESSAGE
 		exit RET_ON_FAIL
 	}


Reassign publishers.

Reassign publishers.

git-svn-id: 293778eaa97c8c94097d610b1bd5133a8f478f36@33750 4f837ed2-42f5-46e7-a7a5-fa17313484d4


Parser: get parseJson() right (hopefully)

--- include/Parser.awk
+++ include/Parser.awk
@@ -265,17 +265,18 @@
     for (i = 0; i < length(tokens); i++) {
         token = tokens[i]

-        if (belongsTo(token, arrayStartTokens))
+        if (belongsTo(token, arrayStartTokens)) {
             stack[++p] = 0
-        else if (belongsTo(token, objectStartTokens))
+        } else if (belongsTo(token, objectStartTokens)) {
             stack[++p] = NULLSTR
-        else if (belongsTo(token, objectEndTokens) ||
-                 belongsTo(token, arrayEndTokens))
+            flag = 0 # ready to read key
+        } else if (belongsTo(token, objectEndTokens) ||
+                   belongsTo(token, arrayEndTokens)) {
             --p
-        else if (belongsTo(token, commas)) {
+        } else if (belongsTo(token, commas)) {
             if (isnum(stack[p])) # array
                 stack[p]++ # increase index
-            else # anyway
+            else # object
                 flag = 0 # ready to read key
         } else if (belongsTo(token, colons)) {
             flag = 1 # ready to read value


Removed obsolete AWK script.

Removed obsolete AWK script.

--- code/awk/generate_source_list_from_make_output.awk
+++ code/awk/generate_source_list_from_make_output.awk
@@ -1,77 +0,0 @@
-#!/usr/bin/awk -f
-BEGIN{
-    # This program generates source list to be used in `CMakeLists.txt`
-    # or elsewhere using `foo.txt` produced by `make >foo.txt 2>&1` as input.
-
-    array_index = 0;
-    split("", dir_array);
-    current_dir = "";
-    new_filename = "";
-    current_filename = "";
-    entering_directory_regex = "Entering directory '";
-    cpp_regex = "\\<[a-zA-Z0-9_-]+\\.cpp\\>";
-    c_regex = "\\<[a-zA-Z0-9_-]+\\.c\\>";
-} # BEGIN
-
-function get_filename()
-{
-    # OK, there's a `.cpp` file on this line.
-    cpp_filename = substr($0, RSTART, RLENGTH);
-    new_filename = current_dir "/" cpp_filename;
-
-    if (new_filename != current_filename && new_filename != "")
-    {
-        current_filename = new_filename;
-
-        # find out if there's a matching source file.
-        if (system("test -f " current_filename) == 0)
-        {
-            # print the filename.
-            print current_filename;
-        }
-
-        # find out if there's a matching `*.h` header file too.
-        header_filename = gensub(/(^.*\.)c(|pp)$/, "\\1h", "g", current_filename);
-
-        if (system("test -f " header_filename) == 0)
-        {
-            # header exists, so print its filename too!
-            print header_filename;
-        }
-    }
-}
-{
-    entering_directory_match_index = match($0, entering_directory_regex);
-    cpp_match_index = match($0, cpp_regex);
-    c_match_index = match($0, c_regex);
-
-    if (entering_directory_match_index > 0)
-    {
-        # OK, we are entering a new directory on this line.
-        junk_part_length = entering_directory_match_index + length(entering_directory_regex);
-
-        # read current dir.
-        current_dir = substr($0, junk_part_length, length($0) - junk_part_length);
-
-        # store current dir into array.
-        dir_array[array_index++] = current_dir "/";
-    }
-    else if (cpp_match_index > 0)
-    {
-        match($0, cpp_regex); # update `RSTART` & `RLENGTH`.
-        get_filename();
-    }
-    else if (c_match_index > 0)
-    {
-        match($0, c_regex); # update `RSTART` & `RLENGTH`.
-        get_filename();
-    }
-}
-END{
-    asort(dir_array);
-
-    print "";
-    print "include_directories(";
-
-    for (i in dir_array) print dir_array[i];
-} # END


Filter out IPv4 string from the output.

Filter out IPv4 string from the output.


compact hints

compact hints

--- scripts/hinter.awk
+++ scripts/hinter.awk
@@ -2,6 +2,7 @@
   n_matches = 0;
   line_pos = 0;
   col_pos = 0;
+  COLLAPSE_HINTS = 1;

   HINTS[0] = "p"
   HINTS[1] = "o"
@@ -106,8 +107,16 @@

   finger_patterns = ENVIRON["FINGER_PATTERNS"];

-  hint_format = "\033[1;33m[%s]\033[0m"
-  highlight_format = "\033[1;33m%s\033[0m "
+  if (COLLAPSE_HINTS) {
+    hint_format = "\033[30;1;43m%s\033[0m"
+    highlight_format = "\033[1;33m%s\033[0m"
+  } else {
+    hint_format = "\033[1;33m[%s]\033[0m"
+    highlight_format = "\033[1;33m%s\033[0m"
+  }
+
+  compound_format = highlight_format hint_format
+
   hint_lookup = ""
 }

@@ -126,21 +135,27 @@
     pos += RSTART;

     col_pos = pos;
+
     line_match = substr(line, RSTART, RLENGTH);
+
+    if (COLLAPSE_HINTS) {
+      hint_len = length(hint)
+      line_match = substr(line_match, hint_len - 1, length(line_match) - hint_len);
+    }

     col_pos = col_pos + col_pos_correction

     line_pos = NR;

 		pre_match = substr(output_line, 0, col_pos - 1);
-    hint_match = sprintf(highlight_format hint_format, line_match, hint);
+    hint_match = sprintf(compound_format, line_match, hint);
 		post_match = substr(output_line, col_pos + RLENGTH, length(line) - 1);

     output_line = pre_match hint_match post_match;

     line = post_match;

-    col_pos_correction += (length(sprintf(highlight_format, line_match)) - 1 + length(sprintf(hint_format, hint)) - 1) + 1;
+    col_pos_correction += length(sprintf(highlight_format, line_match)) + length(sprintf(hint_format, hint)) - 1;

     hint_lookup = hint_lookup hint ":" line_match "\n"
   }


ahrf.awk: readers will cry if there is no comment

--- ahrf.awk
+++ ahrf.awk
@@ -13,9 +13,11 @@

 # h1, h2, h3, h4, h5, h6
 /^[\t ]*:/ {
+	# Count ':' and match the valid "level"
 	match($0,":+")
 	cnt = RLENGTH
 	gsub(/^[\t ]*:+[\t ]*|[\t ]*:+[\t ]*$/,"")
+	# Create the anchor
 	anc = tolower($0)
 	gsub(/ +/,"-",anc)
 	# length($0) would also work
@@ -66,6 +68,7 @@
 	for (l=1; l<=NF; l++) {
 		gsub(/^[\t ]*/,"",$l)
 		if ($l ~ /\* +/) {
+			# Only match the text
 			match($l,"\\* +")
 			str = substr($l,RSTART+RLENGTH)
 			printf("\t
%s
\n", str)
@@ -81,9 +84,11 @@
 	for (u=1; u<=NF; u++) {
 		gsub(/^[\t ]*/,"",$u)
 		if (match($u,"\\[[0-9]+\\]")) {
-			# RSTART can be replaced by 1, because we removed useless tabs/spaces
+			# RSTART can be replaced by 1, because we already removed
+			# useless tabs and/or spaces
 			num = substr($u,RSTART,RLENGTH)
 			url = substr($u,RSTART+RLENGTH+1)
+			# Do not print the entire link if chars > 61
 			if (length(url) >= 60) {
 				printf("\t
%s %.60s…
\n", num, url, url)
 			} else {


Changed the JAVA_MAXHEAP_ARGUMENT default to match the UNIX one.

--- src/condor_examples/convert_config_to_win32.awk
+++ src/condor_examples/convert_config_to_win32.awk
@@ -94,6 +94,12 @@
 	next
 }

+# Default to -Xmx1024m
+/^JAVA_MAXHEAP_ARGUMENT/ {
+	printf "%s= -Xmx1024m\n", $1
+	next
+}
+
 # Win32 has a path separator of ';', while on Unix it is ':'
 /^JAVA_CLASSPATH_SEPARATOR/ {
 	printf "%s= ;\n", $1


Use increment operator instead.

Use increment operator instead.

--- gfwlist2dnsmasq.awk
+++ gfwlist2dnsmasq.awk
@@ -1,10 +1,4 @@
 #!/usr/bin/awk -f
-
-# Add domain name to global variable domains.
-function add(domain) {
-	domain_count = domain_count + 1
-	domains[domain_count] = domain
-}

 # Extract domain name from non-regex line
 function extract(line, original_line) {
@@ -14,8 +8,8 @@
 	sub(/\*/, "", line)      # remove *
 	sub(/^\./, "", line)     # remove leading dot

-	if (match(line, /([a-zA-Z0-9\-]+\.)+[a-zA-Z0-9\-]+/)) {
-		add(line)
+	if (match(line, /([A-Za-z0-9\-]+\.)+[A-Za-z0-9\-]+/)) {
+		domains[++domain_count] = line
 	} else {
 		print "[WARN] <NR>" NR "</NR><original>" original_line "</original><extracted>" line "</extracted>" | "cat >&2"
 	}
@@ -25,13 +19,13 @@
 function extract_regex(line, original_line) {

 	# Expand the lines like (aa|bb|cc) into multiple records
-	pos = match(line, /\([a-zA-Z0-9\.\|]+\)/)
+	pos = match(line, /\([A-Za-z0-9\.\|]+\)/)
 	if (pos != 0) {
 		in_bracket = substr(line, RSTART + 1, RLENGTH - 2)
 		n = split(in_bracket, arr, "|")
 		for (i = 1; i <= n; i++) {
 			expanded_line = line
-			sub(/\([a-zA-Z0-9\.\|]+\)/, arr[i], expanded_line)
+			sub(/\([A-Za-z0-9\.\|]+\)/, arr[i], expanded_line)
 			extract_regex(expanded_line, original_line)
 		}
 	} else {


Translators/Apertium: fix

Translators/Apertium: fix

--- include/Translators/Apertium.awk
+++ include/Translators/Apertium.awk
@@ -63,7 +63,8 @@
         return
     }

-    translation = unparameterize(ast[0 SUBSEP "responseData" SUBSEP])
+    # FIXME: build a cache for recurring invocation of uprintf()
+    translation = uprintf(unparameterize(ast[0 SUBSEP "responseData" SUBSEP "translatedText"]))

     returnIl[0] = il = _sl
     if (Option["verbose"] < 0)


ahrf.awk: give me credit. It was written by me and nobody else

--- ahrf.awk
+++ ahrf.awk
@@ -1,4 +1,5 @@
 #!/usr/bin/awk -f
+# Script by Ypnose - http://ywstd.fr

 BEGIN { FS = "\n"; RS = "" }


Use FILENAME built-in variable.

Use FILENAME built-in variable.

--- CASED.awk
+++ CASED.awk
@@ -45,7 +45,6 @@
   tohex["e"] = 15;
   tohex["f"] = 16;

-  FILE = "UnicodeData.txt";
   FS = "[ \t]*[;#][ \t]*";
 }

@@ -77,7 +76,7 @@

 /^[^\#]/ {

-  if (FILE == "UnicodeData.txt") {
+  if (FILENAME == "UNIDATA/UnicodeData.txt") {
     if ($3 ~ /L[ltu]/)
       single($1, 1);
     else if ($3 ~ /Mn|Me|Cf|Lm|Sk/)
@@ -85,7 +84,7 @@
     next;
   }

-  else if (FILE == "PropList.txt") {
+  else if (FILENAME == "UNIDATA/PropList.txt") {
     if ($2 ~ /Other_(Upp|Low)ercase/) {
       if (index($1, "."))
 	range($1, 1);
@@ -106,14 +105,6 @@
   }
 }

-/^\# PropList-.+\.txt/ {
-  FILE = "PropList.txt";
-}
-
-/^\# WordBreakProperty-.+\.txt/ {
-  FILE = "WordBreakProperty.txt";
-}
-
 END {
   for (i in cased)
     printf ("0x%X %d\n", i, cased[i]);


Add snippets to snip, arrows and go stuff

--- bin/snip.awk
+++ bin/snip.awk
@@ -8,6 +8,8 @@
   FIXED["isod"] = strftime("%F")
   FIXED["ts"]   = strftime("%s")
   FIXED["cr"]   = "⏎"
+  FIXED["->"]   = "→"
+  FIXED["=>"]   = "⇨"

   # javascript
   FIXED["javascript:fn"]       = "function"
@@ -34,8 +36,10 @@
   FIXED["go:fn"]      = "func |() {\n}"
   FIXED["go:fori"]    = "for i := 0; i < |; i++ {}"
   FIXED["go:forr"]    = "for i, _ := range | {}"
-  FIXED["go:handler"] = "func(w http.ResponseWriter, r *http.Request)"
-  PREFIX["go:print"] = "fmt.Printf(\"%v\\n\", |)"
+  FIXED["go:handler"] = "func(res http.ResponseWriter, req *http.Request)"
+  PREFIX["go:print"]   = "fmt.Printf(\"%v\\n\", |)"
+  PREFIX["go:handler"] = "handler"
+  PREFIX["go:iferr"]   = "if err != nil {return}"
 }

 #-------------------------------------------------


Fix 0x0d end lines

Fix 0x0d end lines

--- caldaily.awk
+++ caldaily.awk
@@ -1,18 +1,19 @@
-BEGIN {
-    FS="\n"
+BEGIN {
+    FS="\n"
     OFS=""
     ORS="\n"
     print "#!/bin/sh"
-    print " "
+    print " "
 }
 # blank lines
 /^$/ { next }
 # record header
-$1 ~ /^\*\*\*\*/ {
+$1 ~ /^\*\*\*\*/ {
     next
 }
 # summary field
 $1 ~ /^[ ]*summary\:/ {
+    gsub(/\r/,"");
     idx = match($1, /summary\:(.*)/)
     print "SUMMARY=\"" substr($1, idx + 9) "\""
     next
@@ -25,18 +26,21 @@
 }
 # vcalendar start tag
 $1 ~ /^[ ]*calendardata\: / {
+    gsub(/\r/,"");
     match($1, /calendardata\: /)
     print "echo \"" substr($1, RSTART + RLENGTH) "\" >event.ics"
     next
 }
 # vcalendar end tag
 $1 ~ /^END\:VCALENDAR/ {
-    print "echo \"" $1 "\" >>event.ics"
+    gsub(/\r/,"");
+    print "echo \"" $1 "\" >>event.ics"
     print "mpack -s \"$SUMMARY - $STARTDATE\" event.ics $1"
-    print ""
+    print ""
     next
 }
 # vcalendar body
-{
+{
+    gsub(/\r/,"");
     print "echo \"" $0 "\" >> event.ics"
 }


Fix check-api-docs.awk in FreeBSD

Fix check-api-docs.awk in FreeBSD

Quote a forward slash in a regular expression so that FreeBSD's native
version of awk accepts the pattern.

--- admin/check-api-docs.awk
+++ admin/check-api-docs.awk
@@ -35,7 +35,7 @@
 /^$/ {next}

 # Skip lines that do not directly reference a file.
-/^[^/]/ {next}
+/^[^\/]/ {next}

 # Ignore known problems.  As far as I can tell, all the cases listed here are
 # well-documented in the code but Doxygen fails, for some reason or another, to


Bugfix for incorrectly specifying search completed in an optimization problem where we produced feasible solutions but did not prove optimality.

--- fzn/fzn2py.awk
+++ fzn/fzn2py.awk
@@ -289,16 +289,15 @@
 		}
 	}
 	print "    print '----------'";
-	print "if solver.is_unsat():"
+	if (objective){
+		print "    if solver.is_opt():"
+		print "        print '=========='"
+	} else {
+		print "    print '=========='"
+	}
+	print "elif solver.is_unsat():"
 	print "    print '=====UNSATISFIABLE====='"
-	if (objective){
-		print "elif solver.is_opt():"
-		print "    print '=========='"
-	} else {
-		print "elif solver.is_sat():"
-		print "    print '=========='"
-	}
-        print "else:"
+    print "else:"
 	print "    print '=====UNKNOWN====='"
 	print "print '% SolveTime', solver.getTime()";
 	print "print '% Nodes', solver.getNodes()";


neater whitespace

neater whitespace

--- bin/util/header2params2.awk
+++ bin/util/header2params2.awk
@@ -159,7 +159,7 @@
                                     printf("      conversion:enhance [      \n");
                                     printf("         ov:csvRow %s;\n",header);
                                     printf("         a conversion:HeaderRow;\n");
-                                    printf("      ];                        \n");
+                                    printf("      ];                        \n\n");
    }
    if(length(dataStart)) {
                                     printf("      conversion:enhance [          \n");


change compare and title heads

change compare and title heads

git-svn-id: 293778eaa97c8c94097d610b1bd5133a8f478f36@22105 4f837ed2-42f5-46e7-a7a5-fa17313484d4

--- scripts/tdb/statuses_clockss.awk
+++ scripts/tdb/statuses_clockss.awk
@@ -7,36 +7,35 @@
 }

 {
-# add a loop to add line only if ending year is gt or eq to contract year
-end = 0
-if ((length($4) == 9) {
-  end = substr($4,6,4)
-} else if ((length($4) == 4 {
-  end = substr($4,1,4)
-}
-if (end >= $3) {
-  incontract = 1
-} else {
+  # add a loop to add line only if ending year is gt or eq to contract year
+  end = 0
   incontract = 0
-}
+  if ((length($4) == 9) {
+    end = substr($4,6,4)
+  } else {
+    end = substr($4,1,4)
+  }
+  if (end >= $3) {
+    incontract = 1
+  }

-if (incontract == 1) {
-    nn = split($2,na,/\./)
-    lp2 = na[nn]
-  if (!(($1,lp2,$3,$4) in b)) {
-    p[pn] = $1
-    n[pn] = lp2
-#    n[pn] = $2
-    t[pn] = $3
-    d[pn] = $4
-    r[pn] = $5
-    pn++
+  if (incontract == 1) {
+      nn = split($2,na,/\./)
+      lp2 = na[nn]
+    if (!(($1,lp2,$3,$4) in b)) {
+      p[pn] = $1
+      n[pn] = lp2
+  #    n[pn] = $2
+      t[pn] = $3
+      d[pn] = $4
+      r[pn] = $5
+      pn++
+    }
+    b[$1,lp2,$3,$4]++
+    c[$1,lp2,$3,$4,$6]++
+    x[$6]++
+    tt++
   }
-  b[$1,lp2,$3,$4]++
-  c[$1,lp2,$3,$4,$6]++
-  x[$6]++
-  tt++
-}
 }

 END {


Translate: support basic authentication for HTTP proxies (fix #193)

--- include/Translate.awk
+++ include/Translate.awk
@@ -63,8 +63,10 @@
     _Init()

     if (Option["proxy"]) {
-        match(Option["proxy"], /^(http:\/*)?([^\/]*):([^\/:]*)/, HttpProxySpec)
-        HttpService = "/inet/tcp/0/" HttpProxySpec[2] "/" HttpProxySpec[3]
+        match(Option["proxy"], /^(http:\/*)?(([^:]+):([^@]+)@)?([^\/]*):([^\/:]*)/, HttpProxySpec)
+        HttpAuthUser = HttpProxySpec[3]
+        HttpAuthPass = HttpProxySpec[4]
+        HttpService = "/inet/tcp/0/" HttpProxySpec[5] "/" HttpProxySpec[6]
         HttpPathPrefix = HttpProtocol HttpHost
     } else {
         HttpService = "/inet/tcp/0/" HttpHost "/" HttpPort
@@ -96,6 +98,10 @@
         header = header "User-Agent: " Option["user-agent"] "\n"
     if (Cookie)
         header = header "Cookie: " Cookie "\n"
+    if (HttpAuthUser && HttpAuthPass)
+        # TODO: digest auth
+        header = header "Proxy-Authorization: Basic "   \
+            base64(HttpAuthUser ":" HttpAuthPass) "\n"

     content = NULLSTR; isBody = 0
     print header |& HttpService


Special process richard-sammel-inetrview

--- getMHzFrom-episodePages.awk
+++ getMHzFrom-episodePages.awk
@@ -93,7 +93,7 @@
     if (episodeURL ~ /-trailer-|-finale-/)
         episodeType = "T"
     # If episode is a BONUS:, set episodeType to "X"
-    if (episodeURL ~ /-c-x[[:digit:]]{3,4}$|montme-c-01001/)
+    if (episodeURL ~ /-c-x[[:digit:]]{3,4}$|montme-c-01001|richard-sammel-inetrview/)
         episodeType = "X"
     episodeTitle = fld[4]
     gsub (/"/,"\"\"",episodeTitle)


Fix episode mismatch in Jamaica Inn

Fix episode mismatch in Jamaica Inn

--- getAcornFrom-seriesPages.awk
+++ getAcornFrom-seriesPages.awk
@@ -278,6 +278,16 @@
             seasonNumber = URLseasonNumber
         }
     }
+    # Jamaica Inn has wrong episode numbers as of 180918 (may be temporary)
+    if (episodeURL ~ /jamaicainn\/episode-[1-9]/) {
+        split (episodeURL, episode, "-")
+        if (episodeNumber != episode[2]) {
+            printf ("==> Corrected mismatch: %s was episode %d\n", \
+               episodeURL, episodeNumber) >> ERROR_FILE
+            episodeNumber = episode[2]
+        }
+    }
+
     if ((episodeNumber + 0) == 0)
         print "==> Episode number is 00: " episodeURL >> ERROR_FILE
     printf ("%d\t=HYPERLINK(\"%s\";\"%s, %s%02d%s%02d, %s\"\)\t\t\t%s\n", \


List all unique IP addresses and number of times it was requested

error: pathspec 'HASH/ip-example.awk' did not match any file(s) known to git

--- HASH/ip-example.awk
+++ HASH/ip-example.awk
@@ -0,0 +1,5 @@
+awk '{Ip[$3]++;}
+END
+{ for (var in Ip)
+  print var, "access", Ip[var]," times"
+}


Create getBBoxFrom-sitemap.awk

Create getBBoxFrom-sitemap.awk

Continue experiment using sitemaps for BBox

error: pathspec 'getBBoxFrom-sitemap.awk' did not match any file(s) known to git

--- getBBoxFrom-sitemap.awk
+++ getBBoxFrom-sitemap.awk
@@ -0,0 +1,225 @@
+# Print the processed "Episode" lines from a WebScraper csv file saved in tsv format
+
+# INVOCATION:
+#       awk -v EPISODE_INFO_FILE=$EPISODE_INFO_FILE -v ERROR_FILE=$ERROR_FILE \
+#           -f getBBoxEpisodesFrom-webscraper.awk $EPISODES_SORTED_FILE >$EPISODES_SPREADSHEET_FILE
+
+# Field numbers
+#    1 web-scraper-start-url  2 SsnURL     3 SsnURL-href    4 URL        5 Program_Title
+#    6 Episode_Title          7 Year       8 Duration       9 Rating    10 Description
+
+
+BEGIN {
+    FS="\t"
+    OFS="\t"
+    print "Sortkey\tTitle\tSeasons\tEpisodes\tDuration\tYear(s)\tRating\tDescription"
+    # For debugging variations in seasons and episodes format
+    str = "date +%y%m%d.%H%M%S"
+    str | getline longdate
+    close str
+    for ( i = 1; i <= 4; i++ ) {
+        outfile = "BBox-scrapes/c" i "-" longdate ".csv"
+        print "Type\t#\tSortkey\tURL\tshowTitle\tepisodeTitle\tYear(s)" > outfile
+    }
+}
+
+{
+    for ( i = 1; i <= NF; i++ ) {
+        if ($i == "null")
+            $i = ""
+    }
+}
+
+/\/us\/movie\/|\/us\/episode\// {
+    baseURL = $1
+    URL = $4
+    showTitle = $5
+    episodeTitle = $6
+    Years = $7
+    Duration = $8
+    Rating = $9
+    Description = $10
+    showtype = "S"
+
+    shortURL = URL
+    sub (/^\/us\/episode\//,"",shortURL)
+    episodeSeason = ""
+    episodeNumber = ""
+    # Season 3, Episode 8
+    if (match (episodeTitle, /^Season [[:digit:]]+|^Series [[:digit:]]+/))
+        episodeSeason = substr(episodeTitle,8,RLENGTH-7)
+
+    # Extract sortkey from URL
+    nflds = split (URL,fld,"_")
+    if (URL ~ /_S[[:digit:]]*_E[[:digit:]]*_[[:digit:]]*$/) {
+        # /us/episode/35_Days_S3_E8_23851
+        seasonNumber = substr(fld[nflds-2], 2)
+        episodeNumber = substr(fld[nflds-1], 2)
+        if (baseURL ~ /The_Edinburgh_Show_23924$/) {
+            episodeSeason = Years
+        }
+        # Give precedence to season number in episodeTitle over season number in URL
+        if (episodeSeason != "" && seasonNumber+0 != episodeSeason+0) {
+            revisedSeasons1 += 1
+            printf ("==> Fixed c1 season: %02d-%02d\t%s\t%s\t%s\n", \
+                    seasonNumber, episodeSeason, showTitle, shortURL, episodeTitle) >> ERROR_FILE
+            seasonNumber = episodeSeason
+        }
+        sortkey = sprintf ("%s%02dE%03d", showtype, seasonNumber, episodeNumber)
+        c1Num += 1
+        outfile = "BBox-scrapes/c1-" longdate ".csv"
+        printf ("c1\t%d\t%s\t%s\t%s\t%s\t%s\n",c1Num,sortkey,showTitle,shortURL,episodeTitle,Years) >> outfile
+    } else if (URL ~ /_E[[:digit:]]*_[[:digit:]]*$/) {
+        # /us/episode/35_Hours_E1_26129
+        revisedSeasons2 += 1
+        episodeSeason = Years
+        if (episodeSeason != "" && seasonNumber+0 != episodeSeason+0) {
+            printf ("==> Fixed c2 season: %02d-%02d\t%s\t%s\t%s\n", \
+                    seasonNumber, episodeSeason, showTitle, shortURL, episodeTitle) >> ERROR_FILE
+            seasonNumber = episodeSeason
+        }
+        episodeNumber = substr(fld[nflds-1], 2)
+        sortkey = sprintf ("%s%02dE%03d", showtype, seasonNumber, episodeNumber)
+        c2Num += 1
+        outfile = "BBox-scrapes/c2-" longdate ".csv"
+        printf ("c2\t%d\t%s\t%s\t%s\t%s\t%s\n",c2Num,sortkey,showTitle,shortURL,episodeTitle,Years) >> outfile
+    } else if (URL ~ /Episode_[[:digit:]]*_[[:digit:]]*$/) {
+        # /us/episode/Episode_5_26089
+        revisedSeasons3 += 1
+        seasonNumber = Years
+        if (episodeSeason != "" && seasonNumber+0 != episodeSeason+0) {
+            printf ("==> Fixed c3 season: %02d-%02d\t%s\t%s\t%s\n", \
+                    seasonNumber, episodeSeason, showTitle, shortURL, episodeTitle) >> ERROR_FILE
+            seasonNumber = episodeSeason
+        }
+        episodeNumber = substr(fld[nflds-1], 1)
+        sortkey = sprintf ("%s%02dE%03d", showtype, seasonNumber, episodeNumber)
+        c3Num += 1
+        outfile = "BBox-scrapes/c3-" longdate ".csv"
+        printf ("c3\t%d\t%s\t%s\t%s\t%s\t%s\n",c3Num,sortkey,showTitle,shortURL,episodeTitle,Years) >> outfile
+    } else {
+        revisedSeasons4 += 1
+        URL ~ /^\/us\/movie\// ? showtype = "M" : showtype = "E"
+        # /us/episode/Orkneys_Stone_Age_Temple_7144
+        # A History of Ancient Britain Special, Orkney's Stone Age Temple
+        sortkey = sprintf ("%s%05d", showtype, fld[nflds])
+        if (episodeSeason != "") {
+            showtype = "S"
+            sortkey = sprintf ("%s%02dE%05d", showtype, episodeSeason, 99999 - fld[nflds])
+            printf ("==> Fixed c4 season: null-%02d\t%s\t%s\t%s\n", \
+                    episodeSeason, showTitle, shortURL, episodeTitle) >> ERROR_FILE
+        }
+        c4Num += 1
+        outfile = "BBox-scrapes/c4-" longdate ".csv"
+        printf ("c4\t%d\t%s\t%s\t%s\t%s\t%s\n",c4Num,sortkey,showTitle,shortURL,episodeTitle,Years) >> outfile
+    }
+
+    # Convert duration from minutes to HMS
+    sub( / min/,"",Duration)
+    secs = 0
+    mins = Duration % 60
+    hrs = int(Duration / 60)
+    HMS = sprintf ("%02d:%02d:%02d", hrs, mins, secs)
+    if (HMS == "00:00:00")
+        HMS = ""
+
+    # Special processing for some shows is needed in all getBBox*From-webscraper.awk scripts.
+    # "Changed" message and counting revisedTitles are only in getBBoxProgramsFrom-webscraper.awk
+    # so they are not repeated for each episode and each season.
+    if (baseURL ~ /Maigret_15974$/) {
+        showTitle = "Maigret (2016)"
+    }
+    if (baseURL ~ /Maigret_\(1992\)_15928$/) {
+        showTitle = "Maigret (1992)"
+    }
+    if (baseURL ~ /Porridge_9509$/) {
+        showTitle = "Porridge (1974-1977)"
+    }
+    if (baseURL ~ /Porridge_14747$/) {
+        showTitle = "Porridge (2016-2017)"
+    }
+
+    # Get rid of redundant "Series #" or "Series #" from episodeTitle
+    if (match (episodeTitle, /^Season [[:digit:]]*, |^Series [[:digit:]]*, /))
+        episodeTitle = substr(episodeTitle,RLENGTH+1)
+
+    # Get rid of initial/trailing quotes in showTitle
+    # "BBC Three's ""Murdered By..."" Collection Trailer"
+    if (showTitle ~ /^".*"$/) {
+        revisedTitles += 1
+        printf ("==> Fixed quoted title: www.britbox.com%s\n", URL) >> ERROR_FILE
+        # printf ("    %s\n", showTitle) >> ERROR_FILE
+        sub (/^"/,"",showTitle)
+        sub (/"$/,"",showTitle)
+        # printf ("    %s\n", showTitle) >> ERROR_FILE
+    }
+
+    # Non-existent fields in movies or episodes
+    if (URL ~ /^\/us\/movie\//) {
+        depth = "1"
+        numSeasons = 1
+        numEpisodes = 1
+        fullTitle = showTitle
+    } else {
+        depth = "2"
+        numSeasons = ""
+        numEpisodes = ""
+        fullTitle = showTitle ", " sortkey ", " episodeTitle
+    }
+
+    # Fix two consecutive double quotes in showTitle, but leave in fullTitle
+    gsub ("\"\"","\"",showTitle)
+
+    # Fix HEX quotes in Description
+    gsub ("\xc2\x91","\"",Description)
+    gsub ("\xc2\x92","\"",Description)
+
+    # Create spreadsheet row in common format
+    savedLine = sprintf \
+        ("%s (%s) %s %s\t=HYPERLINK(\"https://www.britbox.com%s\";\"%s\"\)\t%s\t%s\t%s\t%s\t%s\t%s",\
+         showTitle, depth, Years, sortkey, URL, fullTitle, numSeasons, numEpisodes, \
+         HMS, Years, Rating, Description)
+
+    # Make sure line doesn't start with a single quote so it sorts correctly in Open Office
+    sub (/^'/,"",savedLine)
+
+    print savedLine
+    next
+}
+
+/\/us\/show\// {
+    # Shouldn't get here
+    badEpisodes += 1
+    URL = $4
+    nflds = split (URL,URLflds,"/")
+    printf ("==> Upstream error in %s\n", FILENAME)  >> ERROR_FILE
+    print "==> Found /us/show/ in episodes: " URLflds[nflds]  >> ERROR_FILE
+}
+
+END {
+    printf ("In getBBoxEpisodesFrom-webscraper.awk\n") > "/dev/stderr"
+    if (revisedTitles > 0 ) {
+        revisedTitles == 1 ? field = "title" : field = "titles"
+        printf ("    %2d %s revised in %s\n", revisedTitles, field, FILENAME) > "/dev/stderr"
+    }
+    if (revisedSeasons1 > 0 ) {
+        revisedSeasons1 == 1 ? field = "season" : field = "seasons"
+        printf ("    %3d c1 %s revised in %s\n", revisedSeasons1, field, FILENAME) > "/dev/stderr"
+    }
+    if (revisedSeasons2 > 0 ) {
+        revisedSeasons2 == 1 ? field = "season" : field = "seasons"
+        printf ("    %3d c2 %s revised in %s\n", revisedSeasons2, field, FILENAME) > "/dev/stderr"
+    }
+    if (revisedSeasons3 > 0 ) {
+        revisedSeasons3 == 1 ? field = "season" : field = "seasons"
+        printf ("    %3d c3 %s revised in %s\n", revisedSeasons3, field, FILENAME) > "/dev/stderr"
+    }
+    if (revisedSeasons4 > 0 ) {
+        revisedSeasons4 == 1 ? field = "season" : field = "seasons"
+        printf ("    %3d c4 %s revised in %s\n", revisedSeasons4, field, FILENAME) > "/dev/stderr"
+    }
+    if (badEpisodes > 0 ) {
+        badEpisodes == 1 ? field = "URL" : field = "URLs"
+        printf ("    %2d extra /show/ %s in %s\n", badEpisodes, field, FILENAME) > "/dev/stderr"
+    }
+}


fix instruction matching errors in i386 CFI generation

fdiv and fmul instructions were wrongly matched by the rules for
integer div and mul instructions, leading to incorrect conclusions
about register values being clobbered.

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/chardi/musl.git/'


add script bin/includebloat

add script bin/includebloat

Change-Id: I086052c9a4dd2a216e0af153c43e98eec85a4600

error: pathspec 'bin/includebloat.awk' did not match any file(s) known to git

--- bin/includebloat.awk
+++ bin/includebloat.awk
@@ -0,0 +1,34 @@
+#!/usr/bin/gawk -f
+
+BEGIN {
+    cmd = "find workdir/Dep/CxxObject/ -name *.d | xargs cat"
+    while ((cmd | getline) > 0) {
+        if ($0 ~ /^ .*\\$/) {
+            gsub(/^ /, "");
+            gsub(/ *\\$/, "");
+            includes[$1]++
+            if ($2) {
+                # GCC emits 2 per line if short enough!
+                includes[$2]++
+            }
+        }
+    }
+    exit
+}
+
+END {
+    for (inc in includes) {
+        cmd = "wc -c " inc
+        if ((cmd | getline) < 0)
+            print "ERROR on: " cmd
+        sizes[inc] = $1 # $0 is wc -c output, $1 is size
+        totals[inc] = $1 * includes[inc]
+        totalsize += totals[inc]
+        close(cmd)
+    }
+    PROCINFO["sorted_in"] = "@val_num_desc"
+    print "sum total bytes included: " totalsize
+    for (inc in totals) {
+        print totals[inc], sizes[inc], includes[inc], inc
+    }
+}


Fix build for wp8

Fix build for wp8

error: pathspec 'build/wp8/libilbc-rfc3951/extract-cfile.awk' did not match any file(s) known to git

--- build/wp8/libilbc-rfc3951/extract-cfile.awk
+++ build/wp8/libilbc-rfc3951/extract-cfile.awk
@@ -0,0 +1,25 @@
+BEGIN { srcname = "nothing"; }
+{ if (/^A\.[0-9][0-9]*\.* *[a-zA-Z][a-zA-Z_0-9]*\.[ch]/) {
+    if (srcname != "nothing")
+      close(srcname);
+    srcname = $2;
+    printf("creating source file %s\n", srcname);
+  }else if (srcname != "nothing") {
+    if (/Andersen,* *et* *al\./)
+      printf("skipping %s\n", $0);
+    else if (/+/)
+      printf("skipping2 %s\n", $0);
+    else if (/Internet Low Bit Rate Codec *December 2004/)
+      printf("skipping3 %s\n", $0);
+    else if (/Authors' *Addresses/){
+      close(srcname);
+      exit;}
+    else
+      print $0 >> srcname;
+  }
+}
+END {
+  printf("ending file %s\n", srcname);
+  close(srcname);
+}


Add TMS1mmProbeTestBadDAC.awk for analyzing probe test data to identify failed DACs and print for a wiki table entry.

error: pathspec 'Software/Analysis/src/TMS1mmProbeTestBadDAC.awk' did not match any file(s) known to git

--- Software/Analysis/src/TMS1mmProbeTestBadDAC.awk
+++ Software/Analysis/src/TMS1mmProbeTestBadDAC.awk
@@ -0,0 +1,43 @@
+#!/usr/bin/awk -f
+#
+# Check if a tested chip is bad due to failed DACs and print for a wiki table entry.
+#
+
+BEGIN {
+    # at which DAC code to check for voltage
+    dacCode2Check = 0
+    # voltage threshold to declare as bad channel
+    badVth = 0.2
+    veryBadVth = 1.5
+    # having >= these number of bad channels will be declared as bad chip
+    nBadChTh = 3
+    # column id of begin and end channel data in data file
+    chColBegin = 3
+    chColEnd = 8
+#    print("==== Characteristics of Topmetal-S chips of wafer ====")
+}
+
+/^#/ {
+    printf("| %2d | %2d |", $3, $4)
+}
+
+{
+    if($1 == dacCode2Check) {
+        nBad = 0
+        nVeryBad = 0
+        for(i=chColBegin; i<=chColEnd; i++) {
+            if($i > veryBadVth) { nVeryBad++ }
+            if($i > badVth || $i == 0.0) {
+                printf(" **%g** |", $i)
+                nBad++
+            } else {
+                printf(" %g |", $i)
+            }
+        }
+        if(nBad >= nBadChTh || nVeryBad > 0) {
+            printf(" %d/%d | **Y** |  |  |\n", nBad, nVeryBad)
+        } else {
+            printf(" %d/%d | N |  |  |\n", nBad, nVeryBad)
+        }
+    }
+}


if (str_len(y[x]) != 3)

if (str_len(y[x]) != 3)

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/svnpenn/sage.git/'


initial add

initial add

error: pathspec 'scripts/ntriple2dot.awk' did not match any file(s) known to git

--- scripts/ntriple2dot.awk
+++ scripts/ntriple2dot.awk
@@ -0,0 +1,69 @@
+#! /usr/bin/awk -f
+
+# remove first and last chars
+function trim(str){
+	return substr(str,2,length(str)-2)
+}
+
+# remove final element in slashed path
+function stripid(uri){
+	l = match(uri,/.*\//)  # side effect is RLENGTH
+	if(l<=0)
+		return uri
+	else
+		return substr(uri,1,RLENGTH -1)
+}
+
+function contract(uri){
+	if(uri in prefix)
+		return prefix[uri]
+	else {
+		gsub(/[:./-]+/,"_",uri)
+		return uri
+	}
+}
+
+# parse and stash the curie file (first file)
+(FNR == NR) && /^'[^']*' *: 'http[^']*'.*/ {
+	split($0,a,"'")
+	prefix[stripid(a[4])]=a[2]
+}
+
+# process the ntriple file(s)  which are not the first file
+### all are uri
+(FNR != NR) && /^<[^>]*> <[^>]*> <[^>]*> \.$/ {
+	### Subject (uri)
+	s = contract(stripid(trim($1)))
+	### Predicate (uri)
+	split(trim($2),b,"/")
+	p = b[length(b)]
+	### Object (like subject)
+	o = contract(stripid(trim($3)))
+	edgelist[s " -> " o " [label=\"" p "\"];"]++
+}
+### object is a literal
+(FNR != NR) && /^<[^>]*> <[^>]*> "[^"]*" \.$/ {
+	### Subject (uri)
+	s = contract(stripid(trim($1)))
+	### Predicate (uri)
+	split(trim($2),b,"/")
+	p = b[length(b)]
+	### not a uri
+	o = "LITERAL"
+	edgelist[s " -> " o " [label=\"" p "\"];"]++
+	nodelist[o " [shape=record];"]++
+}
+
+END{
+	print "digraph {"
+	print "rankdir=LR;"
+	print "charset=\"utf-8\";"
+	for(edge in edgelist){
+		print edge
+	}
+	for(node in nodelist){
+		print node
+	}
+	print "}"
+}
+


while (ec = getline < "setup.ini") {

while (ec = getline < "setup.ini") {


add binding...

add binding...

error: pathspec 'tool.imbh/calc_bindingenergy.awk' did not match any file(s) known to git


Added awk script which swaps columns

Added awk script which swaps columns

error: pathspec 'awk/examples/swap2cols.awk' did not match any file(s) known to git

--- awk/examples/swap2cols.awk
+++ awk/examples/swap2cols.awk
@@ -0,0 +1,2 @@
+#!/bin/awk
+{ t = $1; $1 = $2; $2 = t; print; }


2008-03-14  Martin Sebor  <sebor@roguewave.com>

	* bin/xcomp.awk (get_gzlogfname): New function to removed directory
	prefix from log file and replace the temporary PID suffix with the
	original .gz extension.
	(print_logtable, print_timingstable): Called get_gzlogfname().

git-svn-id: 8ce9432b95a2a271c6c279131eb1bb968a8ee7fb@637301 13f79535-47bb-0310-9956-ffa450edef68

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/pathscale/stdcxx.git/'


Although Cray's may want to have their #:s double quoted other machines don't.

git-svn-id: 193148810cf65385f3a195dbc9a8b504846da3a2@6933 ec53bebd-3082-4978-b11e-865c3cabbd6b

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/madscientist159/heimdal.git/'


added salt-bridge script

added salt-bridge script

error: pathspec 'salt-bridge.awk' did not match any file(s) known to git

--- salt-bridge.awk
+++ salt-bridge.awk
@@ -0,0 +1,44 @@
+#!/usr/bin/awk -f
+
+function charged(res){
+    if (res=="ARG" || res=="LYS") return 1;
+    if (res=="ASP" || res=="GLU") return -1;
+    return 0;
+}
+function okatom(aa,res) {
+    if (res=="ARG" && aa=="CZ") return 1;
+    if (res=="LYS" && aa=="NZ") return 1;
+    if (res=="ASP" && aa=="CG") return 1;
+    if (res=="GLU" && aa=="CD") return 1;
+    return 0;
+}
+BEGIN {
+    VERBOSE=1
+
+    if (ARGC==1) {
+        print "usage: salt-bridge.awk [VERBOSE=0/1]  nco.dat";
+        print
+        print "SB definition: contact between"
+        print " CZ_ARG(+) -- CG_ASP(-)"
+        print " CZ_ARG(+) -- CD_GLU(-)"
+        print " NZ_LYS(+) -- CG_ASP(-)"
+        print " NZ_LYS(+) -- CD_GLU(-)"
+        print
+        print "Prints the salt bridges found in the contact list file nco.dat"
+        print "Expecting the column format:"
+        print
+        print "ID        AT1  ATM RES RESID  AT2 ATM RES RESID  dist"
+        print "8771      4449 OC2 GLN 274    1765 OE1 GLN 110   4.654825"
+        print
+        print "if variable VERBOSE=0 ony prints [AT1 AT2 dist] of the salt bridge otherwise more info"
+
+        exit 0;
+    }
+}
+{
+    if (VERBOSE==1) {
+        if (index($1,"#")!=1 && charged($4)*charged($8)==-1 && okatom($3,$4) && okatom($7,$8)) print $2,$3,$4,$5,$6,$7,$8,$9
+    } else {
+        if (index($1,"#")!=1 && charged($4)*charged($8)==-1 && okatom($3,$4) && okatom($7,$8)) print $2,$6,$10
+    }
+}


initial commit of splitOnRecords.awk

initial commit of splitOnRecords.awk

error: pathspec 'splitOnRecords.awk' did not match any file(s) known to git

--- splitOnRecords.awk
+++ splitOnRecords.awk
@@ -0,0 +1,81 @@
+BEGIN {
+	active=0;
+	print "BatchId, jobtype, starttime, jobid, endtime, totalmaptime, totalreducetime, maptasks";
+}
+
+# Output:
+# BatchId, job type, start time, end time, duration, jobId, #map input records, map time, reduce time
+
+#2014-08-12 07:50:07.901 INFO  d.s.m.autonomous.AutonomousComponent - Found batch B400026955287-RT2
+/Found/ {
+	if (!active) {
+		print "RECORD START" | "cat 1>&2"
+		split($0, s, "batch ");
+		printf "%s", s[2];
+		printf ", %s", jobtype
+		active=1
+	} else {
+		print "ERROR - out of sequence!" $0 | "cat 1>&2"
+		exit
+	}
+}
+
+# 2014-08-11 10:30:14.415 INFO  org.apache.hadoop.mapreduce.Job - Running job: job_1407155868271_0080
+/Running job:/ {
+	if (active==1) {
+		#printf "\tSTART: %s\n", $0
+		split($0,s," INFO ");
+		printf ", %s", s[1];
+		split($0,s,"Running job: ")
+		printf ", %s", s[2];
+	}
+}
+
+# This is the last log message in a record
+#		Map input records=11680
+/Map input records/ {
+	if (active==1) {
+		#printf "\t%s, \n", $0
+		split($0, s, "=");
+		printf ", %s\n", s[2];
+		print "RECORD END" | "cat 1>&2"
+		active = 0
+	}
+}
+
+#		Total time spent by all maps in occupied slots (ms)=5512646
+/Total time spent by all maps in occupied slots/ {
+	if (active==1) {
+		#printf "\t%s, \n", $0
+		split($0, s, "=");
+		printf ", %s", s[2];
+	}
+}
+
+#		Total time spent by all reduces in occupied slots (ms)=81308394
+/Total time spent by all reduces in occupied slots/ {
+	if (active==1) {
+		#printf "\t%s, \n", $0
+		split($0, s, "=");
+		printf ", %s", s[2];
+	}
+}
+
+
+/failed with state FAILED due/ {
+	if (active==1) {
+		#print "\tFAILED: " $0
+		printf ", FAILED\n";
+		active = 0
+		print "RECORD END" | "cat 1>&s"
+	}
+}
+
+#2014-08-12 04:38:00.649 INFO  org.apache.hadoop.mapreduce.Job - Job job_1407155868271_0084 completed successfully
+/completed successfully/ {
+	if (active==1) {
+		#print "\tSTOP: " $0
+		split($0, s, " INFO ");
+		printf ", %s", s[1];
+	}
+}


transpose.awk

transpose.awk

error: pathspec 'transpose.awk' did not match any file(s) known to git


if (str_length(pa[ch]) != 3)

if (str_length(pa[ch]) != 3)


rx_split("/", url, br)

rx_split("/", url, br)


rough filter: keeping only PASS records

rough filter: keeping only PASS records

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/marcelm/CAW.git/'


add wordfreq

add wordfreq

error: pathspec 'wordfreq.awk' did not match any file(s) known to git

--- wordfreq.awk
+++ wordfreq.awk
@@ -0,0 +1,11 @@
+#!/usr/bin/awk -f
+{
+    for (i = 1; i <= NF; i++) {
+        word[$i]++;
+    }
+}
+END {
+    for (i in word) {
+        print word[i], i;
+    }
+}


update

update

--- sedbot.awk
+++ sedbot.awk
@@ -1,10 +1,4 @@
 #!/usr/bin/gawk -f
-# https://github.com/FoobarBazbot/sedbot
-# https://github.com/FoobarBazbot/sedbot/blob/master/LICENSE
-# by FoobarBazbot
-# modified by crutchy
-# https://github.com/crutchy-/test/blob/master/sedbot.awk
-# 21-july-2014
 function lineout(old,new,nouser) {
   if(old!=new) print (nouser?"":"<" tauntuser(user) "> ") new >outfile; close(outfile);
   if(taunt[tolower(user)]>0) taunt[tolower(user)]--;
@@ -14,7 +8,6 @@
   return u;
 }
 BEGIN {
-  #outfile=( ENVIRON["HOME"] "/sedbotirc/irc.sylnt.us/#soylent/in");
   line_re="^[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2} <([^>]*)> (.*)$";
   blag_re="world wide web|internet|interweb|intersphere|intertubes|interblag|blogosphere|blagonet|blagosphere|blagoblag|webnet|webweb";
   blag_n=split(blag_re,blag_word,/\|/);


Added a copy of the original script that will later become a method of extracting subnets and pools

error: pathspec 'dhcpparse.awk' did not match any file(s) known to git

--- dhcpparse.awk
+++ dhcpparse.awk
@@ -0,0 +1,127 @@
+#!/usr/bin/awk -f
+#
+# Author: Matt Pascoe - matt@opennetadmin.com
+#
+# This awk script is used to extract relavant information from a dhcpd.conf
+# config file and build a csv with appropriate fields for passing into
+# a dcm.pl module.  This can be used to bootstrap a new database from existing
+# site data.  As usual, inspect the output for accuracy.
+
+# Note that for hosts, it will try a reverse lookup on the IP address
+# to determine an appropriate dns name
+#
+# USAGE:
+# make this script executable with `chmod +x dhcpparse.awk` and then
+#
+#   cat dhcpd.conf|./dhcpparse.awk
+
+# set the RECORD SEPARATOR, RS, to "}" ... records span multiple lines
+BEGIN {RS="}"}
+
+# TODO: figure out how to skip comment lines without having to use sed first
+
+length($0) > 5 { total++
+
+  for(i=1;i<=NF;i++) {
+
+    counter[total] = total
+
+    # if this field matches the word "host"
+    if($i ~ /^host$/) {
+      type[total] = "host"
+      hostname[total]=$(i+1)
+      # Remove the trailing { that might be there
+      gsub(/{/, "", hostname[total])
+    }
+
+    # if this field matches the word "hardware"
+    else if($i ~ /^hardware$/) {
+
+      # get rid of the trailing semi-colon
+      split($(i+2),arr,";")
+
+      mac[total]=arr[1]
+    }
+
+    # if this field matches the word "fixed-address"
+    else if($i ~ /^fixed-address$/) {
+
+      # get rid of the trailing semi-colon
+      split($(i+1),arr,";")
+
+      ip[total]=arr[1]
+    }
+
+    # if this field matches the word "subnet"
+    else if($i ~ /^subnet$/) {
+
+      type[total] = "subnet"
+      # get rid of the enclosing quotes
+      split($(i+1),arr,"\"")
+
+      subnetip[total]=arr[1]
+    }
+
+    # if this field matches the word "netmask"
+    else if($i ~ /^netmask$/) {
+
+      subnetmask[total]=$(i+1)
+    }
+
+    # if this field matches the word "range"
+    else if($i ~ /^range$/) {
+      total++
+      type[total] = "pool"
+      poolstart[total]=$(i+1)
+      # get rid of the trailing semi-colon
+      split($(i+2),arr,";")
+      poolend[total]=arr[1]
+    }
+
+    # if this field matches the word "failover"
+    if($i ~ /^#failover$/) {
+      # get rid of the enclosing quotes
+      split($(i+2),arr,"\"")
+
+      failover[total]=arr[2]
+    }
+  }
+
+
+
+  # do a host command reverse lookup on the IP to try and find a dns name
+  if( length(ip[total]) > 0 ) {
+    command = ("host " ip[total])
+    command | getline tmpname
+    close(command)
+    split(tmpname,n,"pointer")
+
+    # trim off leading spaces etc
+    gsub(/^[ \t]+/, "", n[2])
+
+    name[total] = substr(n[2],0,length(n[2])-1)
+  }
+
+  if( length(name[total]) == 0 ) {
+    name[total]="dhcpload-" ip[total]
+  }
+
+
+}
+
+# for every entry we captured, display its appropriate info
+END { for(entry in counter) {
+         if(type[entry] == "subnet") {
+             printf("%s,%s,%s,DHCPLOAD-%s\n",\
+                 type[entry],subnetip[entry],subnetmask[entry],subnetip[entry])
+         }
+         if(type[entry] == "pool") {
+             printf("%s,%s,%s,%s\n",\
+                 type[entry],poolstart[entry],poolend[entry],failover[entry])
+         }
+         if(type[entry] == "host") {
+             printf("%s,%s,%s,%s,%s\n",\
+                 type[entry],ip[entry],mac[entry],name[entry],hostname[entry])
+         }
+    }
+}


Added more files for NDB Cluster

Added more files for NDB Cluster

error: pathspec 'ndb/home/bin/parseConfigFile.awk' did not match any file(s) known to git

--- ndb/home/bin/parseConfigFile.awk
+++ ndb/home/bin/parseConfigFile.awk
@@ -0,0 +1,98 @@
+BEGIN{
+    where=0;
+    n_hosts=0;
+    n_api=0;
+    n_ndb=0;
+    n_mgm=0;
+    n_ports=0;
+}
+/COMPUTERS/ {
+    where=1;
+}
+/\[[ \t]*COMPUTER[ \t]*\]/ {
+    where=1;
+}
+/PROCESSES/ {
+    where=2;
+}
+/Type: MGMT/ {
+    if(where!=1){
+	where=2;
+	n_mgm++;
+    }
+}
+/\[[ \t]*MGM[ \t]*\]/ {
+    where=2;
+    n_mgm++;
+}
+/Type: DB/ {
+    if(where!=1){
+	where=3;
+	n_ndb++;
+    }
+}
+/\[[ \t]*DB[ \t]*\]/ {
+    where=3;
+    n_ndb++;
+}
+/Type: API/ {
+    if(where!=1){
+	where=4;
+	n_api++;
+    }
+}
+/\[[ \t]*API[ \t]*\]/ {
+    where=4;
+    n_api++;
+}
+/HostName:/ {
+    host_names[host_ids[n_hosts]]=$2;
+}
+
+/FileSystemPath:/ {
+  if (where==3){
+    ndb_fs[ndb_ids[n_ndb]]=$2;
+  }
+}
+
+/Id:/{
+    if(where==1){
+	n_hosts++;
+	host_ids[n_hosts]=$2;
+    }
+    if(where==2){
+	mgm_ids[n_mgm]=$2;
+    }
+    if(where==3){
+	ndb_ids[n_ndb]=$2;
+    }
+    if(where==4){
+	api_ids[n_api]=$2;
+    }
+}
+/ExecuteOnComputer:/{
+    if(where==2){
+	mgm_hosts[mgm_ids[n_mgm]]=host_names[$2];
+    }
+    if(where==3){
+	ndb_hosts[ndb_ids[n_ndb]]=host_names[$2];
+    }
+    if(where==4){
+	api_hosts[api_ids[n_api]]=host_names[$2];
+    }
+}
+END {
+    for(i=1; i<=n_mgm; i++){
+	printf("mgm_%d=%s\n", mgm_ids[i], mgm_hosts[mgm_ids[i]]);
+    }
+    for(i=1; i<=n_ndb; i++){
+	printf("ndb_%d=%s\n", ndb_ids[i], ndb_hosts[ndb_ids[i]]);
+	printf("ndbfs_%d=%s\n", ndb_ids[i], ndb_fs[ndb_ids[i]]);
+    }
+    for(i=1; i<=n_api; i++){
+	printf("api_%d=%s\n", api_ids[i], api_hosts[api_ids[i]]);
+    }
+    printf("mgm_nodes=%d\n", n_mgm);
+    printf("ndb_nodes=%d\n", n_ndb);
+    printf("api_nodes=%d\n", n_api);
+}


adding yamado-categories

adding yamado-categories

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/orbifx/yamado.git/'


kinetis: Add script for generating vendor header include lines

error: pathspec 'cpu/kinetis/dist/generate-cpu-files/generate-header-includes.awk' did not match any file(s) known to git

--- cpu/kinetis/dist/generate-cpu-files/generate-header-includes.awk
+++ cpu/kinetis/dist/generate-cpu-files/generate-header-includes.awk
@@ -0,0 +1,22 @@
+# Usage: awk -f <this_script> vendor/MKxxxx.h vendor/MKxxyy.h vendor/MKzzz.h ...
+/Processor[s]?:/ {
+    i=0;
+    if (FNR == NR) {
+        printf "#if";
+    } else {
+        printf "#elif";
+    }
+    while(match($0, /MK.*/)) {
+        if (i>0) {
+            printf " || \\\n   ";
+        }
+        printf " defined(CPU_MODEL_%s)", substr($0, RSTART, RLENGTH);
+        getline;
+        i++;
+    }
+    printf("\n#include \"%s\"\n", FILENAME);
+    nextfile;
+}
+END {
+  print "#endif"
+}


fix misinterpretation of indexed memory operand in i386 CFI generation

a register used as an index in the memory destination of a mov
instruction was wrongly interpreted as the destination of the mov.

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/chardi/musl.git/'


I'm tired of searching single sequences

I'm tired of searching single sequences

error: pathspec 'seqlike.awk' did not match any file(s) known to git


First archiving of an awk script that takes calculates a reasonable scaling
factor for all png files in this directory, and inserts them into the html
files in ../Project (named with html.tmp suffixes).

git-svn-id: afcf11d89342f630bd950d18a70234a9e277d909@91724 523d945c-050c-4681-91ec-863ad3bb968a

error: pathspec 'Documents/ACSArchitecture/Project/Images/scaleImages.awk' did not match any file(s) known to git

--- Documents/ACSArchitecture/Project/Images/scaleImages.awk
+++ Documents/ACSArchitecture/Project/Images/scaleImages.awk
@@ -0,0 +1,28 @@
+#! /usr/bin/gawk -f
+
+BEGIN {
+width = 562;
+pngRegexp = "[A-Za-z_-]+\.png"
+hRegexp="[Hh][Ee][Ii][Gg][Hh][Tt]=\"?[0-9]+\"?";
+wRegexp="[Ww][Ii][Dd][Tt][Hh]=\"?[0-9]+\"?";
+
+while (getline < "imageSizeList.txt" == 1) {
+	fname = substr($1,1,length($1)-1);
+	height=$7*512.0/$5;
+	h[fname] = height;
+	}
+close("imageSizeList.txt");
+}
+/^.*.png/{
+if (match($0,pngRegexp) !=0) {
+	sub(hRegexp,"");
+	sub(wRegexp,"");
+	match($0,pngRegexp);
+	fname = substr($0, RSTART, RLENGTH);
+	nmRegexp = fname"\"";
+	sub(nmRegexp,("&" sprintf(" WIDTH=\"%i\" HEIGHT=\"%i\" ",width, h[fname])));
+	print $0 >> FILENAME".tmp"
+	next;
+   }
+}
+{print $0 >> FILENAME".tmp"}


added normal checker, written in GAWK

added normal checker, written in GAWK

error: pathspec 'check_positive_normals.gawk' did not match any file(s) known to git

--- check_positive_normals.gawk
+++ check_positive_normals.gawk
@@ -0,0 +1,52 @@
+#!/usr/bin/gawk -f
+
+### check_positive_normals.gawk
+###
+### Check plate normals of well-behaved STL model
+###
+### Well-behaved:  all surface normals point outward from the origin,
+###                a la Peter Thomas SPUD models, with any ray from the
+###                origin never intersecting the surface in more than
+###                one place.
+###
+### 1) dot products of facet normal with
+###
+###      Vertex0,
+###      Vertex1,
+###      Vertex2,
+###
+###    appended to end of [vertex X Y Z] lines, should be positive
+###
+### 2) Scaled dot products of facet normal with
+###
+###      VCROSS(Vertex1-Vertex0, Vertex2-Vertex0),
+###
+###    printed out after last [vertex X Y Z] line for each facet,
+###    should also be positive and equal to +1.0
+###
+
+function vdot(x0,y0,z0,x1,y1,z1) { return x0*x1 + y0*y1 + z0*z1 }
+function vnorm(x0,y0,z0) { return sqrt(vdot(x0,y0,z0,x0,y0,z0)) }
+
+$1=="facet" { nx=$3+0.; ny=$4+0.; nz=$5+0. ; vtx=0 ; print FNR, $0; next }
+
+$1=="vertex" {
+  vx[vtx] = $2
+  vy[vtx] = $3
+  vz[vtx] = $4
+  print FNR,$0,vdot(nx,ny,nz,$2,$3,$4)
+
+  # Difference from v?[0] to either v?[1] or v>[2]
+  if (vtx>0) {
+    vx[vtx] -= vx[0]
+    vy[vtx] -= vy[0]
+    vz[vtx] -= vz[0]
+  }
+  if (++vtx<3) next
+
+  # Cross product
+  x = vy[1] * vz[2] - vz[1]*vy[2]   # x <= y cross z
+  y = vz[1] * vx[2] - vx[1]*vz[2]   # y <= z cross x
+  z = vx[1] * vy[2] - vy[1]*vx[2]   # z <= x cross y
+  print vdot(x,y,z,nx,ny,nz) / (vnorm(x,y,z)*vnorm(nx,ny,nz))
+}


Script used to import raw values.

Script used to import raw values.

error: pathspec 'fiximports.awk' did not match any file(s) known to git

--- fiximports.awk
+++ fiximports.awk
@@ -0,0 +1,3 @@
+#!/usr/bin/awk -f
+BEGIN {FS=","}
+{print "insert into annotation(id,api,name,usage) values(", --i, "'" $1 "','" $2 "','" $3 "')"}


REPL: update

REPL: update

--- include/REPL.awk
+++ include/REPL.awk
@@ -4,7 +4,7 @@

 # Detect external readline wrapper (rlwrap).
 function initRlwrap() {
-    Rlwrap = ("rlwrap --version 2>/dev/null" | getline) ? "rlwrap" : ""
+    Rlwrap = ("rlwrap --version" SUPERR | getline) ? "rlwrap" : ""
 }

 # Prompt for interactive session.
@@ -118,5 +118,5 @@
     }

     # %s : source language
-    printf(AnsiCode["bold"] AnsiCode[tolower(Option["prompt-color"])] p AnsiCode[0] " ", getDisplay(Option["sl"])) > "/dev/stderr"
+    printf(AnsiCode["bold"] AnsiCode[tolower(Option["prompt-color"])] p AnsiCode[0] " ", getDisplay(Option["sl"])) > STDERR
 }


added pattern to cases when all the calls are printed out

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/szilvajuhos/CAW.git/'


utf selection in header

utf selection in header


script to fix contigs and reads for Manta


conv.awk for Pig

conv.awk for Pig

error: pathspec 'scripts/misc/conv_pig.awk' did not match any file(s) known to git

--- scripts/misc/conv_pig.awk
+++ scripts/misc/conv_pig.awk
@@ -0,0 +1,15 @@
+BEGIN{ FS=" " }
+{
+    label=$1;
+    features="{"
+    for(i=2;i<=NF;i++)
+    {
+        if (i!=2)
+            features = features ","
+        feature = $i
+        features = features "(" feature ")";
+    }
+    features = features "}"
+    print NR "\t" label "\t" features;
+}
+END{}


Add checkFile rule governing blank lines after imports.

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/citycloud-bigdata/mondrian.git/'


awk example

awk example

error: pathspec 'awk/hello.awk' did not match any file(s) known to git

--- awk/hello.awk
+++ awk/hello.awk
@@ -0,0 +1,8 @@
+# run with awk -f
+
+function greet(name)
+{
+    print "Hello", name
+}
+
+BEGIN { greet("DevFest") }


Add new script for gln testing report

Add new script for gln testing report

git-svn-id: 293778eaa97c8c94097d610b1bd5133a8f478f36@24405 4f837ed2-42f5-46e7-a7a5-fa17313484d4

error: pathspec 'scripts/tdb/statuses_gln.awk' did not match any file(s) known to git

--- scripts/tdb/statuses_gln.awk
+++ scripts/tdb/statuses_gln.awk
@@ -0,0 +1,85 @@
+#!/usr/bin/awk -f
+# cat *.tdb | tdbout -t publisher,plugin,publisher:info[tester],status
+
+BEGIN {
+  FS="\t"
+  pn = 0
+}
+
+{
+    nn = split($2,na,/\./)
+    lp2 = na[nn]
+    if (!(($1,lp2) in b)) {
+      p[pn] = $1
+      n[pn] = lp2
+  #    n[pn] = $2
+      r[pn] = $3
+      pn++
+    }
+    b[$1,lp2]++
+    c[$1,lp2,$4]++
+    x[$4]++
+    tt++
+}
+
+END {
+  s[0] = "expected"
+  s[1] = "exists"
+  s[2] = "manifest"
+  s[3] = "wanted"
+  s[4] = "crawling"
+  s[5] = "testing"
+  s[6] = "notReady"
+  s[7] = "released"
+  s[8] = "down"
+  s[9] = "superseded"
+  s[10] = "zapped"
+  sn = 11
+
+  sc[0] = "expe"
+  sc[1] = "exis"
+  sc[2] = "mani"
+  sc[3] = "want"
+  sc[4] = "craw"
+  sc[5] = "test"
+  sc[6] = "notR"
+  sc[7] = "rele"
+  sc[8] = "down"
+  sc[9] = "supe"
+  sc[10] = "zapp"
+  scn = 11
+
+  #print out header
+  printf "Publisher\tPlugin\tT\tTotal"
+  for (j = 0 ; j < scn ; j++) {
+    if (x[s[j]] > 0) {
+    printf "\t%s", sc[j]
+    }
+  }
+  printf "\n"
+
+  #print out publisher, plugin, tester, total aus
+  for (i = 0 ; i < pn ; i++) {
+    printf "%s\t%s\t%s\t%d", p[i], n[i], r[i], b[p[i],n[i]]
+    for (j = 0 ; j < sn ; j++) {
+      if (x[s[j]] > 0){
+      if (c[p[i],n[i],s[j]] == 0) {
+      printf "\t.."
+    } else {
+        printf "\t%d", c[p[i],n[i],s[j]]
+      }
+    }
+    }
+    printf "\n"
+  }
+    #print out bottom line sums
+    printf "Publisher\tPlugin\tT\t%d", tt
+    for (j = 0 ; j < sn ; j++) {
+      if (x[s[j]] > 0) {
+        printf "\t%d", x[s[j]]
+      }
+    }
+
+  printf "\n"
+}
+


updated awk yamado parser for dating and abstract


SCCS var.gen.awk 10/09/30 08:23:33: date and time created 10/09/30 08:23:33 by neo

error: pathspec 'src/pbasis/var.gen.awk' did not match any file(s) known to git

--- src/pbasis/var.gen.awk
+++ src/pbasis/var.gen.awk
@@ -0,0 +1,361 @@
+#!/bin/awk
+#This is a utility script to generate get-/set and conversion-functions for the
+#variant data type pvar implemented in var.h
+#
+#I was lazy, had not the wish to write every of  this functions by hand... so
+#I'm sorry for yet another generator script...
+
+BEGIN								{
+										FS = "[ \t;:]+"
+										datatype = ""
+										member = ""
+										within_vargen = 0
+										first = 0
+										variants_cnt = 0
+										on_vargen = 0
+
+										SUBSEP = "#"
+
+										print "/*"
+										print " * WARNING:"
+										print " * THIS FILE IS GENERATED - DO NOT EDIT MANUALLY - IT WILL GO AWAY!"
+										print " */"
+										print ""
+										print "#include \"pbasis.h\""
+										print ""
+									}
+
+END									{
+										prev = ""
+										for( i = 1; i <= variants_cnt; i++ )
+										{
+											if( prev == members[ variants[ i ] \
+													SUBSEP "member" ] )
+												continue
+
+											if( with_conv )
+												convfunc( variants[ i ] );
+
+											prev = members[ variants[ i ] \
+													SUBSEP "member" ]
+										}
+
+										if( with_conv )
+											allconv_func()
+									}
+
+/[a-zA-Z_]+\*?[ \t]*[a-zA-Z_]+;/	{
+										if( !within_vargen )
+										{
+											datatype = $2
+											member = $3
+											next
+										}
+									}
+
+/vargen:/							{
+										within_vargen = 1
+										line = $0
+										gsub( "/\\*", "", line )
+										gsub( "\\*/", "", line )
+										split( line, types, ":" )
+
+										var_type = types[2]
+										var_format = types[3]
+										var_define = types[4]
+										var_emptyval = types[5]
+
+										if( var_define == "" )
+											var_define = "PVAR_" \
+												toupper( var_type )
+
+										variants[ ++variants_cnt ] = datatype
+										members[ datatype SUBSEP \
+													"member" ] = member
+										members[ datatype SUBSEP \
+													"var_type" ] = var_type
+										members[ datatype SUBSEP \
+													"var_format" ] = var_format
+										members[ datatype SUBSEP \
+													"var_define" ] = var_define
+										members[ datatype SUBSEP \
+													"var_emptyval" ] = var_emptyval
+
+										setcode = ""
+										first = 1
+										lastconvcode = ""
+									}
+
+/to [a-zA-Z_]+\*?:/					{
+										if( !within_vargen )
+											next
+
+										convcode = trim( substr( $0, \
+														index( $0, ":" ) + 1) )
+
+										if( convcode == "(same)" )
+											convcode = lastconvcode
+
+										#print $3 SUBSEP datatype
+										convert[ $3 SUBSEP datatype ] = convcode
+
+										lastconvcode = convcode
+									}
+
+/set:/								{
+										if( !within_vargen )
+											next
+
+										gsub( "set:", "", $0 )
+
+										if( !first )
+										{
+											if( setcode != "" )
+												setcode = setcode "\n"
+
+											setcode = setcode "\t" trim( $0 )
+										}
+
+										first = 0
+										next
+									}
+
+									{
+										if( !within_vargen )
+											next
+
+										line = trim( $0 )
+										if( substr( line, length( line ) \
+												 - 1, 2 ) == "*/" )
+										{
+											within_vargen = 0
+
+											if( with_set )
+												setfunc()
+
+											if( with_get )
+												getfunc()
+										}
+
+										first = 0
+									}
+
+#--- Utility functions go here ---
+
+function setfunc()
+{
+	print "/* -FUNCTION--------------------------------------------------------------------"
+	print "	Function:		pvar_set_" var_type "()"
+	print ""
+	print "	Author:			Jan Max Meyer (generated with var.gen.awk)"
+	print ""
+	print "	Usage:			Sets a variant's " datatype " data value and type."
+	print ""
+	print "	Parameters:		pvar*	var	Pointer to pvar structure."
+	print "					" datatype "	" member "	Value to be assigned."
+	print ""
+	print "	Returns:		" datatype "		The value of " member "."
+	print ""
+	print "	~~~ CHANGES & NOTES ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
+	print "	Date:		Author:			Note:"
+	print "----------------------------------------------------------------------------- */"
+
+	print datatype " pvar_set_" var_type "( pvar* var, " \
+				datatype " " member " )"
+	print "{"
+	print "	PROC( \"pvar_set_" var_type "\" );"
+	print "	PARMS( \"var\", \"%p\", var );"
+	print "	PARMS( \"" member "\", \"" var_format "\", " member " );"
+	print ""
+	print "	pvar_reset( var );"
+	print " var->type &= ~0x0F;"
+	print "	var->type |= " var_define ";"
+	print "	var->val." member " = " member ";"
+
+	if( setcode != "" )
+		print setcode
+
+	print ""
+	print "	RETURN( var->val." member " );"
+	print "}\n"
+}
+
+function getfunc()
+{
+	print "/* -FUNCTION--------------------------------------------------------------------"
+	print "	Function:		pvar_get_" var_type "()"
+	print ""
+	print "	Author:			Jan Max Meyer (generated with var.gen.awk)"
+	print ""
+	print "	Usage:			Returns a variant's " datatype " data value and type."
+	print "					If the variant exists in another data type, it will be"
+	print "					converted, so use it carefully if data loss is not desired!"
+	print ""
+	print "	Parameters:		pvar*	var	Pointer to pvar structure."
+	print ""
+	print "	Returns:		" datatype "		The " datatype "-value of the variant."
+	print ""
+	print "	~~~ CHANGES & NOTES ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
+	print "	Date:		Author:			Note:"
+	print "----------------------------------------------------------------------------- */"
+
+	print datatype " pvar_get_" var_type "( pvar* var )"
+	print "{"
+	print "	PROC( \"pvar_get_" var_type "\" );"
+	print "	PARMS( \"var\", \"%p\", var );"
+	print ""
+	print "	if( pvar_type( var ) != " var_define ")"
+	print "	{"
+	print "		if( pvar_is_convertible( var ) )"
+	print "		{"
+	print "			MSG( \"Conversion allowed and required\" );"
+	print "			if( pvar_convert( var, " var_define " ) != ERR_OK )"
+	print "				RETURN( (" datatype ")" var_emptyval " );"
+	print "		}"
+	print "		else"
+	print "			RETURN( (" datatype ")" var_emptyval " );"
+	print "	}"
+	print ""
+	print "	RETURN( var->val." member " );"
+	print "}\n"
+}
+
+function convfunc( type )
+{
+	for( ok in okdone )
+		okdone[ ok ] = 0
+
+	member = members[ type SUBSEP "member" ]
+	var_type = members[ type SUBSEP "var_type" ]
+	var_format = members[ type SUBSEP "var_format" ]
+	var_define = members[ type SUBSEP "var_define" ]
+	var_emptyval = members[ type SUBSEP "var_emptyval" ]
+
+	print "/* -FUNCTION--------------------------------------------------------------------"
+	print "	Function:		pvar_to_" var_type "()"
+	print ""
+	print "	Author:			Jan Max Meyer (generated with var.gen.awk)"
+	print ""
+	print "	Usage:			Converts a variant's current value into a " type " variable."
+
+	if( var_type ~ /string/ )
+		print "					The returned memory is allocated, and must be freed by the caller."
+
+	print ""
+	print "	Parameters:		pvar*	var	Pointer to pvar structure."
+	print ""
+	print "	Returns:		" type "		The " type "-value of the variant."
+
+	if( var_type ~ /string/ )
+		print "					Memory must be freed by caller!"
+
+	print ""
+	print "	~~~ CHANGES & NOTES ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
+	print "	Date:		Author:			Note:"
+	print "----------------------------------------------------------------------------- */"
+
+	print type " pvar_to_" var_type "( pvar* var )"
+	print "{"
+	print "	PROC( \"pvar_to_" var_type "\" );"
+	print "	PARMS( \"var\", \"%p\", var );"
+	print ""
+
+	print "	switch( pvar_type( var ) )"
+	print "	{"
+
+	for( j = 1; j <= variants_cnt; j++ )
+	{
+		if( okdone[ variants[j] ] )
+			continue
+
+		okdone[ variants[j] ] = 1
+		print "		case " members[ variants[j] SUBSEP "var_define" ] ":"
+
+		if( variants[j] == type )
+		{
+			print "			RETURN( var->val." member " );"
+			continue
+		}
+
+		if( ( conv = convert[ type SUBSEP variants[j] ] ) == "" )
+			conv = "var->val." members[ variants[j] SUBSEP "member" ]
+
+		print "			RETURN( (" type ")" conv " );"
+	}
+
+	print "	}\n"
+	print "	MSG( \"Can't convert this type!\" );"
+	print "	RETURN( (" type ")" var_emptyval " );"
+	print "}\n"
+}
+
+function allconv_func()
+{
+	for( ok in okdone )
+		okdone[ ok ] = 0
+
+	print "/* -FUNCTION--------------------------------------------------------------------"
+	print "	Function:		pvar_convert()"
+	print ""
+	print "	Author:			Jan Max Meyer (generated with var.gen.awk)"
+	print ""
+	print "	Usage:			Converts a pvar-structure to any supported type."
+	print ""
+	print "	Parameters:		pvar*	var		Pointer to pvar structure."
+	print "					pbyte	type	Type to which var should be converted to."
+	print ""
+	print "	Returns:		pint	ERR_OK	on success, else an ERR_-define."
+	print ""
+	print "	~~~ CHANGES & NOTES ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
+	print "	Date:		Author:			Note:"
+	print "----------------------------------------------------------------------------- */"
+
+	print "pint pvar_convert( pvar* var, pbyte type )"
+	print "{"
+	print "	PROC( \"pvar_convert\" );"
+	print "	PARMS( \"var\", \"%p\", var );"
+	print "	PARMS( \"type\", \"%d\", type );"
+	print ""
+	print "	if( pvar_type( var ) == type )"
+	print "		RETURN( ERR_OK );"
+	print ""
+	print "	switch( type )"
+	print "	{"
+
+	for( i = 1; i <= variants_cnt; i++ )
+	{
+		if( okdone[ variants[i] ] )
+			continue
+
+		okdone[ variants[i] ] = 1
+
+		print "		case " members[ variants[i] SUBSEP "var_define" ] ":"
+		print "			pvar_set_" members[ variants[i] SUBSEP "var_type" ] \
+			  "( var, pvar_to_" members[ variants[i] SUBSEP "var_type" ] \
+			  "( var ) );"
+		print "			RETURN( ERR_OK );\n"
+	}
+
+	print "	}"
+	print ""
+	print "	RETURN( ERR_FAILURE );"
+	print "}\n"
+}
+
+function ltrim( s )
+{
+	sub( /^[ \t\n]+/, "", s )
+	return s
+}
+
+function rtrim( s )
+{
+	sub( /[ \t\n]+$/, "", s )
+	return s
+}
+
+function trim( s )
+{
+	return rtrim( ltrim( s ) )
+}
+


file sep

file sep

error: pathspec 'src/awk/fs.awk' did not match any file(s) known to git

--- src/awk/fs.awk
+++ src/awk/fs.awk
@@ -0,0 +1,14 @@
+#! /bin/awk -f
+
+#find mean and variance of a column from a file
+BEGIN {
+OFS=","
+}
+#body
+{
+$1=$1 #rebuild the record using current OFS
+print $0
+}
+END {
+print "Done"
+}


* awk filter for logs

* awk filter for logs

error: pathspec 'tools/log_bbTT.awk' did not match any file(s) known to git


Added an auxiliary utility to ncheck 16 consecutive inumbers with debugfs.

error: pathspec 'ncheck16.awk' did not match any file(s) known to git

--- ncheck16.awk
+++ ncheck16.awk
@@ -0,0 +1,15 @@
+# 2 january 2015
+# usage: awk -f icheck16.awk diskimage
+# enter one inumber at a time
+# TODO the usual
+BEGIN {
+	diskimage = ARGV[1]
+	ARGC--
+}
+{
+	for (i = 0; i < 16; i++) {
+		n = $1 + i
+		c = sprintf("debugfs -R 'ncheck %d' '%s' 2>/dev/null", n, diskimage)
+		system(c)
+	}
+}


rollback

rollback

error: pathspec 'CPU/common/collisions.awk' did not match any file(s) known to git

--- CPU/common/collisions.awk
+++ CPU/common/collisions.awk
@@ -0,0 +1,121 @@
+#!/usr/bin/awk -f
+##########
+#The MIT License (MIT)
+#
+# Copyright (c) 2015 Aiden Lab
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+#  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+#  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+#  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+#  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+#  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+#  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+#  THE SOFTWARE.
+##########
+# Takes a SAM file, looks for interesting abnormal chimeric reads.
+# only those reads mapped to chromosomes 1-24 with MAPQ >= 10, and
+# with at least a triple where the minimum distance >= 20Kb
+# Juicer version 1.5
+function abs(v) {
+    return v<0?-v:v;
+}
+BEGIN{
+  OFS="\t";
+  mapq_thresh=-1;
+  tottot = -1; # will count first non-group
+}
+{
+  # input file is sorted by read name.  Look at read name to group
+  # appropriately
+  split($1,a,"/");
+  if(a[1]==prev){
+    # move on to next record.  look below this block for actions that occur
+    # regardless.
+    count++;
+  }
+  else {
+    # deal with read pair group
+    tottot++;
+    printme = 1;
+    j = 0;
+    for (i in c) {
+      split(c[i], tmp);
+      mapped[j] = tmp[3] ~ /^[1-9,X,Y,M][0-9,T]?$/ || tmp[3] ~ /^chr[1-9,X,Y,M][0-9,T]?$/;
+      name[j] = tmp[1];
+      str[j] = tmp[2];
+      chr[j] = tmp[3];
+      pos[j] = tmp[4];
+      m[j] = tmp[5];
+      cig[j] = tmp[6];
+      seq[j] = tmp[10];
+      j++;
+    }
+    len = j;
+    bigdist = 0;
+    for (j=0; j<len; j++) {
+        printme = printme && mapped[j] && (m[j] >= 10);
+        for (k=j+1; k<len; k++) {
+            if (abs(pos[j]-pos[k]) >= 20000) {
+                bigdist++;
+            }
+        }
+    }
+#    printme = printme && (bigdist >= 3);
+    if (printme) {
+      for (j = 0; j < len; j++) {
+          printf("%s %d %s %d %d %s %s ", name[j], str[j], chr[j], pos[j], m[j], cig[j], seq[j]);
+      }
+      printf("\n");
+    }
+
+    # reset variables
+    delete c;
+    count=1;
+    prev=a[1];
+  }
+  # these happen no matter what, after the above processing
+  c[count] = $0;
+}
+END {
+    printme = 1;
+    j = 0;
+    for (i in c) {
+      split(c[i], tmp);
+      mapped[j] = tmp[3] ~ /^[1-9,X,Y,M][0-9,T]?$/ || tmp[3] ~ /^chr[1-9,X,Y,M][0-9,T]?$/;
+      name[j] = tmp[1];
+      str[j] = tmp[2];
+      chr[j] = tmp[3];
+      pos[j] = tmp[4];
+      m[j] = tmp[5];
+      cig[j] = tmp[6];
+      seq[j] = tmp[10];
+      j++;
+    }
+    len = j;
+    bigdist = 0;
+    for (j=0; j<len; j++) {
+        printme = printme && mapped[j] && (m[j] >= 10);
+        for (k=j+1; k<len; k++) {
+            if (abs(pos[j]-pos[k]) >= 20000) {
+                bigdist++;
+            }
+        }
+    }
+#    printme = printme && (bigdist >= 3);
+    if (printme) {
+      for (j = 0; j < len; j++) {
+          printf("%s %d %s %d %d %s %s ", name[j], str[j], chr[j], pos[j], m[j], cig[j], seq[j]);
+      }
+      printf("\n");
+    }
+}


if (s_length(pa[ch]) != 3) {

if (s_length(pa[ch]) != 3) {

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/svnpenn/sage.git/'


Add AWK script to generate a frequency table from a column of numbers

error: pathspec 'tools/awk/frequency_table.awk' did not match any file(s) known to git

--- tools/awk/frequency_table.awk
+++ tools/awk/frequency_table.awk
@@ -0,0 +1,22 @@
+#!/usr/bin/env awk -f
+#
+# Generates a frequency table.
+#
+# Usage: frequency_table
+#
+# Input:
+#   - a column of numbers
+#
+# Output:
+#   - frequency table
+
+{
+	total += 1
+	table[$1] += 1
+}
+END {
+	for (v in table) {
+		count = table[v]
+		print v OFS count OFS count/total
+	}
+}


Added script to filter out long stack traces.

error: pathspec 'src/awk/longThreads.awk' did not match any file(s) known to git

--- src/awk/longThreads.awk
+++ src/awk/longThreads.awk
@@ -0,0 +1,27 @@
+#!/usr/bin/awk -f
+
+BEGIN {
+    PRINT=0
+    BUFF=""
+    LINES=0
+}
+/"[^"]*".*prio=[^ ]* tid=[^ ]* .*/ {
+    if (LINES>30) {
+	print BUFF
+	PRINT=0
+    }
+    LINES=0
+    BUFF=""
+}
+{
+    if (LINES<2000) {
+	BUFF=BUFF "\n" $0
+	LINES=LINES+1
+    }
+}
+
+END {
+    if (PRINT) {
+        print BUFF
+    }
+}


Add Tobias Waldekranz's awesome little AWK script

Signed-off-by: Joachim Nilsson <583c295fd7602c168ad814279bbc3894ba65f5d6@gmail.com>

error: pathspec 'ipcalc.awk' did not match any file(s) known to git


A script that generates language model data from frame data, suitable
for gnuplot

git-svn-id: a8b04003a33e1d3e001b9d20391fa392a9f62d91@2457 94700074-3cef-4d97-a70e-9c8c206c02f5

error: pathspec 'scripts/extractLanguageProbs.awk' did not match any file(s) known to git

--- scripts/extractLanguageProbs.awk
+++ scripts/extractLanguageProbs.awk
@@ -0,0 +1,8 @@
+# An awk/gawk script that extracts the language probabilities from an
+# S4 results output file.  Output is 3 columns:
+# 1 - frame number
+# 2 - total lang probability applied
+# 3 - this frames lang prob
+# 4 - this frames insertion prob
+$1 >= 1 && $1 < 100000 { sum += $4;  sum += $5; }
+$1 >= 1 && $1 < 100000 { print $1, sum, $4, $5 }


Create trace.awk

Create trace.awk

error: pathspec 'tools/trace.awk' did not match any file(s) known to git

--- tools/trace.awk
+++ tools/trace.awk
@@ -0,0 +1,2 @@
+#提取trace文件中想要的信息
+cat usr_1.csv | awk -F"," '{if($4=="Write") print "W",$5,$6;else print "R",$5,$6}'> ~/usr_1_ssd.csv


Added sjCollapseSamples.awk script

Added sjCollapseSamples.awk script

error: pathspec 'extras/scripts/sjCollapseSamples.awk' did not match any file(s) known to git

--- extras/scripts/sjCollapseSamples.awk
+++ extras/scripts/sjCollapseSamples.awk
@@ -0,0 +1,25 @@
+# usage:
+# awk -f sjCollapseSamples.awk /path/to/all/*/SJ.out.tab | sort -k1,1V -k2,2n -k3,3n > SJ.all
+# output columns:
+# 1-6 - same as in SJ.out.tab
+# 7   - total number of unique mappers
+# 8   - total number of multi-mappers
+# 9   - max overhang
+# 10  - number of samples the junction was detected in
+
+BEGIN {
+    OFS="\t";
+}
+
+{
+    sj=$1 "\t" $2 "\t" $3 "\t" $4 "\t" $5 "\t" $6;
+    nSamples[sj]++;
+    nU[sj]+=$7;
+    nM[sj]+=$8;
+    if (nO[sj]<$9) nO[sj]=$9;
+};
+
+END {
+    for (sj in nSamples) print sj,nU[sj],nM[sj],nO[sj],nSamples[sj];
+}
+


Fix Awk code avoiding division by zero error

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/vilugao/fibonacci.git/'


Initial revision

Initial revision

error: pathspec 'modules/src/em_opt/makefuns.awk' did not match any file(s) known to git

--- modules/src/em_opt/makefuns.awk
+++ modules/src/em_opt/makefuns.awk
@@ -0,0 +1,59 @@
+BEGIN		{
+		FS = "|";
+		seenproc = 0;
+		CC="${CMD}"
+		}
+/^%/		{}
+/^$/		{}
+/^[a-z]/ && $3 !~ /.*NOTIMPLEMENTED.*/ {
+		if(seenproc) {
+			print "}"
+			print "--EOF--"
+			printf "if %s C_%s.c\n",CC,nam
+			printf "then :\nelse exit 1\nfi\n"
+			printf "rm -f C_%s.c\n",nam
+		}
+		seenproc = 1
+		$1 = substr($1,1,index($1,"\t")-1);
+		nam = $1
+		printf "cat > C_%s.c << '--EOF--'\n",$1
+		print "#include \"nopt.h\""
+		printf "C_%s(",$1
+		nparms = split($2,parms,":");
+		for(p=1;p<nparms;p++) {
+			if(p!=1) {
+				printf ","
+			}
+			split(parms[p+1],a," ")
+			printf a[1]
+		}
+		printf ")\n"
+		if(nparms) {
+			printf "\t%s",parms[1]
+		}
+		for(p=1;p<nparms;p++) {
+			split(parms[p+1],a," ")
+			printf " %s;\n",a[1]
+			if(a[2]) {
+				printf "\t%s%s%s",a[2],a[3],a[4]
+			}
+		}
+		if($3) {
+			printf "{\n\t%s\n",$3
+		}
+		else {
+			printf "{\n"
+		}
+		}
+/^	/	{
+		print
+		}
+END		{
+		if(seenproc) {
+			print "}"
+			print "--EOF--"
+			printf "if %s C_%s.c\n",CC,nam
+			printf "then :\nelse exit 1\nfi\n"
+			printf "rm -f C_%s.c\n",nam
+		}
+		}


Add an awk script used in one-vs-the-rest classification example.

error: pathspec 'scripts/misc/one-vs-rest.awk' did not match any file(s) known to git

--- scripts/misc/one-vs-rest.awk
+++ scripts/misc/one-vs-rest.awk
@@ -0,0 +1,17 @@
+BEGIN{ FS="\t"; OFS="\t"; }
+{
+ 	possible_labels=$1;
+ 	rowid=$2;
+    label=$3;
+    features=$4;
+
+ 	label_count = split(possible_labels, label_array, ",");
+
+	for(i = 1; i <= label_count; i++) {
+    	if (label_array[i] == label)
+      		print rowid, label, 1, features;
+      	else
+      		print rowid, label_array[i], -1, features;
+	}
+}
+END{}


2008-03-24  Martin Sebor  <sebor@roguewave.com>

	* bin/xcomp.awk (print_section): Prepended "../" to the log file name
	since build logs are stored in the parent directory of the one that
	contains the cross-build results.

git-svn-id: 8ce9432b95a2a271c6c279131eb1bb968a8ee7fb@640483 13f79535-47bb-0310-9956-ffa450edef68

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/pathscale/stdcxx.git/'


Added normalize.

Added normalize.

error: pathspec 'examples/normalize.awk' did not match any file(s) known to git

--- examples/normalize.awk
+++ examples/normalize.awk
@@ -0,0 +1,13 @@
+#!/usr/bin/awk -f
+
+{
+	for (i = 1; i <= NF; ++i) {
+	    split ($i, fields, "=");
+	    map[fields[1]] = fields[2];
+	}
+
+	user = map["user"];
+	total = map["total"];
+
+	printf ("system=%f\n", (total - user) / total);
+}


gps.sh -> .awk

gps.sh -> .awk

error: pathspec 'bin/gps.awk' did not match any file(s) known to git

--- bin/gps.awk
+++ bin/gps.awk
@@ -0,0 +1,80 @@
+#!/usr/bin/awk -f
+#
+# Copyright (c) 1995-2016 Cyrille Lefevre (Cyrille.Lefevre@laposte.net). All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in
+#    the documentation and/or other materials provided with the
+#    distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS''
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+# PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS
+# OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+
+BEGIN {
+	split("N S", nsa); split("E W", eoa)
+	CONVFMT = "%04.1f"
+	fmt = "%.8f"
+	epsilon = .00000001
+}
+function round(l, n) { return +(+(l "e+" n) "e-" n) }
+function l2dms(l, t,	n, d, m, s) {
+	n = t[1+(l<0)]
+	if (l < 0) l = -l
+	d = int(l)
+	l -= int(l)
+	l *= 60
+	m = int(l)
+	l -= int(l)
+	l *= 60
+	s = round(l, 2)
+	if (s == 60) { m++; s -= 60 }
+	return d "°" m "'" s "''" n
+}
+function dms2l(n, d, m, s,	l, t) {
+	return n * (d + (m / 60) + (s / 3600))
+}
+function l2l(l, a, m, n,	s, o, x, t) {
+	s = o = l2dms(l, a)
+	x = o ~ m ? n : -n
+	gsub(/[^-.0-9]/, " ", o)
+	split(o, t)
+	return dms2l(x, t[1], t[2], t[3])
+}
+/./ {
+	ns = /N/ ? 1 : -1
+	eo = /[OW]/ ? -1 : 1
+	gsub(/[^-.0-9]/, " ")
+	if (NF != 6) {
+		nss = l2dms($1, nsa)
+		eos = l2dms($2, eoa)
+		nsn = l2l($1, nsa, "N", 1)
+		eon = l2l($2, eoa, "[OW]", -1)
+		printf fmt " " fmt "\n", nsn, eon
+		print nss, eos
+	} else {
+		nsn = dms2l(ns, $1, $2, $3)
+		eon = dms2l(eo, $4, $5, $6)
+		nss = l2dms(nsn, nsa)
+		eos = l2dms(eon, eoa)
+		printf fmt " " fmt "\n", nsn, eon
+		print nss, eos
+	}
+}
+
+# eof


Added unbundle script for hub4

Added unbundle script for hub4

git-svn-id: a8b04003a33e1d3e001b9d20391fa392a9f62d91@1409 94700074-3cef-4d97-a70e-9c8c206c02f5

error: pathspec 'scripts/unbundleHub4.awk' did not match any file(s) known to git

--- scripts/unbundleHub4.awk
+++ scripts/unbundleHub4.awk
@@ -0,0 +1,83 @@
+# This is an awk script that will take the hub4 eval99 distribution
+# and generate a script that will unpack the distribution into a set
+# of audio and batch files suitable for s4.
+#
+
+BEGIN {
+    audioCount = 0;
+    directory = "/lab/speech/sphinx4/data/hub4/eval99/supervised/";
+
+    print "#!/bin/sh"
+    print "#  This Script unbundles the hub4/eval99 (broadcast news)"
+    print "#  into a set of raw audio and batch files suitable for "
+    print "#  processing by sphinx."
+    print "#  "
+    print "#  This script is automatically generated by unbundleHub99.awk"
+    print "#  "
+    print "#  "
+    print "#  Create the destination directory"
+    print "mkdir -p " directory;
+    print "rm -rf " directory "/*";
+
+}
+
+function displaySummary() {
+    print "========================";
+    print "Sphere   : "  sphereName;
+    print "Audio    : " audioName;
+    print "Speaker  : "  speaker;
+    print "start    : "  startTime;
+    print "end      : "  endTime;
+    print "duration : " duration;
+    print "class    : " speechClass;
+    print "sox cmd  : " soxCommand;
+    print "xcrpt    : " transcript;
+}
+
+function outputCommands() {
+    print "";
+    print "";
+    print "echo Processing" audioName
+    print soxCommand;
+    print "echo " audioName " " transcript " >> " batchName;
+    print "echo " audioName " " transcript " >> " allBatch;
+}
+
+function isGoodUtterance() {
+    return speechClass != "";
+}
+
+$1 != ";;"  {
+    audioCount++;
+    source = $1;
+    sphereName = $1 ".sph";
+    speaker = $3;
+    startTime = $4;
+    endTime = $5
+    duration = endTime - startTime;
+    info = $6;
+
+    split(info, infoArray, ",");
+    speechClass = infoArray[2];
+    transcript = "";
+    for (i = 7; i <= NF; i++) {
+        # markup is in parans, so drop that.
+        if (index($i, "(")  == 0) {
+            transcript = transcript " " $i;
+        }
+    }
+
+
+    audioName = directory source "." audioCount "." speechClass ".raw";
+    batchName = directory speechClass "_hub4.batch"
+    allBatch = directory "all_hub4.batch"
+
+    soxCommand =  "sox " sphereName " -r 16000 -s -w " audioName  \
+        " trim " startTime " " duration
+
+
+    if (isGoodUtterance()) {
+        outputCommands();
+    }
+    # displaySummary();
+}


Created an AWK script to generate pipe separate keyword list

error: pathspec 'SupportDocs/keywordPipeGenerator.awk' did not match any file(s) known to git

--- SupportDocs/keywordPipeGenerator.awk
+++ SupportDocs/keywordPipeGenerator.awk
@@ -0,0 +1 @@
+{ printf "%s|", $0}