_id stringlengths 2 7 | title stringlengths 3 140 | partition stringclasses 3
values | text stringlengths 73 34.1k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q10800 | MorseDistance.computeMorse | train | private String computeMorse(BytesRef term) {
StringBuilder stringBuilder = new StringBuilder();
int i = term.offset + prefixOffset;
for (; i < term.length; i++) {
if (ALPHABET_MORSE.containsKey(term.bytes[i])) {
stringBuilder.append(ALPHABET_MORSE.get(term.bytes[i]) + " ");
} else if(ter... | java | {
"resource": ""
} |
q10801 | MtasSolrComponentTermvector.distributedProcessFinish | train | private void distributedProcessFinish(ResponseBuilder rb,
ComponentFields mtasFields) throws IOException {
// rewrite
Object mtasResponseRaw;
if ((mtasResponseRaw = rb.rsp.getValues().get("mtas")) != null
&& mtasResponseRaw instanceof NamedList) {
NamedList<Object> mtasResponse = (Named... | java | {
"resource": ""
} |
q10802 | protocoludp_stats.get | train | public static protocoludp_stats get(nitro_service service) throws Exception{
protocoludp_stats obj = new protocoludp_stats();
protocoludp_stats[] response = (protocoludp_stats[])obj.stat_resources(service);
return response[0];
} | java | {
"resource": ""
} |
q10803 | csvserver_cachepolicy_binding.get | train | public static csvserver_cachepolicy_binding[] get(nitro_service service, String name) throws Exception{
csvserver_cachepolicy_binding obj = new csvserver_cachepolicy_binding();
obj.set_name(name);
csvserver_cachepolicy_binding response[] = (csvserver_cachepolicy_binding[]) obj.get_resources(service);
return res... | java | {
"resource": ""
} |
q10804 | authenticationradiuspolicy_vpnglobal_binding.get | train | public static authenticationradiuspolicy_vpnglobal_binding[] get(nitro_service service, String name) throws Exception{
authenticationradiuspolicy_vpnglobal_binding obj = new authenticationradiuspolicy_vpnglobal_binding();
obj.set_name(name);
authenticationradiuspolicy_vpnglobal_binding response[] = (authenticatio... | java | {
"resource": ""
} |
q10805 | HashIndex.indices | train | public int[] indices(Collection<E> elems) {
int[] indices = new int[elems.size()];
int i = 0;
for (E elem : elems) {
indices[i++] = indexOf(elem);
}
return indices;
} | java | {
"resource": ""
} |
q10806 | HashIndex.get | train | public E get(int i) {
if (i < 0 || i >= objects.size())
throw new ArrayIndexOutOfBoundsException("Index " + i +
" outside the bounds [0," +
size() + ")");
return objects.get(i);
} | java | {
"resource": ""
} |
q10807 | HashIndex.add | train | @Override
public boolean add(E o) {
Integer index = indexes.get(o);
if (index == null && ! locked) {
index = objects.size();
objects.add(o);
indexes.put(o, index);
return true;
}
return false;
} | java | {
"resource": ""
} |
q10808 | vlan.add | train | public static base_response add(nitro_service client, vlan resource) throws Exception {
vlan addresource = new vlan();
addresource.id = resource.id;
addresource.aliasname = resource.aliasname;
addresource.ipv6dynamicrouting = resource.ipv6dynamicrouting;
return addresource.add_resource(client);
} | java | {
"resource": ""
} |
q10809 | vlan.add | train | public static base_responses add(nitro_service client, vlan resources[]) throws Exception {
base_responses result = null;
if (resources != null && resources.length > 0) {
vlan addresources[] = new vlan[resources.length];
for (int i=0;i<resources.length;i++){
addresources[i] = new vlan();
addresources[... | java | {
"resource": ""
} |
q10810 | vlan.update | train | public static base_response update(nitro_service client, vlan resource) throws Exception {
vlan updateresource = new vlan();
updateresource.id = resource.id;
updateresource.aliasname = resource.aliasname;
updateresource.ipv6dynamicrouting = resource.ipv6dynamicrouting;
return updateresource.update_resource(cl... | java | {
"resource": ""
} |
q10811 | vlan.get | train | public static vlan[] get(nitro_service service) throws Exception{
vlan obj = new vlan();
vlan[] response = (vlan[])obj.get_resources(service);
return response;
} | java | {
"resource": ""
} |
q10812 | vlan.get | train | public static vlan get(nitro_service service, Long id) throws Exception{
vlan obj = new vlan();
obj.set_id(id);
vlan response = (vlan) obj.get_resource(service);
return response;
} | java | {
"resource": ""
} |
q10813 | systemcore.get | train | public static systemcore get(nitro_service service) throws Exception{
systemcore obj = new systemcore();
systemcore[] response = (systemcore[])obj.get_resources(service);
return response[0];
} | java | {
"resource": ""
} |
q10814 | systemcore.get | train | public static systemcore[] get(nitro_service service, systemcore_args args) throws Exception{
systemcore obj = new systemcore();
options option = new options();
option.set_args(nitro_util.object_to_string_withoutquotes(args));
systemcore[] response = (systemcore[])obj.get_resources(service, option);
return re... | java | {
"resource": ""
} |
q10815 | rnat_stats.get | train | public static rnat_stats get(nitro_service service) throws Exception{
rnat_stats obj = new rnat_stats();
rnat_stats[] response = (rnat_stats[])obj.stat_resources(service);
return response[0];
} | java | {
"resource": ""
} |
q10816 | snmpoption.update | train | public static base_response update(nitro_service client, snmpoption resource) throws Exception {
snmpoption updateresource = new snmpoption();
updateresource.snmpset = resource.snmpset;
updateresource.snmptraplogging = resource.snmptraplogging;
return updateresource.update_resource(client);
} | java | {
"resource": ""
} |
q10817 | snmpoption.unset | train | public static base_response unset(nitro_service client, snmpoption resource, String[] args) throws Exception{
snmpoption unsetresource = new snmpoption();
return unsetresource.unset_resource(client,args);
} | java | {
"resource": ""
} |
q10818 | snmpoption.get | train | public static snmpoption get(nitro_service service) throws Exception{
snmpoption obj = new snmpoption();
snmpoption[] response = (snmpoption[])obj.get_resources(service);
return response[0];
} | java | {
"resource": ""
} |
q10819 | lbvserver_filterpolicy_binding.get | train | public static lbvserver_filterpolicy_binding[] get(nitro_service service, String name) throws Exception{
lbvserver_filterpolicy_binding obj = new lbvserver_filterpolicy_binding();
obj.set_name(name);
lbvserver_filterpolicy_binding response[] = (lbvserver_filterpolicy_binding[]) obj.get_resources(service);
retur... | java | {
"resource": ""
} |
q10820 | Redwood.removeHandler | train | protected static <E extends LogRecordHandler> boolean removeHandler(Class<E> toRemove) {
boolean rtn = false;
Iterator<LogRecordHandler> iter = handlers.iterator();
while(iter.hasNext()){
if(iter.next().getClass().equals(toRemove)){
rtn = true;
iter.remove();
}
}
... | java | {
"resource": ""
} |
q10821 | Redwood.appendHandler | train | protected static void appendHandler(LogRecordHandler parent, LogRecordHandler child){
RecordHandlerTree p = handlers.find(parent);
if(p != null){
p.addChild(child);
} else {
throw new IllegalArgumentException("No such parent handler: " + parent);
}
} | java | {
"resource": ""
} |
q10822 | Redwood.appendHandler | train | protected static void appendHandler(Class<? extends LogRecordHandler> parent, LogRecordHandler child){
List<LogRecordHandler> toAdd = new LinkedList<LogRecordHandler>();
//--Find Parents
for(LogRecordHandler term : handlers){
if(parent.isAssignableFrom(term.getClass())){
toAdd.add(term);
... | java | {
"resource": ""
} |
q10823 | Redwood.getHandler | train | @Deprecated
@SuppressWarnings("unchecked")
private static <E extends LogRecordHandler> E getHandler(Class<E> clazz){
for(LogRecordHandler cand : handlers){
if(clazz == cand.getClass()){
return (E) cand;
}
}
return null;
} | java | {
"resource": ""
} |
q10824 | Redwood.captureSystemStreams | train | protected static void captureSystemStreams(boolean captureOut, boolean captureErr){
if(captureOut){
System.setOut(new RedwoodPrintStream(STDOUT, realSysOut));
}
if(captureErr){
System.setErr(new RedwoodPrintStream(STDERR, realSysErr));
}
} | java | {
"resource": ""
} |
q10825 | Redwood.startTrack | train | public static void startTrack(final Object... args){
if(isClosed){ return; }
//--Create Record
final int len = args.length == 0 ? 0 : args.length-1;
final Object content = args.length == 0 ? "" : args[len];
final Object[] tags = new Object[len];
final StackTraceElement ste = getStackTrace(... | java | {
"resource": ""
} |
q10826 | Redwood.endTrack | train | public static void endTrack(final String title){
if(isClosed){ return; }
//--Make Task
final long timestamp = System.currentTimeMillis();
Runnable endTrack = new Runnable(){
public void run(){
assert !isThreaded || control.isHeldByCurrentThread();
//(check name match)
... | java | {
"resource": ""
} |
q10827 | Redwood.finishThread | train | public static void finishThread(){
//--Create Task
final long threadId = Thread.currentThread().getId();
Runnable finish = new Runnable(){
public void run(){
releaseThreadControl(threadId);
}
};
//--Run Task
if(isThreaded){
//(case: multithreaded)
attem... | java | {
"resource": ""
} |
q10828 | Redwood.endThreads | train | public static void endThreads(String check){
//(error check)
if(currentThread != -1L){
throw new IllegalStateException("endThreads() called, but thread " + currentThread + " has not finished (exception in thread?)");
}
//(end threaded environment)
assert !control.isHeldByCurrentThread();... | java | {
"resource": ""
} |
q10829 | Redwood.showOnlyChannels | train | public static void showOnlyChannels(Object... channels){
for(LogRecordHandler handler : handlers){
if(handler instanceof VisibilityHandler){
VisibilityHandler visHandler = (VisibilityHandler) handler;
visHandler.hideAll();
for (Object channel : channels) {
visHandler.al... | java | {
"resource": ""
} |
q10830 | Redwood.hideOnlyChannels | train | public static void hideOnlyChannels(Object... channels){
for(LogRecordHandler handler : handlers){
if(handler instanceof VisibilityHandler){
VisibilityHandler visHandler = (VisibilityHandler) handler;
visHandler.showAll();
for (Object channel : channels) {
visHandler.al... | java | {
"resource": ""
} |
q10831 | Redwood.showChannels | train | public static void showChannels(Object... channels){
// TODO this could share more code with the other show/hide(Only)Channels methods
for(LogRecordHandler handler : handlers){
if(handler instanceof VisibilityHandler){
VisibilityHandler visHandler = (VisibilityHandler) handler;
for (O... | java | {
"resource": ""
} |
q10832 | Redwood.hideChannels | train | public static void hideChannels(Object... channels){
// TODO this could share more code with the other show/hide(Only)Channels methods
for(LogRecordHandler handler : handlers){
if(handler instanceof VisibilityHandler){
VisibilityHandler visHandler = (VisibilityHandler) handler;
for (O... | java | {
"resource": ""
} |
q10833 | Redwood.stop | train | public static void stop(){
//--Close logger
isClosed = true; // <- not a thread-safe boolean
Thread.yield(); //poor man's synchronization attempt (let everything else log that wants to)
Thread.yield();
//--Close Tracks
while(depth > 0){
depth -= 1;
//(send signal to handlers)... | java | {
"resource": ""
} |
q10834 | Redwood.getStackTrace | train | private static StackTraceElement getStackTrace() {
StackTraceElement[] stack = Thread.currentThread().getStackTrace();
int i = 2; // we can skip the first two (first is getStackTrace(), second is this method)
while (i < stack.length) {
boolean isLoggingClass = false;
for (String loggingCl... | java | {
"resource": ""
} |
q10835 | Redwood.filterStackTrace | train | protected static List<StackTraceElement> filterStackTrace(StackTraceElement[] stack) {
List<StackTraceElement> filteredStack = new ArrayList<StackTraceElement>();
int i = 2; // we can skip the first two (first is getStackTrace(), second is this method)
while (i < stack.length) {
boolean isLoggin... | java | {
"resource": ""
} |
q10836 | ipset.add | train | public static base_response add(nitro_service client, ipset resource) throws Exception {
ipset addresource = new ipset();
addresource.name = resource.name;
addresource.td = resource.td;
return addresource.add_resource(client);
} | java | {
"resource": ""
} |
q10837 | ipset.get | train | public static ipset[] get(nitro_service service) throws Exception{
ipset obj = new ipset();
ipset[] response = (ipset[])obj.get_resources(service);
return response;
} | java | {
"resource": ""
} |
q10838 | ipset.get | train | public static ipset get(nitro_service service, String name) throws Exception{
ipset obj = new ipset();
obj.set_name(name);
ipset response = (ipset) obj.get_resource(service);
return response;
} | java | {
"resource": ""
} |
q10839 | appfwprofile_crosssitescripting_binding.get | train | public static appfwprofile_crosssitescripting_binding[] get(nitro_service service, String name) throws Exception{
appfwprofile_crosssitescripting_binding obj = new appfwprofile_crosssitescripting_binding();
obj.set_name(name);
appfwprofile_crosssitescripting_binding response[] = (appfwprofile_crosssitescripting_b... | java | {
"resource": ""
} |
q10840 | auditsyslogpolicy_aaauser_binding.get | train | public static auditsyslogpolicy_aaauser_binding[] get(nitro_service service, String name) throws Exception{
auditsyslogpolicy_aaauser_binding obj = new auditsyslogpolicy_aaauser_binding();
obj.set_name(name);
auditsyslogpolicy_aaauser_binding response[] = (auditsyslogpolicy_aaauser_binding[]) obj.get_resources(se... | java | {
"resource": ""
} |
q10841 | autoscaleaction.add | train | public static base_response add(nitro_service client, autoscaleaction resource) throws Exception {
autoscaleaction addresource = new autoscaleaction();
addresource.name = resource.name;
addresource.type = resource.type;
addresource.profilename = resource.profilename;
addresource.parameters = resource.paramete... | java | {
"resource": ""
} |
q10842 | autoscaleaction.add | train | public static base_responses add(nitro_service client, autoscaleaction resources[]) throws Exception {
base_responses result = null;
if (resources != null && resources.length > 0) {
autoscaleaction addresources[] = new autoscaleaction[resources.length];
for (int i=0;i<resources.length;i++){
addresources[i... | java | {
"resource": ""
} |
q10843 | autoscaleaction.update | train | public static base_response update(nitro_service client, autoscaleaction resource) throws Exception {
autoscaleaction updateresource = new autoscaleaction();
updateresource.name = resource.name;
updateresource.profilename = resource.profilename;
updateresource.parameters = resource.parameters;
updateresource.... | java | {
"resource": ""
} |
q10844 | autoscaleaction.update | train | public static base_responses update(nitro_service client, autoscaleaction resources[]) throws Exception {
base_responses result = null;
if (resources != null && resources.length > 0) {
autoscaleaction updateresources[] = new autoscaleaction[resources.length];
for (int i=0;i<resources.length;i++){
updatere... | java | {
"resource": ""
} |
q10845 | autoscaleaction.get | train | public static autoscaleaction[] get(nitro_service service) throws Exception{
autoscaleaction obj = new autoscaleaction();
autoscaleaction[] response = (autoscaleaction[])obj.get_resources(service);
return response;
} | java | {
"resource": ""
} |
q10846 | autoscaleaction.get | train | public static autoscaleaction get(nitro_service service, String name) throws Exception{
autoscaleaction obj = new autoscaleaction();
obj.set_name(name);
autoscaleaction response = (autoscaleaction) obj.get_resource(service);
return response;
} | java | {
"resource": ""
} |
q10847 | sslvserver_sslcipher_binding.get | train | public static sslvserver_sslcipher_binding[] get(nitro_service service, String vservername) throws Exception{
sslvserver_sslcipher_binding obj = new sslvserver_sslcipher_binding();
obj.set_vservername(vservername);
sslvserver_sslcipher_binding response[] = (sslvserver_sslcipher_binding[]) obj.get_resources(servic... | java | {
"resource": ""
} |
q10848 | vpnglobal_authenticationsamlpolicy_binding.get | train | public static vpnglobal_authenticationsamlpolicy_binding[] get(nitro_service service) throws Exception{
vpnglobal_authenticationsamlpolicy_binding obj = new vpnglobal_authenticationsamlpolicy_binding();
vpnglobal_authenticationsamlpolicy_binding response[] = (vpnglobal_authenticationsamlpolicy_binding[]) obj.get_re... | java | {
"resource": ""
} |
q10849 | nsacl6.add | train | public static base_response add(nitro_service client, nsacl6 resource) throws Exception {
nsacl6 addresource = new nsacl6();
addresource.acl6name = resource.acl6name;
addresource.acl6action = resource.acl6action;
addresource.td = resource.td;
addresource.srcipv6 = resource.srcipv6;
addresource.srcipop = res... | java | {
"resource": ""
} |
q10850 | nsacl6.add | train | public static base_responses add(nitro_service client, nsacl6 resources[]) throws Exception {
base_responses result = null;
if (resources != null && resources.length > 0) {
nsacl6 addresources[] = new nsacl6[resources.length];
for (int i=0;i<resources.length;i++){
addresources[i] = new nsacl6();
addre... | java | {
"resource": ""
} |
q10851 | nsacl6.delete | train | public static base_response delete(nitro_service client, String acl6name) throws Exception {
nsacl6 deleteresource = new nsacl6();
deleteresource.acl6name = acl6name;
return deleteresource.delete_resource(client);
} | java | {
"resource": ""
} |
q10852 | nsacl6.delete | train | public static base_responses delete(nitro_service client, String acl6name[]) throws Exception {
base_responses result = null;
if (acl6name != null && acl6name.length > 0) {
nsacl6 deleteresources[] = new nsacl6[acl6name.length];
for (int i=0;i<acl6name.length;i++){
deleteresources[i] = new nsacl6();
d... | java | {
"resource": ""
} |
q10853 | nsacl6.update | train | public static base_response update(nitro_service client, nsacl6 resource) throws Exception {
nsacl6 updateresource = new nsacl6();
updateresource.acl6name = resource.acl6name;
updateresource.aclaction = resource.aclaction;
updateresource.srcipv6 = resource.srcipv6;
updateresource.srcipop = resource.srcipop;
... | java | {
"resource": ""
} |
q10854 | nsacl6.update | train | public static base_responses update(nitro_service client, nsacl6 resources[]) throws Exception {
base_responses result = null;
if (resources != null && resources.length > 0) {
nsacl6 updateresources[] = new nsacl6[resources.length];
for (int i=0;i<resources.length;i++){
updateresources[i] = new nsacl6();
... | java | {
"resource": ""
} |
q10855 | nsacl6.unset | train | public static base_response unset(nitro_service client, nsacl6 resource, String[] args) throws Exception{
nsacl6 unsetresource = new nsacl6();
unsetresource.acl6name = resource.acl6name;
return unsetresource.unset_resource(client,args);
} | java | {
"resource": ""
} |
q10856 | nsacl6.unset | train | public static base_responses unset(nitro_service client, String acl6name[], String args[]) throws Exception {
base_responses result = null;
if (acl6name != null && acl6name.length > 0) {
nsacl6 unsetresources[] = new nsacl6[acl6name.length];
for (int i=0;i<acl6name.length;i++){
unsetresources[i] = new nsa... | java | {
"resource": ""
} |
q10857 | nsacl6.enable | train | public static base_response enable(nitro_service client, String acl6name) throws Exception {
nsacl6 enableresource = new nsacl6();
enableresource.acl6name = acl6name;
return enableresource.perform_operation(client,"enable");
} | java | {
"resource": ""
} |
q10858 | nsacl6.enable | train | public static base_responses enable(nitro_service client, String acl6name[]) throws Exception {
base_responses result = null;
if (acl6name != null && acl6name.length > 0) {
nsacl6 enableresources[] = new nsacl6[acl6name.length];
for (int i=0;i<acl6name.length;i++){
enableresources[i] = new nsacl6();
e... | java | {
"resource": ""
} |
q10859 | nsacl6.disable | train | public static base_response disable(nitro_service client, nsacl6 resource) throws Exception {
nsacl6 disableresource = new nsacl6();
disableresource.acl6name = resource.acl6name;
return disableresource.perform_operation(client,"disable");
} | java | {
"resource": ""
} |
q10860 | nsacl6.disable | train | public static base_responses disable(nitro_service client, String acl6name[]) throws Exception {
base_responses result = null;
if (acl6name != null && acl6name.length > 0) {
nsacl6 disableresources[] = new nsacl6[acl6name.length];
for (int i=0;i<acl6name.length;i++){
disableresources[i] = new nsacl6();
... | java | {
"resource": ""
} |
q10861 | nsacl6.rename | train | public static base_response rename(nitro_service client, nsacl6 resource, String new_acl6name) throws Exception {
nsacl6 renameresource = new nsacl6();
renameresource.acl6name = resource.acl6name;
return renameresource.rename_resource(client,new_acl6name);
} | java | {
"resource": ""
} |
q10862 | nsacl6.get | train | public static nsacl6[] get(nitro_service service) throws Exception{
nsacl6 obj = new nsacl6();
nsacl6[] response = (nsacl6[])obj.get_resources(service);
return response;
} | java | {
"resource": ""
} |
q10863 | nsacl6.get | train | public static nsacl6 get(nitro_service service, String acl6name) throws Exception{
nsacl6 obj = new nsacl6();
obj.set_acl6name(acl6name);
nsacl6 response = (nsacl6) obj.get_resource(service);
return response;
} | java | {
"resource": ""
} |
q10864 | nsacl6.get | train | public static nsacl6[] get(nitro_service service, String acl6name[]) throws Exception{
if (acl6name !=null && acl6name.length>0) {
nsacl6 response[] = new nsacl6[acl6name.length];
nsacl6 obj[] = new nsacl6[acl6name.length];
for (int i=0;i<acl6name.length;i++) {
obj[i] = new nsacl6();
obj[i].set_acl6n... | java | {
"resource": ""
} |
q10865 | service_dospolicy_binding.get | train | public static service_dospolicy_binding[] get(nitro_service service, String name) throws Exception{
service_dospolicy_binding obj = new service_dospolicy_binding();
obj.set_name(name);
service_dospolicy_binding response[] = (service_dospolicy_binding[]) obj.get_resources(service);
return response;
} | java | {
"resource": ""
} |
q10866 | appfwprofile_csrftag_binding.get | train | public static appfwprofile_csrftag_binding[] get(nitro_service service, String name) throws Exception{
appfwprofile_csrftag_binding obj = new appfwprofile_csrftag_binding();
obj.set_name(name);
appfwprofile_csrftag_binding response[] = (appfwprofile_csrftag_binding[]) obj.get_resources(service);
return response... | java | {
"resource": ""
} |
q10867 | dnsview_binding.get | train | public static dnsview_binding get(nitro_service service, String viewname) throws Exception{
dnsview_binding obj = new dnsview_binding();
obj.set_viewname(viewname);
dnsview_binding response = (dnsview_binding) obj.get_resource(service);
return response;
} | java | {
"resource": ""
} |
q10868 | nsspparams.update | train | public static base_response update(nitro_service client, nsspparams resource) throws Exception {
nsspparams updateresource = new nsspparams();
updateresource.basethreshold = resource.basethreshold;
updateresource.throttle = resource.throttle;
return updateresource.update_resource(client);
} | java | {
"resource": ""
} |
q10869 | nsspparams.unset | train | public static base_response unset(nitro_service client, nsspparams resource, String[] args) throws Exception{
nsspparams unsetresource = new nsspparams();
return unsetresource.unset_resource(client,args);
} | java | {
"resource": ""
} |
q10870 | nsspparams.get | train | public static nsspparams get(nitro_service service) throws Exception{
nsspparams obj = new nsspparams();
nsspparams[] response = (nsspparams[])obj.get_resources(service);
return response[0];
} | java | {
"resource": ""
} |
q10871 | CollectionUtils.asList | train | public static List<Integer> asList(int[] a) {
List<Integer> result = new ArrayList<Integer>(a.length);
for (int i = 0; i < a.length; i++) {
result.add(Integer.valueOf(a[i]));
}
return result;
} | java | {
"resource": ""
} |
q10872 | CollectionUtils.makeList | train | public static <T> List<T> makeList(T... items) {
List<T> s = new ArrayList<T>(items.length);
for (int i = 0; i < items.length; i++) {
s.add(items[i]);
}
return s;
} | java | {
"resource": ""
} |
q10873 | CollectionUtils.asSet | train | public static <T> Set<T> asSet(T[] o) {
return new HashSet<T>(Arrays.asList(o));
} | java | {
"resource": ""
} |
q10874 | CollectionUtils.diff | train | public static <T> Collection<T> diff(Collection<T> list1, Collection<T> list2) {
Collection<T> diff = new ArrayList<T>();
for (T t : list1) {
if (!list2.contains(t)) {
diff.add(t);
}
}
return diff;
} | java | {
"resource": ""
} |
q10875 | CollectionUtils.sampleWithoutReplacement | train | public static <E> Collection<E> sampleWithoutReplacement(Collection<E> c, int n) {
return sampleWithoutReplacement(c, n, new Random());
} | java | {
"resource": ""
} |
q10876 | CollectionUtils.sampleWithReplacement | train | public static <E> Collection<E> sampleWithReplacement(Collection<E> c, int n) {
return sampleWithReplacement(c, n, new Random());
} | java | {
"resource": ""
} |
q10877 | CollectionUtils.compareLists | train | public static <T extends Comparable<T>> int compareLists(List<T> list1, List<T> list2) {
if (list1 == null && list2 == null)
return 0;
if (list1 == null || list2 == null) {
throw new IllegalArgumentException();
}
int size1 = list1.size();
int size2 = list2.size();
int size = ... | java | {
"resource": ""
} |
q10878 | CollectionUtils.toList | train | public static <T> List<T> toList(Iterable<T> items) {
List<T> list = new ArrayList<T>();
addAll(list, items);
return list;
} | java | {
"resource": ""
} |
q10879 | CollectionUtils.toSet | train | public static <T> Set<T> toSet(Iterable<T> items) {
Set<T> set = new HashSet<T>();
addAll(set, items);
return set;
} | java | {
"resource": ""
} |
q10880 | CollectionUtils.addAll | train | public static <T> void addAll(Collection<T> collection, Iterable<? extends T> items) {
for (T item : items) {
collection.add(item);
}
} | java | {
"resource": ""
} |
q10881 | CollectionUtils.getNGrams | train | public static <T> List<List<T>> getNGrams(List<T> items, int minSize, int maxSize) {
List<List<T>> ngrams = new ArrayList<List<T>>();
int listSize = items.size();
for (int i = 0; i < listSize; ++i) {
for (int ngramSize = minSize; ngramSize <= maxSize; ++ngramSize) {
if (i + ngramSize <= l... | java | {
"resource": ""
} |
q10882 | CollectionUtils.flatten | train | public static <T> List<T> flatten(Collection<List<T>> nestedList) {
List<T> result = new ArrayList<T>();
for (List<T> list : nestedList) {
result.addAll(list);
}
return result;
} | java | {
"resource": ""
} |
q10883 | CollectionUtils.uniqueNonhashableObjects | train | public static <ObjType, Hashable> Collection<ObjType> uniqueNonhashableObjects(Collection<ObjType> objects, Function<ObjType, Hashable> customHasher) {
Map<Hashable, ObjType> hashesToObjects = new HashMap<Hashable, ObjType>();
for (ObjType object : objects) {
hashesToObjects.put(customHasher.apply(obje... | java | {
"resource": ""
} |
q10884 | CollectionUtils.containsAny | train | public static <T> boolean containsAny(Collection<T> collection, Collection<T> toCheck){
for(T c: toCheck){
if(collection.contains(c))
return true;
}
return false;
} | java | {
"resource": ""
} |
q10885 | CollectionUtils.mode | train | public static <T> T mode(Collection<T> values) {
Set<T> modes = modes(values);
return modes.iterator().next();
} | java | {
"resource": ""
} |
q10886 | crvserver_binding.get | train | public static crvserver_binding get(nitro_service service, String name) throws Exception{
crvserver_binding obj = new crvserver_binding();
obj.set_name(name);
crvserver_binding response = (crvserver_binding) obj.get_resource(service);
return response;
} | java | {
"resource": ""
} |
q10887 | appfwprofile.restore | train | public static base_response restore(nitro_service client, appfwprofile resource) throws Exception {
appfwprofile restoreresource = new appfwprofile();
restoreresource.archivename = resource.archivename;
return restoreresource.perform_operation(client,"restore");
} | java | {
"resource": ""
} |
q10888 | appfwprofile.restore | train | public static base_responses restore(nitro_service client, appfwprofile resources[]) throws Exception {
base_responses result = null;
if (resources != null && resources.length > 0) {
appfwprofile restoreresources[] = new appfwprofile[resources.length];
for (int i=0;i<resources.length;i++){
restoreresource... | java | {
"resource": ""
} |
q10889 | appfwprofile.get | train | public static appfwprofile[] get(nitro_service service) throws Exception{
appfwprofile obj = new appfwprofile();
appfwprofile[] response = (appfwprofile[])obj.get_resources(service);
return response;
} | java | {
"resource": ""
} |
q10890 | appfwprofile.get | train | public static appfwprofile get(nitro_service service, String name) throws Exception{
appfwprofile obj = new appfwprofile();
obj.set_name(name);
appfwprofile response = (appfwprofile) obj.get_resource(service);
return response;
} | java | {
"resource": ""
} |
q10891 | route6.add | train | public static base_response add(nitro_service client, route6 resource) throws Exception {
route6 addresource = new route6();
addresource.network = resource.network;
addresource.gateway = resource.gateway;
addresource.vlan = resource.vlan;
addresource.weight = resource.weight;
addresource.distance = resource... | java | {
"resource": ""
} |
q10892 | route6.add | train | public static base_responses add(nitro_service client, route6 resources[]) throws Exception {
base_responses result = null;
if (resources != null && resources.length > 0) {
route6 addresources[] = new route6[resources.length];
for (int i=0;i<resources.length;i++){
addresources[i] = new route6();
addre... | java | {
"resource": ""
} |
q10893 | route6.clear | train | public static base_response clear(nitro_service client, route6 resource) throws Exception {
route6 clearresource = new route6();
clearresource.routetype = resource.routetype;
return clearresource.perform_operation(client,"clear");
} | java | {
"resource": ""
} |
q10894 | route6.clear | train | public static base_responses clear(nitro_service client, route6 resources[]) throws Exception {
base_responses result = null;
if (resources != null && resources.length > 0) {
route6 clearresources[] = new route6[resources.length];
for (int i=0;i<resources.length;i++){
clearresources[i] = new route6();
... | java | {
"resource": ""
} |
q10895 | route6.delete | train | public static base_response delete(nitro_service client, String network) throws Exception {
route6 deleteresource = new route6();
deleteresource.network = network;
return deleteresource.delete_resource(client);
} | java | {
"resource": ""
} |
q10896 | route6.delete | train | public static base_response delete(nitro_service client, route6 resource) throws Exception {
route6 deleteresource = new route6();
deleteresource.network = resource.network;
deleteresource.gateway = resource.gateway;
deleteresource.vlan = resource.vlan;
deleteresource.td = resource.td;
return deleteresource... | java | {
"resource": ""
} |
q10897 | route6.delete | train | public static base_responses delete(nitro_service client, String network[]) throws Exception {
base_responses result = null;
if (network != null && network.length > 0) {
route6 deleteresources[] = new route6[network.length];
for (int i=0;i<network.length;i++){
deleteresources[i] = new route6();
delete... | java | {
"resource": ""
} |
q10898 | route6.delete | train | public static base_responses delete(nitro_service client, route6 resources[]) throws Exception {
base_responses result = null;
if (resources != null && resources.length > 0) {
route6 deleteresources[] = new route6[resources.length];
for (int i=0;i<resources.length;i++){
deleteresources[i] = new route6();
... | java | {
"resource": ""
} |
q10899 | route6.update | train | public static base_response update(nitro_service client, route6 resource) throws Exception {
route6 updateresource = new route6();
updateresource.network = resource.network;
updateresource.gateway = resource.gateway;
updateresource.vlan = resource.vlan;
updateresource.weight = resource.weight;
updateresourc... | java | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.