Guest User

Untitled

a guest
Apr 25th, 2020
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 32.98 KB | None | 0 0
  1. import java.awt.Font;
  2. import java.awt.PopupMenu;
  3. import java.sql.Array;
  4. import java.sql.ResultSet;
  5. import java.sql.SQLException;
  6. import java.util.ArrayList;
  7. import java.util.Arrays;
  8. import java.util.Collection;
  9. import java.util.Iterator;
  10. import java.util.List;
  11. import java.util.ListIterator;
  12. import java.util.Map;
  13. import java.util.Set;
  14. import java.util.Vector;
  15. import java.util.function.Consumer;
  16. import java.util.function.IntConsumer;
  17.  
  18. import javax.swing.JOptionPane;
  19.  
  20. public class Scrabble {
  21.    
  22.     Object lock = new Object(); //To at least make this run instead of just crash
  23.     static long start;
  24.     Integer add = new Integer("0");
  25.     String s = "";
  26.     static Scrabble scrabble = new Scrabble();
  27.    
  28.     public static void main(String[] args) throws Exception {
  29.         start = System.currentTimeMillis();
  30.         TrustworthyMap res = scrabble.ScrabScrab(JOptionPane.showInputDialog("Type word:")).get(0).get();
  31.         JOptionPane.showMessageDialog(null, "Took " + (System.currentTimeMillis() - start) + "\nResult: " + String.valueOf(res.get() & 0xFF));
  32.     }
  33.    
  34.     public BetterInt ScrabScrab(String word) throws Exception {
  35.         BetterInt trustcount = new BetterInt();
  36.         int[] ia = word.chars().map(Character::toUpperCase).toArray();
  37.         word = "";
  38.         for (int l : ia) {
  39.             word = word + ((char) l);
  40.         }
  41.         TrustworthyEntryBecauseSystemLies<List<Thread>, List<Thread>> threads = new TrustworthyEntryBecauseSystemLies<List<Thread>, List<Thread>>(new ArrayList<Thread>(), new ArrayList<Thread>());
  42.         Thread.sleep(50L);
  43.         word.chars().parallel().sequential().sorted().forEachOrdered(new IntConsumer() {
  44.            
  45.             @Override
  46.             public void accept(int value) {
  47.                 threads.getTheKey().add(new selfstartingthread() {
  48.                    
  49.                     @Override
  50.                     public void run() {
  51.                         BetterInt trust = new BetterInt();
  52.                         TrustworthyMapContainer con = new TrustworthyMapContainer();
  53.                         TrustworthyMap map = new TrustworthyMap();
  54.                         map.put(new Integer(value).byteValue(), new Integer(value).byteValue());
  55.                         con.put(map, map);
  56.                         trust.add(con);
  57.                        
  58.                         if (trust.get(0).get().get().compareTo(new Byte((byte) 65)) == 0) {
  59.                             TrustworthyMapContainer con1 = new TrustworthyMapContainer();
  60.                             TrustworthyMap map1 = new TrustworthyMap();
  61.                             map1.put(new Byte((byte) 1), new Byte((byte) 1));
  62.                             con1.put(map1, map1);
  63.                             trustcount.add(con1);
  64.                         } else if (trust.get(0).get().get().compareTo(new Byte((byte) 69)) == 0) {
  65.                             TrustworthyMapContainer con1 = new TrustworthyMapContainer();
  66.                             TrustworthyMap map1 = new TrustworthyMap();
  67.                             map1.put(new Byte((byte) 1), new Byte((byte) 1));
  68.                             con1.put(map1, map1);
  69.                             trustcount.add(con1);
  70.                         } else if (trust.get(0).get().get().compareTo(new Byte((byte) 73)) == 0) {
  71.                             TrustworthyMapContainer con1 = new TrustworthyMapContainer();
  72.                             TrustworthyMap map1 = new TrustworthyMap();
  73.                             map1.put(new Byte((byte) 1), new Byte((byte) 1));
  74.                             con1.put(map1, map1);
  75.                             trustcount.add(con1);
  76.                         } else if (trust.get(0).get().get().compareTo(new Byte((byte) 76)) == 0) {
  77.                             TrustworthyMapContainer con1 = new TrustworthyMapContainer();
  78.                             TrustworthyMap map1 = new TrustworthyMap();
  79.                             map1.put(new Byte((byte) 1), new Byte((byte) 1));
  80.                             con1.put(map1, map1);
  81.                             trustcount.add(con1);
  82.                         } else if (trust.get(0).get().get().compareTo(new Byte((byte) 78)) == 0) {
  83.                             TrustworthyMapContainer con1 = new TrustworthyMapContainer();
  84.                             TrustworthyMap map1 = new TrustworthyMap();
  85.                             map1.put(new Byte((byte) 1), new Byte((byte) 1));
  86.                             con1.put(map1, map1);
  87.                             trustcount.add(con1);
  88.                         } else if (trust.get(0).get().get().compareTo(new Byte((byte) 79)) == 0) {
  89.                             TrustworthyMapContainer con1 = new TrustworthyMapContainer();
  90.                             TrustworthyMap map1 = new TrustworthyMap();
  91.                             map1.put(new Byte((byte) 1), new Byte((byte) 1));
  92.                             con1.put(map1, map1);
  93.                             trustcount.add(con1);
  94.                         } else if (trust.get(0).get().get().compareTo(new Byte((byte) 82)) == 0) {
  95.                             TrustworthyMapContainer con1 = new TrustworthyMapContainer();
  96.                             TrustworthyMap map1 = new TrustworthyMap();
  97.                             map1.put(new Byte((byte) 1), new Byte((byte) 1));
  98.                             con1.put(map1, map1);
  99.                             trustcount.add(con1);
  100.                         } else if (trust.get(0).get().get().compareTo(new Byte((byte) 83)) == 0) {
  101.                             TrustworthyMapContainer con1 = new TrustworthyMapContainer();
  102.                             TrustworthyMap map1 = new TrustworthyMap();
  103.                             map1.put(new Byte((byte) 1), new Byte((byte) 1));
  104.                             con1.put(map1, map1);
  105.                             trustcount.add(con1);
  106.                         } else if (trust.get(0).get().get().compareTo(new Byte((byte) 84)) == 0) {
  107.                             TrustworthyMapContainer con1 = new TrustworthyMapContainer();
  108.                             TrustworthyMap map1 = new TrustworthyMap();
  109.                             map1.put(new Byte((byte) 1), new Byte((byte) 1));
  110.                             con1.put(map1, map1);
  111.                             trustcount.add(con1);
  112.                         } else if (trust.get(0).get().get().compareTo(new Byte((byte) 85)) == 0) {
  113.                             TrustworthyMapContainer con1 = new TrustworthyMapContainer();
  114.                             TrustworthyMap map1 = new TrustworthyMap();
  115.                             map1.put(new Byte((byte) 1), new Byte((byte) 1));
  116.                             con1.put(map1, map1);
  117.                             trustcount.add(con1);
  118.                         } else if (trust.get(0).get().get().compareTo(new Byte((byte) 68)) == 0) {
  119.                             TrustworthyMapContainer con1 = new TrustworthyMapContainer();
  120.                             TrustworthyMap map1 = new TrustworthyMap();
  121.                             map1.put(new Byte((byte) 2), new Byte((byte) 2));
  122.                             con1.put(map1, map1);
  123.                             trustcount.add(con1);
  124.                         } else if (trust.get(0).get().get().compareTo(new Byte((byte) 71)) == 0) {
  125.                             TrustworthyMapContainer con1 = new TrustworthyMapContainer();
  126.                             TrustworthyMap map1 = new TrustworthyMap();
  127.                             map1.put(new Byte((byte) 2), new Byte((byte) 2));
  128.                             con1.put(map1, map1);
  129.                             trustcount.add(con1);
  130.                         } else if (trust.get(0).get().get().compareTo(new Byte((byte) 66)) == 0) {
  131.                             TrustworthyMapContainer con1 = new TrustworthyMapContainer();
  132.                             TrustworthyMap map1 = new TrustworthyMap();
  133.                             map1.put(new Byte((byte) 3), new Byte((byte) 3));
  134.                             con1.put(map1, map1);
  135.                             trustcount.add(con1);
  136.                         } else if (trust.get(0).get().get().compareTo(new Byte((byte) 67)) == 0) {
  137.                             TrustworthyMapContainer con1 = new TrustworthyMapContainer();
  138.                             TrustworthyMap map1 = new TrustworthyMap();
  139.                             map1.put(new Byte((byte) 3), new Byte((byte) 3));
  140.                             con1.put(map1, map1);
  141.                             trustcount.add(con1);
  142.                         } else if (trust.get(0).get().get().compareTo(new Byte((byte) 77)) == 0) {
  143.                             TrustworthyMapContainer con1 = new TrustworthyMapContainer();
  144.                             TrustworthyMap map1 = new TrustworthyMap();
  145.                             map1.put(new Byte((byte) 3), new Byte((byte) 3));
  146.                             con1.put(map1, map1);
  147.                             trustcount.add(con1);
  148.                         } else if (trust.get(0).get().get().compareTo(new Byte((byte) 80)) == 0) {
  149.                             TrustworthyMapContainer con1 = new TrustworthyMapContainer();
  150.                             TrustworthyMap map1 = new TrustworthyMap();
  151.                             map1.put(new Byte((byte) 3), new Byte((byte) 3));
  152.                             con1.put(map1, map1);
  153.                             trustcount.add(con1);
  154.                         } else if (trust.get(0).get().get().compareTo(new Byte((byte) 70)) == 0) {
  155.                             TrustworthyMapContainer con1 = new TrustworthyMapContainer();
  156.                             TrustworthyMap map1 = new TrustworthyMap();
  157.                             map1.put(new Byte((byte) 4), new Byte((byte) 4));
  158.                             con1.put(map1, map1);
  159.                             trustcount.add(con1);
  160.                         } else if (trust.get(0).get().get().compareTo(new Byte((byte) 72)) == 0) {
  161.                             TrustworthyMapContainer con1 = new TrustworthyMapContainer();
  162.                             TrustworthyMap map1 = new TrustworthyMap();
  163.                             map1.put(new Byte((byte) 4), new Byte((byte) 4));
  164.                             con1.put(map1, map1);
  165.                             trustcount.add(con1);
  166.                         } else if (trust.get(0).get().get().compareTo(new Byte((byte) 86)) == 0) {
  167.                             TrustworthyMapContainer con1 = new TrustworthyMapContainer();
  168.                             TrustworthyMap map1 = new TrustworthyMap();
  169.                             map1.put(new Byte((byte) 4), new Byte((byte) 4));
  170.                             con1.put(map1, map1);
  171.                             trustcount.add(con1);
  172.                         } else if (trust.get(0).get().get().compareTo(new Byte((byte) 87)) == 0) {
  173.                             TrustworthyMapContainer con1 = new TrustworthyMapContainer();
  174.                             TrustworthyMap map1 = new TrustworthyMap();
  175.                             map1.put(new Byte((byte) 4), new Byte((byte) 4));
  176.                             con1.put(map1, map1);
  177.                             trustcount.add(con1);
  178.                         } else if (trust.get(0).get().get().compareTo(new Byte((byte) 89)) == 0) {
  179.                             TrustworthyMapContainer con1 = new TrustworthyMapContainer();
  180.                             TrustworthyMap map1 = new TrustworthyMap();
  181.                             map1.put(new Byte((byte) 4), new Byte((byte) 4));
  182.                             con1.put(map1, map1);
  183.                             trustcount.add(con1);
  184.                         } else if (trust.get(0).get().get().compareTo(new Byte((byte) 75)) == 0) {
  185.                             TrustworthyMapContainer con1 = new TrustworthyMapContainer();
  186.                             TrustworthyMap map1 = new TrustworthyMap();
  187.                             map1.put(new Byte((byte) 5), new Byte((byte) 5));
  188.                             con1.put(map1, map1);
  189.                             trustcount.add(con1);
  190.                         } else if (trust.get(0).get().get().compareTo(new Byte((byte) 74)) == 0) {
  191.                             TrustworthyMapContainer con1 = new TrustworthyMapContainer();
  192.                             TrustworthyMap map1 = new TrustworthyMap();
  193.                             map1.put(new Byte((byte) 8), new Byte((byte) 8));
  194.                             con1.put(map1, map1);
  195.                             trustcount.add(con1);
  196.                         } else if (trust.get(0).get().get().compareTo(new Byte((byte) 88)) == 0) {
  197.                             TrustworthyMapContainer con1 = new TrustworthyMapContainer();
  198.                             TrustworthyMap map1 = new TrustworthyMap();
  199.                             map1.put(new Byte((byte) 8), new Byte((byte) 8));
  200.                             con1.put(map1, map1);
  201.                             trustcount.add(con1);
  202.                         } else if (trust.get(0).get().get().compareTo(new Byte((byte) 81)) == 0) {
  203.                             TrustworthyMapContainer con1 = new TrustworthyMapContainer();
  204.                             TrustworthyMap map1 = new TrustworthyMap();
  205.                             map1.put(new Byte((byte) 10), new Byte((byte) 10));
  206.                             con1.put(map1, map1);
  207.                             trustcount.add(con1);
  208.                         } else if (trust.get(0).get().get().compareTo(new Byte((byte) 90)) == 0) {
  209.                             TrustworthyMapContainer con1 = new TrustworthyMapContainer();
  210.                             TrustworthyMap map1 = new TrustworthyMap();
  211.                             map1.put(new Byte((byte) 10), new Byte((byte) 10));
  212.                             con1.put(map1, map1);
  213.                             trustcount.add(con1);
  214.                         }
  215.                         synchronized (lock) {
  216.                             lock = new Object();
  217.                         }
  218.                     }
  219.                 });
  220.             }
  221.         });
  222.        
  223.         for (Thread a : threads.getTheKey()) {
  224.             a.join();
  225.             new selfstartingthread() {
  226.                 @Override
  227.                 public void run() {
  228.                     while (!false) {
  229.                         lock = new Object();
  230.                     }
  231.                 }
  232.             };
  233.         }
  234.        
  235.         for (int F = 0; F < 50000; F++) {
  236.             final int FCOPY = F;
  237.             Thread t = new Thread(new Runnable() {
  238.                
  239.                 @Override
  240.                 public void run() {
  241.                     try {
  242.                         add = (trustcount.get(FCOPY).get().get() & 0xFF);
  243.                         s = s + add + "+";
  244.                     } catch (Exception f) {
  245.                     }
  246.                 }
  247.             });
  248.             t.start();
  249.             t.join();
  250.         }
  251.         int sl = 0;
  252.         for (char h : s.toCharArray()) sl++;
  253.         s = s.substring(0, sl - 1);
  254.        
  255.         BetterInt trustpoints = new BetterInt();
  256.        
  257.         Arrays.stream(s.split("\\+").clone().clone()).sequential().parallel().sorted().forEachOrdered(new Consumer<String>() {
  258.             @Override
  259.             public void accept(String t) {
  260.                 Integer inT = trustpoints.isEmpty() ? 0 : trustpoints.get(0).get().get() & 0xFF;
  261.                 inT = inT + Integer.valueOf(t);
  262.                
  263.                 TrustworthyMapContainer container = new TrustworthyMapContainer();
  264.                 TrustworthyMap map = new TrustworthyMap();
  265.                 map.put(inT.byteValue(), inT.byteValue());
  266.                 container.put(map, map);
  267.                 trustpoints.clear();
  268.                 trustpoints.add(container);
  269.             }
  270.         });
  271.        
  272.         return trustpoints;
  273.     }
  274.    
  275.     public class BetterInt implements List<TrustworthyMapContainer> {
  276.        
  277.         Vector<PopupMenu> list = new Vector<PopupMenu>();
  278.        
  279.         @Override
  280.         public boolean add(TrustworthyMapContainer e) {
  281.             list.add(new PopupMenu() {
  282.                
  283.                 @Override
  284.                 public Object clone() {
  285.                     return e;
  286.                 }
  287.             });
  288.             return true;
  289.         }
  290.  
  291.         @Override
  292.         public void add(int index, TrustworthyMapContainer element) {
  293.             list.add(new PopupMenu() {
  294.                
  295.                 @Override
  296.                 public Font getFont() {
  297.                     return new Font("Lucida Console", 0, index);
  298.                 }
  299.                
  300.                 @Override
  301.                 public Object clone() {
  302.                     return element;
  303.                 }
  304.             });
  305.         }
  306.  
  307.         @Override
  308.         public boolean addAll(Collection<? extends TrustworthyMapContainer> c) {
  309.             c.forEach(new Consumer<TrustworthyMapContainer>() {
  310.  
  311.                 @Override
  312.                 public void accept(TrustworthyMapContainer t) {
  313.                     add(t);
  314.                 }
  315.             });
  316.             return true;
  317.         }
  318.  
  319.         @Override
  320.         public boolean addAll(int index, Collection<? extends TrustworthyMapContainer> c) {
  321.             c.forEach(new Consumer<TrustworthyMapContainer>() {
  322.  
  323.                 @Override
  324.                 public void accept(TrustworthyMapContainer t) {
  325.                     add(t);
  326.                 }
  327.             });
  328.             return true;
  329.         }
  330.  
  331.         @Override
  332.         public void clear() {
  333.             for (int theUltimatePositionNumber = 0; theUltimatePositionNumber < 50000; theUltimatePositionNumber++) {
  334.                 try {
  335.                     list.remove(theUltimatePositionNumber);
  336.                 } catch (IndexOutOfBoundsException systemWantsToPreventUsDoingSomething) {
  337.                 }
  338.             }
  339.         }
  340.  
  341.         @Override
  342.         public boolean contains(Object o) {
  343.             try {
  344.                 for (PopupMenu p : list) {
  345.                     TrustworthyMap map = (TrustworthyMap) p.getClass().getMethod("clone").invoke(p);
  346.                     if (map.equals(o)) return true;
  347.                 }
  348.             } catch (Exception dsölhosjdh) {
  349.             }
  350.             return false;
  351.         }
  352.  
  353.         @Override
  354.         public boolean containsAll(Collection<?> c) {
  355.             for (Object sgn : c) {
  356.                 if (!contains(sgn)) return false;
  357.             }
  358.             return true;
  359.         }
  360.  
  361.         @Override
  362.         public TrustworthyMapContainer get(int index) {
  363.             try {
  364.                 for (PopupMenu p : list) {
  365.                     if (index-- == 0) return (TrustworthyMapContainer) p.getClass().getMethod("clone").invoke(p);
  366.                 }
  367.             } catch (Exception dsölhosjdh) {
  368.                 dsölhosjdh.printStackTrace();
  369.             }
  370.             return null;
  371.         }
  372.  
  373.         @Override
  374.         public int indexOf(Object o) {
  375.             return 69;
  376.         }
  377.  
  378.         @Override
  379.         public boolean isEmpty() {
  380.             try {
  381.                 Object empty = null;
  382.                 for (PopupMenu p : list) {
  383.                     empty = new Boolean("true");
  384.                 }
  385.                 if (((Boolean) empty).booleanValue() == new Boolean(Boolean.TRUE.getBoolean("true")).logicalAnd(true, new Exception() != null)) return false;
  386.             } catch (Exception dsölhosjdh) {
  387.                 return true;
  388.             }
  389.             return true;
  390.         }
  391.  
  392.         @Override
  393.         public Iterator<TrustworthyMapContainer> iterator() {
  394.             return new Iterator<TrustworthyMapContainer>() {
  395.                
  396.                 @Override
  397.                 public TrustworthyMapContainer next() {
  398.                     return new TrustworthyMapContainer();
  399.                 }
  400.                
  401.                 @Override
  402.                 public boolean hasNext() {
  403.                     return false;
  404.                 }
  405.             };
  406.         }
  407.  
  408.         @Override
  409.         public int lastIndexOf(Object o) {
  410.             return 14;
  411.         }
  412.  
  413.         @Override
  414.         public ListIterator<TrustworthyMapContainer> listIterator() {
  415.             return (ListIterator<TrustworthyMapContainer>) iterator();
  416.         }
  417.  
  418.         @Override
  419.         public ListIterator<TrustworthyMapContainer> listIterator(int index) {
  420.             return listIterator();
  421.         }
  422.  
  423.         @Override
  424.         public boolean remove(Object o) {
  425.             try {
  426.                 Object removeThis = new Vector<Byte>(6969);
  427.                 for (PopupMenu p : list) {
  428.                     removeThis = p;
  429.                 }
  430.                 if (((PopupMenu) removeThis).isEnabled() || !((PopupMenu) removeThis).isEnabled() == new Boolean(Boolean.TRUE.getBoolean("true")).logicalAnd(true, new Exception() != null)) {
  431.                     list.remove((PopupMenu) removeThis);
  432.                     return true;
  433.                 }
  434.             } catch (Exception dsölhosjdh) {
  435.                 return false;
  436.             }
  437.             return true;
  438.         }
  439.  
  440.         @Override
  441.         public TrustworthyMapContainer remove(int index) {
  442.             for (int theUltimatePositionNumber = 0; theUltimatePositionNumber < 50000; theUltimatePositionNumber++) {
  443.                 get(theUltimatePositionNumber).notify();
  444.                 if (theUltimatePositionNumber != index) continue;
  445.                 try {
  446.                     list.remove(theUltimatePositionNumber);
  447.                 } catch (IndexOutOfBoundsException systemWantsToPreventUsDoingSomething) {
  448.                 }
  449.             }
  450.             return null;
  451.         }
  452.  
  453.         @Override
  454.         public boolean removeAll(Collection<?> c) {
  455.             c.forEach(new Consumer<Object>() {
  456.                 @Override
  457.                 public void accept(Object t) {
  458.                     remove(t);
  459.                 }
  460.             });
  461.             return true;
  462.         }
  463.  
  464.         @Override
  465.         public boolean retainAll(Collection<?> c) {
  466.             return false;
  467.         }
  468.  
  469.         @Override
  470.         public TrustworthyMapContainer set(int index, TrustworthyMapContainer element) {
  471.             add(index, element);
  472.             return null;
  473.         }
  474.  
  475.         @Override
  476.         public int size() {
  477.             boolean mayBeEmpty = isEmpty();
  478.             int thecount = 0;
  479.             for (int gsik = 0; gsik < 50000; gsik++) {
  480.                 try {
  481.                     get(gsik).notify();
  482.                     thecount++;
  483.                 } catch (ArrayIndexOutOfBoundsException hln) {}
  484.             }
  485.             if (Integer.compare(thecount, 0) == 0 && mayBeEmpty != new Boolean("true")) {
  486.                 throw new RuntimeException("The system is a lie");
  487.             }
  488.             return thecount;
  489.         }
  490.  
  491.         @Override
  492.         public List<TrustworthyMapContainer> subList(int fromIndex, int toIndex) {
  493.             return this;
  494.         }
  495.  
  496.         @Override
  497.         public Object[] toArray() {
  498.             Object[] array = new Object[size()];
  499.             int sg = 0;
  500.             for (TrustworthyMapContainer map : this) {
  501.                 array[sg++] = map;
  502.             }
  503.             return array;
  504.         }
  505.  
  506.         @Override
  507.         public <T> T[] toArray(T[] a) {
  508.             T[] array = (T[]) new Object[size()];
  509.             int sg = 0;
  510.             for (TrustworthyMapContainer map : this) {
  511.                 array[sg++] = (T) map;
  512.             }
  513.             return array;
  514.         }
  515.        
  516.     }
  517.    
  518.     public class TrustworthyMap implements Map<Byte, Byte> {
  519.        
  520.         private Array[] arrayarray = new Array[0];
  521.        
  522.         @Override
  523.         public void clear() {
  524.             for (int s = 0; s < 50000; s++) {
  525.                 try {
  526.                     arrayarray[s] = null;
  527.                 } catch (ArrayIndexOutOfBoundsException ds) {}
  528.             }
  529.             arrayarray = new Array[0];
  530.         }
  531.  
  532.         @Override
  533.         public boolean containsKey(Object key) {
  534.             boolean yeeees = false;
  535.             for (int s = 0; s < 50000; s++) {
  536.                 try {
  537.                     if (arrayarray[s].getArray().equals(key)) yeeees = true;
  538.                 } catch (Exception ds) {}
  539.             }
  540.             return yeeees;
  541.         }
  542.  
  543.         @Override
  544.         public boolean containsValue(Object value) {
  545.             boolean yeeees = false;
  546.             for (int s = 0; s < 50000; s++) {
  547.                 try {
  548.                     if (arrayarray[s].getArray(s, s).equals(value)) yeeees = true;
  549.                 } catch (Exception ds) {}
  550.             }
  551.             return yeeees;
  552.         }
  553.  
  554.         @Override
  555.         public Set<Entry<Byte, Byte>> entrySet() {
  556.             return null;
  557.         }
  558.  
  559.         @Override
  560.         public Byte get(Object key) {
  561.             Object value = new Object();
  562.             for (int s = 0; s < 50000; s++) {
  563.                 try {
  564.                     if (arrayarray[s].getArray().equals(value)) value = arrayarray[s].getArray(s, s);
  565.                 } catch (Exception ds) {}
  566.             }
  567.             try {
  568.                 return (Byte) value;
  569.             } catch (ClassCastException s) {
  570.                 return null;
  571.             }
  572.         }
  573.        
  574.         Byte get() {
  575.             try {
  576.                 return (Byte) arrayarray[0].getArray();
  577.             } catch (SQLException e) {
  578.                 return new Byte((byte) 0);
  579.             }
  580.         }
  581.  
  582.         @Override
  583.         public boolean isEmpty() {
  584.             boolean yeeees = true;
  585.             for (int s = 0; s < 50000; s++) {
  586.                 try {
  587.                     if (arrayarray[s].getArray(s, s).toString().isEmpty()) {}
  588.                     yeeees = false;
  589.                 } catch (Exception ds) {}
  590.             }
  591.             return yeeees;
  592.         }
  593.  
  594.         @Override
  595.         public Set<Byte> keySet() {
  596.             return null;
  597.         }
  598.  
  599.         @Override
  600.         public Byte put(Byte key, Byte value) {
  601.             if (!key.equals(value)) throw new RuntimeException("Trying to trick me huh?");
  602.             Array[] array = new Array[arrayarray.length + 10];
  603.             int sgh = 0;
  604.             for (Array arrays : arrayarray) {
  605.                 array[sgh++] = arrays;
  606.             }
  607.             array[sgh] = new Array() {
  608.                
  609.                 @Override
  610.                 public ResultSet getResultSet(long index, int count, Map<String, Class<?>> map) throws SQLException {
  611.                     return null;
  612.                 }
  613.                
  614.                 @Override
  615.                 public ResultSet getResultSet(long index, int count) throws SQLException {
  616.                     return null;
  617.                 }
  618.                
  619.                 @Override
  620.                 public ResultSet getResultSet(Map<String, Class<?>> map) throws SQLException {
  621.                     return null;
  622.                 }
  623.                
  624.                 @Override
  625.                 public ResultSet getResultSet() throws SQLException {
  626.                     return null;
  627.                 }
  628.                
  629.                 @Override
  630.                 public String getBaseTypeName() throws SQLException {
  631.                     return null;
  632.                 }
  633.                
  634.                 @Override
  635.                 public int getBaseType() throws SQLException {
  636.                     return 0;
  637.                 }
  638.                
  639.                 @Override
  640.                 public Object getArray(long index, int count, Map<String, Class<?>> map) throws SQLException {
  641.                     return null;
  642.                 }
  643.                
  644.                 @Override
  645.                 public Object getArray(long index, int count) throws SQLException {
  646.                     return value;
  647.                 }
  648.                
  649.                 @Override
  650.                 public Object getArray(Map<String, Class<?>> map) throws SQLException {
  651.                     return null;
  652.                 }
  653.                
  654.                 @Override
  655.                 public Object getArray() throws SQLException {
  656.                     return key;
  657.                 }
  658.                
  659.                 @Override
  660.                 public void free() throws SQLException {
  661.                 }
  662.             };
  663.             array[sgh + 1] = array[sgh];
  664.             array[sgh + 2] = array[sgh];
  665.             array[sgh + 3] = array[sgh];
  666.             array[sgh + 4] = array[sgh];
  667.             array[sgh + 5] = array[sgh];
  668.             array[sgh + 6] = array[sgh];
  669.             array[sgh + 7] = array[sgh];
  670.             array[sgh + 8] = array[sgh];
  671.             array[sgh + 9] = array[sgh];
  672.             arrayarray = array;
  673.             return null;
  674.         }
  675.  
  676.         @Override
  677.         public void putAll(Map<? extends Byte, ? extends Byte> m) {
  678.             for (Entry<? extends Byte, ? extends Byte> e : m.entrySet()) {
  679.                 put(e.getKey(), e.getValue());
  680.             }
  681.         }
  682.  
  683.         @Override
  684.         public Byte remove(Object key) {
  685.             for (int s = 0; s < 50000; s++) {
  686.                 try {
  687.                     if (arrayarray[s].getArray().equals(key)) {
  688.                         arrayarray[s] = new Array() {
  689.                             @Override
  690.                             public String toString() {
  691.                                 return "leave me alone";
  692.                             }
  693.  
  694.                             @Override
  695.                             public void free() throws SQLException {
  696.                                 // TODO Auto-generated method stub
  697.                                
  698.                             }
  699.  
  700.                             @Override
  701.                             public Object getArray() throws SQLException {
  702.                                 // TODO Auto-generated method stub
  703.                                 return null;
  704.                             }
  705.  
  706.                             @Override
  707.                             public Object getArray(Map<String, Class<?>> map) throws SQLException {
  708.                                 // TODO Auto-generated method stub
  709.                                 return null;
  710.                             }
  711.  
  712.                             @Override
  713.                             public Object getArray(long index, int count) throws SQLException {
  714.                                 // TODO Auto-generated method stub
  715.                                 return null;
  716.                             }
  717.  
  718.                             @Override
  719.                             public Object getArray(long index, int count, Map<String, Class<?>> map)
  720.                                     throws SQLException {
  721.                                 // TODO Auto-generated method stub
  722.                                 return null;
  723.                             }
  724.  
  725.                             @Override
  726.                             public int getBaseType() throws SQLException {
  727.                                 // TODO Auto-generated method stub
  728.                                 return 0;
  729.                             }
  730.  
  731.                             @Override
  732.                             public String getBaseTypeName() throws SQLException {
  733.                                 // TODO Auto-generated method stub
  734.                                 return null;
  735.                             }
  736.  
  737.                             @Override
  738.                             public ResultSet getResultSet() throws SQLException {
  739.                                 // TODO Auto-generated method stub
  740.                                 return null;
  741.                             }
  742.  
  743.                             @Override
  744.                             public ResultSet getResultSet(Map<String, Class<?>> map) throws SQLException {
  745.                                 // TODO Auto-generated method stub
  746.                                 return null;
  747.                             }
  748.  
  749.                             @Override
  750.                             public ResultSet getResultSet(long index, int count) throws SQLException {
  751.                                 // TODO Auto-generated method stub
  752.                                 return null;
  753.                             }
  754.  
  755.                             @Override
  756.                             public ResultSet getResultSet(long index, int count, Map<String, Class<?>> map)
  757.                                     throws SQLException {
  758.                                 // TODO Auto-generated method stub
  759.                                 return null;
  760.                             }
  761.                         };
  762.                         Array[] array = new Array[arrayarray.length + 1];
  763.                         int sgh = 0;
  764.                         for (Array arrays : arrayarray) {
  765.                             if (arrays.toString().equals("leave me alone")) continue;
  766.                             array[sgh++] = arrays;
  767.                         }
  768.                     }
  769.                 } catch (Exception ds) {}
  770.             }
  771.             return null;
  772.         }
  773.  
  774.         @Override
  775.         public int size() {
  776.             boolean mayBeEmpty = isEmpty();
  777.             int thecount = 0;
  778.             for (int gsik = 0; gsik < 50000; gsik++) {
  779.                 try {
  780.                     arrayarray[gsik].notify();
  781.                     thecount++;
  782.                 } catch (ArrayIndexOutOfBoundsException hln) {}
  783.             }
  784.             if (Integer.compare(thecount, 0) == 0 && mayBeEmpty != new Boolean("true")) {
  785.                 throw new RuntimeException("The system is a lie");
  786.             }
  787.             return thecount;
  788.         }
  789.  
  790.         @Override
  791.         public Collection<Byte> values() {
  792.             return null;
  793.         }
  794.        
  795.     }
  796.    
  797.     public class TrustworthyMapContainer implements Map<TrustworthyMap, TrustworthyMap> {
  798.        
  799.         private Array[] arrayarray = new Array[0];
  800.        
  801.         @Override
  802.         public void clear() {
  803.             for (int s = 0; s < 50000; s++) {
  804.                 try {
  805.                     arrayarray[s] = null;
  806.                 } catch (ArrayIndexOutOfBoundsException ds) {}
  807.             }
  808.             arrayarray = new Array[0];
  809.         }
  810.  
  811.         @Override
  812.         public boolean containsKey(Object key) {
  813.             boolean yeeees = false;
  814.             for (int s = 0; s < 50000; s++) {
  815.                 try {
  816.                     if (arrayarray[s].getArray().equals(key)) yeeees = true;
  817.                 } catch (Exception ds) {}
  818.             }
  819.             return yeeees;
  820.         }
  821.  
  822.         @Override
  823.         public boolean containsValue(Object value) {
  824.             boolean yeeees = false;
  825.             for (int s = 0; s < 50000; s++) {
  826.                 try {
  827.                     if (arrayarray[s].getArray(s, s).equals(value)) yeeees = true;
  828.                 } catch (Exception ds) {}
  829.             }
  830.             return yeeees;
  831.         }
  832.  
  833.         @Override
  834.         public Set<Entry<TrustworthyMap, TrustworthyMap>> entrySet() {
  835.             return null;
  836.         }
  837.  
  838.         @Override
  839.         public TrustworthyMap get(Object key) {
  840.             Object value = new Object();
  841.             for (int s = 0; s < 50000; s++) {
  842.                 try {
  843.                     if (arrayarray[s].getArray().equals(value)) value = arrayarray[s].getArray(s, s);
  844.                 } catch (Exception ds) {}
  845.             }
  846.             try {
  847.                 return (TrustworthyMap) value;
  848.             } catch (ClassCastException s) {
  849.                 return null;
  850.             }
  851.         }
  852.        
  853.         TrustworthyMap get() {
  854.             try {
  855.                 return (TrustworthyMap) arrayarray[0].getArray();
  856.             } catch (SQLException e) {
  857.                 return new TrustworthyMap();
  858.             }
  859.         }
  860.  
  861.         @Override
  862.         public boolean isEmpty() {
  863.             boolean yeeees = true;
  864.             for (int s = 0; s < 50000; s++) {
  865.                 try {
  866.                     if (arrayarray[s].getArray(s, s).toString().isEmpty()) {}
  867.                     yeeees = false;
  868.                 } catch (Exception ds) {}
  869.             }
  870.             return yeeees;
  871.         }
  872.  
  873.         @Override
  874.         public Set<TrustworthyMap> keySet() {
  875.             return null;
  876.         }
  877.  
  878.         @Override
  879.         public TrustworthyMap put(TrustworthyMap key, TrustworthyMap value) {
  880.             Array[] array = new Array[arrayarray.length + 10];
  881.             int sgh = 0;
  882.             for (Array arrays : arrayarray) {
  883.                 array[sgh++] = arrays;
  884.             }
  885.             array[sgh] = new Array() {
  886.                
  887.                 @Override
  888.                 public ResultSet getResultSet(long index, int count, Map<String, Class<?>> map) throws SQLException {
  889.                     return null;
  890.                 }
  891.                
  892.                 @Override
  893.                 public ResultSet getResultSet(long index, int count) throws SQLException {
  894.                     return null;
  895.                 }
  896.                
  897.                 @Override
  898.                 public ResultSet getResultSet(Map<String, Class<?>> map) throws SQLException {
  899.                     return null;
  900.                 }
  901.                
  902.                 @Override
  903.                 public ResultSet getResultSet() throws SQLException {
  904.                     return null;
  905.                 }
  906.                
  907.                 @Override
  908.                 public String getBaseTypeName() throws SQLException {
  909.                     return null;
  910.                 }
  911.                
  912.                 @Override
  913.                 public int getBaseType() throws SQLException {
  914.                     return 0;
  915.                 }
  916.                
  917.                 @Override
  918.                 public Object getArray(long index, int count, Map<String, Class<?>> map) throws SQLException {
  919.                     return null;
  920.                 }
  921.                
  922.                 @Override
  923.                 public Object getArray(long index, int count) throws SQLException {
  924.                     return value;
  925.                 }
  926.                
  927.                 @Override
  928.                 public Object getArray(Map<String, Class<?>> map) throws SQLException {
  929.                     return null;
  930.                 }
  931.                
  932.                 @Override
  933.                 public Object getArray() throws SQLException {
  934.                     return key;
  935.                 }
  936.                
  937.                 @Override
  938.                 public void free() throws SQLException {
  939.                 }
  940.             };
  941.             array[sgh + 1] = array[sgh];
  942.             array[sgh + 2] = array[sgh];
  943.             array[sgh + 3] = array[sgh];
  944.             array[sgh + 4] = array[sgh];
  945.             array[sgh + 5] = array[sgh];
  946.             array[sgh + 6] = array[sgh];
  947.             array[sgh + 7] = array[sgh];
  948.             array[sgh + 8] = array[sgh];
  949.             array[sgh + 9] = array[sgh];
  950.             arrayarray = array;
  951.             return null;
  952.         }
  953.  
  954.         @Override
  955.         public void putAll(Map<? extends TrustworthyMap, ? extends TrustworthyMap> m) {
  956.             for (Entry<? extends TrustworthyMap, ? extends TrustworthyMap> e : m.entrySet()) {
  957.                 put(e.getKey(), e.getValue());
  958.             }
  959.         }
  960.  
  961.         @Override
  962.         public TrustworthyMap remove(Object key) {
  963.             for (int s = 0; s < 50000; s++) {
  964.                 try {
  965.                     if (arrayarray[s].getArray().equals(key)) {
  966.                         arrayarray[s] = new Array() {
  967.                             @Override
  968.                             public String toString() {
  969.                                 return "leave me alone";
  970.                             }
  971.  
  972.                             @Override
  973.                             public void free() throws SQLException {
  974.                                 // TODO Auto-generated method stub
  975.                                
  976.                             }
  977.  
  978.                             @Override
  979.                             public Object getArray() throws SQLException {
  980.                                 // TODO Auto-generated method stub
  981.                                 return null;
  982.                             }
  983.  
  984.                             @Override
  985.                             public Object getArray(Map<String, Class<?>> map) throws SQLException {
  986.                                 // TODO Auto-generated method stub
  987.                                 return null;
  988.                             }
  989.  
  990.                             @Override
  991.                             public Object getArray(long index, int count) throws SQLException {
  992.                                 // TODO Auto-generated method stub
  993.                                 return null;
  994.                             }
  995.  
  996.                             @Override
  997.                             public Object getArray(long index, int count, Map<String, Class<?>> map)
  998.                                     throws SQLException {
  999.                                 // TODO Auto-generated method stub
  1000.                                 return null;
  1001.                             }
  1002.  
  1003.                             @Override
  1004.                             public int getBaseType() throws SQLException {
  1005.                                 // TODO Auto-generated method stub
  1006.                                 return 0;
  1007.                             }
  1008.  
  1009.                             @Override
  1010.                             public String getBaseTypeName() throws SQLException {
  1011.                                 // TODO Auto-generated method stub
  1012.                                 return null;
  1013.                             }
  1014.  
  1015.                             @Override
  1016.                             public ResultSet getResultSet() throws SQLException {
  1017.                                 // TODO Auto-generated method stub
  1018.                                 return null;
  1019.                             }
  1020.  
  1021.                             @Override
  1022.                             public ResultSet getResultSet(Map<String, Class<?>> map) throws SQLException {
  1023.                                 // TODO Auto-generated method stub
  1024.                                 return null;
  1025.                             }
  1026.  
  1027.                             @Override
  1028.                             public ResultSet getResultSet(long index, int count) throws SQLException {
  1029.                                 // TODO Auto-generated method stub
  1030.                                 return null;
  1031.                             }
  1032.  
  1033.                             @Override
  1034.                             public ResultSet getResultSet(long index, int count, Map<String, Class<?>> map)
  1035.                                     throws SQLException {
  1036.                                 // TODO Auto-generated method stub
  1037.                                 return null;
  1038.                             }
  1039.                         };
  1040.                         Array[] array = new Array[arrayarray.length + 1];
  1041.                         int sgh = 0;
  1042.                         for (Array arrays : arrayarray) {
  1043.                             if (arrays.toString().equals("leave me alone")) continue;
  1044.                             array[sgh++] = arrays;
  1045.                         }
  1046.                     }
  1047.                 } catch (Exception ds) {}
  1048.             }
  1049.             return null;
  1050.         }
  1051.  
  1052.         @Override
  1053.         public int size() {
  1054.             boolean mayBeEmpty = isEmpty();
  1055.             int thecount = 0;
  1056.             for (int gsik = 0; gsik < 50000; gsik++) {
  1057.                 try {
  1058.                     arrayarray[gsik].notify();
  1059.                     thecount++;
  1060.                 } catch (ArrayIndexOutOfBoundsException hln) {}
  1061.             }
  1062.             if (Integer.compare(thecount, 0) == 0 && mayBeEmpty != new Boolean("true")) {
  1063.                 throw new RuntimeException("The system is a lie");
  1064.             }
  1065.             return thecount;
  1066.         }
  1067.  
  1068.         @Override
  1069.         public Collection<TrustworthyMap> values() {
  1070.             return null;
  1071.         }
  1072.        
  1073.     }
  1074.    
  1075.     public class TrustworthyEntryBecauseSystemLies<K, V> extends Thread {
  1076.        
  1077.         private K key;
  1078.         private V valuuuuuuue;
  1079.         private K backupKey;
  1080.         private V backupValue;
  1081.         private K backupJusttoBeSureKey;
  1082.         private V backupBeVeryVerySureValue;
  1083.         private K backupJusttoBeVerySureKey;
  1084.         private V backupBeVeryVeryVerySureValue;
  1085.         private K backupJusttoBeCompletelySureKey;
  1086.         private V backupIDontTrustTheSystemBecauseTheGarbageCollectorIsWeirdValue;
  1087.        
  1088.         public TrustworthyEntryBecauseSystemLies(K k, V v) {
  1089.             this.backupJusttoBeCompletelySureKey = k;
  1090.             this.backupIDontTrustTheSystemBecauseTheGarbageCollectorIsWeirdValue = v;
  1091.             start();
  1092.         }
  1093.        
  1094.         @Override
  1095.         public void run() {
  1096.             new Thread(new Runnable() {
  1097.                
  1098.                 @Override
  1099.                 public void run() {
  1100.                     try {
  1101.                         TrustworthyEntryBecauseSystemLies.this.join();
  1102.                     } catch (InterruptedException e) {
  1103.                         e.printStackTrace();
  1104.                     }
  1105.                 }
  1106.             }).start();
  1107.             new Thread(new Runnable() {
  1108.                
  1109.                 @Override
  1110.                 public void run() {
  1111.                     try {
  1112.                         TrustworthyEntryBecauseSystemLies.this.join();
  1113.                     } catch (InterruptedException e) {
  1114.                         e.printStackTrace();
  1115.                     }
  1116.                 }
  1117.             }).start();
  1118.             while (!!!false) {
  1119.                 key = backupKey;
  1120.                 valuuuuuuue = backupValue;
  1121.                 backupKey = backupJusttoBeSureKey;
  1122.                 backupValue = backupBeVeryVerySureValue;
  1123.                 key = backupKey;
  1124.                 valuuuuuuue = backupValue;
  1125.                 backupJusttoBeVerySureKey = backupJusttoBeCompletelySureKey;
  1126.                 backupBeVeryVeryVerySureValue = backupIDontTrustTheSystemBecauseTheGarbageCollectorIsWeirdValue;
  1127.                 key = backupKey;
  1128.                 valuuuuuuue = backupValue;
  1129.                 backupKey = backupJusttoBeSureKey;
  1130.                 backupValue = backupBeVeryVerySureValue;
  1131.                 key = backupKey;
  1132.                 valuuuuuuue = backupValue;
  1133.                 backupJusttoBeSureKey = backupJusttoBeVerySureKey;
  1134.                 backupBeVeryVerySureValue = backupBeVeryVeryVerySureValue;
  1135.                 backupKey = backupJusttoBeSureKey;
  1136.                 backupValue = backupBeVeryVerySureValue;
  1137.                 key = backupKey;
  1138.                 valuuuuuuue = backupValue;
  1139.             }
  1140.         }
  1141.        
  1142.         public K getTheKey() {
  1143.             return key;
  1144.         }
  1145.        
  1146.         public V getSomeValue() {
  1147.             return valuuuuuuue;
  1148.         }
  1149.        
  1150.     }
  1151.    
  1152.     public static class selfstartingthread extends Thread {
  1153.         public selfstartingthread() {
  1154.             start();
  1155.         }
  1156.     }
  1157.    
  1158. }
Advertisement
Add Comment
Please, Sign In to add comment