input stringlengths 10 828 | output stringlengths 5 107 |
|---|---|
public double get average rate return get series overall get yvalue get number of days 1 double value | get the average keyrate over all days |
public long get blocks return blocks | get the sum of blocks for this day |
public int get cpu return cpu | get the cpu id of the client which submitted this entry |
public int get number of days return last day first day 1 | get the number of days for the accounted range i |
public void add day collector new days array list keys new days get keys sorted for int i 0 i keys size i int value key int value keys get i day entry de get key if de null de add new days get key else day entry d new day entry new days get key days put key d expired true | add a complete day collection to this collection |
public int value get day return day | get the day of submission for this entry |
public int get last day return last day | get the last accounted day |
public int get ip return ip | get the ip address of the client which submitted this entry |
public string resolve int addr return resolve new int value addr | resolve an ipv4 address to an human readable string |
public int get first day return first day | get the first accounted day |
public void remove int value day days remove day expired true | remove day from the day entry collection |
public int compare to total another total long this val this value long another val another total value return this val another val 1 this val another val key to string compare to another total key to string 1 | compares two code total code objects numerically |
public day collector get days return days | get the day collection used to calculate the keyrates |
public int compare to object o return compare to total o | compares this code total code object to another object |
public boolean accept file file if file is file return false string name file get name if prefix null name starts with prefix return false if ext null name ends with ext name ends with extgz name ends with extzip return false return true | implements file filter |
public string matches int ip if ip mask addr return replacement return null | get the replacement for the submitted ip address |
public void add xydata pair pair data add pair | overwritten since by contract all pairs are added at once not twice |
public number get yvalue int index if index 0 index data size return new double 0 return get data pair index get y | overwritten to return 0 if index is out of bounds |
protected void collect data log entry le for int i 0 i stats list length i stats list i add le | submit the log entry to several collectors for accounting |
public boolean equals object obj if obj instanceof long value return value long value obj get value return false | compares this object to the specified object |
public long get blocks for day int i return get blocks for day new int value i | get the numbers of blocks for the i th day since 01 |
public long get blocks for day int value i if days null i null days contains key i return day entry days get i blocks return 0 | get the numbers of blocks for the i th day since 01 |
public int compare to long value another long value long this val this value long another val another long value value return this val another val 1 this val another val 0 1 | compares two code long value code objects numerically |
public int compare to object o return compare to long value o | compares this code long value code object to another object |
private void check ip stats if ip ip stats null ip stats new ip stats this ip stats reset this ip stats add ip raw stats | check whether ip stats are already initialized |
private void calc totals if days is empty return set map days entry set iterator i map iterator this total 0 long max 0 object key null while i has next map entry entry map entry i next day entry day day entry entry get value this total day blocks if day blocks max max day blocks key entry get key this best day int value key this expired false | recalculate total stats for this day history |
public void write html log debug start writing html stats to stat get what2 stat html summary summary new html summary to stat html detail detail new html detail to stat html home home new html home to stat home write page team stats for int i 0 i to stat length i summary write page to stat i detail write page to stat i log debug writing html done | create all required html pages and charts |
public void write as text stats to stat get what2 stat for int i 0 i to stat length i system out println n to stat i to txt | write information about all stats as text to stdout |
public int get xregister size return circuit get xregister size | returns the size of the i x i register |
public function parser get function return function | returns the specified function |
public int get yregister size return circuit get yregister size | returns the size of the i y i register |
public void set bundle java util properties bundle this bundle bundle | sets the properties bundle for this circuit panel |
public double get scale compute parameters return scale | gets the scale which determines the size of a square representing a |
public void set scale double scale this scale scale this auto scale false | sets the scale which determines the size of a square representing a |
public rational add rational n return plus n | returns the rational number i k i i m n i where |
public rational minus rational n big integer denominator lcm this q n q big integer numerator p multiply denominator divide q subtract n p multiply denominator divide n q return new rational numerator denominator | returns the rational number i k i i m n i where |
public rational negate return new rational p negate q | returns the negative of this rational number |
public rational reciprocal return new rational q p | returns the reciprocal 1 i n i of this rational i n i |
public complex add complex z return new complex this z 0 z z 0 this z 1 z z 1 | returns the sum of this number and the complex number i z i |
public double arg return arg this | returns the argument of this complex number i z i |
public complex divide complex z return new complex divide new double this z 0 this z 1 new double z z 0 z z 1 | divides this complex numbers by i z i |
public int get xregister size return x register size | yields the size of the i x i register of this quantum circuit |
public int get yregister size return y register size | yields the size of the i y i register of this quantum circuit |
public complex minus complex z return new complex this z 0 z z 0 this z 1 z z 1 | subtracts i z i from this complex number |
public int get number of wires return number of wires | returns the number of wires of this quantum circuit |
public void set initial qubits int initial qubits set initial state initial qubits | sets the initial states of the qubits of this quantum circuit |
public complex multiply double x return new complex x z 0 x z 1 | the product of a real number i x i with this complex number |
public complex plus complex z return new complex this z 0 z z 0 this z 1 z z 1 | returns the sum of this number and the complex number i z i |
public register get xregister return x register | returns the i x i register of this quantum circuit |
public void set real double real if real length this real length throw new illegal argument exception wrong register size real length this real length required this real real | returns the array containing the real parts of the qubit state components |
public register get yregister return y register | returns the i y i register of this quantum circuit |
public void initialize int register sizes array list quantum gate gates this x register size register sizes 0 this y register size register sizes 1 this number of wires x register size y register size clear add all gates if size 0 next gate number 1 initialize registers | constructs and initializes this quantum cicuit according to the |
public void set imaginary double imaginary if imaginary length this real length throw new illegal argument exception wrong register size imaginary length this real length required this imaginary imaginary | returns the array containing the imaginary parts of the qubit state components |
public complex reciprocal double y z double w new double 2 double h if math abs y 0 0 math abs y 1 0 w 0 double positive infinity return new complex w if math abs y 0 math abs y 1 h y 1 y 0 w 0 1 y 0 y 1 h w 1 h y 0 y 1 h else h y 0 y 1 w 0 h y 0 h y 1 w 1 1 y 0 h y 1 return new complex w | returns the reciprocal of this number |
public void hadamard int j double real tmp imaginary tmp for int k 0 k power2 size k power2 j for int l 0 l power2 j 1 l int i0 k l int i1 k l power2 j 1 real tmp real i0 imaginary tmp imaginary i0 real i0 real tmp real i1 sqrt2 imaginary i0 imaginary tmp imaginary i1 sqrt2 real i1 real tmp real i1 sqrt2 imaginary i1 imaginary tmp imaginary i1 sqrt2 | hadamard transformation of the i j i th qubit |
public void initialize registers if size 0 return int initial qubits get 0 get qubits x register new register x register size for int i 1 i x register size i if initial qubits x register size i 1 x register x pauli i next gate number 1 important to mark the current gate to be executed y register new register y register size for int i 1 i y register size i if initial qubits x register size y register size i 1 y register x pauli i | initializes this quantum register according to the initial qubit state |
public complex sin return new complex math sin z 0 math cosh z 1 math cos z 0 math sinh z 1 | returns the sine of this complex number |
public void set final step next gate number this size | sets the quantum cicuit into its final state |
public void set next step if next gate number this size perform get next gate number next gate number | executes the next quantum gate in this quantum circuit |
public complex subtract complex z return new complex this z 0 z z 0 this z 1 z z 1 | subtracts i z i from this complex number |
public void set previous step if next gate number 1 next gate number unperform get next gate number | executes the inverse of the previously executed quantum gate in this quantum circuit |
public void y pauli int j double real tmp imaginary tmp for int k 0 k power2 size k power2 j for int l 0 l power2 j 1 l int i0 k l int i1 k l power2 j 1 real tmp real i0 imaginary tmp imaginary i0 real i0 imaginary i1 imaginary i0 real i1 real i1 imaginary tmp imaginary i1 real tmp | applies the pauli y gate to the i j i th qubit |
public void set initial state int initial qubits if this size 0 this add 0 new quantum gate initial state initial qubits false else this set 0 new quantum gate initial state initial qubits false next gate number 1 | determines the initial state of the quantum circuit |
public void z pauli int j for int k 0 k power2 size k power2 j for int l 0 l power2 j 1 l int i1 k l power2 j 1 real i1 1 imaginary i1 1 | applies the pauli z gate to the i j i th qubit |
public void add cnot int qubits boolean y register throws no wire exception if number of wires 0 throw new no wire exception register not existing this add new quantum gate c not qubits y register | adds a cnot gate on the two qubits specified by the two numbers |
public void s gate int j for int k 0 k power2 size k power2 j for int l 0 l power2 j 1 l int i1 k l power2 j 1 double tmp real i1 real i1 imaginary i1 imaginary i1 tmp | applies the i s i gate to the i j i th qubit |
public void t gate int j for int k 0 k power2 size k power2 j for int l 0 l power2 j 1 l int i1 k l power2 j 1 double tmp real i1 real i1 tmp imaginary i1 sqrt 2 imaginary i1 imaginary i1 tmp sqrt 2 | applies the i t i gate to the i j i th qubit |
public void add toffoli int qubits boolean y register throws no wire exception if number of wires 0 throw new no wire exception register not existing this add new quantum gate toffoli qubits y register | adds a toffoli gate on the three qubits specified by the three numbers |
public void add inv qft boolean y register throws no wire exception if number of wires 0 throw new no wire exception register not existing int qubits if y register qubits new int y register size for int i 0 i y register size i qubits i i 1 else qubits new int x register size for int i 0 i x register size i qubits i i 1 this add new quantum gate inv qft qubits y register | adds the inverse fourier transform gate to the circuit |
public void add qft boolean y register throws no wire exception if number of wires 0 throw new no wire exception register not existing int qubits if y register qubits new int y register size for int i 0 i y register size i qubits i i 1 else qubits new int x register size for int i 0 i x register size i qubits i i 1 this add new quantum gate qft qubits y register | adds the fourier transform gate to the circuit |
public void add function function parser function throws no wire exception if number of wires 0 throw new no wire exception register not existing int qubits new int y register size for int i 0 i y register size i qubits i i 1 this add new quantum gate function qubits function true | adds a function evaluating gate to the circuit specified by the input function |
public void add grover int needle throws no wire exception if number of wires 0 throw new no wire exception register not existing int qubits needle this add new quantum gate grover qubits false | adds the grover gate searching for the specified needle to the circuit |
public void add measurement int qubits boolean y register throws no wire exception if number of wires 0 throw new no wire exception register not existing this add new quantum gate measurement qubits y register | adds a measurement gate on the qubits specified by the qubit array |
public boolean execute all initialize registers for int i 1 i size i perform get i set final step return true | executes the entire quantum circuit and returns code true code if |
public int measure double f math random double p int j 1 while f 0 j p real j real j imaginary j imaginary j f p collapse real new double power2 size imaginary new double power2 size real j 1 return j | returns the random value of a quantum measurement of this register |
public string show int n max return to string n max | returns a string representation of the first code n max code qubits of |
public string to string int n max int j max power2 n max string output n register state n for int j 0 j j max j string binary int k j while k 0 binary k 2 binary k 2 int length binary length for int i n max i length i binary 0 binary if j 10 output j else output j output real j imaginary j i binary n return output | returns a string representation of the first code n max code qubits of |
public string get display name return this j sap parsed arguments get string argument parser display name flag long | the parsed display address |
public string get logic dir return this j sap parsed arguments get string argument parser logic dir flag long | the parsed logic directory |
public void shut down this running false | shut down this code event fetcher code |
public file from class path final string resource throws ioexception final file tmp file from class path resource get class get class loader file create temp file this temp file name prefix null tmp file delete on exit return tmp file | load a code file code from this code classpath resource loader code s |
public object get illegal parent return this parent | the illegal parent code widget code that caused this |
public void set weight int weight if weight 0 weight 0 this weight weight | a weight of 0 or lower indicates a static size |
public int get delta height return this delta height | the absolute difference between the current vertical height and the new |
public int get delta width return this delta width | the absolute difference between the current horizontal height and the new |
public int get delta x return this delta x | the absolute difference between the current relative x coordinate and the |
public managed display get existing managed display final string display name final managed display return managed display this managed display map get display name return return managed display | gets the code managed display code bound to its native display name |
public int get delta y return this delta y | the absolute difference between the current relative y coordinate and the |
public void init event producers throws hydrogen display interface exception for final event producer factory event producer factory get display platform get event producer factories add event producer event producer factory get new event producer this | add all code event producer code s to this |
public int get height0 return this height0 | the current vertical size in pixels |
public void shut down throws hyperdrive exception for final entry string managed display display entry this managed display map entry set display entry get value shut down this managed display map clear | shut down this code display manager code |
public int get height1 return this height1 | the new vertical size in pixels |
public int get width0 return this width0 | the current horizontal size in pixels |
public int get width1 return this width1 | the new horizontal size in pixels |
public int get x0 return this x0 | the current relative x coordinate value |
public void stop process monitor this process err service shutdown this process std out service shutdown todo does this give an interrupted exception this process stopped service shutdown now this monitoring false | stops the monitoring of the code process code |
public virtual root get default virtual root render area return this default virtual root | the default code virtual root code of this code managed display code |
public int get x1 return this x1 | the new relative x coordinate value |
public int get y0 return this y0 | the current relative y coordinate value |
public display get display return this display | the code display code peer of this code managed display code |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.