10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
here is what i want to achieve... consider a file contains below contents. the file size is large about 60mb
cat dump.sql
INSERT INTO `table1` (`id`, `action`, `date`, `descrip`, `lastModified`) VALUES (1,'Change','2011-05-05 00:00:00','Account Updated','2012-02-10... (10 Replies)
Discussion started by: vivek d r
10 Replies
2. Shell Programming and Scripting
continuing from my previous post, whose link is given below as a reference
https://www.unix.com/shell-programming-scripting/171076-shell-scripting.html#post302573569
consider there is create table commands in a file for eg:
CREATE TABLE `Blahblahblah` (
`id` int(11) NOT NULL... (2 Replies)
Discussion started by: vivek d r
2 Replies
3. UNIX for Advanced & Expert Users
Hi folks,
I have an application that is acting up. I have another machine with a replacement application on it but because of the naming structure clients are using I cannot change the name to the replacement machine as it is also used to access other applications.
The host OS is Centos 5.6... (0 Replies)
Discussion started by: beddo
0 Replies
4. Solaris
Hi,
i got the following error when i tried to access the cygwin x server from a windows XP PC.
"xdmcp fatal error session failed session 23 failed for display"
Alternatively, when i tried to access the same Cygwin X Server from another windows XP PC which is on a different LAN... (3 Replies)
Discussion started by: HarishKumarM
3 Replies
5. Solaris
Hi All
I need to find the biggest files on our system BUT excluding some directories.
I.E Find / -size +10000 (excluding 'platform'|'db' ..etc) |sort -n > file
I tried grep -v but that can only do one expression at a time. Tried /usr/xpg4/bin/grep but cant use -v
Please help
Chris (5 Replies)
Discussion started by: JTS911
5 Replies
6. AIX
Hi friends,....
am sindhiya,
i have joined as AIX level 1 support.
help me to identify the failed pv in vg which has some 4 physical volumes? (2 Replies)
Discussion started by: sindhiya
2 Replies
7. AIX
Hi,
While I am trying SFTP my machine to another unix machine ,
it was working fine till 10 min back.
But now i am getting the below error
"Request for subsystem 'sftp' failed on channel 0"
Could you please someone help me to solve or analyise the root cause...
Cheers:b:,
Mahiban (0 Replies)
Discussion started by: mahiban
0 Replies
8. Shell Programming and Scripting
Hi folks,
I have the following configuration file:
tofu:/tmp # cat bitbandConfig.properties
maestroIp=10.10.10.10
maestroPort=2020
adminPlayPath=<Streaming Agent IP>:2021/streamingGateway/GetPlayList
###This part should not be changed###
adminPlayVODProtocol=http
username=iptv... (7 Replies)
Discussion started by: nir_s
7 Replies
9. Shell Programming and Scripting
Hi folks,
I have the following template file:
application.filePath.core = /core-RIGHTV/Html/
application.filePath.xbip = /xbip-RIGHTV/Html/
translator.rootContext = /translator_<schame_name>/
I need to substitute the string in the third line "<schema_name>" with $SCHEMA_NAME
I ran the... (4 Replies)
Discussion started by: nir_s
4 Replies
10. Shell Programming and Scripting
Hi folks,
I have the following program:
#! /bin/ksh
set -xv
export grepDataSource="</data-sources>"
export DB_HOST=tornado
export SCHEMA_NAME=IAS10G
export dataSource=data-sources.xml
sourceString="<data-source class=\"oracle.jdbc.pool.OracleConnectionCacheImpl\" name=\"RiGHTvDS\"... (7 Replies)
Discussion started by: nir_s
7 Replies
Math::BaseCalc(3pm) User Contributed Perl Documentation Math::BaseCalc(3pm)
NAME
Math::BaseCalc - Convert numbers between various bases
VERSION
version 1.016
SYNOPSIS
use Math::BaseCalc;
my $calc = new Math::BaseCalc(digits => [0,1]); #Binary
my $bin_string = $calc->to_base(465); # Convert 465 to binary
$calc->digits('oct'); # Octal
my $number = $calc->from_base('1574'); # Convert octal 1574 to decimal
DESCRIPTION
This module facilitates the conversion of numbers between various number bases. You may define your own digit sets, or use any of several
predefined digit sets.
The to_base() and from_base() methods convert between Perl numbers and strings which represent these numbers in other bases. For instance,
if you're using the binary digit set [0,1], $calc->to_base(5) will return the string "101". $calc->from_base("101") will return the number
5.
To convert between, say, base 7 and base 36, use the 2-step process of first converting to a Perl number, then to the desired base for the
result:
$calc7 = new Math::BaseCalc(digits=>[0..6]);
$calc36 = new Math::BaseCalc(digits=>[0..9,'a'..'z']);
$in_base_36 = $calc36->to_base( $calc7->from_base('3506') );
If you just need to handle regular octal & hexdecimal strings, you probably don't need this module. See the sprintf(), oct(), and hex()
Perl functions.
METHODS
o new Math::BaseCalc
o new Math::BaseCalc(digits=>...)
Create a new base calculator. You may specify the digit set to use, by either giving the digits in a list reference (in increasing
order, with the 'zero' character first in the list) or by specifying the name of one of the predefined digit sets (see the digit()
method below).
If your digit set includes the character "-", then a dash at the beginning of a number will no longer signify a negative number.
o $calc->to_base(NUMBER)
Converts a number to a string representing that number in the associated base.
If "NUMBER" is a "Math::BigInt" object, "to_base()" will still work fine and give you an exact result string.
o $calc->from_base(STRING)
Converts a string representing a number in the associated base to a Perl integer. The behavior when fed strings with characters not in
$calc's digit set is currently undefined.
If "STRING" converts to a number too large for perl's integer representation, beware that the result may be auto-converted to a
floating-point representation and thus only be an approximation.
o $calc->digits
o $calc->digits(...)
Get/set the current digit set of the calculator. With no arguments, simply returns a list of the characters that make up the current
digit set. To change the current digit set, pass a list reference containing the new digits, or the name of a predefined digit set.
Currently the predefined digit sets are:
bin => [0,1],
hex => [0..9,'a'..'f'],
HEX => [0..9,'A'..'F'],
oct => [0..7],
64 => ['A'..'Z','a'..'z',0..9,'+','/'],
62 => [0..9,'a'..'z','A'..'Z'],
Examples:
$calc->digits('bin');
$calc->digits([0..7]);
$calc->digits([qw(w a l d o)]);
If any of your "digits" has more than one character, the behavior is currently undefined.
QUESTIONS
The '64' digit set is meant to be useful for Base64 encoding. I took it from the MIME::Base64.pm module. Does it look right? It's sure
in a strange order.
AUTHOR
Ken Williams, ken@forum.swarthmore.edu
COPYRIGHT
This is free software in the colloquial nice-guy sense of the word. Copyright (c) 1999, Ken Williams. You may redistribute and/or modify
it under the same terms as Perl itself.
SEE ALSO
perl(1).
perl v5.12.3 2011-05-16 Math::BaseCalc(3pm)