Sponsored Content
Full Discussion: Those simple one liners
The Lounge What is on Your Mind? Those simple one liners Post 302793469 by MadeInGermany on Friday 12th of April 2013 12:34:27 PM
Old 04-12-2013
Quote:
Originally Posted by Corona688
...

There's also some bad habits in trying to squeeze things down to the absolute mininum number of characters. I see this a lot in awk scripts -- using an unused variable instead of "" since it's one character shorter. That's baffling to read later.
Yep, it's already a bad habit to replace an unconditional {print} with 1.
Nerd's artistic license or what?
Professors please! And no nerds!

---------- Post updated at 11:34 AM ---------- Previous update was at 11:26 AM ----------

Quote:
Originally Posted by ahamed101
...

Does this happen to you? You write a 10 liner and "HE" comes in with a one liner and you will be like "what?". Can't agree if someone says it cause of experience not in this case at least. May be our brain misses something sometimes and thinks too complex?

--ahamed
Not really.
If s.o. "beats" me with a shorter and better readable solution, I am happy it can be improved. And hit the Thanks button.
That's another purpose of this forum, isn't it?
 

4 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

invaluable resource for shell one liners and more

Hi all, This link might help whom is seeking a quick solutions for thier daily shell needs. linkAll commands | commandlinefu.com (1 Reply)
Discussion started by: h@foorsa.biz
1 Replies

2. Shell Programming and Scripting

awk - one liners

Guys, I have a requirement like this. A file has >5K records always. Separated by "|", it has 30 fields for each line. In some lines, I am getting an odd field. say, the 15th field is supposed to be 2 characters but comes in as >2. In this case, for resolving this I need to copy the value of... (6 Replies)
Discussion started by: PikK45
6 Replies

3. Shell Programming and Scripting

awk one liners into a nice script

Hi All, I got some awk one liners, how can i split it all into a nice script? Got these: gzcat capgw0.log-201308161376632741.gz | sed -n '/2013-08-16 05:56:/,/2013-08-16 05:58:/p' > timebased.log awk -F":|," 'FNR==NR && /INFO - AId:/ {a=$0;next} END {for (i in a) print i "|" a}'... (8 Replies)
Discussion started by: batka
8 Replies

4. What is on Your Mind?

One liners, quick rant...

Hi fellas and fella-esses... There are numerous threads on here where people ask for, and often expect, solutions to difficult problems solved using _one_liners_. Why do they insist as such when it is virtually no different in execution time with well thought out indented code? Is it me... (12 Replies)
Discussion started by: wisecracker
12 Replies
HMINE(1)																  HMINE(1)

NAME
hypex - computes the Chernoff exponent between two simple categories. SYNOPSIS
hypex [-hH size] [-s stepsize] CATDUMP1 CATDUMP2 hmine -V DESCRIPTION
hypex reads two category dumps produced by dbacl(1) after learning. A category dump is obtained using the -d and -l switches, and is a textual representation of the feature weights which exist in the binary category files. Given two such category dumps for simple unigram categories, hypex calculates the Kullback Leibler divergence between the probability mod- els, and prints out exponential error exponents for Neyman-Pearson hypothesis tests under a range of threshold values. See Cover and Thomas (1991) Elements of Information Theory, Chap. 12. Note that only simple categories are supported, and the output only makes sense under appropriate theoretical conditions. This is a very specialized calculator. EXIT STATUS
hypex returns 0 on success, 1 if an error occurs. OPTIONS
-h -H Same as dbacl(1). Selects the hash sizes in powers of two. -s Stepsize for the threshold. hypex outputs exponents for different values of the threshold, within an interval bounded by the Kull- back Leibler divergences between the categories. -V Print the program version number and exit. SOURCE
The source code for the latest version of this program is available at the following locations: http://www.lbreyer.com/gpl.html http://dbacl.sourceforge.net BUGS
Doesn't work with complex categories, and theoretical assumptions are unrealistic in practice. AUTHOR
Laird A. Breyer <laird@lbreyer.com> SEE ALSO
dbacl(1), mailcross(1), mailfoot(1), mailinspect(1), mailtoe(1), regex(7) Version 1.12 Bayesian Classification Tools HMINE(1)
All times are GMT -4. The time now is 10:44 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy