Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling

Re: Challenge Problem: Merging Network Addresses

by fjonckers (Novice)
on Oct 12, 2001 at 01:39 UTC ( #118355=note: print w/replies, xml ) Need Help??

in reply to Challenge Problem: Merging Network Addresses

maybe you could translate the addresses first to their binary value.. you can then do calculations with them (bitwise) finally translate back to IP's just a thought.. Filip
  • Comment on Re: Challenge Problem: Merging Network Addresses

Replies are listed 'Best First'.
Re: Re: Challenge Problem: Merging Network Addresses
by hatter (Pilgrim) on Oct 12, 2001 at 12:41 UTC
    I'd thought about doing it similarly, but in a bit more detail:

    o Convert the addresses to binary strings, and remove the bits that represent the network (so a /32 becomes a 32 char long string, a /24 24 bits)
    o For each line, see if there is a matching line, except with opposite LSB - if there is, delete them and replace it with a string one digit shorter.
    o Repeat until you run out of matches.

    the hatter

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://118355]
[shmem]: perldigious: as always - if it ain't broke, don't fix it. Ther must be a very compelling reason for changing column names in a database. Those are rare.
[Corion]: If you have whitespace in the column names in the database, whap the DBAs ;)
[shmem]: It's common for some vendors to have column names such as WRSTVG or some other such whizzbang, and another table where these names are mapped to something meaningful depending on how you look at the data
[shmem]: afair in SAP that occurs all the time

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (11)
As of 2017-05-25 13:38 GMT
Find Nodes?
    Voting Booth?