10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
HI
I need to get the function "kick" to get executed in any way the parameters are passed in to the function. The parameters are first stored in a dictionary
self.otherlist = {}
print self.otherlist
self.populateTestList(self.system_type)
print... (1 Reply)
Discussion started by: Priya Amaresh
1 Replies
2. Shell Programming and Scripting
Hi,
I want to be able to sort/print a hash based on the string length of the values.
For example
%hash = (
key1 => 'jeri',
key2 => 'corona',
key3 => 'una,
);
I want to be able to print in the following order (smallest to largest)
una,jeri,corona
OR... (1 Reply)
Discussion started by: jdilts
1 Replies
3. Shell Programming and Scripting
I want to sort values of a hash in ascending order.
my %records;
for my $value (sort values %records){print $value,"\n";}
When I use the above code I get values in this order: 1,10,11,2,3,4,5,6,7,8,9. But, I need values in my output in this order: 1,2,3,4,5,6,7,8,9,10,11.
Can Someone... (1 Reply)
Discussion started by: koneru_18
1 Replies
4. Shell Programming and Scripting
Hi All,
Thanks all for the continued support so far.
Today, I need to find the most occurring string/number(also called mode in statistics terminology) for each column in a data file (.csv type).
For one column of data(1.txt) like below
Sample
1
2
2
3
4
1
1
1
2
I can find the mode... (6 Replies)
Discussion started by: ks_reddy
6 Replies
5. Shell Programming and Scripting
Dear Forum
I'm Trying to use split function to split a string, but the output is not as the same order as of the string, please see simple example
echo " " | nawk -v var="First;Second;Third;Fourth" '
BEGIN {split(var, arr,";") for(i in arr){print arr }}'
The output is
Second
Third... (6 Replies)
Discussion started by: yahyaaa
6 Replies
6. Shell Programming and Scripting
Can Someone explain me why even using Tie::IxHash I can not get the output data in the same order that it was inserted? See code below.
#!/usr/bin/perl
use warnings;
use Tie::IxHash;
use strict;
tie (my %programs, "Tie::IxHash");
while (my $line = <DATA>) {
chomp $line;
my(... (1 Reply)
Discussion started by: jgfcoimbra
1 Replies
7. Programming
Hi,
I want build 10 processus with fork and that each processus write a value betwen 0 and 9 , but each processus send the same value .
So my code ,you can compile and try .
#include <time.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/ipc.h> ... (7 Replies)
Discussion started by: carton99
7 Replies
8. Programming
I have created my own hash table class, but am looking to speed it up. My current hash function is:
int HashTable::hashFunc(const string &key) const
{
int tableSize = theLists.size();
int hashVal = 0;
for(int i = 0; i<key.length(); i++)
hashVal =... (7 Replies)
Discussion started by: killerqb
7 Replies
9. Shell Programming and Scripting
I have a file with a format of
A,2
B,2
G,3
A,2
A,3
A,2
D,7
A,2
E,2
A,2
I need to create a sum of each alphabet with the numbers assigned to it using awk. (2 Replies)
Discussion started by: dinjo_jo
2 Replies
10. Programming
Hi all,
Is the rand() function in C uniform or normal distribution. If it is unform, is there a random function that is normal.
Thanks and Regards (2 Replies)
Discussion started by: omran
2 Replies
Sys::Statistics::Linux::FileStats(3pm) User Contributed Perl Documentation Sys::Statistics::Linux::FileStats(3pm)
NAME
Sys::Statistics::Linux::FileStats - Collect linux file statistics.
SYNOPSIS
use Sys::Statistics::Linux::FileStats;
my $lxs = Sys::Statistics::Linux::FileStats->new;
my $stat = $lxs->get;
DESCRIPTION
Sys::Statistics::Linux::FileStats gathers file statistics from the virtual /proc filesystem (procfs).
For more information read the documentation of the front-end module Sys::Statistics::Linux.
FILE STATISTICS
Generated by /proc/sys/fs/file-nr, /proc/sys/fs/inode-nr and /proc/sys/fs/dentry-state.
fhalloc - Number of allocated file handles.
fhfree - Number of free file handles.
fhmax - Number of maximum file handles.
inalloc - Number of allocated inodes.
infree - Number of free inodes.
inmax - Number of maximum inodes.
dentries - Dirty directory cache entries.
unused - Free diretory cache size.
agelimit - Time in seconds the dirty cache entries can be reclaimed.
wantpages - Pages that are requested by the system when memory is short.
METHODS
new()
Call "new()" to create a new object.
my $lxs = Sys::Statistics::Linux::FileStats->new;
It's possible to set the path to the proc filesystem.
Sys::Statistics::Linux::FileStats->new(
files => {
# This is the default
path => '/proc',
file_nr => 'sys/fs/file-nr',
inode_nr => 'sys/fs/inode-nr',
dentries => 'sys/fs/dentry-state',
}
);
get()
Call "get()" to get the statistics. "get()" returns the statistics as a hash reference.
my $stat = $lxs->get;
EXPORTS
No exports.
SEE ALSO
proc(5)
REPORTING BUGS
Please report all bugs to <jschulz.cpan(at)bloonix.de>.
AUTHOR
Jonny Schulz <jschulz.cpan(at)bloonix.de>.
COPYRIGHT
Copyright (c) 2006, 2007 by Jonny Schulz. All rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
perl v5.14.2 2012-03-09 Sys::Statistics::Linux::FileStats(3pm)