Math problem - converting between arbitrary bases in perl - help!


Hi all - I've been trying to write a small sub to convert form an input base (eg: 16) to an output base (eg:64) and back. The reason is that I need to communicate tristate (base 3) data efficiently via ...
Posted On: Monday 26th of November 2012 08:51:02 PM Total Views:  223
View Complete with Replies

RELATED TOPICS OF Perl PROGRAMMING LANGUAGE




print math symbol into image created with GD

Hy! I am using the GD::Simple libs to draw a simple diagram. My problem is, that I have to put some math symbols in there (for example the symbol for delta and my). Is there an easy way to do that Best regards, Kai
VIEWS ON THIS POST

91

Posted on:

Monday 22nd October 2012
View Replies!

Re: Arbitrary mathematical relations, not just hashes

On Sun, 2008-04-06 at 16:52 -0700, Kelly Jones wrote: > Many programming languages (including Perl, Ruby, and PHP) support hashes: > > $color['apple'] = 'red'; > $color['ruby'] = 'red'; > > $type['apple'] = 'fruit'; > $type['ruby'] = 'gem'; > > This quickly lets me find the color or type of a given item. > > In this sense, color() and type() are like mathematical functions. > > However, I can't easily find all items whose $color is 'red', nor all > items whose $type is 'fruit'. In other words, color() and type() > aren't full mathematical relations. > > Of course, I could create the inverse function as I go along: > > $inverse_color['red'] = ['apple', 'ruby']; # uglyish, assigning list to value > > and there are many other ways to do this, but they all seem kludgey. > > Is there a clean way to add 'relation' support to Perl, Ruby, or PHP Yes, create a class/object to handle the relationship. That way, the details are hidden and may be anything you want. E.g. use Relationship; my $color = new Relatinship; $color->add( 'apple', 'red' ); $color->add( 'ruby', 'red' ); my $type = new Relationship; $type->add( 'apple', 'fruit' ); $type->add( 'ruby', 'gem' ); my @red_things = $color->find( undef, 'red' ); -- Just my 0.00000002 million dollars worth, Shawn 99% of you are just big dumb apes! +------------\ | Shangri La \ | 40,000 KM / +------------/
VIEWS ON THIS POST

74

Posted on:

Wednesday 7th November 2012
View Replies!

Re: [PHP] Arbitrary mathematical relations, not just hashes

On Sun, Apr 06, 2008 at 08:51:00PM -0700, Casey wrote: > I hit reply-all... now am I suddenly subscribed to Perl and Ruby lists!! Be careful. Next time you do it you'll be subscribed to Haskell, OCaml and Smalltalk lists. Bwahahaha! -- Paul Johnson - paul@pjcj.net http://www.pjcj.net
VIEWS ON THIS POST

73

Posted on:

Wednesday 7th November 2012
View Replies!

math error

The code: $weight = 5.03; my $gross = int($weight); my $frac = $weight - $gross; print "$frac\n"; Should print the decimal part of .03, but gives this instead: 0.0300000000000002 What am I doing wrong Marshall...
VIEWS ON THIS POST

71

Posted on:

Thursday 15th November 2012
View Replies!

Re: Arbitrary mathematical relations, not just hashes

From: "Kelly Jones" > Many programming languages (including Perl, Ruby, and PHP) support hashes: > > $color['apple'] = 'red'; > $color['ruby'] = 'red'; > > $type['apple'] = 'fruit'; > $type['ruby'] = 'gem'; > > This quickly lets me find ...
VIEWS ON THIS POST

78

Posted on:

Sunday 25th November 2012
View Replies!

More math than perl...

Background: I have a routine I am writing in perl that will give me the median for a 0 to 5 rating. The ratings are stored in a file and I load the values into 7 different variables, RATE0 - ...
VIEWS ON THIS POST

61

Posted on:

Monday 26th November 2012
View Replies!

Re: https / proxy problem (LWP::UserAgent)

"Larry" said: >I have a script on Windows which uses LWP to make a simple GET request >through a proxy: > > #!/usr/bin/perl > > use strict; > use warnings; > use LWP::UserAgent; > > my $url = "https://mysite.com"; ...
VIEWS ON THIS POST

65

Posted on:

Monday 26th November 2012
View Replies!

problem in moving bunch of lines

