RE: sorting by IP addresses...
you could convert it back to an int, but then every ip starting 128 or above would display before those >= 127 (negative) so Id think char(32) would be best - and store the actual binary string. -Original Message- From: Paris Lundis [mailto:[EMAIL PROTECTED]] Sent: 07 June 2001 16:32 To: CF-Talk Subject: RE: sorting by IP addresses... Wow... now that looks so simple... Thanks a bunch Marlon Will get that implemented tonight Now what would the most efficient way be to store that value in an ACCESS database? Love this list... -paris [finding the future in the past, passing the future in the present] [connecting people, places and things] -Original Message- From: Marlon Moyer <[EMAIL PROTECTED]> Date: Thu, 07 Jun 2001 09:24:31 -0500 Subject: RE: sorting by IP addresses... > > > > >numberFormat(formatBaseN(byte,2),"")> > > > > -Original Message- > From: Paris Lundis [mailto:[EMAIL PROTECTED]] > Sent: Thursday, June 07, 2001 8:41 AM > To: CF-Talk > Subject: Re: sorting by IP addresses... > > > Thanks Hank... > > the conversion for the 32bit binary would seem best... > > So has anyone wrote a function/Cf code to convert IPs to their binary > representations? > > Had seen it done elsewhere in this manner and trust the designer... > > -paris > [finding the future in the past, passing the future in the present] > [connecting people, places and things] > > > -Original Message----- > From: "Hanz Zarcovic" <[EMAIL PROTECTED]> > Date: Thu, 07 Jun 2001 09:20:48 -0400 > Subject: Re: sorting by IP addresses... > > > Paris, > > > > I imagine if you are writing some log analyzing software that you > are > > dumping the logs into a database for easier analysis ? > > If you are dumping them into a database then you should just do > some > > simple > > string parsing to break the IP address up into 4 "tiny int" fields > in > > this > > way you'll be able to do any sort of funky processing you want to > > them. > > > > Or to get really freaky why not process them back into their 32 bit > > binary > > representations > > > > If you want some SQL ideas just let me know. > > > > -eric > > > > - Original Message - > > From: "Paris Lundis" <[EMAIL PROTECTED]> > > To: "CF-Talk" <[EMAIL PROTECTED]> > > Sent: Thursday, June 07, 2001 2:35 AM > > Subject: sorting by IP addresses... > > > > > > > So I am writing some log reporting for my enjoyment... well to > make > > > things a little easier to quantify... > > > > > > one thing I want to be ablt to do is ORDER queries by the value > > stored > > > of the viewers IP ADDRESS... > > > > > > It doesn't work without some modification of the IP address... > > anyone > > > worked on anything to do this right... > > > > > > for instance I get this in order: > > > > > > 216.56.6.245 > > > 216.66.132.134 > > > 24.16.140.8 > > > 24.165.85.118 > > > 24.178.211.39 > > > > > > not exactly right :) > > > > > > ideas please... > > > > > > -paris > > > [finding the future in the past, passing the future in the > present] > > > [connecting people, places and things] > > > > > > > > > > > > > > > ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: sorting by IP addresses...
Wow... now that looks so simple... Thanks a bunch Marlon Will get that implemented tonight Now what would the most efficient way be to store that value in an ACCESS database? Love this list... -paris [finding the future in the past, passing the future in the present] [connecting people, places and things] -Original Message- From: Marlon Moyer <[EMAIL PROTECTED]> Date: Thu, 07 Jun 2001 09:24:31 -0500 Subject: RE: sorting by IP addresses... > > > > >numberFormat(formatBaseN(byte,2),"")> > > > > -Original Message- > From: Paris Lundis [mailto:[EMAIL PROTECTED]] > Sent: Thursday, June 07, 2001 8:41 AM > To: CF-Talk > Subject: Re: sorting by IP addresses... > > > Thanks Hank... > > the conversion for the 32bit binary would seem best... > > So has anyone wrote a function/Cf code to convert IPs to their binary > representations? > > Had seen it done elsewhere in this manner and trust the designer... > > -paris > [finding the future in the past, passing the future in the present] > [connecting people, places and things] > > > -Original Message----- > From: "Hanz Zarcovic" <[EMAIL PROTECTED]> > Date: Thu, 07 Jun 2001 09:20:48 -0400 > Subject: Re: sorting by IP addresses... > > > Paris, > > > > I imagine if you are writing some log analyzing software that you > are > > dumping the logs into a database for easier analysis ? > > If you are dumping them into a database then you should just do > some > > simple > > string parsing to break the IP address up into 4 "tiny int" fields > in > > this > > way you'll be able to do any sort of funky processing you want to > > them. > > > > Or to get really freaky why not process them back into their 32 bit > > binary > > representations > > > > If you want some SQL ideas just let me know. > > > > -eric > > > > - Original Message - > > From: "Paris Lundis" <[EMAIL PROTECTED]> > > To: "CF-Talk" <[EMAIL PROTECTED]> > > Sent: Thursday, June 07, 2001 2:35 AM > > Subject: sorting by IP addresses... > > > > > > > So I am writing some log reporting for my enjoyment... well to > make > > > things a little easier to quantify... > > > > > > one thing I want to be ablt to do is ORDER queries by the value > > stored > > > of the viewers IP ADDRESS... > > > > > > It doesn't work without some modification of the IP address... > > anyone > > > worked on anything to do this right... > > > > > > for instance I get this in order: > > > > > > 216.56.6.245 > > > 216.66.132.134 > > > 24.16.140.8 > > > 24.165.85.118 > > > 24.178.211.39 > > > > > > not exactly right :) > > > > > > ideas please... > > > > > > -paris > > > [finding the future in the past, passing the future in the > present] > > > [connecting people, places and things] > > > > > > > > > > > > > > > ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: sorting by IP addresses...
As far as converting an IP to binary in CFML... Wouldn't be hard to do BitMaskRead. Loop over the address as if it's a list with a period delimiter. Read the bit mask with a length of 8, and smash them all together. I don't see why it wouldn't work, but I haven't tried it :) I don't know how you could tell SQL to do this though. Perhaps there's a conversion function on the DB? Norman -Original Message- From: Paris Lundis [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 07, 2001 9:41 AM To: CF-Talk Subject: Re: sorting by IP addresses... Thanks Hank... the conversion for the 32bit binary would seem best... So has anyone wrote a function/Cf code to convert IPs to their binary representations? Had seen it done elsewhere in this manner and trust the designer... -paris [finding the future in the past, passing the future in the present] [connecting people, places and things] -Original Message- From: "Hanz Zarcovic" <[EMAIL PROTECTED]> Date: Thu, 07 Jun 2001 09:20:48 -0400 Subject: Re: sorting by IP addresses... > Paris, > > I imagine if you are writing some log analyzing software that you are > dumping the logs into a database for easier analysis ? > If you are dumping them into a database then you should just do some > simple > string parsing to break the IP address up into 4 "tiny int" fields in > this > way you'll be able to do any sort of funky processing you want to > them. > > Or to get really freaky why not process them back into their 32 bit > binary > representations > > If you want some SQL ideas just let me know. > > -eric > > - Original Message - > From: "Paris Lundis" <[EMAIL PROTECTED]> > To: "CF-Talk" <[EMAIL PROTECTED]> > Sent: Thursday, June 07, 2001 2:35 AM > Subject: sorting by IP addresses... > > > > So I am writing some log reporting for my enjoyment... well to make > > things a little easier to quantify... > > > > one thing I want to be ablt to do is ORDER queries by the value > stored > > of the viewers IP ADDRESS... > > > > It doesn't work without some modification of the IP address... > anyone > > worked on anything to do this right... > > > > for instance I get this in order: > > > > 216.56.6.245 > > 216.66.132.134 > > 24.16.140.8 > > 24.165.85.118 > > 24.178.211.39 > > > > not exactly right :) > > > > ideas please... > > > > -paris > > [finding the future in the past, passing the future in the present] > > [connecting people, places and things] > > > > > > > > > ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: sorting by IP addresses...
-Original Message- From: Paris Lundis [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 07, 2001 8:41 AM To: CF-Talk Subject: Re: sorting by IP addresses... Thanks Hank... the conversion for the 32bit binary would seem best... So has anyone wrote a function/Cf code to convert IPs to their binary representations? Had seen it done elsewhere in this manner and trust the designer... -paris [finding the future in the past, passing the future in the present] [connecting people, places and things] -Original Message- From: "Hanz Zarcovic" <[EMAIL PROTECTED]> Date: Thu, 07 Jun 2001 09:20:48 -0400 Subject: Re: sorting by IP addresses... > Paris, > > I imagine if you are writing some log analyzing software that you are > dumping the logs into a database for easier analysis ? > If you are dumping them into a database then you should just do some > simple > string parsing to break the IP address up into 4 "tiny int" fields in > this > way you'll be able to do any sort of funky processing you want to > them. > > Or to get really freaky why not process them back into their 32 bit > binary > representations > > If you want some SQL ideas just let me know. > > -eric > > - Original Message - > From: "Paris Lundis" <[EMAIL PROTECTED]> > To: "CF-Talk" <[EMAIL PROTECTED]> > Sent: Thursday, June 07, 2001 2:35 AM > Subject: sorting by IP addresses... > > > > So I am writing some log reporting for my enjoyment... well to make > > things a little easier to quantify... > > > > one thing I want to be ablt to do is ORDER queries by the value > stored > > of the viewers IP ADDRESS... > > > > It doesn't work without some modification of the IP address... > anyone > > worked on anything to do this right... > > > > for instance I get this in order: > > > > 216.56.6.245 > > 216.66.132.134 > > 24.16.140.8 > > 24.165.85.118 > > 24.178.211.39 > > > > not exactly right :) > > > > ideas please... > > > > -paris > > [finding the future in the past, passing the future in the present] > > [connecting people, places and things] > > > > > > > > > ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: sorting by IP addresses...
Thanks Hank... the conversion for the 32bit binary would seem best... So has anyone wrote a function/Cf code to convert IPs to their binary representations? Had seen it done elsewhere in this manner and trust the designer... -paris [finding the future in the past, passing the future in the present] [connecting people, places and things] -Original Message- From: "Hanz Zarcovic" <[EMAIL PROTECTED]> Date: Thu, 07 Jun 2001 09:20:48 -0400 Subject: Re: sorting by IP addresses... > Paris, > > I imagine if you are writing some log analyzing software that you are > dumping the logs into a database for easier analysis ? > If you are dumping them into a database then you should just do some > simple > string parsing to break the IP address up into 4 "tiny int" fields in > this > way you'll be able to do any sort of funky processing you want to > them. > > Or to get really freaky why not process them back into their 32 bit > binary > representations > > If you want some SQL ideas just let me know. > > -eric > > - Original Message - > From: "Paris Lundis" <[EMAIL PROTECTED]> > To: "CF-Talk" <[EMAIL PROTECTED]> > Sent: Thursday, June 07, 2001 2:35 AM > Subject: sorting by IP addresses... > > > > So I am writing some log reporting for my enjoyment... well to make > > things a little easier to quantify... > > > > one thing I want to be ablt to do is ORDER queries by the value > stored > > of the viewers IP ADDRESS... > > > > It doesn't work without some modification of the IP address... > anyone > > worked on anything to do this right... > > > > for instance I get this in order: > > > > 216.56.6.245 > > 216.66.132.134 > > 24.16.140.8 > > 24.165.85.118 > > 24.178.211.39 > > > > not exactly right :) > > > > ideas please... > > > > -paris > > [finding the future in the past, passing the future in the present] > > [connecting people, places and things] > > > > > > > > > ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: sorting by IP addresses...
Paris, I imagine if you are writing some log analyzing software that you are dumping the logs into a database for easier analysis ? If you are dumping them into a database then you should just do some simple string parsing to break the IP address up into 4 "tiny int" fields in this way you'll be able to do any sort of funky processing you want to them. Or to get really freaky why not process them back into their 32 bit binary representations If you want some SQL ideas just let me know. -eric - Original Message - From: "Paris Lundis" <[EMAIL PROTECTED]> To: "CF-Talk" <[EMAIL PROTECTED]> Sent: Thursday, June 07, 2001 2:35 AM Subject: sorting by IP addresses... > So I am writing some log reporting for my enjoyment... well to make > things a little easier to quantify... > > one thing I want to be ablt to do is ORDER queries by the value stored > of the viewers IP ADDRESS... > > It doesn't work without some modification of the IP address... anyone > worked on anything to do this right... > > for instance I get this in order: > > 216.56.6.245 > 216.66.132.134 > 24.16.140.8 > 24.165.85.118 > 24.178.211.39 > > not exactly right :) > > ideas please... > > -paris > [finding the future in the past, passing the future in the present] > [connecting people, places and things] > > > > ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: sorting by IP addresses...
I had the exact same problem. I don't know if it's an option for you, but I ended up storing the four octets seperately. Then simply doing a sort on "IPOctet1, IPOctet2, IPOctet3, IPOctet4". Norman -Original Message- From: Paris Lundis [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 07, 2001 2:36 AM To: CF-Talk Subject: sorting by IP addresses... So I am writing some log reporting for my enjoyment... well to make things a little easier to quantify... one thing I want to be ablt to do is ORDER queries by the value stored of the viewers IP ADDRESS... It doesn't work without some modification of the IP address... anyone worked on anything to do this right... for instance I get this in order: 216.56.6.245 216.66.132.134 24.16.140.8 24.165.85.118 24.178.211.39 not exactly right :) ideas please... -paris [finding the future in the past, passing the future in the present] [connecting people, places and things] ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: sorting by IP addresses...
Try running this code from CF (obviously): ---code--- #ListGetAt(iplist, i)# : #ListGetAt(newiplist, i)# #j# ---code--- Enjoy! Paul -Original Message- From: Paris Lundis <[EMAIL PROTECTED]> To: CF-Talk <[EMAIL PROTECTED]> Date: 07 June 2001 07:53 Subject: sorting by IP addresses... >So I am writing some log reporting for my enjoyment... well to make >things a little easier to quantify... > >one thing I want to be ablt to do is ORDER queries by the value stored >of the viewers IP ADDRESS... > >It doesn't work without some modification of the IP address... anyone >worked on anything to do this right... > >for instance I get this in order: > >216.56.6.245 >216.66.132.134 >24.16.140.8 >24.165.85.118 >24.178.211.39 > >not exactly right :) > >ideas please... > >-paris >[finding the future in the past, passing the future in the present] >[connecting people, places and things] > > > > ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: sorting by IP addresses...
wouldn't sorting them using the bitwise functions make more sense on this one? They are binary after all. Paul PS Otherwise, just recreate the ip address with leading zeros, then sort them as text and it may well sort out the problem e.g.: 216.56.6.245-> 216.056.006.245 216.66.132.134 -> 216.066.132.134 24.16.140.8 -> 024.016.140.008 24.165.85.118 -> 024.165.85.118 24.178.211.39 -> 024.178.211.039 -Original Message- From: Paris Lundis <[EMAIL PROTECTED]> To: CF-Talk <[EMAIL PROTECTED]> Date: 07 June 2001 07:53 Subject: sorting by IP addresses... >So I am writing some log reporting for my enjoyment... well to make >things a little easier to quantify... > >one thing I want to be ablt to do is ORDER queries by the value stored >of the viewers IP ADDRESS... > >It doesn't work without some modification of the IP address... anyone >worked on anything to do this right... > >for instance I get this in order: > >216.56.6.245 >216.66.132.134 >24.16.140.8 >24.165.85.118 >24.178.211.39 > >not exactly right :) > >ideas please... > >-paris >[finding the future in the past, passing the future in the present] >[connecting people, places and things] > > > > ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
sorting by IP addresses...
So I am writing some log reporting for my enjoyment... well to make things a little easier to quantify... one thing I want to be ablt to do is ORDER queries by the value stored of the viewers IP ADDRESS... It doesn't work without some modification of the IP address... anyone worked on anything to do this right... for instance I get this in order: 216.56.6.245 216.66.132.134 24.16.140.8 24.165.85.118 24.178.211.39 not exactly right :) ideas please... -paris [finding the future in the past, passing the future in the present] [connecting people, places and things] ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists