User Profile

Collapse

Profile Sidebar

Collapse
jota69
jota69
Last Activity: Mar 23 '10, 06:55 PM
Joined: Mar 15 '10
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • jota69
    replied to How to get the next row id using access
    Reaching, Max value...

    Assuming you have a database with at least one table, and some records.
    Assuming also that the table contains a primary key or id field, and that key value increases automatically.
    If you create a function that has id field records, and checks that this value is not greater than MaxValue.
    If so, a message informs you of the event, otherwise, what you want to do, for example save the new...
    See more | Go to post

    Leave a comment:


  • jota69
    replied to Algorithm to merge ip address
    Continue...

    Work with IP addresses at least in visual basic, is a difficult task, given that there are no types to classify an ip address, since it is not a natural number, either integer or decimal.
    That is why in most cases, you must convert ip address to an integer type Long, to work more comfortably.

    But in other cases, you can work directly with the ip address.
    Let's suppose that the first two lines...
    See more | Go to post

    Leave a comment:


  • jota69
    replied to Algorithm to merge ip address
    Seriously, :)
    Well, it is something like that:

    Code:
    Dim NewRangeList As New SortedList()
    
    If start1<start2
    min=start1
    else: min=start2
    end if
    
    If end1<end2
    max=end2
    else: max=end1
    end if
    
    NewRangeList.add (min,max)
    PrintKeysAndValues(NewRangeList)
    
    End sub
    
    'Getting final txt file, with sorted ranges.
    ...
    See more | Go to post

    Leave a comment:


  • jota69
    replied to Algorithm to merge ip address
    About brackets, You are right.
    I modified the code, but forgot to change it in the post.

    Now I could not find the equivalent of these operators in vb. (?) and (:) and (---)
    Can you help me, with this block of code?

    Code:
    min = (start1 < start2 ? start1 : start2)
    max = (end1 < end2 ? end2 : end1)
    New range: (min --- max)
    I am storing start,end,start 1,end1 values, in SortedList....
    See more | Go to post

    Leave a comment:


  • jota69
    replied to Algorithm to merge ip address
    Another one..

    Code:
    ' do range before ip
    If Not (ip = start) Then
    start1 = start
    ' save this range.
    end1 = System.Math.Max(System.Threading.Interlocked.Decrement(ip),ip + 1)
    End If
    
    'do range after ip
    If Not (ip = [end]) Then
    start2 = System.Math.Max(System.Threading.Interlocked.Increment(ip),ip - 1)
    'save this range too.
    end2 = [end]
    End If
    ...
    See more | Go to post

    Leave a comment:


  • jota69
    replied to Algorithm to merge ip address
    I use Visual basic (vs 2005) and WXP sp3.
    I have no knowledge of c #. I'm trying to adapt your code to mine.

    I must assume that this is correct?
    1st range = Ip range entered by user, (208.77.188.236 - 208.77.188.243)
    2nd range = Ip range in textline
    start1 = userIpStart = 208.77.188.236
    end1= userIpEnd = 208.77.188.243
    start2 = arr
    end2 = arra

    Now, adapting your code to...
    See more | Go to post

    Leave a comment:


  • jota69
    replied to Algorithm to merge ip address
    adding something...

    Since....



    I get octets splitting (as you point below) ip address, entered by user. and same with each file line. (delimited file(-)). e.g.

    208.77.188.166 - 208.77.188.183
    208.77.188.195 - 208.77.188.206
    208.77.188.210 - 208.77.188.255

    Ip to excluded from range, (entered by user) : 208.77.188.236
    Range container: 208.77.188.210 - 208.77.188.255...
    See more | Go to post

    Leave a comment:


  • jota69
    replied to Algorithm to merge ip address
    Explanation:
    There are 10 lists,(lis1.txt , list2.txt, list3.txt and so on.) involved in the process.
    They all contain IP ranges.
    Now you imagine such an application like a firewall, that uses these lists to filter harmful ips for network, and its users.
    Well, Ipfile.txt file is the sum of all these lists.
    Obviously ip ranges have to order, when added to the final file. (Ipfile.txt).

    Example:...
    See more | Go to post

    Leave a comment:


  • jota69
    started a topic Algorithm to merge ip address

    Algorithm to merge ip address

    I am developing application that manage a plain text, containing ip address ranges.
    User will be able to add/delete ip from ranges.

    Example to delete ip:
    Ip entered by user through a text box : 25.2.0.58
    Ip Range container: 25.2.0.10 - 25.255.255.255

    the Algorithm should determine whether there is in text file, a range that may contain the ip entered by the user. If so, remove it from container ip range....
    See more | Go to post
No activity results to display
Show More
Working...