input
stringlengths
10
828
output
stringlengths
5
107
protected void increment failed fetch count live failed fetch count increment and get
increment the running count of failed uris
protected void increment disregarded uri count live disregarded uri count increment and get
increment the running count of disregarded uris
public long delete uris string uri match return delete uris uri match null
delete all scheduled uris matching the given regex
public long delete uris string uri match string queue match long count 0 todo danger values may not work right from cached bdb map iterator iter all queues key set iterator while iter has next string queue key string iter next if string utils is not empty queue match queue key matches queue match skip this queue continue work queue wq get queue for queue key wq unpeek count wq delete matching this uri match decrement queued count count return count
delete all scheduled uris matching the given regex in queues with names
protected void for all pending do closure c throws database exception database entry key new database entry database entry value new database entry cursor cursor pending uris db open cursor null null while cursor get next key value null operation status success if value get data length 0 continue crawl uri item crawl uri crawl uri binding entry to object value c execute item
utility method to perform action for all pending crawl uri instances
public long get recorded size return get http recorder null get http recorder get recorded input get size if unavailable fall back on content size get content size
get size of data recorded transferred
public void set content size long l content size l
sets the content size for the uri which is considered inclusive
public void install thread context settings handler settings handler set thread context settings handler settings handler
utility method to install this crawls settings handler into the
public long get max size object obj get attribute unchecked attr max size bytes return obj null default max file size long obj long value
max size we want files to be bytes
protected boolean should be forgotten crawl uri curi boolean should forget false switch curi get fetch status case s out of scope case s too many embed hops case s too many link hops should forget true default should forget false if should forget if curi contains key a discard revisit boolean no revisit boolean curi get object a discard revisit if no revisit if logger is loggable level fine logger fine no revisit tag set for uri curi get uuri to string should forget true return should forget
some uris if they recur deserve another
public boolean is active if alive and not waiting in for frontier next we re active return this is alive current curi null is interrupted
is this thread validly processing a uri not paused waiting for
private swfreader get swfreader crawl uri curi input stream document stream if document stream null return null create swf actions that will add discoved uris to crawl uri alist s extractor swfactions actions new extractor swfactions curi get controller overwrite parsing of specific tags that might have uris extractor swftags tags new extractor swftags actions get a swfreader instance swfreader reader new extractor swfreader get tag parser tags document stream return reader
get a link extracting swfparser
private tag parser get tag parser swftag types custom tags return new extractor tag parser custom tags
get a tag parser
public void test no whitespace before valid attribute throws uriexception crawl uri curi new crawl uri uurifactory get instance http www example com char sequence cs frame name main src http www example com this extractor extract curi cs link links curi get out links to array new link 0 assert true no links found links length 1 assert true expected link not found links 0 get destination to string equals http www example com
test a missing whitespace issue found in form
public void test only extract form gets throws uriexception crawl uri curi new crawl uri uurifactory get instance http www example com char sequence cs form method get action http www example com ok1 form action http www example com ok2 method get form method post action http www example com notok form action http www example com ok3 this extractor extract curi cs link links curi get out links to array new link 0 assert true incorrect number of links found links length 3
test only extract form actions with method get
public long delete uris from pending string regexpr return delete uris from pending regexpr null
delete any uri from the frontier of the current paused job that match
public void test script tag writing script type throws uriexception crawl uri curi new crawl uri uurifactory get instance http www example com en fiche dossier 322 char sequence cs script type text javascript var ga js host https document location protocol https ssl http www document write unescape 3 cscript src ga js host google analytics com ga js type text javascript 3 e 3 c script 3 e script this extractor extract curi cs assert true outlinks should be empty curi get out links is empty
test to see if embedded script which writes script type
public long delete uris from pending string uri pattern string queue pattern return this current job null this current job delete uris from pending uri pattern queue pattern 0
delete any uri from the frontier of the current paused job that match
public void get url string url string target throws ioexception process uristring url
overwrite handling of discovered uris
protected boolean evaluate object o if o instanceof crawl uri return false string content type crawl uri o get content type string regexp get regexp o return regexp null content type null false super evaluate o
evaluate whether given objects string version does not match
protected boolean get bit long bit index long int index bit index address bits per unit return bits int int index one mb ints int int index one mb ints 1 bit index bit index mask 0
returns from the local bitvector the value of the bit with
protected void set bit long bit index long int index bit index address bits per unit bits int int index one mb ints int int index one mb ints 1 bit index bit index mask
changes the bit with index tt bit index tt in local bitvector
protected boolean set get bit long bit index long int index int bit index address bits per unit int a int int index one mb ints int b int int index one mb ints int mask 1 bit index bit index mask boolean ret bits a b mask 0 bits a b mask return ret
sets the bit with index tt bit index tt in local bitvector
public void tally k key tally key 1 l
record one more occurence of the given object key
public void tally k key long count if contains key key put key get key count else if we didn t find this key add it put key count
record i count i more occurence s of the given object key
public long get largest value long largest 0 for long el values if el largest largest el return largest
return the largest value of any key that is larger than 0
public long get total long total 0 for long el values total el return total
return the total of all tallies
public boolean add string s sorted set string sub head set s if sub is empty s starts with string sub last no need to add prefix is already present return false boolean ret val super add s sub tail set s 0 while sub is empty string sub first starts with s remove redundant entries sub remove sub first return ret val
maintains additional invariant if one entry is a
protected string transform string line ignore line reset line if ignore line matches return null extract line reset line if extract line matches string buffer output new string buffer todo consider if a loop that find s all is more generally useful here extract line append replacement output output template return output to string no match possibly error logger warning line not extracted nor no op line return null
loads next item into lookahead spot if available
public void kick update install thread context settings handler toe pool set size order get max toes this scope kick update this frontier kick update this processor chains kick update todo continue to generalize this so that any major component can get a kick when it may need to refresh its data set thresholds
while many settings will update automatically when the settings handler is
public string substring int offset int len return sub sequence offset offset len to string
convenience method for getting a substring
public int available long amount get header get length get position return amount integer max value integer max value int amount
this available is not the streams available
public void mark remember this position for subsequent reset this mark position position
when used alongside a mark supporting recording input stream remember
public long delete uris from pending string uri pattern string queue pattern return this controller null this controller get frontier null this controller is paused this controller get frontier delete uris uri pattern queue pattern 0
delete any uri from the frontier of the current paused job that match
public void reset take note of furthest position reached to avoid double recording max position math max max position position reset to previous position position mark position
when used alongside a mark supporting recording input stream reset
public void set limits long length long milliseconds long rate kbps max length length 0 length long max value timeout ms milliseconds 0 milliseconds long max value max rate bytes per ms rate kbps 0 rate kbps 1024 1000 long max value
set limits on length time and rate to enforce
public void end def end
release the deflaters native process resources
public void reset limits max length long max value timeout ms long max value max rate bytes per ms long max value
reset limits to effectively unlimited defaults
public long get remaining length return max length position
return number of bytes that could be recorded without hitting
public void set limits long hard max long timeout ms long max rate kbps recording output stream set limits hard max timeout ms max rate kbps
set limits to be enforced by internal recording out
public uri get uri throws uriexception string buffer buffer new string buffer if this httphost null buffer append this httphost get protocol get scheme buffer append buffer append this httphost get host name int port this httphost get port if port 1 port this httphost get protocol get default port buffer append buffer append port buffer append this path if this query string null buffer append buffer append this query string begin ia heritrix changes return new uri buffer to string true return new org archive net lax uri buffer to string true end ia heritrix changes
returns the uri of the http method
public void clear cookies begin ia heritrix changes this cookies array list clear this cookies map clear end ia heritrix changes
clears all cookies
public long reduce long fp int n 8 degree 8 long local n 8 0 fp 1 l 8 n long temp zero for int i 0 i n i temp byte mod table 8 i int fp 0xff fp 8 return local temp
return a value equal mod code polynomial code to
public void set end offset int offset this end offset offset
set the ending offset
public boolean stop server throws ioexception return is success result stop server string
call stop server command
public string stop server string throws ioexception return stop server string type text
call stop server command
public string stop server string string type throws ioexception return do command server stop type
call stop server command
public boolean run throws ioexception return is passed result run string
call run command
public string run string throws ioexception return run string type text
call run command
public string run string string type throws ioexception return do command run type
call run command
public boolean run async throws ioexception return is success result run async string
call run async command
public string run async string throws ioexception return run async string type text
call run async command
public string run async string string type throws ioexception return do command run async type
call run async command
private void init throws exception number converter1 set min integer digits 1 number converter1 set max integer digits 40 number converter1 set max fraction digits 3
p automatically managed component initialization
private void init throws exception drop down1 default options set options new com sun webui jsf model option new com sun webui jsf model option 1 f sica new com sun webui jsf model option 2 jur dica drop down1 default options set selected value 1
p automatically managed component initialization
protected application bean1 get application bean1 return this get application bean1
p return a reference to the scoped data bean
protected session bean1 get session bean1 return this get session bean1
p return a reference to the scoped data bean
protected request bean1 get request bean1 return this get request bean1
p return a reference to the scoped data bean
public void registrar tramite tramite ptramite throws my sqlintegrity constraint violation exception tramite dao req dao new tramite dao try req dao tramite registrar ptramite catch my sqlintegrity constraint violation exception ee throw ee catch exception e
se registra un tr mite en la bd
public tramite buscar tramite por id int pid throws exception result set rs null prepared statement stmt null connection cx connection database util get connection factory get connection stmt prepared statement cx prepare statement call tramites xid listar stmt set int 1 pid rs result set stmt execute query tramite tramite null while rs next tramite new tramite tramite set dias respuesta rs get int dias respuesta tramite set nombre rs get string nombre tramite tramite set activo rs get boolean activo tramite set id tramite rs get int id tramite rs close cx close return tramite
devuelve un tr mite seg n su id
public void registrar array list requisito requisitos throws my sqlintegrity constraint violation exception gestor registrar tramite this gestor asignar requisitos tramite this requisitos
descripcion registra un tr mite con sus requisitos
private void init throws exception radio button group1 default options set options new com sun webui jsf model option new com sun webui jsf model option true s new com sun webui jsf model option false no radio button group2 default options set options new com sun webui jsf model option new com sun webui jsf model option true s new com sun webui jsf model option false no
p automatically managed component initialization
private void init throws exception drop down1 default options set options new com sun webui jsf model option new com sun webui jsf model option 1 profesional new com sun webui jsf model option 2 administrador new com sun webui jsf model option 3 cliente
p automatically managed component initialization
private void init throws exception radio button group1 default options set options new com sun webui jsf model option new com sun webui jsf model option 1 f sica new com sun webui jsf model option 2 jur dica
p automatically managed component initialization
private void init throws exception drop down1 default options set options new com sun webui jsf model option new com sun webui jsf model option urbana urbana new com sun webui jsf model option rural rural
p automatically managed component initialization
private void init throws exception drop down tipo default options set options new com sun webui jsf model option new com sun webui jsf model option 1 casa new com sun webui jsf model option 2 condominio new com sun webui jsf model option 3 urbanizacion
p automatically managed component initialization
protected void hotkey pressed hotkey key callback hotkey pressed key
subclasses need to call this method so the
protected void do paint graphics2 d graphics buffered image image int x int y graphics draw image image x y null
image is softclipped
public void stop bundle context bc throws exception log info string format stopping java to osgi services converter for s service class get name no need to unregister our service the osgi framework handles it for us
called whenever the osgi framework stops our bundle
public void multiply hessian vect x vect data data clone transform forward linearized data x reference model data is fx data multiply inverse covariance data is nfx x multiply inverse covariance x is mx transform add transpose data x reference model x is f nf m x data dispose
multiply by hessian code h fnf m code
private void print double fraction long current time synchronized this if log null log info prefix get progress report start time current time fraction init fraction last fraction fraction last time current time
let user know about progress
public void add row object items if n columns 0 n columns items length if items length 0 throw new illegal argument exception added row with no items if items length n columns throw new illegal argument exception added row with items length items to table with n columns columns string row new string items length for int i 0 i items length i if items i instanceof double items i instanceof float row i nsf number items i double value else row i string value of items i rows add row
adds a row of items to the table
public void remove row int index rows remove index
removes the row at the specified position from the table
public void condense int max if max 0 throw new illegal argument exception max size is max must be 0 int size size if size max return int stride size max 1 max assert stride 1 stride stride size size max max for int index size 1 index 0 index stride for int i 0 i stride 1 size max i remove row index i assert size max size size max max new size size stride stride n to string return
condenses the table to specified maximum number of lines
public line3 intersect plane3 plane throws ill posed exception float direction new float 3 direction of intersecting line cross3 direction plane normal normal parallels both planes if almost float zero magnitude3 direction throw new ill posed exception planes are parallel find a line on this plane that is perpendicular to intersection line float angle new float 3 cross3 angle direction normal line3 line new line3 point angle float point line intersect plane point on both planes return new line3 point direction
get the line at the intersection of two planes
public index grouper grouper grouper int indices init grouper indices
find adjacent groups in an arbitrary set of indices
protected void init double data double variance data data variance variance
construct from an array of data
public int get number groups return n groups
return the number of identified groups
public int get first element int group return first group
identify the first member of a group
public int get number elements int group return n elements group
identify the number of members in a group
public int get group int element return group element
return the group for an element
public int get last element int group return get first element group get number elements group 1
identify the last member of a group
public double get distance list first list list second list double best distances initialize new double first list size 1 second list size 1 return get distance first list second list 0 0 best distances
returns the edit distance between two sentences
public int size int size 0 iterator i iterator while i has next size i next return size
returns the numbers of sentences in this collection
public s get start state return start state
get the unique start state for this trellis
public s get end state return end state
get the unique end state for this trellis
public double score tagging tagged sentence tagged sentence double log score 0 0 list labeled local trigram context labeled local trigram contexts extract labeled local trigram contexts tagged sentence for labeled local trigram context labeled local trigram context labeled local trigram contexts counter string log score counter local trigram scorer get log score counter labeled local trigram context string current tag labeled local trigram context get current tag if log score counter contains key current tag log score log score counter get count current tag else log score double negative infinity return log score
scores a tagging for a sentence
private string get name out of entry string entry string name if entry index of fn quoted printable 0 name entry substring entry index of fn quoted printable name name substring 0 name index of n name name substring name index of 1 return name
get name out of an entry
private string get number out of entry string entry string number if entry index of tel cell 0 number entry substring entry index of tel cell number number substring 0 number index of n number number substring number index of 1 return number
get cell number out of entry
public string get string string item string s if confproperties contains key item s confproperties get property item if langproperties contains key item s langproperties get property item if s null s equals ignore case system out println value in property file not specified or empty item system exit 8 return s
returns the string from the value of the properties file
public void load into table jtable table default table model model default table model table get model remove everything for int i model get row count 1 i 0 i model remove row i add everything for string elem map key set vector string row new vector string row add elem row add map get elem model add row row table repaint
update table with template data
public int get integer string item string string item get string item int value 1 try value integer parse int string item catch exception e system out println value in property file has wrong format not int item system exit 8 return value
returns the integer from the value of the properties file
public void update money new thread new first connect start new thread new money get start
update credit from sipgate
public void reset main window to field set text sms text set text sms text change to field request focus
reset the main window clear to field and message field
public void send sms if to field get text equals ignore case easter egg decode easter egg e1 to field set text easter egg e new easter egg main window e set visible true e start writing return if check smspre cond new thread new first connect start new thread new send sms start
sends sms after it checked all preconditions
public template handler get template handler if templatehandler null templatehandler new template handler return templatehandler
gives back the templatehandler and creates it if it was not there
public void set adr prop properties adr prop adrproperties adr prop output stream prop out null try prop out new file output stream new file get string adr file catch file not found exception e show message 1 get string error get string error phonebook write return try adrproperties store prop out address list catch ioexception e show message 1 get string error get string error phonebook write return adr updated true
saves the new addresses
public void show addresses if adr window null adr updated adr window new adr select window main window adr window update list adr window set visible true
displays the addressbook window
public string get string string item if confproperties contains key item return confproperties get property item if langproperties contains key item return langproperties get property item system out println value in property file not specified item system exit 8 return
get string from properties
public string get smstext string text sms text get text int i 0 while i text length if text char at i n if i 0 if text char at i 1 text text substring 0 i text substring i 1 text length else char array text to char array array i text new string array else i else i return text
returns the sms text without multiple returns