idx int64 0 165k | question stringlengths 73 5.81k | target stringlengths 5 918 |
|---|---|---|
127,900 | private static String getTemplateMarker ( String str ) throws IllegalStateException { Pattern p = Pattern . compile ( "\\{\\{(.*?)\\}\\}" , Pattern . DOTALL ) ; Matcher matcher = p . matcher ( str ) ; String tpl = null ; while ( matcher . find ( ) ) { if ( tpl != null ) { throw new IllegalStateException ( "More than on... | Returns the template marker of the sentence . |
127,901 | public void process ( final Task < Diff > task ) throws ConfigurationException , IOException , SQLConsumerException { long startTime = System . currentTimeMillis ( ) ; TaskTypes type = task . getTaskType ( ) ; if ( type == TaskTypes . TASK_FULL || type == TaskTypes . TASK_PARTIAL_FIRST ) { this . sqlEncoder . init ( ) ... | This method will process the given DiffTask and send him to the specified output . |
127,902 | public void add ( final D data ) { this . container . add ( data ) ; if ( data instanceof ISizeable ) { this . byteSize += ( ( ISizeable ) data ) . byteSize ( ) ; } } | Adds data to this task . |
127,903 | public void generate ( ) throws WikiApiException { Indexer data = null ; try { data = new Indexer ( config ) ; System . out . println ( "GENERATING INDEX STARTED" ) ; long bufferSize = config . getBufferSize ( ) ; Revision rev ; long count = 0 ; long last = 0 , now , start = System . currentTimeMillis ( ) ; Iterator < ... | Starts the generation of the indices . |
127,904 | private static Properties load ( String configFilePath ) { Properties props = new Properties ( ) ; BufferedInputStream fis = null ; try { File configFile = new File ( configFilePath ) ; fis = new BufferedInputStream ( new FileInputStream ( configFile ) ) ; props . load ( fis ) ; } catch ( IOException e ) { System . err... | Load a properties file from the classpath |
127,905 | public List < TextPair > getInlineTextPairs ( boolean markTemplates ) { List < TextPair > pairList = new ArrayList < TextPair > ( ) ; try { List < ExtractedSection > beforeSections = null ; List < ExtractedSection > afterSections = null ; if ( markTemplates ) { beforeSections = ParseUtils . getSections ( before . getRe... | Returns the text around the given template and returns the corresponding text in the other pair part of the RevisionPair . |
127,906 | private boolean containsIgnoreCase ( List < String > stringlist , String match ) { for ( String s : stringlist ) { if ( s . equalsIgnoreCase ( match ) ) { return true ; } } return false ; } | Checks if a list of string contains a String while ignoring case |
127,907 | private List < String > listToLowerCase ( List < String > l ) { List < String > result = new ArrayList < String > ( ) ; for ( String s : l ) { result . add ( s . toLowerCase ( ) ) ; } return result ; } | Converts a List of Strings to lower case Strings . |
127,908 | public String configurationInfo ( ) { StringBuilder result = new StringBuilder ( ) ; result . append ( "MediaWikiParser configuration:\n" ) ; result . append ( "ParserClass: " + this . getClass ( ) + "\n" ) ; result . append ( "ShowImageText: " + showImageText + "\n" ) ; result . append ( "DeleteTags: " + deleteTags + ... | Look at the MediaWikiParser interface for a description ... |
127,909 | private boolean runConfig ( ) { if ( lineSeparator == null ) { logger . debug ( "Set lineSeparator" ) ; return false ; } if ( categoryIdentifers == null ) { logger . warn ( "Set categoryIdentifers" ) ; return false ; } if ( languageIdentifers == null ) { logger . warn ( "Set languageIdentifers" ) ; return false ; } if ... | Checks if the configuration is runnable . |
127,910 | private void deleteTOCTag ( SpanManager sm ) { int temp = 0 ; while ( ( temp = sm . indexOf ( "__TOC__" , temp ) ) != - 1 ) { sm . delete ( temp , temp + 2 + 3 + 2 ) ; } temp = 0 ; while ( ( temp = sm . indexOf ( "__NOTOC__" , temp ) ) != - 1 ) { sm . delete ( temp , temp + 2 + 5 + 2 ) ; } } | Deleteing ALL TOC Tags |
127,911 | private lineType getLineType ( SpanManager sm , Span lineSpan ) { switch ( lineSpan . charAt ( 0 , sm ) ) { case '{' : if ( lineSpan . charAt ( 1 , sm ) == '|' ) { return lineType . TABLE ; } else { return lineType . PARAGRAPH ; } case '=' : if ( lineSpan . length ( ) > 2 && sm . charAt ( lineSpan . getEnd ( ) - 1 ) ==... | Retunrns the Type of a line this is mainly done by the First Char of the Line ... |
127,912 | private int getSectionLevel ( SpanManager sm , Span sectionNameSpan ) { int begin = sectionNameSpan . getStart ( ) ; int end = sectionNameSpan . getEnd ( ) ; int level = 0 ; try { while ( ( sm . charAt ( begin + level ) == '=' ) && ( sm . charAt ( end - 1 - level ) == '=' ) ) { level ++ ; } } catch ( StringIndexOutOfBo... | Returns the number of Equality Chars which are used to specify the level of the Section . |
127,913 | private SectionContainer buildSectionStructure ( List < SectionContent > scl ) { SectionContainer result = new SectionContainer ( 0 ) ; for ( SectionContent sContent : scl ) { int contentLevel = sContent . getLevel ( ) ; SectionContainer sContainer = result ; for ( int containerLevel = result . getLevel ( ) + 1 ; conta... | Takes a list of SectionContent and returns a SectionContainer with the given SectionContent s in the right structure . |
127,914 | private static String getLinkNameSpace ( String target ) { int pos = target . indexOf ( ':' ) ; if ( pos == - 1 ) { return null ; } else { return target . substring ( 0 , pos ) . replace ( '_' , ' ' ) . trim ( ) . toLowerCase ( ) ; } } | Returns the LOWERCASE NameSpace of the link target |
127,915 | private void parseQuotedSpans ( SpanManager sm , Span s , List < Span > quotedSpans , String quotation ) { final int qlen = quotation . length ( ) ; int start = sm . indexOf ( quotation , s . getStart ( ) , s . getEnd ( ) ) ; while ( start != - 1 ) { int end = sm . indexOf ( quotation , start + qlen , s . getEnd ( ) ) ... | Searches the Range given by the Span s for the double occurence of quotation and puts the results in the List quotedSpans . The Quotation tags will be deleted . |
127,916 | private void parseBoldAndItalicSpans ( SpanManager sm , Span line , List < Span > boldSpans , List < Span > italicSpans ) { parseQuotedSpans ( sm , line , boldSpans , "'''" ) ; parseQuotedSpans ( sm , line , italicSpans , "''" ) ; int openTag = sm . indexOf ( "''" , line ) ; if ( openTag != - 1 ) { Span qs = new Span (... | Searches a line for Bold and Italic quotations this has to be done linewhise . |
127,917 | public ContentElement parseContentElement ( String src ) { SpanManager sm = new SpanManager ( src ) ; ContentElementParsingParameters cepp = new ContentElementParsingParameters ( ) ; parseImagesAndInternalLinks ( sm , cepp . linkSpans , cepp . links ) ; LinkedList < Span > lineSpans = new LinkedList < Span > ( ) ; getL... | Building a ContentElement from a String |
127,918 | private ContentElement parseContentElement ( SpanManager sm , ContentElementParsingParameters cepp , Span lineSpan ) { LinkedList < Span > lineSpans = new LinkedList < Span > ( ) ; lineSpans . add ( lineSpan ) ; return parseContentElement ( sm , cepp , lineSpans , new ContentElement ( ) ) ; } | Building a ContentElement from a single line . |
127,919 | private static List < Link > sortLinks ( List < Link > links ) { List < Link > result = new ArrayList < Link > ( ) ; for ( Link l : links ) { int pos = 0 ; while ( pos < result . size ( ) && l . getPos ( ) . getStart ( ) > result . get ( pos ) . getPos ( ) . getStart ( ) ) { pos ++ ; } result . add ( pos , l ) ; } retu... | Sorts the Links ... |
127,920 | private static List < Template > sortTemplates ( List < Template > templates ) { List < Template > result = new ArrayList < Template > ( ) ; for ( Template t : templates ) { int pos = 0 ; while ( pos < result . size ( ) && t . getPos ( ) . getStart ( ) > result . get ( pos ) . getPos ( ) . getStart ( ) ) { pos ++ ; } r... | Sorts the Templates ... |
127,921 | private void setFirstParagraph ( ParsedPage pp ) { int nr = pp . nrOfParagraphs ( ) ; for ( int i = 0 ; i < nr ; i ++ ) { Paragraph p = pp . getParagraph ( i ) ; SpanManager ptext = new SpanManager ( p . getText ( ) ) ; List < Span > delete = new ArrayList < Span > ( ) ; ptext . manageList ( delete ) ; List < Template ... | Algorithm to identify the first paragraph of a ParsedPage |
127,922 | public static void printProgressInfo ( int counter , int size , int step , ProgressInfoMode mode , String text ) { if ( size < step ) { return ; } if ( counter % ( size / step ) == 0 ) { double progressPercent = counter * 100 / size ; progressPercent = 1 + Math . round ( progressPercent * 100 ) / 100.0 ; if ( mode . eq... | Prints a progress counter . |
127,923 | protected void bufferInsertRow ( String table , Object [ ] [ ] row ) throws IOException { StringBuffer sql = ( StringBuffer ) insertBuffers . get ( table ) ; if ( sql != null ) { if ( traits . supportsMultiRowInsert ( ) && ( sql . length ( ) < blockSize ) ) { sql . append ( ',' ) ; appendInsertValues ( sql , row ) ; re... | default 512k inserts |
127,924 | public void add ( final Revision rev ) { int revIndex = rev . getRevisionCounter ( ) ; if ( this . mapping . containsKey ( revIndex ) ) { revIndex = this . mapping . get ( revIndex ) ; } ChronoFullRevision cfr = this . fullRevStorage . get ( rev . getRevisionCounter ( ) ) ; ChronoStorageBlock block = new ChronoStorageB... | Adds a revision to the chrono storage . |
127,925 | public Revision remove ( ) { ChronoStorageBlock block = first ; this . revisionIndex = block . getRevisionIndex ( ) ; ChronoStorageBlock next = block . getIndexNext ( ) ; this . first = next ; if ( next != null ) { this . first . setIndexPrev ( null ) ; } else { this . last = null ; } block . setDelivered ( true ) ; Ch... | Removes a revision from the chrono storage . |
127,926 | public Revision get ( final int revisionIndex ) { if ( this . storage . containsKey ( revisionIndex ) ) { ChronoStorageBlock block = this . storage . get ( revisionIndex ) ; return block . getRev ( ) ; } return null ; } | Returns the revision of the specified chrono storage block . |
127,927 | public void clean ( ) { ChronoFullRevision cfr = firstCFR ; totalSize = size ; while ( cfr != null ) { totalSize += cfr . size ( ) ; cfr = cfr . getNext ( ) ; } if ( totalSize < MAX_STORAGE_SIZE ) { return ; } cfr = firstCFR ; while ( cfr != null ) { totalSize += cfr . clean ( revisionIndex , 0 ) ; cfr = cfr . getNext ... | Reduces the amount of used storage by discarding chrono storage blocks . |
127,928 | private void write ( final int val ) throws EncodingException { if ( val < 0 || val > 255 ) { throw ErrorFactory . createEncodingException ( ErrorKeys . DIFFTOOL_ENCODING_VALUE_OUT_OF_RANGE , "byte value out of range: " + val ) ; } this . stream . write ( val ) ; } | Writes a byte to the buffer . |
127,929 | public void writeBit ( final int bit ) throws EncodingException { if ( bit != 0 && bit != 1 ) { throw ErrorFactory . createEncodingException ( ErrorKeys . DIFFTOOL_ENCODING_VALUE_OUT_OF_RANGE , "bit value out of range: " + bit ) ; } this . buffer |= bit << ( 7 - this . bufferLength ) ; this . bufferLength ++ ; if ( buf... | Writes a single bit to the buffer . |
127,930 | public void writeValue ( final int length , final int value ) throws EncodingException { if ( length > 31 ) { throw ErrorFactory . createEncodingException ( ErrorKeys . DIFFTOOL_ENCODING_VALUE_OUT_OF_RANGE , "more than maximum length: " + value ) ; } for ( int i = length - 1 ; i >= 0 ; i -- ) { writeBit ( ( value >> i ... | Writes a positive integer to the buffer . |
127,931 | public void write ( final byte [ ] bText ) throws EncodingException { writeFillBits ( ) ; int l = bText . length ; for ( int i = 0 ; i < l ; i ++ ) { write ( 0xFF & bText [ i ] ) ; } } | Writes the byte array to the buffer . The currently used buffer will be filled with zero bits before is is written in front of the byte - array . |
127,932 | public static String getOsType ( ) { String osType = "unknown" ; String osName = System . getProperty ( "os.name" ) ; if ( osName . contains ( "Windows" ) ) { osType = "Windows" ; } else if ( osName . contains ( "Linux" ) ) { osType = "Linux" ; } return osType ; } | Tries to determine the tpye of OS the application is running on . At the moment only Windows and Linux are supported . |
127,933 | public static double getUsedMemory ( ) { Runtime rt = Runtime . getRuntime ( ) ; long memLong = rt . totalMemory ( ) - rt . freeMemory ( ) ; double memDouble = memLong / ( 1024.0 * 1024.0 ) ; memDouble = Math . round ( memDouble * 100 ) / 100.0 ; return memDouble ; } | Gets the memory used by the JVM in MB . |
127,934 | public Set < Integer > getOutlinkIDs ( ) { Set < Integer > tmpSet = new HashSet < Integer > ( ) ; Session session = wiki . __getHibernateSession ( ) ; session . beginTransaction ( ) ; session . buildLockRequest ( LockOptions . NONE ) . lock ( hibernatePage ) ; tmpSet . addAll ( hibernatePage . getOutLinks ( ) ) ; sessi... | The result set may also contain links from non - existing pages . It is in the responsibility of the user to check whether the page exists . |
127,935 | public void run ( ) { try { ArchiveManager archives = new ArchiveManager ( ) ; ArticleReaderInterface articleReader = null ; ArchiveDescription description = null ; Task < Revision > task = null ; DiffCalculatorInterface diffCalc ; if ( MODE_STATISTICAL_OUTPUT ) { diffCalc = new TimedDiffCalculator ( new TaskTransmitte... | Runs the diff creation process |
127,936 | public void setTimeStamp ( final String timeStamp ) { String time = timeStamp . replace ( 'T' , ' ' ) ; time = time . replace ( 'Z' , ' ' ) ; this . timeStamp = Timestamp . valueOf ( time ) ; } | Sets the timestamp information . |
127,937 | public String readFragmentedUTF ( ) throws IOException { StringBuffer result = new StringBuffer ( super . readUTF ( ) ) ; boolean fragmentFlag = super . readBoolean ( ) ; while ( fragmentFlag != END_REACHED ) { result . append ( super . readUTF ( ) ) ; fragmentFlag = super . readBoolean ( ) ; } return result . toString... | Read a fragmented UTF - 8 String |
127,938 | public String readUTFAsArray ( ) throws IOException { byte [ ] buffer = new byte [ super . readInt ( ) ] ; super . read ( buffer , 0 , buffer . length ) ; return new String ( buffer , "UTF-8" ) ; } | Read a byte array formed UTF - 8 String |
127,939 | private String getPagesArticlesFile ( ) { String pagesArticlesFile = null ; String parseMessage = null ; if ( files . getInputPagesArticles ( ) != null ) { pagesArticlesFile = files . getInputPagesArticles ( ) ; parseMessage = "Discussions are unavailable" ; } if ( files . getInputPagesMetaCurrent ( ) != null ) { pages... | Parse either pages - articles . xml or pages - meta - current . xml . If both files exist in the input directory pages - meta - current . xml will be favored . |
127,940 | public Span adjust ( int offset , int n ) { if ( offset < 0 ) return this ; if ( offset < end ) { end += n ; if ( end < offset ) end = offset ; } else return this ; if ( offset < start ) { start += n ; if ( start < offset ) start = offset ; } return this ; } | Adjusts the start and end Position of the Span if they are larger than the offset . |
127,941 | public Span trimTrail ( CharSequence src ) { if ( start < end ) { while ( src . charAt ( end - 1 ) == 32 ) { end -- ; if ( start == end ) break ; } } return this ; } | Returns the Span with trailing whitespaces omitted . |
127,942 | public Span trim ( CharSequence src ) { if ( start < end ) while ( src . charAt ( end - 1 ) == 32 ) { end -- ; if ( start == end ) break ; } if ( start < end ) while ( src . charAt ( start ) == 32 ) { start ++ ; if ( start == end ) break ; } return this ; } | Returns the Span with leading and trailing whitespaces omitted . |
127,943 | public long byteSize ( ) { long byteSize = 3 ; int size = parts . size ( ) ; for ( int i = 0 ; i < size ; i ++ ) { byteSize += this . parts . get ( i ) . byteSize ( ) ; } return byteSize ; } | Returns an estimation of the size used to stored the data . |
127,944 | public boolean isFullRevision ( ) { if ( this . parts . size ( ) == 1 ) { DiffPart p = this . parts . get ( 0 ) ; if ( p . getAction ( ) == DiffAction . FULL_REVISION_UNCOMPRESSED ) { return true ; } } return false ; } | Returns whether the revision described by this diff is a full revision or not . |
127,945 | private double computeAverageFanOut ( Iterable < Page > pages ) { Set < Integer > pageIDs = new HashSet < Integer > ( ) ; while ( pages . iterator ( ) . hasNext ( ) ) { pageIDs . add ( pages . iterator ( ) . next ( ) . getPageId ( ) ) ; } if ( pageIDs . isEmpty ( ) ) { logger . warn ( "Cannot compute average fan-out of... | Computes the average fan out of the page set . Fan out is the number of outgoing links per page . |
127,946 | private Map < Integer , Set < Integer > > getCategoryArticleMap ( Wikipedia pWiki , Set < Integer > pNodes ) throws WikiPageNotFoundException { Map < Integer , Set < Integer > > categoryArticleMap = new HashMap < Integer , Set < Integer > > ( ) ; int progress = 0 ; for ( int node : pNodes ) { progress ++ ; ApiUtilities... | Building a mapping from categories to article sets . |
127,947 | public void getGraphParameters ( CategoryGraph catGraph ) { double startTime = System . currentTimeMillis ( ) ; logger . error ( catGraph . getGraphInfo ( ) ) ; double endTime = ( System . currentTimeMillis ( ) - startTime ) / 1000.0 ; logger . error ( endTime + "s" ) ; } | Get various graph parameters like diameter average out - degree etc of the categroy graph . |
127,948 | public int getNumberOfCategorizedArticles ( Wikipedia pWiki , CategoryGraph catGraph ) throws WikiApiException { if ( categorizedArticleSet == null ) { iterateCategoriesGetArticles ( pWiki , catGraph ) ; } return categorizedArticleSet . size ( ) ; } | If the return value has been already computed it is returned else it is computed at retrieval time . |
127,949 | public Map < Integer , Integer > getDistributionOfArticlesByCategory ( Wikipedia pWiki , CategoryGraph catGraph ) throws WikiPageNotFoundException { if ( degreeDistribution == null ) { iterateCategoriesGetArticles ( pWiki , catGraph ) ; } return degreeDistribution ; } | Computes the distribution of the number of articles per category . If the return value has been already computed it is returned else it is computed at retrieval time . |
127,950 | private void verify ( final Task < Diff > task , final Diff decodedDiff , final Diff originalDiff ) throws SQLConsumerException { String orig = originalDiff . toString ( ) ; String deco = decodedDiff . toString ( ) ; boolean notEqual = ! orig . equals ( deco ) ; if ( notEqual && MODE_SURROGATES == SurrogateModes . REPL... | Verifies that the decoded diff is identical to the original diff . |
127,951 | public void writeFragmentedUTF ( String str ) throws IOException { if ( str . length ( ) <= MAX_LENGTH ) { writeLastUTFFragment ( str ) ; } else { writeUTFFragment ( str . substring ( 0 , MAX_LENGTH ) ) ; writeFragmentedUTF ( str . substring ( MAX_LENGTH ) ) ; } } | The UTF - 8 encoding uses sequences of 1 2 or 3 bytes per character . With he maximal length of the fragment we want to ensure that there are no overflow of 65536 byte sized buffer |
127,952 | private void validate7ZipSettings ( ) { boolean flag = controller . is7ZipEnabled ( ) ; sevenZipEnableBox . setSelected ( flag ) ; sevenZipLabel . setEnabled ( flag ) ; sevenZipPathField . setEnabled ( flag ) ; sevenZipSearchButton . setEnabled ( flag ) ; } | Validates the 7Zip settings |
127,953 | public MediaWikiParser createParser ( ) { logger . debug ( "Selected Parser: {}" , parserClass ) ; if ( parserClass == ModularParser . class ) { ModularParser mwgp = new ModularParser ( "\n" , languageIdentifers , categoryIdentifers , imageIdentifers , showImageText , deleteTags , showMathTagContent , calculateSrcSpans... | Creates a MediaWikiParser with the configurations which has been set . |
127,954 | public static String getSetContents ( Set s ) { StringBuffer sb = new StringBuffer ( 1000 ) ; Object [ ] sortedArray = s . toArray ( ) ; Arrays . sort ( sortedArray ) ; int counter = 0 ; int elementsPerRow = 10 ; for ( Object element : sortedArray ) { sb . append ( element . toString ( ) + " " ) ; counter ++ ; if ( ( c... | Debug output an internal set structure . |
127,955 | public static String getMapContents ( Map m ) { StringBuffer sb = new StringBuffer ( 1000 ) ; Object [ ] sortedArray = m . keySet ( ) . toArray ( ) ; Arrays . sort ( sortedArray ) ; for ( Object element : sortedArray ) { sb . append ( element . toString ( ) + " - " + m . get ( element ) + System . getProperty ( "line.s... | Debug output an internal map structure as key - value pairs . |
127,956 | public static void logDiffException ( final Logger logger , final DiffException e ) { logger . logException ( Level . ERROR , "DiffException" , e ) ; } | Logs the occurance of a DiffException . |
127,957 | public static void logInvalidTaskType ( final Logger logger , final TaskTypes type ) { logger . logMessage ( Level . INFO , "Invalid TaskType: " + type ) ; } | Logs the occurance of an invalid task type . |
127,958 | public static void logStartArticleProcessing ( final Logger logger , final Task < Revision > article , long time , long transmittingTime ) { logger . logMessage ( Level . TRACE , "Start Procssing Task\t" + article . toString ( ) ) ; } | Logs the start of the processing of an revision task . |
127,959 | private void initializePrefixes ( ) { if ( namespaceMap == null ) { System . err . println ( "Cannot use whitespace filter without initializing the namespace-prefix map for the current Wikipedia language version. DISABLING FILTER." ) ; } else { prefixesToAllow = new HashSet < String > ( ) ; prefixesToReject = new HashS... | Initialize allowed and restricted prefixes |
127,960 | public boolean checkArticle ( String title ) { if ( namespaceMap == null || namespaceMap . size ( ) == 0 || allowedNamespaces == null || allowedNamespaces . size ( ) == 0 ) { return true ; } else { for ( String str : prefixesToReject ) { if ( title . startsWith ( str ) ) { return false ; } } for ( String str : prefixes... | Filter any pages by title prefixes |
127,961 | public void setSectionHandling ( Map < String , EnumMap < SIT , EnumMap < CIT , Boolean > > > sectionHandling ) { this . sectionHandling = sectionHandling ; } | Be sure to set the Default Section Handling to avoid errors ... |
127,962 | public void addSectionHandling ( int level , EnumMap < SIT , EnumMap < CIT , Boolean > > sh ) { sectionHandling . put ( SectionType . SECTION_LEVEL . toString ( ) + level , sh ) ; } | adds section handling for a specified relative level ... |
127,963 | public void addSectionHandling ( String name , EnumMap < SIT , EnumMap < CIT , Boolean > > sh ) { sectionHandling . put ( SectionType . USER_SECTION . toString ( ) + name . toUpperCase ( ) , sh ) ; } | adds section handling for a specila section name ... |
127,964 | public void setDefaultSectionHandling ( EnumMap < SIT , EnumMap < CIT , Boolean > > sh ) { sectionHandling . put ( SectionType . DEFAULT_SECTION . toString ( ) , sh ) ; } | sets the section handling for all sections which are not set by level or name ... |
127,965 | public String getSelectionInfo ( ) { StringBuilder result = new StringBuilder ( ) ; result . append ( "SelectionInfo: " + this . getClass ( ) . toString ( ) + "\n" ) ; result . append ( "Page:" + CITInfo ( pageHandling ) + "\n" ) ; result . append ( "FirstParagraph:" + CITInfo ( firstParagraphHandling ) + "\n" ) ; for ... | Returns information which infomations are selected by the actual configuration |
127,966 | public static String CITInfo ( EnumMap < CIT , Boolean > hp ) { StringBuilder result = new StringBuilder ( ) ; result . append ( "[" ) ; if ( hp != null ) { for ( CIT key : hp . keySet ( ) ) result . append ( key . toString ( ) + ":" + hp . get ( key ) + ", " ) ; result . delete ( result . length ( ) - 2 , result . len... | Converts a CITMap into a human readable String |
127,967 | public static String SITInfo ( EnumMap < SIT , EnumMap < CIT , Boolean > > shp ) { StringBuilder result = new StringBuilder ( ) ; for ( SIT key : shp . keySet ( ) ) { result . append ( "\t" + key . toString ( ) + ":" + CITInfo ( shp . get ( key ) ) + "\n" ) ; } return result . toString ( ) ; } | Converts a SITMap into a human readable String |
127,968 | public String getSelectedText ( ParsedPage pp ) { if ( pp == null ) return null ; StringBuilder sb = new StringBuilder ( ) ; levelModifier = pp . getSection ( 0 ) . getLevel ( ) - 1 ; if ( pageHandling == null ) { if ( firstParagraphHandling != null ) { handleContent ( pp . getFirstParagraph ( ) , firstParagraphHandlin... | Returns the Information of a ParsedPage which are selected by the actual configuration |
127,969 | public String toClock ( ) { StringBuilder s = new StringBuilder ( ) ; s . append ( ( ( this . weeks * 7 + this . days ) * 24 + this . hours ) + ":" ) ; if ( this . minutes < 10 ) { s . append ( '0' ) ; } s . append ( this . minutes + ":" ) ; if ( this . seconds < 10 ) { s . append ( '0' ) ; } s . append ( this . second... | Returns the clock description of the time value . |
127,970 | public static String toClock ( long time ) { long ttime = time ; short miliseconds = ( short ) ( ttime % 1000 ) ; ttime = ttime / 1000 ; short seconds = ( short ) ( ttime % 60 ) ; ttime = ttime / 60 ; short minutes = ( short ) ( ttime % 60 ) ; ttime = ttime / 60 ; short hours = ( short ) ( ttime % 24 ) ; ttime = ttime ... | Transforms a millisecond value to the clock representation . |
127,971 | public Object getValueAt ( final int row , final int col ) { switch ( col ) { case 0 : return archives . get ( row ) . getType ( ) ; case 1 : return archives . get ( row ) . getStartPosition ( ) ; case 2 : return archives . get ( row ) . getPath ( ) ; } return "---" ; } | Returns the value at the specified position . |
127,972 | public void applyConfiguration ( final ConfigSettings config ) { clear ( ) ; Iterator < ArchiveDescription > aIt = config . archiveIterator ( ) ; while ( aIt . hasNext ( ) ) { addArchive ( aIt . next ( ) ) ; } } | Adds the ArchiveDescriptions contained in the configuration . |
127,973 | private boolean queryArticle ( ) throws SQLException { Statement statement = this . connection . createStatement ( ) ; String query = "SELECT ArticleID, FullRevisionPKs, RevisionCounter " + "FROM index_articleID_rc_ts " + "WHERE articleID > " + this . currentArticleID + " LIMIT " + MAX_NUMBER_RESULTS ; resultArticles =... | Retrieves the next articles from the article index . |
127,974 | private Revision init ( ) throws WikiApiException { try { currentArticleID = resultArticles . getInt ( 1 ) ; String fullRevisionPKs = resultArticles . getString ( 2 ) ; String revisionCounters = resultArticles . getString ( 3 ) ; int index = revisionCounters . lastIndexOf ( ' ' ) ; if ( index == - 1 ) { throw new Runti... | Initiates the iteration over of a new article . |
127,975 | private void initTable ( ) { namespaces = new JTable ( new FilterTableModel ( ) ) ; namespaces . removeColumn ( namespaces . getColumn ( "#" ) ) ; namespaces . setFillsViewportHeight ( true ) ; namespaces . setPreferredScrollableViewportSize ( new Dimension ( 500 , 70 ) ) ; JScrollPane scrollPane = new JScrollPane ( na... | Initialize JTable that contains namespaces |
127,976 | public static void logError ( final Logger logger , final Error e ) { logger . logError ( Level . ERROR , "Unexpected Error" , e ) ; } | Logs an error . |
127,977 | public static void logException ( final Logger logger , final Exception e ) { logger . logException ( Level . ERROR , "Unexpected Exception" , e ) ; } | Logs an exception . |
127,978 | public static void logStatus ( final Logger logger , final long startTime , final long sleepingTime , final long workingTime ) { logger . logMessage ( Level . DEBUG , "Consumer-Status-Report [" + Time . toClock ( System . currentTimeMillis ( ) - startTime ) + "]" + "\tEFFICIENCY\t " + MathUtilities . percentPlus ( work... | Logs the status of the consumer . |
127,979 | public static void logTimeoutException ( final Logger logger , final TimeoutException e ) { logger . logException ( Level . WARN , "TimeoutException" , e ) ; } | Logs the occurrence of a TimeoutException . |
127,980 | public static Logger createLogger ( final LoggerType type , final String consumerName ) throws LoggingException { Logger log = new Logger ( type , consumerName ) ; if ( consumerLoggingIndex . put ( consumerName , log ) != null ) { throw ErrorFactory . createLoggingException ( ErrorKeys . LOGGING_LOGGINGFACTORY_LOGGER_A... | Creates a new Logger . |
127,981 | public static Logger getLogger ( final String consumerName ) throws LoggingException { Logger log = consumerLoggingIndex . get ( consumerName ) ; if ( log == null ) { throw ErrorFactory . createLoggingException ( ErrorKeys . LOGGING_LOGGINGFACTORY_NO_SUCH_LOGGER ) ; } return log ; } | Returns an already created Logger . |
127,982 | public Diff decode ( ) throws UnsupportedEncodingException , DecodingException { int header = r . read ( 3 ) ; if ( DiffAction . parse ( header ) != DiffAction . DECODER_DATA ) { throw new DecodingException ( "Invalid codecData code: " + header ) ; } int blockSize_C = 3 ; int blockSize_S = r . read ( 5 ) ; int blockSiz... | Decodes the information and returns the Diff . |
127,983 | private Diff decode ( final int blockSize_C , final int blockSize_S , final int blockSize_E , final int blockSize_B , final int blockSize_L ) throws UnsupportedEncodingException , DecodingException { int code = r . read ( blockSize_C ) ; Diff diff = new Diff ( ) ; while ( code != - 1 ) { switch ( DiffAction . parse ( c... | Decodes the information after the codec was successfully decoded and returns the Diff . |
127,984 | private DiffPart decodeAdd ( final int blockSize_S , final int blockSize_L ) throws UnsupportedEncodingException , DecodingException { if ( blockSize_S < 1 || blockSize_L < 1 ) { throw new DecodingException ( "Invalid value for blockSize_S: " + blockSize_S + " or blockSize_L: " + blockSize_L ) ; } int s = r . read ( bl... | Decodes an Add operation . |
127,985 | private DiffPart decodeCut ( final int blockSize_S , final int blockSize_E , final int blockSize_B ) throws DecodingException { if ( blockSize_S < 1 || blockSize_E < 1 || blockSize_B < 1 ) { throw new DecodingException ( "Invalid value for blockSize_S: " + blockSize_S + ", blockSize_E: " + blockSize_E + " or blockSize_... | Decodes a Cut operation . |
127,986 | private DiffPart decodeDelete ( final int blockSize_S , final int blockSize_E ) throws DecodingException { if ( blockSize_S < 1 || blockSize_E < 1 ) { throw new DecodingException ( "Invalid value for blockSize_S: " + blockSize_S + " or blockSize_E: " + blockSize_E ) ; } int s = r . read ( blockSize_S ) ; int e = r . re... | Decodes a Delete operation . |
127,987 | private DiffPart decodeFullRevision ( final int blockSize_L ) throws UnsupportedEncodingException , DecodingException { if ( blockSize_L < 1 ) { throw new DecodingException ( "Invalid value for blockSize_L: " + blockSize_L ) ; } int l = r . read ( blockSize_L ) ; ByteArrayOutputStream output = new ByteArrayOutputStream... | Decodes a FullRevision operation . |
127,988 | private DiffPart decodePaste ( final int blockSize_S , final int blockSize_B , final BitReader r ) throws DecodingException { if ( blockSize_S < 1 || blockSize_B < 1 ) { throw new DecodingException ( "Invalid value for blockSize_S: " + blockSize_S + " or blockSize_B: " + blockSize_B ) ; } int s = r . read ( blockSize_S... | Decodes a Paste operation . |
127,989 | private DiffPart decodeReplace ( final int blockSize_S , final int blockSize_E , final int blockSize_L ) throws UnsupportedEncodingException , DecodingException { if ( blockSize_S < 1 || blockSize_E < 1 || blockSize_L < 1 ) { throw new DecodingException ( "Invalid value for blockSize_S: " + blockSize_S + ", blockSize_E... | Decodes a Replace operation . |
127,990 | private byte [ ] inflateInput ( final byte [ ] zipinput , final int start ) { ByteArrayOutputStream stream ; try { byte [ ] compressedInput = zipinput ; Inflater decompresser = new Inflater ( ) ; decompresser . setInput ( compressedInput , start , compressedInput . length - start ) ; byte [ ] output = new byte [ 1000 ]... | Inflates the zipped input . |
127,991 | public void setInput ( final byte [ ] input ) { if ( input [ 0 ] == - 128 ) { r = new BitReader ( inflateInput ( input , 1 ) ) ; } else { r = new BitReader ( input ) ; } } | Assigns the binary input . |
127,992 | public void setInput ( final InputStream input , final boolean binary ) throws IOException { if ( ! binary ) { int v = input . read ( ) ; StringBuilder buffer = new StringBuilder ( ) ; boolean zipFlag = ( char ) v == '_' ; if ( zipFlag ) { v = input . read ( ) ; } while ( v != - 1 ) { buffer . append ( ( char ) v ) ; v... | Assigns an input stream . |
127,993 | public void setInput ( final String input ) throws DecodingException { boolean zipFlag = input . charAt ( 0 ) == '_' ; if ( zipFlag ) { r = new BitReader ( inflateInput ( Base64 . decodeBase64 ( input . substring ( 1 ) ) , 0 ) ) ; } else { byte [ ] data = Base64 . decodeBase64 ( input ) ; if ( data == null ) { for ( in... | Assigns base 64 encoded input . |
127,994 | public int totalSizeInBits ( ) { if ( converted ) { return 24 + this . countC * 3 + this . countS * blocksize_S + this . countE * blocksize_E + this . countB * blocksize_B + this . countL * blocksize_L + this . countT * 8 ; } converted = true ; if ( this . blocksize_B > 0 ) { this . blocksize_B = ( int ) Math . ceil ( ... | Converts the input information into their log2 values . If an operation is contained in the diff the minimum number of bits used to encode this block is 1 byte . |
127,995 | private void validateDebugSettings ( ) { verifyDiffCheckBox . setSelected ( controller . isDiffVerificationEnabled ( ) ) ; verifyEncodingCheckBox . setSelected ( controller . isEncodingVerificationEnabled ( ) ) ; statsOutputCheckBox . setSelected ( controller . isStatsOutputEnabled ( ) ) ; boolean flagA = controller . ... | Validates the debug settings . |
127,996 | public int read ( final int length ) throws DecodingException { if ( length > 31 ) { throw ErrorFactory . createDecodingException ( ErrorKeys . DIFFTOOL_DECODING_VALUE_OUT_OF_RANGE , "more than maximum length: " + length ) ; } int v , b = 0 ; for ( int i = length - 1 ; i >= 0 ; i -- ) { v = readBit ( ) ; if ( v == - 1 ... | Reads the next length - bits from the input . |
127,997 | private boolean query ( ) throws SQLException { statement = this . connection . createStatement ( ) ; String query = "SELECT PrimaryKey, RevisionCounter," + " RevisionID, ArticleID, Timestamp, FullRevisionID " + "FROM revisions" ; if ( primaryKey > 0 ) { query += " WHERE PrimaryKey > " + primaryKey ; } if ( MAX_NUMBER_... | Queries the database for more revision information . |
127,998 | public boolean hasNext ( ) { try { if ( result != null && result . next ( ) ) { return true ; } if ( this . statement != null ) { this . statement . close ( ) ; } if ( this . result != null ) { this . result . close ( ) ; } return query ( ) ; } catch ( SQLException e ) { throw new RuntimeException ( e ) ; } } | Returns TRUE if another revision information is available . |
127,999 | public String getContext ( int wordsLeft , int wordsRight ) { final String text = home_cc . getText ( ) ; int temp ; int posLeft = pos . getStart ( ) ; temp = posLeft - 1 ; while ( posLeft != 0 && wordsLeft > 0 ) { while ( temp > 0 && text . charAt ( temp ) < 48 ) { temp -- ; } while ( temp > 0 && text . charAt ( temp ... | Returns the Number of Words left and right of the Link in the Bounds of the HomeElement of this Link . |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.