I have a task in which i have many lines connected between ovals , in a fashion that many lines are branching out from a single oval and these lines terminate at different ovals . I have tagged the lives ...
VIEWS ON THIS POST

58

Posted on:

Monday 26th November 2012
View Replies!

RE: pTk Scrolled Text problem

> Sorry, same problem with Tcl::Tk 0.88 + Tcl 0.88 on a FreeBSD/XFre86 > system. I think that the length of the inserted text is crucial for > the problem to appear. So if your're on a Windows system, you ...
VIEWS ON THIS POST

60

Posted on:

Monday 26th November 2012
View Replies!

ChartDirector [problem]

all I'm currently developping a cgi script which use ChartDirector, and I have a HUGE problem with drawing... Diagram displays correctly, but bars doesn't stop, and continue til the top of the image zone. Here is following my code: ...
VIEWS ON THIS POST

159

Posted on:

Monday 26th November 2012
View Replies!

DB_File problem

I am working on a script to base64 encode a file and then scramble the lines but also keep track of the order in which these lines were scrambled. Anyway, the problem occurs when I untie and undef all references ...
VIEWS ON THIS POST

182

Posted on:

Monday 26th November 2012
View Replies!

problems with installation of XML::LibXML

When trying to install XML::LibXML, I get the following error: perl-libxml-mm.c: In function `nodeC2Sv': perl-libxml-mm.c:968: parse error before `*' perl-libxml-mm.c:972: `decoded' undeclared (first use in this function) perl-libxml-mm.c:972: (Each undeclared identifier is reported only once perl-libxml-mm.c:972: for each function ...
VIEWS ON THIS POST

146

Posted on:

Monday 26th November 2012
View Replies!

Win32::Api module problem.

, i got problem with Win32:API module. I have instaled ActivePerl on windows 95 (i must use this one ;/ ) after this i have downloded binary package Win32-Api, and ppm install Win32-API.ppd. But when i try to run my ...
VIEWS ON THIS POST

230

Posted on:

Monday 26th November 2012
View Replies!

progressbar and deep recursion problem

I was toying around with making a progressbar gui for the rsync utility. I'm running into some bizarre behavior with the progressbar. Can anyone explain this There are 2 scripts below, which just copy from one local directory to ...
VIEWS ON THIS POST

126

Posted on:

Monday 26th November 2012
View Replies!

XML::Parser::Expat install problem

Hi I am trying to install this module. I have installed XML-Parser-2.34 and this seems to be ok. It is supposed to install XML::Expat with it. On my system it seems to have partly installed XML:;Expat. I have: Expat::Expat.so Expat.Expat.bs ...
VIEWS ON THIS POST

115

Posted on:

Monday 26th November 2012
View Replies!

Tk/MainWindow.pm display problem

I'm getting this error when I try to start my application. The application works fine on other boxes but not here. Any help would be appreciated. "couldn't connect to display 'localhost:10:0' at /usr/lib/perl5/5.6.1/Tk/MainWindow.pm line 55" Also note that this isn't ...
VIEWS ON THIS POST

179

Posted on:

Monday 26th November 2012
View Replies!

Installation problem

, when installing the followin modulue from CPAN under MDK Linux I receive the error message (in the end of STDERR output) which I don't understand. Can you tell me what's wrong there Shall I follow the message and install ...
VIEWS ON THIS POST

116

Posted on:

Monday 26th November 2012
View Replies!

Win32MemMap problem

Hi I am trying to use Tie::Win32MemMap as shown in O'Reilly "Mastering Perl/Tk". I need the two processes to share some variables, bidirectionaly. So I generate two MemMap, one "owned" by the parent and one in the child process. For ...
VIEWS ON THIS POST

132

Posted on:

Monday 26th November 2012
View Replies!

Optimization problem, for a sports tournament

Hi all! I am working on a Perl program for managing a (real-life) sports tournament. There are 10 teams involved, which all are to play against every other team exactly once. Thus, each team plays a total of 9 matches. ...
VIEWS ON THIS POST

130

Posted on:

Monday 26th November 2012
View Replies!

Help! W32ODBC problem with network database access

I am new to Perl/cgi-bin. My web page access Access DB using W32ODBC in Perl. The datasource is specified as system DSN. When the database is stored locally, it works fine. When the database is stored in a network ...
VIEWS ON THIS POST

151

Posted on:

Monday 26th November 2012
View Replies!