小编Sri*_*Sri的帖子

在select2中使用AJAX进行标记

我正在用select2进行标记

我对select2有这些要求:

  1. 我需要使用select2 ajax搜索一些标签
  2. 另外我需要在select2中使用"tags",它允许不在列表中的值(Ajax结果).

这两个场景都是独立运作的 但加在一起的aJax值只是填充.如果我们输入不在列表中的任何其他值,则表示"找不到匹配项"

我的场景如果用户键入列表中没有的任何新值,请允许他们组成自己的标记.

有什么办法使这项工作?

javascript jquery jquery-select2

70
推荐指数
3
解决办法
4万
查看次数

在Mapreduce中设置job.setInputFormatClass时出错

我正在运行MapReduce程序.我需要以KEYVALUE对的格式给出输入文本文件.所以,如果我写

job.setInputFormatClass(KeyValueTextInputFormat.class);
Run Code Online (Sandbox Code Playgroud)

eclipse编译器显示错误,我无法使用InputFormat.无论如何我需要将Input的格式设置为KeyValueTextInputFormat我该怎么做?任何的想法 ?????

我的代码是

`

package com.iot.dictionary;

import java.io.IOException;

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapred.KeyValueTextInputFormat;
import org.apache.hadoop.mapreduce.Job;
import org.apache.hadoop.mapreduce.lib.input.FileInputFormat;
import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat;
import org.apache.hadoop.util.GenericOptionsParser;


import com.iot.dictionary.Dictionary.AllTranslationsReducer;
import com.iot.dictionary.Dictionary.WordMapper;
public class Driver2 {
public static void main(String[] args) throws IOException, ClassNotFoundException, InterruptedException {
    Configuration conf = new Configuration();

        String[] otherArgs = new GenericOptionsParser(conf, args).getRemainingArgs();
        if (otherArgs.length != 2) {
          System.err.println("Usage: wordcount <in> <out>");
          System.exit(2);
        }
        Job job = new Job(conf, "dictionary");
        System.out.println("Job-> "+job.toString());
        job.setJarByClass(Dictionary.class);
        job.setMapperClass(WordMapper.class);
        job.setReducerClass(AllTranslationsReducer.class);
        job.setOutputKeyClass(Text.class);
        job.setOutputValueClass(Text.class);
        job.setInputFormatClass(KeyValueTextInputFormat.class); …
Run Code Online (Sandbox Code Playgroud)

java hadoop mapreduce

5
推荐指数
1
解决办法
5079
查看次数

StringUtil indexOf() 等效的 postgreSQL 查询

我需要在 postgresql 中实现 stringUtils Class indexOf() 方法。

假设我有一个table其中url的列之一。

url : "http://paypal-info.com/home.webapps.cgi-bin-limit/webscr.cmd-login-submit"

我的要求是在上面的 url 中找到 '/' 的第 3 次出现的索引并做 substring 并且只取paypal-info.com 主机名Postgresql Query

任何关于实现这一点的想法将不胜感激。谢谢

java postgresql indexof string-utils

5
推荐指数
1
解决办法
6207
查看次数

按编号对列表排序

我的意见 -

List<String> parameterNames => [value0, type1, type0, name1, value1, name0]
Run Code Online (Sandbox Code Playgroud)

我使用Collections.Sort

Collections.sort(parameterNames)
Run Code Online (Sandbox Code Playgroud)

我得到这样的答案

[name0, name1, type0, type1, value0, value1]
Run Code Online (Sandbox Code Playgroud)

我想排序并获得这样的列表

[name0,type0,value0,name1,type1,value1]
Run Code Online (Sandbox Code Playgroud)

我能用Java做到这一点吗?

java sorting list

0
推荐指数
1
解决办法
125
查看次数