Private Proxies – Buy Cheap Private Elite USA Proxy + 50% Discount!Private Proxies – Buy Cheap Private Elite USA Proxy + 50% Discount!Private Proxies – Buy Cheap Private Elite USA Proxy + 50% Discount!Private Proxies – Buy Cheap Private Elite USA Proxy + 50% Discount!
    0
  •   was successfully added to your cart.
  • Home
  • Buy proxies
  • Extra features
  • Help
  • Contact
  • Login
  • 50% OFF
    BUY NOW!
    50
    PROXIES
    $19
    --------------------
    BUY NOW!
    BUY NOW!
    BUY NOW!
    BUY NOW!
    BUY NOW!
    $29
    $49
    $109
    $179
    $299
    --------------------
    --------------------
    --------------------
    --------------------
    --------------------
    PROXIES
    PROXIES
    PROXIES
    PROXIES
    PROXIES
    100
    200
    500
    1,000
    2,000
    TOP SELLER
    BEST VALUE
    For All Private Proxies!

before I post any code, I should probably explain the weird way we choose who buys stuff for who.

  • my family is made up of three branches
  • no one buys for anyone else in the same branch
  • names are first given to the leader of each branch, and then one is given to each adult (except in branch three). leader keeps remaining names.
  • there is a 10/8/4 split between families, but the names are drawn in a 9/9/4 split. (meaning branch two takes one extra name, and branch one takes one less)
  • the leaders of each branch are not in the drawing

as you can imagine, these rules made everything extremely difficult for me, In fact, I’ve used for different methods so far, and only the last (and messiest) one works completely, so that’s the one I’ll be showing you.

        package com.kestrel.test;  import java.util.ArrayList; import java.util.Random;  public class Main4 {     public static int listLength;     public static int namesUnpicked;     public static int[] branchSize = {9, 9, 4};     public static boolean[] doSubSplit= {true, true, false};     public static Random rand = new Random();     public static FamilyMember member;      public static void main(String[] args)     {         FamilyMember.setup();          listLength = FamilyMember.familyMembers.size();         namesUnpicked = listLength;          ArrayList<ArrayList<String>> pools = new ArrayList<ArrayList<String>>(3);         ArrayList<String> pool1 = new ArrayList<String>();         ArrayList<String> pool2 = new ArrayList<String>();         ArrayList<String> pool3 = new ArrayList<String>();         pools.add(pool1);         pools.add(pool2);         pools.add(pool3);          for(int i = 0; i < listLength; i++)         {             member = FamilyMember.familyMembers.get(i);             for(int ii = 0; ii < branchSize.length; ii++)             {                 if(member.branch != ii + 1)                 {                     pools.get(ii).add(member.name);                 }             }         }          int timeout = 0;         while(namesUnpicked > 0 && timeout < 100)         {             for(int i = 0; i < 3; i++)             {                 if(branchSize[i] > 0)                 {                     int timeout2 = 0;                     while(timeout2 < 15)                     {                         member = FamilyMember.familyMembers.get(rand.nextInt(listLength));                          if(pools.get(i).contains(member.name) && member.drawnBy == 0)                         {                             member.drawnBy = i + 1;                             namesUnpicked--;                             branchSize[i]--;                             timeout = 0;                             break;                         }                         timeout2++;                         timeout++;                     }                 }             }         }          if(branchSize[0] + branchSize[1] + branchSize[2] != 0)         {             System.out.println("failed");             System.exit(0);         }          ArrayList<FamilyMember> children = new ArrayList<FamilyMember>();         ArrayList<FamilyMember> adults = new ArrayList<FamilyMember>();          for(int i = 0; i < 3; i++)         {             for(int ii = 0; ii < listLength; ii++)             {                 member = FamilyMember.familyMembers.get(ii);                 if(member.branch == i + 1 && member.status.equals("adult"))                 {                     adults.add(member);                 }                 else if(member.drawnBy == i + 1 && member.status.equals("child"))                 {                     children.add(member);                 }             }              for(int ii = 0; ii < adults.size(); ii++)             {                 while(true)                 {                     FamilyMember child = children.get(rand.nextInt(children.size()));                      if(child.subDrawnBy == 0)                     {                         FamilyMember.familyMembers.get(child.index).subDrawnBy = adults.get(ii).index;                         break;                     }                 }             }             adults.clear();             children.clear();         }          for(int i = 0; i < listLength; i++)         {             member = FamilyMember.familyMembers.get(i);             if(member.subDrawnBy != 0)             {                 System.out.println(member.name + "  drawn by " +  FamilyMember.familyMembers.get(member.subDrawnBy).name);             }             else             {                 switch(member.drawnBy)                 {                     case 1:                         System.out.println(member.name + "  drawn by Judy");                         break;                     case 2:                         System.out.println(member.name + "  drawn by Barbra");                         break;                     case 3:                         System.out.println(member.name + "  drawn by Jean");                         break;                 }             }         }     } } 

