idx int64 0 165k | question stringlengths 73 4.15k | target stringlengths 5 918 | len_question int64 21 890 | len_target int64 3 255 |
|---|---|---|---|---|
4,000 | public static base_response update ( nitro_service client , dnsparameter resource ) throws Exception { dnsparameter updateresource = new dnsparameter ( ) ; updateresource . retries = resource . retries ; updateresource . minttl = resource . minttl ; updateresource . maxttl = resource . maxttl ; updateresource . cacherecords = resource . cacherecords ; updateresource . namelookuppriority = resource . namelookuppriority ; updateresource . recursion = resource . recursion ; updateresource . resolutionorder = resource . resolutionorder ; updateresource . dnssec = resource . dnssec ; updateresource . maxpipeline = resource . maxpipeline ; updateresource . dnsrootreferral = resource . dnsrootreferral ; updateresource . dns64timeout = resource . dns64timeout ; return updateresource . update_resource ( client ) ; } | Use this API to update dnsparameter . | 202 | 10 |
4,001 | public static base_response unset ( nitro_service client , dnsparameter resource , String [ ] args ) throws Exception { dnsparameter unsetresource = new dnsparameter ( ) ; return unsetresource . unset_resource ( client , args ) ; } | Use this API to unset the properties of dnsparameter resource . Properties that need to be unset are specified in args array . | 60 | 28 |
4,002 | public static dnsparameter get ( nitro_service service ) throws Exception { dnsparameter obj = new dnsparameter ( ) ; dnsparameter [ ] response = ( dnsparameter [ ] ) obj . get_resources ( service ) ; return response [ 0 ] ; } | Use this API to fetch all the dnsparameter resources that are configured on netscaler . | 63 | 20 |
4,003 | private static HashSet < String > stringToStringValues ( String stringValue ) throws IOException { // should be improved to support escaped characters HashSet < String > stringValues = new HashSet <> ( ) ; JSONParser jsonParser = new JSONParser ( stringValue ) ; int event = jsonParser . nextEvent ( ) ; if ( event == JSONParser . ARRAY_START ) { while ( ( event = jsonParser . nextEvent ( ) ) != JSONParser . ARRAY_END ) { if ( jsonParser . getLevel ( ) == 1 ) { switch ( event ) { case JSONParser . STRING : stringValues . add ( jsonParser . getString ( ) ) ; break ; case JSONParser . BIGNUMBER : case JSONParser . NUMBER : case JSONParser . LONG : stringValues . add ( jsonParser . getNumberChars ( ) . toString ( ) ) ; break ; case JSONParser . BOOLEAN : stringValues . add ( Boolean . toString ( jsonParser . getBoolean ( ) ) ) ; break ; default : // do nothing break ; } } } } else { throw new IOException ( "unsupported json structure" ) ; } return stringValues ; } | String to string values . | 255 | 5 |
4,004 | public static systemglobal_binding get ( nitro_service service ) throws Exception { systemglobal_binding obj = new systemglobal_binding ( ) ; systemglobal_binding response = ( systemglobal_binding ) obj . get_resource ( service ) ; return response ; } | Use this API to fetch a systemglobal_binding resource . | 56 | 12 |
4,005 | protected IntDependency intern ( IntTaggedWord headTW , IntTaggedWord argTW , boolean leftHeaded , short dist ) { Map < IntDependency , IntDependency > map = expandDependencyMap ; IntDependency internTempDependency = new IntDependency ( itwInterner . intern ( headTW ) , itwInterner . intern ( argTW ) , leftHeaded , dist ) ; IntDependency returnDependency = internTempDependency ; if ( map != null ) { returnDependency = map . get ( internTempDependency ) ; if ( returnDependency == null ) { map . put ( internTempDependency , internTempDependency ) ; returnDependency = internTempDependency ; } } return returnDependency ; } | This is a custom interner that simultaneously creates and interns an IntDependency . | 180 | 17 |
4,006 | public static Analyzer getAnalyzer ( ) { if ( analyzer == null ) initAnalyzer ( ) ; if ( ! analyzer . enableGuessing ) System . err . println ( "Morphologic analyzer has disabled out-of-vocabulary guessing - this will reduce tagging accuracy" ) ; return analyzer ; } | Getter for the currently used analyzer | 68 | 8 |
4,007 | private static void applyLVmorphoanalysis ( CoreLabel wi , Collection < String > answerAttributes ) { Word analysis = analyzer . analyze ( wi . word ( ) ) ; applyLVmorphoanalysis ( wi , analysis , answerAttributes ) ; } | Performs LV morphology analysis of the token wi adds the possible readins and marks the most likely one . If an AnswerAnnotation exists then it is considered to be a morphosyntactic tag and the attributes are filtered for the training . | 51 | 48 |
4,008 | public static sslpolicy_sslglobal_binding [ ] get ( nitro_service service , String name ) throws Exception { sslpolicy_sslglobal_binding obj = new sslpolicy_sslglobal_binding ( ) ; obj . set_name ( name ) ; sslpolicy_sslglobal_binding response [ ] = ( sslpolicy_sslglobal_binding [ ] ) obj . get_resources ( service ) ; return response ; } | Use this API to fetch sslpolicy_sslglobal_binding resources of given name . | 94 | 18 |
4,009 | public MtasDataItemNumberComparator < T > recomputeBoundary ( int n ) throws IOException { if ( sortDirection . equals ( CodecUtil . SORT_DESC ) ) { if ( value instanceof Integer ) { return new MtasDataItemNumberComparator ( Math . floorDiv ( ( Integer ) value , n ) , sortDirection ) ; } else if ( value instanceof Long ) { return new MtasDataItemNumberComparator ( Math . floorDiv ( ( Long ) value , n ) , sortDirection ) ; } else if ( value instanceof Float ) { return new MtasDataItemNumberComparator ( ( ( Float ) value ) / n , sortDirection ) ; } else if ( value instanceof Double ) { return new MtasDataItemNumberComparator ( ( ( Double ) value ) / n , sortDirection ) ; } else { throw new IOException ( "unknown NumberComparator" ) ; } } else if ( sortDirection . equals ( CodecUtil . SORT_ASC ) ) { return new MtasDataItemNumberComparator ( getValue ( ) , sortDirection ) ; } else { throw new IOException ( "unknown sortDirection " + sortDirection ) ; } } | Recompute boundary . | 265 | 5 |
4,010 | public static authenticationradiuspolicy_binding get ( nitro_service service , String name ) throws Exception { authenticationradiuspolicy_binding obj = new authenticationradiuspolicy_binding ( ) ; obj . set_name ( name ) ; authenticationradiuspolicy_binding response = ( authenticationradiuspolicy_binding ) obj . get_resource ( service ) ; return response ; } | Use this API to fetch authenticationradiuspolicy_binding resource of given name . | 73 | 15 |
4,011 | public void decimate ( Writer trainW , Writer devW , Writer testW ) throws IOException { PrintWriter trainPW = new PrintWriter ( trainW , true ) ; PrintWriter devPW = new PrintWriter ( devW , true ) ; PrintWriter testPW = new PrintWriter ( testW , true ) ; int i = 0 ; for ( Tree t : this ) { if ( i == 8 ) { t . pennPrint ( devPW ) ; } else if ( i == 9 ) { t . pennPrint ( testPW ) ; } else { t . pennPrint ( trainPW ) ; } i = ( i + 1 ) % 10 ; } } | Divide a Treebank into 3 by taking every 9th sentence for the dev set and every 10th for the test set . Penn people do this . | 144 | 31 |
4,012 | public static crvserver_cspolicy_binding [ ] get ( nitro_service service , String name ) throws Exception { crvserver_cspolicy_binding obj = new crvserver_cspolicy_binding ( ) ; obj . set_name ( name ) ; crvserver_cspolicy_binding response [ ] = ( crvserver_cspolicy_binding [ ] ) obj . get_resources ( service ) ; return response ; } | Use this API to fetch crvserver_cspolicy_binding resources of given name . | 99 | 19 |
4,013 | private String printConfigMappingTypes ( Map < QName , MtasParserType < MtasParserMapping < ? > > > types ) { StringBuilder text = new StringBuilder ( ) ; for ( Entry < QName , MtasParserType < MtasParserMapping < ? > > > entry : types . entrySet ( ) ) { text . append ( "- " + entry . getKey ( ) . getLocalPart ( ) + ": " + entry . getValue ( ) . items . size ( ) + " mapping(s)\n" ) ; for ( int i = 0 ; i < entry . getValue ( ) . items . size ( ) ; i ++ ) { text . append ( "\t" + entry . getValue ( ) . items . get ( i ) + "\n" ) ; } } return text . toString ( ) ; } | Prints the config mapping types . | 183 | 7 |
4,014 | private Collection < ? extends String > recursiveCollect ( String refId , Map < String , SortedSet < String > > relationKeyMap , int maxRecursion ) { Set < String > list = new HashSet <> ( ) ; if ( maxRecursion > 0 && relationKeyMap . containsKey ( refId ) ) { SortedSet < String > subList = relationKeyMap . get ( refId ) ; for ( String subRefId : subList ) { list . add ( subRefId ) ; list . addAll ( recursiveCollect ( subRefId , relationKeyMap , maxRecursion - 1 ) ) ; } } return list ; } | Recursive collect . | 138 | 4 |
4,015 | private QName getQName ( String key ) { QName qname ; if ( ( qname = qNames . get ( key ) ) == null ) { qname = new QName ( namespaceURI , key ) ; qNames . put ( key , qname ) ; } return qname ; } | Gets the q name . | 64 | 6 |
4,016 | public void collectAttributes ( MtasParserObject currentObject , XMLStreamReader streamReader ) { String attributeNamespaceURI ; currentObject . objectAttributes . clear ( ) ; currentObject . objectId = streamReader . getAttributeValue ( namespaceURI_id , "id" ) ; for ( int i = 0 ; i < streamReader . getAttributeCount ( ) ; i ++ ) { attributeNamespaceURI = streamReader . getAttributeNamespace ( i ) ; if ( attributeNamespaceURI == null || attributeNamespaceURI . equals ( "" ) ) { attributeNamespaceURI = streamReader . getNamespaceURI ( ) ; } if ( namespaceURI == null || attributeNamespaceURI . equals ( namespaceURI ) ) { currentObject . objectAttributes . put ( streamReader . getAttributeLocalName ( i ) , streamReader . getAttributeValue ( i ) ) ; } else { HashMap < String , String > otherMap ; if ( ! currentObject . objectOtherAttributes . containsKey ( attributeNamespaceURI ) ) { otherMap = new HashMap <> ( ) ; currentObject . objectOtherAttributes . put ( attributeNamespaceURI , otherMap ) ; } else { otherMap = currentObject . objectOtherAttributes . get ( attributeNamespaceURI ) ; } otherMap . put ( streamReader . getAttributeLocalName ( i ) , streamReader . getAttributeValue ( i ) ) ; } } } | Collect attributes . | 295 | 3 |
4,017 | private Set < MtasParserObject > processCRMSentence ( MtasTokenIdFactory mtasTokenIdFactory , String name , String text , Integer currentOffset , List < MtasCRMParserFunctionOutput > functionOutputList , MtasCRMAncestors unknownAncestors , Map < String , List < MtasParserObject > > currentList , Map < String , Map < Integer , Set < String > > > updateList , Map < String , Set < Integer > > idPositions , Map < String , Integer [ ] > idOffsets , Set < MtasParserObject > previous , Set < MtasParserObject > previousClause ) throws MtasParserException , MtasConfigException { MtasParserType tmpCurrentType ; MtasParserObject currentObject ; if ( ( tmpCurrentType = crmSentenceTypes . get ( name ) ) != null ) { String filteredText = text . replaceAll ( "[^0-9\\-]" , "" ) ; currentObject = new MtasParserObject ( tmpCurrentType ) ; currentObject . setUnknownAncestorNumber ( unknownAncestors . unknown ) ; currentObject . setRealOffsetStart ( currentOffset ) ; currentObject . setText ( filteredText ) ; if ( ! prevalidateObject ( currentObject , currentList ) ) { return new HashSet <> ( ) ; } else { closePrevious ( mtasTokenIdFactory , previousClause , currentOffset , unknownAncestors , currentList , updateList , idPositions , idOffsets ) ; closePrevious ( mtasTokenIdFactory , previous , currentOffset , unknownAncestors , currentList , updateList , idPositions , idOffsets ) ; previous . clear ( ) ; currentList . get ( MAPPING_TYPE_GROUP ) . add ( currentObject ) ; unknownAncestors . unknown = 0 ; return new HashSet <> ( Arrays . asList ( currentObject ) ) ; } } return new HashSet <> ( ) ; } | Process CRM sentence . | 423 | 5 |
4,018 | private void closePrevious ( MtasTokenIdFactory mtasTokenIdFactory , Set < MtasParserObject > previous , Integer currentOffset , MtasCRMAncestors unknownAncestors , Map < String , List < MtasParserObject > > currentList , Map < String , Map < Integer , Set < String > > > updateList , Map < String , Set < Integer > > idPositions , Map < String , Integer [ ] > idOffsets ) throws MtasParserException , MtasConfigException { for ( MtasParserObject previousObject : previous ) { previousObject . setRealOffsetEnd ( currentOffset ) ; idPositions . put ( previousObject . getId ( ) , previousObject . getPositions ( ) ) ; idOffsets . put ( previousObject . getId ( ) , previousObject . getOffset ( ) ) ; previousObject . updateMappings ( idPositions , idOffsets ) ; unknownAncestors . unknown = previousObject . getUnknownAncestorNumber ( ) ; computeMappingsFromObject ( mtasTokenIdFactory , previousObject , currentList , updateList ) ; currentList . get ( MAPPING_TYPE_GROUP ) . remove ( previousObject ) ; } } | Close previous . | 259 | 3 |
4,019 | private void processFunctions ( String name , String text , String type , List < MtasCRMParserFunctionOutput > functionOutputList ) { if ( functions . containsKey ( type ) && functions . get ( type ) . containsKey ( name ) && text != null ) { MtasCRMParserFunction function = functions . get ( type ) . get ( name ) ; String [ ] value ; if ( function . split != null ) { value = text . split ( Pattern . quote ( function . split ) ) ; } else { value = new String [ ] { text } ; } for ( int c = 0 ; c < value . length ; c ++ ) { boolean checkedEmpty = false ; if ( value [ c ] . equals ( "" ) ) { checkedEmpty = true ; } if ( function . output . containsKey ( value [ c ] ) ) { ArrayList < MtasCRMParserFunctionOutput > list = function . output . get ( value [ c ] ) ; for ( MtasCRMParserFunctionOutput listItem : list ) { functionOutputList . add ( listItem . create ( value [ c ] ) ) ; } } if ( ! checkedEmpty && function . output . containsKey ( "" ) ) { ArrayList < MtasCRMParserFunctionOutput > list = function . output . get ( "" ) ; for ( MtasCRMParserFunctionOutput listItem : list ) { functionOutputList . add ( listItem . create ( value [ c ] ) ) ; } } } } } | Process functions . | 317 | 3 |
4,020 | private String printConfigTypes ( HashMap < ? , MtasParserType < MtasParserMapping < ? > > > types ) { StringBuilder text = new StringBuilder ( ) ; for ( Entry < ? , MtasParserType < MtasParserMapping < ? > > > entry : types . entrySet ( ) ) { text . append ( "- " + entry . getKey ( ) + ": " + entry . getValue ( ) . items . size ( ) + " mapping(s)\n" ) ; for ( int i = 0 ; i < entry . getValue ( ) . items . size ( ) ; i ++ ) { text . append ( "\t" + entry . getValue ( ) . items . get ( i ) + "\n" ) ; } } return text . toString ( ) ; } | Prints the config types . | 174 | 6 |
4,021 | public int getMinStartPosition ( int docId , int position ) throws IOException { if ( ignoreSpans != null && docId == currentDocId ) { if ( position < minimumPosition ) { throw new IOException ( "Unexpected position, should be >= " + minimumPosition + "!" ) ; } else { computeFullStartPositionMinimum ( position ) ; if ( minFullStartPosition . containsKey ( position ) ) { return minFullStartPosition . get ( position ) ; } else { return 0 ; } } } else { return 0 ; } } | Gets the min start position . | 117 | 7 |
4,022 | public int getMaxEndPosition ( int docId , int position ) throws IOException { if ( ignoreSpans != null && docId == currentDocId ) { if ( position < minimumPosition ) { throw new IOException ( "Unexpected position, should be >= " + minimumPosition + "!" ) ; } computeFullEndPositionList ( position ) ; if ( maxFullEndPosition . containsKey ( position ) ) { return maxFullEndPosition . get ( position ) ; } else { return 0 ; } } else { return 0 ; } } | Gets the max end position . | 114 | 7 |
4,023 | public Set < Integer > getFullEndPositionList ( int docId , int position ) throws IOException { if ( ignoreSpans != null && docId == currentDocId ) { if ( position < minimumPosition ) { throw new IOException ( "Unexpected startPosition, should be >= " + minimumPosition + "!" ) ; } else { computeFullEndPositionList ( position ) ; return fullEndPositionList . get ( position ) ; } } else { return null ; } } | Gets the full end position list . | 101 | 8 |
4,024 | private void computeFullStartPositionMinimum ( int position ) throws IOException { if ( ignoreSpans != null && ! minFullStartPosition . containsKey ( position ) ) { HashSet < Integer > list = baseStartPositionList . get ( position ) ; HashSet < Integer > newList = new HashSet <> ( ) ; int minimumStartPosition = position ; while ( list != null && ! list . isEmpty ( ) ) { newList . clear ( ) ; for ( int startPosition : list ) { if ( minFullStartPosition . containsKey ( startPosition ) ) { minimumStartPosition = Math . min ( minimumStartPosition , minFullStartPosition . get ( startPosition ) ) ; } else if ( baseStartPositionList . containsKey ( startPosition ) ) { newList . addAll ( baseStartPositionList . get ( startPosition ) ) ; } else { if ( startPosition < minimumStartPosition ) { minimumStartPosition = startPosition ; } } } list . clear ( ) ; list . addAll ( newList ) ; } minFullStartPosition . put ( position , minimumStartPosition ) ; } } | Compute full start position minimum . | 236 | 7 |
4,025 | private void computeFullEndPositionList ( int position ) throws IOException { if ( ignoreSpans != null && ! fullEndPositionList . containsKey ( position ) ) { // initial fill moveTo ( position ) ; HashSet < Integer > list = baseEndPositionList . get ( position ) ; if ( list != null && ! list . isEmpty ( ) ) { int maxEndPosition = maxBaseEndPosition . get ( position ) ; HashSet < Integer > checkList = new HashSet <> ( ) ; HashSet < Integer > subCheckList = new HashSet <> ( ) ; checkList . addAll ( list ) ; int depth = 1 ; while ( ! checkList . isEmpty ( ) ) { if ( depth > maximumIgnoreLength ) { checkList . clear ( ) ; subCheckList . clear ( ) ; throw new IOException ( "too many successive ignores, maximum is " + maximumIgnoreLength ) ; } else { for ( Integer checkItem : checkList ) { if ( fullEndPositionList . get ( checkItem ) != null ) { list . addAll ( fullEndPositionList . get ( checkItem ) ) ; maxEndPosition = Math . max ( maxEndPosition , maxFullEndPosition . get ( checkItem ) ) ; } else { moveTo ( checkItem ) ; if ( baseEndPositionList . containsKey ( checkItem ) ) { list . addAll ( baseEndPositionList . get ( checkItem ) ) ; maxEndPosition = Math . max ( maxEndPosition , maxBaseEndPosition . get ( checkItem ) ) ; subCheckList . addAll ( baseEndPositionList . get ( checkItem ) ) ; } else { // ready for checkItem } } } checkList . clear ( ) ; checkList . addAll ( subCheckList ) ; subCheckList . clear ( ) ; depth ++ ; } } fullEndPositionList . put ( position , list ) ; maxFullEndPosition . put ( position , ( maxEndPosition - position ) ) ; } else { fullEndPositionList . put ( position , null ) ; maxFullEndPosition . put ( position , 0 ) ; } } } | Compute full end position list . | 454 | 7 |
4,026 | private void moveTo ( int position ) { while ( position >= currentPosition ) { try { currentPosition = ignoreSpans . nextStartPosition ( ) ; if ( currentPosition != Spans . NO_MORE_POSITIONS && currentPosition >= minimumPosition ) { if ( ! baseEndPositionList . containsKey ( currentPosition ) ) { baseEndPositionList . put ( currentPosition , new HashSet < Integer > ( ) ) ; maxBaseEndPosition . put ( currentPosition , currentPosition ) ; } else { maxBaseEndPosition . put ( currentPosition , Math . max ( maxBaseEndPosition . get ( currentPosition ) , ignoreSpans . endPosition ( ) ) ) ; } if ( ! baseStartPositionList . containsKey ( ignoreSpans . endPosition ( ) ) ) { baseStartPositionList . put ( ignoreSpans . endPosition ( ) , new HashSet < Integer > ( ) ) ; minBaseStartPosition . put ( ignoreSpans . endPosition ( ) , ignoreSpans . endPosition ( ) ) ; } else { minBaseStartPosition . put ( ignoreSpans . endPosition ( ) , Math . min ( minBaseStartPosition . get ( ignoreSpans . endPosition ( ) ) , currentPosition ) ) ; } baseStartPositionList . get ( ignoreSpans . endPosition ( ) ) . add ( currentPosition ) ; baseEndPositionList . get ( currentPosition ) . add ( ignoreSpans . endPosition ( ) ) ; } } catch ( IOException e ) { log . debug ( e ) ; currentPosition = Spans . NO_MORE_POSITIONS ; break ; } } } | Move to . | 346 | 3 |
4,027 | public void removeBefore ( int docId , int position ) { if ( ignoreSpans != null && docId == currentDocId ) { baseStartPositionList . entrySet ( ) . removeIf ( entry -> entry . getKey ( ) < position ) ; baseEndPositionList . entrySet ( ) . removeIf ( entry -> entry . getKey ( ) < position ) ; fullEndPositionList . entrySet ( ) . removeIf ( entry -> entry . getKey ( ) < position ) ; minBaseStartPosition . entrySet ( ) . removeIf ( entry -> entry . getKey ( ) < position ) ; maxBaseEndPosition . entrySet ( ) . removeIf ( entry -> entry . getKey ( ) < position ) ; minFullStartPosition . entrySet ( ) . removeIf ( entry -> entry . getKey ( ) < position ) ; maxFullEndPosition . entrySet ( ) . removeIf ( entry -> entry . getKey ( ) < position ) ; if ( minimumPosition < position ) { minimumPosition = position ; } if ( currentPosition < position ) { currentPosition = position ; } } } | Removes the before . | 234 | 5 |
4,028 | public static vpnvserver_authenticationlocalpolicy_binding [ ] get ( nitro_service service , String name ) throws Exception { vpnvserver_authenticationlocalpolicy_binding obj = new vpnvserver_authenticationlocalpolicy_binding ( ) ; obj . set_name ( name ) ; vpnvserver_authenticationlocalpolicy_binding response [ ] = ( vpnvserver_authenticationlocalpolicy_binding [ ] ) obj . get_resources ( service ) ; return response ; } | Use this API to fetch vpnvserver_authenticationlocalpolicy_binding resources of given name . | 109 | 21 |
4,029 | public static base_response add ( nitro_service client , gslbvserver resource ) throws Exception { gslbvserver addresource = new gslbvserver ( ) ; addresource . name = resource . name ; addresource . servicetype = resource . servicetype ; addresource . iptype = resource . iptype ; addresource . dnsrecordtype = resource . dnsrecordtype ; addresource . lbmethod = resource . lbmethod ; addresource . backupsessiontimeout = resource . backupsessiontimeout ; addresource . backuplbmethod = resource . backuplbmethod ; addresource . netmask = resource . netmask ; addresource . v6netmasklen = resource . v6netmasklen ; addresource . tolerance = resource . tolerance ; addresource . persistencetype = resource . persistencetype ; addresource . persistenceid = resource . persistenceid ; addresource . persistmask = resource . persistmask ; addresource . v6persistmasklen = resource . v6persistmasklen ; addresource . timeout = resource . timeout ; addresource . edr = resource . edr ; addresource . mir = resource . mir ; addresource . disableprimaryondown = resource . disableprimaryondown ; addresource . dynamicweight = resource . dynamicweight ; addresource . state = resource . state ; addresource . considereffectivestate = resource . considereffectivestate ; addresource . comment = resource . comment ; addresource . somethod = resource . somethod ; addresource . sopersistence = resource . sopersistence ; addresource . sopersistencetimeout = resource . sopersistencetimeout ; addresource . sothreshold = resource . sothreshold ; addresource . sobackupaction = resource . sobackupaction ; addresource . appflowlog = resource . appflowlog ; return addresource . add_resource ( client ) ; } | Use this API to add gslbvserver . | 414 | 11 |
4,030 | public static base_responses add ( nitro_service client , gslbvserver resources [ ] ) throws Exception { base_responses result = null ; if ( resources != null && resources . length > 0 ) { gslbvserver addresources [ ] = new gslbvserver [ resources . length ] ; for ( int i = 0 ; i < resources . length ; i ++ ) { addresources [ i ] = new gslbvserver ( ) ; addresources [ i ] . name = resources [ i ] . name ; addresources [ i ] . servicetype = resources [ i ] . servicetype ; addresources [ i ] . iptype = resources [ i ] . iptype ; addresources [ i ] . dnsrecordtype = resources [ i ] . dnsrecordtype ; addresources [ i ] . lbmethod = resources [ i ] . lbmethod ; addresources [ i ] . backupsessiontimeout = resources [ i ] . backupsessiontimeout ; addresources [ i ] . backuplbmethod = resources [ i ] . backuplbmethod ; addresources [ i ] . netmask = resources [ i ] . netmask ; addresources [ i ] . v6netmasklen = resources [ i ] . v6netmasklen ; addresources [ i ] . tolerance = resources [ i ] . tolerance ; addresources [ i ] . persistencetype = resources [ i ] . persistencetype ; addresources [ i ] . persistenceid = resources [ i ] . persistenceid ; addresources [ i ] . persistmask = resources [ i ] . persistmask ; addresources [ i ] . v6persistmasklen = resources [ i ] . v6persistmasklen ; addresources [ i ] . timeout = resources [ i ] . timeout ; addresources [ i ] . edr = resources [ i ] . edr ; addresources [ i ] . mir = resources [ i ] . mir ; addresources [ i ] . disableprimaryondown = resources [ i ] . disableprimaryondown ; addresources [ i ] . dynamicweight = resources [ i ] . dynamicweight ; addresources [ i ] . state = resources [ i ] . state ; addresources [ i ] . considereffectivestate = resources [ i ] . considereffectivestate ; addresources [ i ] . comment = resources [ i ] . comment ; addresources [ i ] . somethod = resources [ i ] . somethod ; addresources [ i ] . sopersistence = resources [ i ] . sopersistence ; addresources [ i ] . sopersistencetimeout = resources [ i ] . sopersistencetimeout ; addresources [ i ] . sothreshold = resources [ i ] . sothreshold ; addresources [ i ] . sobackupaction = resources [ i ] . sobackupaction ; addresources [ i ] . appflowlog = resources [ i ] . appflowlog ; } result = add_bulk_request ( client , addresources ) ; } return result ; } | Use this API to add gslbvserver resources . | 652 | 12 |
4,031 | public static base_response update ( nitro_service client , gslbvserver resource ) throws Exception { gslbvserver updateresource = new gslbvserver ( ) ; updateresource . name = resource . name ; updateresource . iptype = resource . iptype ; updateresource . dnsrecordtype = resource . dnsrecordtype ; updateresource . backupvserver = resource . backupvserver ; updateresource . backupsessiontimeout = resource . backupsessiontimeout ; updateresource . lbmethod = resource . lbmethod ; updateresource . backuplbmethod = resource . backuplbmethod ; updateresource . netmask = resource . netmask ; updateresource . v6netmasklen = resource . v6netmasklen ; updateresource . tolerance = resource . tolerance ; updateresource . persistencetype = resource . persistencetype ; updateresource . persistenceid = resource . persistenceid ; updateresource . persistmask = resource . persistmask ; updateresource . v6persistmasklen = resource . v6persistmasklen ; updateresource . timeout = resource . timeout ; updateresource . edr = resource . edr ; updateresource . mir = resource . mir ; updateresource . disableprimaryondown = resource . disableprimaryondown ; updateresource . dynamicweight = resource . dynamicweight ; updateresource . considereffectivestate = resource . considereffectivestate ; updateresource . somethod = resource . somethod ; updateresource . sopersistence = resource . sopersistence ; updateresource . sopersistencetimeout = resource . sopersistencetimeout ; updateresource . sothreshold = resource . sothreshold ; updateresource . sobackupaction = resource . sobackupaction ; updateresource . servicename = resource . servicename ; updateresource . weight = resource . weight ; updateresource . domainname = resource . domainname ; updateresource . ttl = resource . ttl ; updateresource . backupip = resource . backupip ; updateresource . cookie_domain = resource . cookie_domain ; updateresource . cookietimeout = resource . cookietimeout ; updateresource . sitedomainttl = resource . sitedomainttl ; updateresource . comment = resource . comment ; updateresource . appflowlog = resource . appflowlog ; return updateresource . update_resource ( client ) ; } | Use this API to update gslbvserver . | 505 | 11 |
4,032 | public static base_responses disable ( nitro_service client , String name [ ] ) throws Exception { base_responses result = null ; if ( name != null && name . length > 0 ) { gslbvserver disableresources [ ] = new gslbvserver [ name . length ] ; for ( int i = 0 ; i < name . length ; i ++ ) { disableresources [ i ] = new gslbvserver ( ) ; disableresources [ i ] . name = name [ i ] ; } result = perform_operation_bulk_request ( client , disableresources , "disable" ) ; } return result ; } | Use this API to disable gslbvserver resources of given names . | 137 | 15 |
4,033 | public static gslbvserver [ ] get ( nitro_service service ) throws Exception { gslbvserver obj = new gslbvserver ( ) ; gslbvserver [ ] response = ( gslbvserver [ ] ) obj . get_resources ( service ) ; return response ; } | Use this API to fetch all the gslbvserver resources that are configured on netscaler . | 67 | 21 |
4,034 | public static gslbvserver get ( nitro_service service , String name ) throws Exception { gslbvserver obj = new gslbvserver ( ) ; obj . set_name ( name ) ; gslbvserver response = ( gslbvserver ) obj . get_resource ( service ) ; return response ; } | Use this API to fetch gslbvserver resource of given name . | 73 | 15 |
4,035 | public static base_response add ( nitro_service client , transformprofile resource ) throws Exception { transformprofile addresource = new transformprofile ( ) ; addresource . name = resource . name ; addresource . type = resource . type ; return addresource . add_resource ( client ) ; } | Use this API to add transformprofile . | 61 | 8 |
4,036 | public static base_response update ( nitro_service client , transformprofile resource ) throws Exception { transformprofile updateresource = new transformprofile ( ) ; updateresource . name = resource . name ; updateresource . type = resource . type ; updateresource . onlytransformabsurlinbody = resource . onlytransformabsurlinbody ; updateresource . comment = resource . comment ; return updateresource . update_resource ( client ) ; } | Use this API to update transformprofile . | 89 | 8 |
4,037 | public static base_responses update ( nitro_service client , transformprofile resources [ ] ) throws Exception { base_responses result = null ; if ( resources != null && resources . length > 0 ) { transformprofile updateresources [ ] = new transformprofile [ resources . length ] ; for ( int i = 0 ; i < resources . length ; i ++ ) { updateresources [ i ] = new transformprofile ( ) ; updateresources [ i ] . name = resources [ i ] . name ; updateresources [ i ] . type = resources [ i ] . type ; updateresources [ i ] . onlytransformabsurlinbody = resources [ i ] . onlytransformabsurlinbody ; updateresources [ i ] . comment = resources [ i ] . comment ; } result = update_bulk_request ( client , updateresources ) ; } return result ; } | Use this API to update transformprofile resources . | 180 | 9 |
4,038 | public static transformprofile [ ] get ( nitro_service service ) throws Exception { transformprofile obj = new transformprofile ( ) ; transformprofile [ ] response = ( transformprofile [ ] ) obj . get_resources ( service ) ; return response ; } | Use this API to fetch all the transformprofile resources that are configured on netscaler . | 52 | 18 |
4,039 | public static transformprofile get ( nitro_service service , String name ) throws Exception { transformprofile obj = new transformprofile ( ) ; obj . set_name ( name ) ; transformprofile response = ( transformprofile ) obj . get_resource ( service ) ; return response ; } | Use this API to fetch transformprofile resource of given name . | 58 | 12 |
4,040 | public static appfwpolicy_appfwpolicylabel_binding [ ] get ( nitro_service service , String name ) throws Exception { appfwpolicy_appfwpolicylabel_binding obj = new appfwpolicy_appfwpolicylabel_binding ( ) ; obj . set_name ( name ) ; appfwpolicy_appfwpolicylabel_binding response [ ] = ( appfwpolicy_appfwpolicylabel_binding [ ] ) obj . get_resources ( service ) ; return response ; } | Use this API to fetch appfwpolicy_appfwpolicylabel_binding resources of given name . | 119 | 23 |
4,041 | public static nsversion get ( nitro_service service ) throws Exception { nsversion obj = new nsversion ( ) ; nsversion [ ] response = ( nsversion [ ] ) obj . get_resources ( service ) ; return response [ 0 ] ; } | Use this API to fetch all the nsversion resources that are configured on netscaler . | 53 | 18 |
4,042 | public static sc_stats get ( nitro_service service ) throws Exception { sc_stats obj = new sc_stats ( ) ; sc_stats [ ] response = ( sc_stats [ ] ) obj . stat_resources ( service ) ; return response [ 0 ] ; } | Use this API to fetch the statistics of all sc_stats resources that are configured on netscaler . | 58 | 21 |
4,043 | public static base_response create ( nitro_service client , sslwrapkey resource ) throws Exception { sslwrapkey createresource = new sslwrapkey ( ) ; createresource . wrapkeyname = resource . wrapkeyname ; createresource . password = resource . password ; createresource . salt = resource . salt ; return createresource . perform_operation ( client , "create" ) ; } | Use this API to create sslwrapkey . | 86 | 10 |
4,044 | public static base_responses create ( nitro_service client , sslwrapkey resources [ ] ) throws Exception { base_responses result = null ; if ( resources != null && resources . length > 0 ) { sslwrapkey createresources [ ] = new sslwrapkey [ resources . length ] ; for ( int i = 0 ; i < resources . length ; i ++ ) { createresources [ i ] = new sslwrapkey ( ) ; createresources [ i ] . wrapkeyname = resources [ i ] . wrapkeyname ; createresources [ i ] . password = resources [ i ] . password ; createresources [ i ] . salt = resources [ i ] . salt ; } result = perform_operation_bulk_request ( client , createresources , "create" ) ; } return result ; } | Use this API to create sslwrapkey resources . | 175 | 11 |
4,045 | public static base_response delete ( nitro_service client , String wrapkeyname ) throws Exception { sslwrapkey deleteresource = new sslwrapkey ( ) ; deleteresource . wrapkeyname = wrapkeyname ; return deleteresource . delete_resource ( client ) ; } | Use this API to delete sslwrapkey of given name . | 62 | 13 |
4,046 | public static base_responses delete ( nitro_service client , String wrapkeyname [ ] ) throws Exception { base_responses result = null ; if ( wrapkeyname != null && wrapkeyname . length > 0 ) { sslwrapkey deleteresources [ ] = new sslwrapkey [ wrapkeyname . length ] ; for ( int i = 0 ; i < wrapkeyname . length ; i ++ ) { deleteresources [ i ] = new sslwrapkey ( ) ; deleteresources [ i ] . wrapkeyname = wrapkeyname [ i ] ; } result = delete_bulk_request ( client , deleteresources ) ; } return result ; } | Use this API to delete sslwrapkey resources of given names . | 149 | 14 |
4,047 | public static sslwrapkey [ ] get ( nitro_service service ) throws Exception { sslwrapkey obj = new sslwrapkey ( ) ; sslwrapkey [ ] response = ( sslwrapkey [ ] ) obj . get_resources ( service ) ; return response ; } | Use this API to fetch all the sslwrapkey resources that are configured on netscaler . | 62 | 20 |
4,048 | public static int min ( int a , int b , int c ) { int mi ; mi = a ; if ( b < mi ) { mi = b ; } if ( c < mi ) { mi = c ; } return mi ; } | Returns the minimum of three int values . | 50 | 8 |
4,049 | public static double exactBinomial ( int k , int n , double p ) { double total = 0.0 ; for ( int m = k ; m <= n ; m ++ ) { double nChooseM = 1.0 ; for ( int r = 1 ; r <= m ; r ++ ) { nChooseM *= ( n - r ) + 1 ; nChooseM /= r ; } // System.out.println(n + " choose " + m + " is " + nChooseM); // System.out.println("prob contribution is " + // (nChooseM * Math.pow(p, m) * Math.pow(1.0-p, n - m))); total += nChooseM * Math . pow ( p , m ) * Math . pow ( 1.0 - p , n - m ) ; } return total ; } | Find a one tailed exact binomial test probability . Finds the chance of this or a higher result | 188 | 21 |
4,050 | public static double factorial ( int x ) { double result = 1.0 ; for ( int i = x ; i > 1 ; i -- ) { result *= i ; } return result ; } | Uses floating point so that it can represent the really big numbers that come up . | 42 | 17 |
4,051 | public static base_response add ( nitro_service client , dnsaction64 resource ) throws Exception { dnsaction64 addresource = new dnsaction64 ( ) ; addresource . actionname = resource . actionname ; addresource . prefix = resource . prefix ; addresource . mappedrule = resource . mappedrule ; addresource . excluderule = resource . excluderule ; return addresource . add_resource ( client ) ; } | Use this API to add dnsaction64 . | 95 | 10 |
4,052 | public static base_responses add ( nitro_service client , dnsaction64 resources [ ] ) throws Exception { base_responses result = null ; if ( resources != null && resources . length > 0 ) { dnsaction64 addresources [ ] = new dnsaction64 [ resources . length ] ; for ( int i = 0 ; i < resources . length ; i ++ ) { addresources [ i ] = new dnsaction64 ( ) ; addresources [ i ] . actionname = resources [ i ] . actionname ; addresources [ i ] . prefix = resources [ i ] . prefix ; addresources [ i ] . mappedrule = resources [ i ] . mappedrule ; addresources [ i ] . excluderule = resources [ i ] . excluderule ; } result = add_bulk_request ( client , addresources ) ; } return result ; } | Use this API to add dnsaction64 resources . | 188 | 11 |
4,053 | public static base_response delete ( nitro_service client , String actionname ) throws Exception { dnsaction64 deleteresource = new dnsaction64 ( ) ; deleteresource . actionname = actionname ; return deleteresource . delete_resource ( client ) ; } | Use this API to delete dnsaction64 of given name . | 56 | 13 |
4,054 | public static base_response update ( nitro_service client , dnsaction64 resource ) throws Exception { dnsaction64 updateresource = new dnsaction64 ( ) ; updateresource . actionname = resource . actionname ; updateresource . prefix = resource . prefix ; updateresource . mappedrule = resource . mappedrule ; updateresource . excluderule = resource . excluderule ; return updateresource . update_resource ( client ) ; } | Use this API to update dnsaction64 . | 95 | 10 |
4,055 | public static base_responses update ( nitro_service client , dnsaction64 resources [ ] ) throws Exception { base_responses result = null ; if ( resources != null && resources . length > 0 ) { dnsaction64 updateresources [ ] = new dnsaction64 [ resources . length ] ; for ( int i = 0 ; i < resources . length ; i ++ ) { updateresources [ i ] = new dnsaction64 ( ) ; updateresources [ i ] . actionname = resources [ i ] . actionname ; updateresources [ i ] . prefix = resources [ i ] . prefix ; updateresources [ i ] . mappedrule = resources [ i ] . mappedrule ; updateresources [ i ] . excluderule = resources [ i ] . excluderule ; } result = update_bulk_request ( client , updateresources ) ; } return result ; } | Use this API to update dnsaction64 resources . | 188 | 11 |
4,056 | public static base_responses unset ( nitro_service client , dnsaction64 resources [ ] , String [ ] args ) throws Exception { base_responses result = null ; if ( resources != null && resources . length > 0 ) { dnsaction64 unsetresources [ ] = new dnsaction64 [ resources . length ] ; for ( int i = 0 ; i < resources . length ; i ++ ) { unsetresources [ i ] = new dnsaction64 ( ) ; unsetresources [ i ] . actionname = resources [ i ] . actionname ; } result = unset_bulk_request ( client , unsetresources , args ) ; } return result ; } | Use this API to unset the properties of dnsaction64 resources . Properties that need to be unset are specified in args array . | 148 | 28 |
4,057 | public static dnsaction64 [ ] get ( nitro_service service ) throws Exception { dnsaction64 obj = new dnsaction64 ( ) ; dnsaction64 [ ] response = ( dnsaction64 [ ] ) obj . get_resources ( service ) ; return response ; } | Use this API to fetch all the dnsaction64 resources that are configured on netscaler . | 62 | 20 |
4,058 | public static dnsaction64 get ( nitro_service service , String actionname ) throws Exception { dnsaction64 obj = new dnsaction64 ( ) ; obj . set_actionname ( actionname ) ; dnsaction64 response = ( dnsaction64 ) obj . get_resource ( service ) ; return response ; } | Use this API to fetch dnsaction64 resource of given name . | 71 | 14 |
4,059 | public static dnsaction64 [ ] get ( nitro_service service , String actionname [ ] ) throws Exception { if ( actionname != null && actionname . length > 0 ) { dnsaction64 response [ ] = new dnsaction64 [ actionname . length ] ; dnsaction64 obj [ ] = new dnsaction64 [ actionname . length ] ; for ( int i = 0 ; i < actionname . length ; i ++ ) { obj [ i ] = new dnsaction64 ( ) ; obj [ i ] . set_actionname ( actionname [ i ] ) ; response [ i ] = ( dnsaction64 ) obj [ i ] . get_resource ( service ) ; } return response ; } return null ; } | Use this API to fetch dnsaction64 resources of given names . | 160 | 14 |
4,060 | public static vpnsessionpolicy_aaagroup_binding [ ] get ( nitro_service service , String name ) throws Exception { vpnsessionpolicy_aaagroup_binding obj = new vpnsessionpolicy_aaagroup_binding ( ) ; obj . set_name ( name ) ; vpnsessionpolicy_aaagroup_binding response [ ] = ( vpnsessionpolicy_aaagroup_binding [ ] ) obj . get_resources ( service ) ; return response ; } | Use this API to fetch vpnsessionpolicy_aaagroup_binding resources of given name . | 109 | 21 |
4,061 | public TreeReaderFactory treeReaderFactory ( ) { return new TreeReaderFactory ( ) { public TreeReader newTreeReader ( Reader in ) { return new PennTreeReader ( in , new LabeledScoredTreeFactory ( ) , new NPTmpRetainingTreeNormalizer ( englishTrain . splitTMP , englishTrain . splitSGapped == 5 , englishTrain . leaveItAll , englishTrain . splitNPADV >= 1 , headFinder ( ) ) ) ; } } ; } | Makes appropriate TreeReaderFactory with all options specified | 102 | 10 |
4,062 | private static String deduceTag ( String w ) { String word = w . toLowerCase ( ) ; if ( word . endsWith ( "ing" ) ) { return "VBG" ; } else if ( word . endsWith ( "d" ) || word . endsWith ( "t" ) ) { return "VBN" ; } else if ( word . endsWith ( "s" ) ) { return "VBZ" ; } else if ( word . equals ( "to" ) ) { return "TO" ; } else { return "VB" ; } } | quite heuristic but not useless given tagging errors? | 122 | 10 |
4,063 | private boolean collectAndCheckLastSpans ( int nextSpans1StartPosition , int nextSpans1EndPosition ) throws IOException { // check next if ( nextSpans1StartPosition == nextSpans2StartPosition && nextSpans1EndPosition == nextSpans2EndPosition ) { return false ; } // check last if ( nextSpans1StartPosition == lastSpans2StartPosition && ( nextSpans1EndPosition == lastSpans2EndPosition || lastSpans2EndPositions . contains ( nextSpans1EndPosition ) ) ) { return false ; } // collect if ( nextSpans1StartPosition == nextSpans2StartPosition ) { // reset if ( nextSpans2StartPosition != lastSpans2StartPosition ) { lastSpans2StartPosition = nextSpans2StartPosition ; lastSpans2EndPosition = - 1 ; lastSpans2EndPositions . clear ( ) ; } while ( nextSpans1StartPosition == nextSpans2StartPosition ) { if ( lastSpans2EndPosition > - 1 ) { lastSpans2EndPositions . add ( lastSpans2EndPosition ) ; } lastSpans2EndPosition = nextSpans2EndPosition ; nextSpans2StartPosition = spans2 . spans . nextStartPosition ( ) ; nextSpans2EndPosition = spans2 . spans . endPosition ( ) ; if ( nextSpans1StartPosition == nextSpans2StartPosition && nextSpans1EndPosition == nextSpans2EndPosition ) { return false ; } } } return true ; } | Collect and check last spans . | 339 | 6 |
4,064 | public static base_response add ( nitro_service client , vpnnexthopserver resource ) throws Exception { vpnnexthopserver addresource = new vpnnexthopserver ( ) ; addresource . name = resource . name ; addresource . nexthopip = resource . nexthopip ; addresource . nexthopport = resource . nexthopport ; addresource . secure = resource . secure ; return addresource . add_resource ( client ) ; } | Use this API to add vpnnexthopserver . | 107 | 12 |
4,065 | public static base_responses add ( nitro_service client , vpnnexthopserver resources [ ] ) throws Exception { base_responses result = null ; if ( resources != null && resources . length > 0 ) { vpnnexthopserver addresources [ ] = new vpnnexthopserver [ resources . length ] ; for ( int i = 0 ; i < resources . length ; i ++ ) { addresources [ i ] = new vpnnexthopserver ( ) ; addresources [ i ] . name = resources [ i ] . name ; addresources [ i ] . nexthopip = resources [ i ] . nexthopip ; addresources [ i ] . nexthopport = resources [ i ] . nexthopport ; addresources [ i ] . secure = resources [ i ] . secure ; } result = add_bulk_request ( client , addresources ) ; } return result ; } | Use this API to add vpnnexthopserver resources . | 202 | 13 |
4,066 | public static vpnnexthopserver [ ] get ( nitro_service service ) throws Exception { vpnnexthopserver obj = new vpnnexthopserver ( ) ; vpnnexthopserver [ ] response = ( vpnnexthopserver [ ] ) obj . get_resources ( service ) ; return response ; } | Use this API to fetch all the vpnnexthopserver resources that are configured on netscaler . | 72 | 22 |
4,067 | public static vpnnexthopserver get ( nitro_service service , String name ) throws Exception { vpnnexthopserver obj = new vpnnexthopserver ( ) ; obj . set_name ( name ) ; vpnnexthopserver response = ( vpnnexthopserver ) obj . get_resource ( service ) ; return response ; } | Use this API to fetch vpnnexthopserver resource of given name . | 78 | 16 |
4,068 | public static lbvserver_csvserver_binding [ ] get ( nitro_service service , String name ) throws Exception { lbvserver_csvserver_binding obj = new lbvserver_csvserver_binding ( ) ; obj . set_name ( name ) ; lbvserver_csvserver_binding response [ ] = ( lbvserver_csvserver_binding [ ] ) obj . get_resources ( service ) ; return response ; } | Use this API to fetch lbvserver_csvserver_binding resources of given name . | 94 | 18 |
4,069 | public static nstrafficdomain_vlan_binding [ ] get ( nitro_service service , Long td ) throws Exception { nstrafficdomain_vlan_binding obj = new nstrafficdomain_vlan_binding ( ) ; obj . set_td ( td ) ; nstrafficdomain_vlan_binding response [ ] = ( nstrafficdomain_vlan_binding [ ] ) obj . get_resources ( service ) ; return response ; } | Use this API to fetch nstrafficdomain_vlan_binding resources of given name . | 99 | 19 |
4,070 | private Entry < E > getEntry ( int index ) { Entry < E > entry = indexToEntry . get ( index ) ; return entry ; } | Get entry by index exception if none . | 31 | 8 |
4,071 | public boolean add ( E key , double priority ) { // System.err.println("Adding " + key + " with priority " + priority); if ( add ( key ) ) { relaxPriority ( key , priority ) ; return true ; } return false ; } | Convenience method for if you want to pretend relaxPriority doesn t exist or if you really want add s return conditions . | 55 | 26 |
4,072 | public boolean relaxPriority ( E key , double priority ) { Entry < E > entry = getEntry ( key ) ; if ( entry == null ) { entry = makeEntry ( key ) ; } if ( compare ( priority , entry . priority ) <= 0 ) { return false ; } entry . priority = priority ; heapifyUp ( entry ) ; return true ; } | Promotes a key in the queue adding it if it wasn t there already . If the specified priority is worse than the current priority nothing happens . Faster than add if you don t care about whether the key is new . | 76 | 44 |
4,073 | public boolean decreasePriority ( E key , double priority ) { Entry < E > entry = getEntry ( key ) ; if ( entry == null ) { entry = makeEntry ( key ) ; } if ( compare ( priority , entry . priority ) >= 0 ) { return false ; } entry . priority = priority ; heapifyDown ( entry ) ; return true ; } | Demotes a key in the queue adding it if it wasn t there already . If the specified priority is better than the current priority nothing happens . If you decrease the priority on a non - present key it will get added but at it s old implicit priority of Double . NEGATIVE_INFINITY . | 76 | 62 |
4,074 | public boolean changePriority ( E key , double priority ) { Entry < E > entry = getEntry ( key ) ; if ( entry == null ) { entry = makeEntry ( key ) ; } if ( compare ( priority , entry . priority ) == 0 ) { return false ; } entry . priority = priority ; heapify ( entry ) ; return true ; } | Changes a priority either up or down adding the key it if it wasn t there already . | 75 | 18 |
4,075 | public static base_response add ( nitro_service client , location resource ) throws Exception { location addresource = new location ( ) ; addresource . ipfrom = resource . ipfrom ; addresource . ipto = resource . ipto ; addresource . preferredlocation = resource . preferredlocation ; addresource . longitude = resource . longitude ; addresource . latitude = resource . latitude ; return addresource . add_resource ( client ) ; } | Use this API to add location . | 95 | 7 |
4,076 | public static base_responses add ( nitro_service client , location resources [ ] ) throws Exception { base_responses result = null ; if ( resources != null && resources . length > 0 ) { location addresources [ ] = new location [ resources . length ] ; for ( int i = 0 ; i < resources . length ; i ++ ) { addresources [ i ] = new location ( ) ; addresources [ i ] . ipfrom = resources [ i ] . ipfrom ; addresources [ i ] . ipto = resources [ i ] . ipto ; addresources [ i ] . preferredlocation = resources [ i ] . preferredlocation ; addresources [ i ] . longitude = resources [ i ] . longitude ; addresources [ i ] . latitude = resources [ i ] . latitude ; } result = add_bulk_request ( client , addresources ) ; } return result ; } | Use this API to add location resources . | 191 | 8 |
4,077 | public static base_response delete ( nitro_service client , String ipfrom ) throws Exception { location deleteresource = new location ( ) ; deleteresource . ipfrom = ipfrom ; return deleteresource . delete_resource ( client ) ; } | Use this API to delete location of given name . | 50 | 10 |
4,078 | public static base_response delete ( nitro_service client , location resource ) throws Exception { location deleteresource = new location ( ) ; deleteresource . ipfrom = resource . ipfrom ; deleteresource . ipto = resource . ipto ; return deleteresource . delete_resource ( client ) ; } | Use this API to delete location . | 64 | 7 |
4,079 | public static base_responses delete ( nitro_service client , String ipfrom [ ] ) throws Exception { base_responses result = null ; if ( ipfrom != null && ipfrom . length > 0 ) { location deleteresources [ ] = new location [ ipfrom . length ] ; for ( int i = 0 ; i < ipfrom . length ; i ++ ) { deleteresources [ i ] = new location ( ) ; deleteresources [ i ] . ipfrom = ipfrom [ i ] ; } result = delete_bulk_request ( client , deleteresources ) ; } return result ; } | Use this API to delete location resources of given names . | 126 | 11 |
4,080 | public static base_responses delete ( nitro_service client , location resources [ ] ) throws Exception { base_responses result = null ; if ( resources != null && resources . length > 0 ) { location deleteresources [ ] = new location [ resources . length ] ; for ( int i = 0 ; i < resources . length ; i ++ ) { deleteresources [ i ] = new location ( ) ; deleteresources [ i ] . ipfrom = resources [ i ] . ipfrom ; deleteresources [ i ] . ipto = resources [ i ] . ipto ; } result = delete_bulk_request ( client , deleteresources ) ; } return result ; } | Use this API to delete location resources . | 142 | 8 |
4,081 | public static location [ ] get ( nitro_service service ) throws Exception { location obj = new location ( ) ; location [ ] response = ( location [ ] ) obj . get_resources ( service ) ; return response ; } | Use this API to fetch all the location resources that are configured on netscaler . | 47 | 17 |
4,082 | public static location get ( nitro_service service , String ipfrom ) throws Exception { location obj = new location ( ) ; obj . set_ipfrom ( ipfrom ) ; location response = ( location ) obj . get_resource ( service ) ; return response ; } | Use this API to fetch location resource of given name . | 56 | 11 |
4,083 | public static location [ ] get ( nitro_service service , String ipfrom [ ] ) throws Exception { if ( ipfrom != null && ipfrom . length > 0 ) { location response [ ] = new location [ ipfrom . length ] ; location obj [ ] = new location [ ipfrom . length ] ; for ( int i = 0 ; i < ipfrom . length ; i ++ ) { obj [ i ] = new location ( ) ; obj [ i ] . set_ipfrom ( ipfrom [ i ] ) ; response [ i ] = ( location ) obj [ i ] . get_resource ( service ) ; } return response ; } return null ; } | Use this API to fetch location resources of given names . | 139 | 11 |
4,084 | public static location [ ] get_filtered ( nitro_service service , filtervalue [ ] filter ) throws Exception { location obj = new location ( ) ; options option = new options ( ) ; option . set_filter ( filter ) ; location [ ] response = ( location [ ] ) obj . getfiltered ( service , option ) ; return response ; } | Use this API to fetch filtered set of location resources . set the filter parameter values in filtervalue object . | 75 | 21 |
4,085 | @ SuppressWarnings ( "unchecked" ) private void mergeNamedList ( ShardRequest sreq , NamedList < Object > mtasResponse , String key , Integer preferredPurpose ) { // create new response for key NamedList < Object > mtasListResponse ; Object o = mtasResponse . get ( key ) ; if ( o instanceof NamedList ) { mtasListResponse = ( NamedList < Object > ) o ; } else { mtasListResponse = new SimpleOrderedMap <> ( ) ; mtasResponse . removeAll ( key ) ; mtasResponse . add ( key , mtasListResponse ) ; } // collect responses for each shard HashMap < String , NamedList < Object > > mtasListShardResponses = new HashMap <> ( ) ; for ( ShardResponse response : sreq . responses ) { // only continue if new shard or preferred purpose if ( mtasListShardResponses . containsKey ( response . getShard ( ) ) && ( ( preferredPurpose == null ) || ( sreq . purpose != preferredPurpose ) ) ) { break ; } // update try { NamedList < Object > result = response . getSolrResponse ( ) . getResponse ( ) ; NamedList < Object > data = ( NamedList < Object > ) result . findRecursive ( "mtas" , key ) ; if ( data != null ) { mtasListShardResponses . put ( response . getShard ( ) , MtasSolrResultUtil . decode ( data ) ) ; } } catch ( ClassCastException e ) { log . debug ( e ) ; } } try { for ( NamedList < Object > mtasListShardResponse : mtasListShardResponses . values ( ) ) { mergeResponsesNamedList ( mtasListResponse , mtasListShardResponse ) ; } } catch ( IOException e ) { log . error ( e ) ; } } | Merge named list . | 422 | 5 |
4,086 | @ SuppressWarnings ( "unchecked" ) private void mergeArrayList ( ShardRequest sreq , NamedList < Object > mtasResponse , String key , Integer preferredPurpose , boolean mergeAllShardResponses ) { // create new response for key ArrayList < Object > mtasListResponse ; Object o = mtasResponse . get ( key ) ; if ( o instanceof ArrayList ) { mtasListResponse = ( ArrayList < Object > ) o ; } else { mtasListResponse = new ArrayList <> ( ) ; mtasResponse . removeAll ( key ) ; mtasResponse . add ( key , mtasListResponse ) ; } // collect responses for each shard HashMap < String , ArrayList < Object > > mtasListShardResponses = new HashMap <> ( ) ; ArrayList < ArrayList < Object > > mtasListShardResponsesExtra = new ArrayList <> ( ) ; for ( ShardResponse response : sreq . responses ) { // only continue if new shard or preferred purpose if ( mtasListShardResponses . containsKey ( response . getShard ( ) ) && ( ( preferredPurpose == null ) || ( sreq . purpose != preferredPurpose ) ) ) { break ; } // update try { NamedList < Object > result = response . getSolrResponse ( ) . getResponse ( ) ; ArrayList < Object > data = ( ArrayList < Object > ) result . findRecursive ( "mtas" , key ) ; if ( data != null ) { if ( mtasListShardResponses . containsKey ( response . getShardAddress ( ) ) ) { if ( mergeAllShardResponses ) { mtasListShardResponsesExtra . add ( data ) ; } } else { mtasListShardResponses . put ( response . getShardAddress ( ) , data ) ; } } } catch ( ClassCastException e ) { log . error ( e ) ; } } try { for ( ArrayList < Object > mtasListShardResponse : mtasListShardResponses . values ( ) ) { mergeResponsesArrayList ( mtasListResponse , mtasListShardResponse ) ; } for ( ArrayList < Object > mtasListShardResponse : mtasListShardResponsesExtra ) { mergeResponsesArrayList ( mtasListResponse , mtasListShardResponse ) ; } } catch ( IOException e ) { log . error ( e ) ; } } | Merge array list . | 546 | 5 |
4,087 | private void mergeResponsesSortedSet ( SortedSet < Object > originalList , SortedSet < Object > shardList ) { for ( Object item : shardList ) { originalList . add ( item ) ; } } | Merge responses sorted set . | 50 | 6 |
4,088 | @ SuppressWarnings ( "unchecked" ) private void mergeResponsesArrayList ( ArrayList < Object > originalList , ArrayList < Object > shardList ) throws IOException { // get keys from original HashMap < String , Object > originalKeyList = new HashMap <> ( ) ; for ( Object item : originalList ) { if ( item instanceof NamedList < ? > ) { NamedList < Object > itemList = ( NamedList < Object > ) item ; Object key = itemList . get ( "key" ) ; if ( ( key != null ) && ( key instanceof String ) ) { originalKeyList . put ( ( String ) key , item ) ; } } } for ( Object item : shardList ) { if ( item instanceof NamedList < ? > ) { NamedList < Object > itemList = ( NamedList < Object > ) item ; Object key = itemList . get ( "key" ) ; // item with key if ( ( key != null ) && ( key instanceof String ) ) { // merge if ( originalKeyList . containsKey ( key ) ) { Object originalItem = originalKeyList . get ( key ) ; if ( originalItem . getClass ( ) . equals ( item . getClass ( ) ) ) { mergeResponsesNamedList ( ( NamedList < Object > ) originalItem , ( NamedList < Object > ) item ) ; } else { // ignore? } // add } else { Object clonedItem = adjustablePartsCloned ( item ) ; originalList . add ( clonedItem ) ; originalKeyList . put ( ( String ) key , clonedItem ) ; } } else { originalList . add ( item ) ; } } else { originalList . add ( item ) ; } } } | Merge responses array list . | 377 | 6 |
4,089 | @ SuppressWarnings ( { "rawtypes" , "unchecked" } ) private void mergeResponsesNamedList ( NamedList < Object > mainResponse , NamedList < Object > shardResponse ) throws IOException { Iterator < Entry < String , Object > > it = shardResponse . iterator ( ) ; while ( it . hasNext ( ) ) { Entry < String , Object > entry = it . next ( ) ; String name = entry . getKey ( ) ; Object shardValue = entry . getValue ( ) ; int originalId = mainResponse . indexOf ( name , 0 ) ; if ( originalId < 0 ) { mainResponse . add ( name , adjustablePartsCloned ( shardValue ) ) ; } else { Object original = mainResponse . getVal ( originalId ) ; if ( original == null ) { original = adjustablePartsCloned ( shardValue ) ; } else if ( shardValue != null && original . getClass ( ) . equals ( shardValue . getClass ( ) ) ) { // merge ArrayList if ( original instanceof ArrayList ) { ArrayList originalList = ( ArrayList ) original ; ArrayList shardList = ( ArrayList ) shardValue ; mergeResponsesArrayList ( originalList , shardList ) ; // merge Namedlist } else if ( original instanceof NamedList < ? > ) { mergeResponsesNamedList ( ( NamedList < Object > ) original , ( NamedList < Object > ) shardValue ) ; // merge SortedSet } else if ( original instanceof SortedSet < ? > ) { mergeResponsesSortedSet ( ( SortedSet < Object > ) original , ( SortedSet < Object > ) shardValue ) ; } else if ( original instanceof MtasSolrMtasResult ) { MtasSolrMtasResult originalComponentResult = ( MtasSolrMtasResult ) original ; originalComponentResult . merge ( ( MtasSolrMtasResult ) shardValue ) ; } else if ( original instanceof MtasSolrCollectionResult ) { MtasSolrCollectionResult originalComponentResult = ( MtasSolrCollectionResult ) original ; originalComponentResult . merge ( ( MtasSolrCollectionResult ) shardValue ) ; } else if ( original instanceof String ) { // ignore? } else if ( original instanceof Integer ) { original = ( Integer ) original + ( ( Integer ) shardValue ) ; } else if ( original instanceof Long ) { original = ( Long ) original + ( ( Long ) shardValue ) ; } else { // ignore? } mainResponse . setVal ( originalId , original ) ; } else { // ignore? } } } } | Merge responses named list . | 583 | 6 |
4,090 | @ SuppressWarnings ( { "rawtypes" , "unchecked" } ) private Object adjustablePartsCloned ( Object original ) { if ( original instanceof NamedList ) { NamedList < Object > newObject = new SimpleOrderedMap ( ) ; NamedList < Object > originalObject = ( NamedList < Object > ) original ; for ( int i = 0 ; i < originalObject . size ( ) ; i ++ ) { newObject . add ( originalObject . getName ( i ) , adjustablePartsCloned ( originalObject . getVal ( i ) ) ) ; } return newObject ; } else if ( original instanceof ArrayList ) { ArrayList < Object > newObject = new ArrayList <> ( ) ; ArrayList < Object > originalObject = ( ArrayList < Object > ) original ; for ( int i = 0 ; i < originalObject . size ( ) ; i ++ ) { newObject . add ( adjustablePartsCloned ( originalObject . get ( i ) ) ) ; } return newObject ; } else if ( original instanceof Integer ) { return original ; } return original ; } | Adjustable parts cloned . | 234 | 6 |
4,091 | public static sslcertkey_service_binding [ ] get ( nitro_service service , String certkey ) throws Exception { sslcertkey_service_binding obj = new sslcertkey_service_binding ( ) ; obj . set_certkey ( certkey ) ; sslcertkey_service_binding response [ ] = ( sslcertkey_service_binding [ ] ) obj . get_resources ( service ) ; return response ; } | Use this API to fetch sslcertkey_service_binding resources of given name . | 97 | 18 |
4,092 | public static csvserver_responderpolicy_binding [ ] get ( nitro_service service , String name ) throws Exception { csvserver_responderpolicy_binding obj = new csvserver_responderpolicy_binding ( ) ; obj . set_name ( name ) ; csvserver_responderpolicy_binding response [ ] = ( csvserver_responderpolicy_binding [ ] ) obj . get_resources ( service ) ; return response ; } | Use this API to fetch csvserver_responderpolicy_binding resources of given name . | 99 | 19 |
4,093 | @ SuppressWarnings ( "unchecked" ) public < GR extends GrammaticalRelationAnnotation > boolean addArc ( Class < GR > arcLabel , TreeGraphNode node ) { if ( node == null ) { return false ; } if ( ! treeGraph ( ) . equals ( node . treeGraph ( ) ) ) { System . err . println ( "Warning: you are trying to add an arc from node " + this + " to node " + node + ", but they do not belong to the same TreeGraph!" ) ; } if ( ! label . containsKey ( arcLabel ) ) { label . set ( arcLabel , new HashSet < TreeGraphNode > ( ) ) ; } return ( ( Collection ) label . get ( arcLabel ) ) . add ( node ) ; } | Add a labeled arc from this node to the argument node . | 167 | 12 |
4,094 | public Set < Dependency < Label , Label , Object > > dependencies ( Filter < Dependency < Label , Label , Object > > f , HeadFinder hf ) { Set < Dependency < Label , Label , Object > > deps = Generics . newHashSet ( ) ; for ( Tree t : this ) { TreeGraphNode node = safeCast ( t ) ; if ( node == null || node . isLeaf ( ) || node . children ( ) . length < 2 ) { continue ; } TreeGraphNode headWordNode ; if ( hf != null ) { headWordNode = safeCast ( node . headTerminal ( hf ) ) ; } else { headWordNode = node . headWordNode ( ) ; } for ( Tree k : node . children ( ) ) { TreeGraphNode kid = safeCast ( k ) ; if ( kid == null ) { continue ; } TreeGraphNode kidHeadWordNode ; if ( hf != null ) { kidHeadWordNode = safeCast ( kid . headTerminal ( hf ) ) ; } else { kidHeadWordNode = kid . headWordNode ( ) ; } if ( headWordNode != null && headWordNode != kidHeadWordNode && kidHeadWordNode != null ) { int headWordNodeIndex = headWordNode . index ( ) ; int kidHeadWordNodeIndex = kidHeadWordNode . index ( ) ; // If the two indices are equal, then the leaves haven't been indexed. Just return an ordinary // UnnamedDependency. This mirrors the implementation of super.dependencies(). Dependency < Label , Label , Object > d = ( headWordNodeIndex == kidHeadWordNodeIndex ) ? new UnnamedDependency ( headWordNode , kidHeadWordNode ) : new UnnamedConcreteDependency ( headWordNode , headWordNodeIndex , kidHeadWordNode , kidHeadWordNodeIndex ) ; if ( f . accept ( d ) ) { deps . add ( d ) ; } } } } return deps ; } | Return a set of node - node dependencies represented as Dependency objects for the Tree . | 431 | 17 |
4,095 | public static systemglobal_auditsyslogpolicy_binding [ ] get ( nitro_service service ) throws Exception { systemglobal_auditsyslogpolicy_binding obj = new systemglobal_auditsyslogpolicy_binding ( ) ; systemglobal_auditsyslogpolicy_binding response [ ] = ( systemglobal_auditsyslogpolicy_binding [ ] ) obj . get_resources ( service ) ; return response ; } | Use this API to fetch a systemglobal_auditsyslogpolicy_binding resources . | 92 | 18 |
4,096 | public static base_response add ( nitro_service client , streamidentifier resource ) throws Exception { streamidentifier addresource = new streamidentifier ( ) ; addresource . name = resource . name ; addresource . selectorname = resource . selectorname ; addresource . interval = resource . interval ; addresource . samplecount = resource . samplecount ; addresource . sort = resource . sort ; return addresource . add_resource ( client ) ; } | Use this API to add streamidentifier . | 97 | 9 |
4,097 | public static base_responses add ( nitro_service client , streamidentifier resources [ ] ) throws Exception { base_responses result = null ; if ( resources != null && resources . length > 0 ) { streamidentifier addresources [ ] = new streamidentifier [ resources . length ] ; for ( int i = 0 ; i < resources . length ; i ++ ) { addresources [ i ] = new streamidentifier ( ) ; addresources [ i ] . name = resources [ i ] . name ; addresources [ i ] . selectorname = resources [ i ] . selectorname ; addresources [ i ] . interval = resources [ i ] . interval ; addresources [ i ] . samplecount = resources [ i ] . samplecount ; addresources [ i ] . sort = resources [ i ] . sort ; } result = add_bulk_request ( client , addresources ) ; } return result ; } | Use this API to add streamidentifier resources . | 195 | 10 |
4,098 | public static base_response update ( nitro_service client , streamidentifier resource ) throws Exception { streamidentifier updateresource = new streamidentifier ( ) ; updateresource . name = resource . name ; updateresource . selectorname = resource . selectorname ; updateresource . interval = resource . interval ; updateresource . samplecount = resource . samplecount ; updateresource . sort = resource . sort ; return updateresource . update_resource ( client ) ; } | Use this API to update streamidentifier . | 97 | 9 |
4,099 | public static base_responses update ( nitro_service client , streamidentifier resources [ ] ) throws Exception { base_responses result = null ; if ( resources != null && resources . length > 0 ) { streamidentifier updateresources [ ] = new streamidentifier [ resources . length ] ; for ( int i = 0 ; i < resources . length ; i ++ ) { updateresources [ i ] = new streamidentifier ( ) ; updateresources [ i ] . name = resources [ i ] . name ; updateresources [ i ] . selectorname = resources [ i ] . selectorname ; updateresources [ i ] . interval = resources [ i ] . interval ; updateresources [ i ] . samplecount = resources [ i ] . samplecount ; updateresources [ i ] . sort = resources [ i ] . sort ; } result = update_bulk_request ( client , updateresources ) ; } return result ; } | Use this API to update streamidentifier resources . | 195 | 10 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.