So, as you’ve probably noticed, there’s a pretty good chance it will just fail. (mostly due to the family sizes) I could most likely fix that, but it works about 50% of the time, so its easier to just re-run it. the code runs in the same order as that list I made above the code, so I don’t think I need to explain every single bit of code, but I will mention that the first half uses nested arraylists to create a drawing pool for each branch, containing everyone in the other two branches. the second half however, I wrote on my way home yesterday, and was not very well thought out. I pass FamilyMember objects into two different arrays, and used what I suspect is a terrible way to keep tract of where they were located in the original arraylist (I saved their position to an “index” variable upon creation in FamilyMember.java, see below)

package com.kestrel.test;  import java.util.ArrayList;  public class FamilyMember {     public final String name;     public final int branch;     public final String status;     public int subDrawnBy = 0;     public int drawnBy = 0;     public int index = 0;      public static ArrayList<FamilyMember> familyMembers = new ArrayList<>();      public FamilyMember(String name, int branch, String status)     {         this.name = name;         this.branch = branch;         this.status = status;         this.index = familyMembers.size();         familyMembers.add(this);     }      public static void setup()     {         new FamilyMember("Jeff", 3, "child");         new FamilyMember("Lauren", 3, "child");         new FamilyMember("Julie", 3, "child");         new FamilyMember("David and Deidre", 3, "child");          new FamilyMember("Kim and Lee", 2, "adult");         new FamilyMember("Sam", 2, "child");         new FamilyMember("Jake", 2, "child");         new FamilyMember("Nathan", 2, "child");         new FamilyMember("Mike and Ashley", 2, "adult");         new FamilyMember("Jon and Meredith", 2, "adult");         new FamilyMember("ellie", 2, "child");         new FamilyMember("JD", 2, "child");          new FamilyMember("Jennifer and Wayne", 1, "adult");         new FamilyMember("Jonathon", 1, "child");         new FamilyMember("Bryant", 1, "child");         new FamilyMember("Lindsay", 1, "child");         new FamilyMember("Lisa and Brian", 1, "adult");         new FamilyMember("Pete", 1, "child");         new FamilyMember("Lucas", 1, "child");         new FamilyMember("Cathy and Lee", 1, "adult");         new FamilyMember("Elliott", 1, "child");         new FamilyMember("Russell", 1, "child");     } } 

and… that’s about it. the FamilyMember class isn’t that complicated, its just an arraylist, a constructor, and a method that creates all my family members. the only other thing I can think to mention would be that the reason I started some values at 1 instead of 0 was for readability when I was debugging. sorry for any spelling errors, I’m not a great typist and stuff runs together when I’m reading plain black-on-white text.

✓ Extra quality

ExtraProxies brings the best proxy quality for you with our private and reliable proxies

✓ Extra anonymity

Top level of anonymity and 100% safe proxies – this is what you get with every proxy package

✓ Extra speed

1,ooo mb/s proxy servers speed – we are way better than others – just enjoy our proxies!

50 proxies

$19/month

50% DISCOUNT!
$0.38 per proxy
✓ Private
✓ Elite
✓ Anonymous
Buy now

100 proxies

$29/month

50% DISCOUNT!
$0.29 per proxy
✓ Private
✓ Elite
✓ Anonymous
Buy now

200 proxies

$49/month

50% DISCOUNT!
$0.25 per proxy
✓ Private
✓ Elite
✓ Anonymous
Buy now

500 proxies

$109/month

50% DISCOUNT!
$0.22 per proxy
✓ Private
✓ Elite
✓ Anonymous
Buy now

1,000 proxies

$179/month

50% DISCOUNT!
$0.18 per proxy
✓ Private
✓ Elite
✓ Anonymous
Buy now

2,000 proxies

$299/month

50% DISCOUNT!
$0.15 per proxy
✓ Private
✓ Elite
✓ Anonymous
Buy now

USA proxy location

We offer premium quality USA private proxies – the most essential proxies you can ever want from USA

100% anonymous

Our proxies have TOP level of anonymity + Elite quality, so you are always safe and secure with your proxies

Unlimited bandwidth

Use your proxies as much as you want – we have no limits for data transfer and bandwidth, unlimited usage!

Superfast speed

Superb fast proxy servers with 1,000 mb/s speed – sit back and enjoy your lightning fast private proxies!

99,9% servers uptime

Alive and working proxies all the time – we are taking care of our servers so you can use them without any problems

No usage restrictions

You have freedom to use your proxies with every software, browser or website you want without restrictions

Perfect for SEO

We are 100% friendly with all SEO tasks as well as internet marketing – feel the power with our proxies

Big discounts

Buy more proxies and get better price – we offer various proxy packages with great deals and discounts

Premium support

We are working 24/7 to bring the best proxy experience for you – we are glad to help and assist you!

Satisfaction guarantee

24/7 premium support, free proxy activation and 100% safe payments! Best reliability private proxies for your needs!

Best Proxy Packs

  • 2,000 Private Proxies $600.00 $299.00 / month
  • 1,000 Private Proxies $360.00 $179.00 / month

Quick Links

  • More information
  • Contact us
  • Privacy Policy
  • Terms and Conditions

Like And Follow Us


Copyright ExtraProxies.com | All Rights Reserved.
  • Checkout
  • Contact
  • Help
  • Home
  • My Account
  • My Cart
  • News
  • Privacy Policy
  • Proxy features
  • Proxy packs
  • Terms and Conditions
Private Proxies – Buy Cheap Private Elite USA Proxy + 50% Discount!
    0 items