what is the best graphics libraries for flooring visualizer

I am struck in implementing flooring visualizer.The goal is to draw a flooring view in the uploaded image of some selected region of user.

I have heard that it can be done in three.js but i have no idea how to do it.

I hope you guide me which one is the best graphic library for implementing such requirements.If any example meets the requirements.please share!

Thanks.

Lucene: How to index multiple words as one term?

I’m creating documents that have multiple words in specific fields.

    FieldType type=new FieldType();
    type.setStoreTermVectors(true);
    type.setStored(true);
    type.setTokenized(false);
    type.setIndexOptions(IndexOptions.DOCS_AND_FREQS_AND_POSITIONS_AND_OFFSETS);
    return new Field(fieldName,value,type);

Above code section shows how I created fields for indexing. I have a field is called “ingredient”. When search the documents that have the value “domates salçası” for ingredient field, I get the documents which have “domates” value in the ingredient field. Similarly searching for “domates” brings to results that includes “domates salçası”.
Is there any way to index multiple words as one term? Because I wanted to search multiple words to check is there any term that are matching it.
I know phraseQuery can done the job. But it makes complicated to create dynamic queries. I want to store fields in the index. Keyword field type is an option for that. But I’m not sure to use it to. Any suggestion to index multiple words as one term?

How to display only assets including a certain word or phrase – Android

So, I have an educational section in my app called ListHCPLessonsActivity now I want to display .PDFs and .Mp4s from my assets folder in android studio that contain the word HCP. In my Lessons class I created this doctor_file boolean and I want to reference it when I am displaying the assets but I don’t know how to reference it:

Lesson:

public class Lesson implements Serializable {
private int id;
private String name="";
private String type="";
private String path="";
private Watch watch;
private boolean doctor_file;



public Lesson(int id,String name,String doctor_file, String type, String path) {
    this.id=id;
    this.name=name;
    this.type=type;
    this.path=path;
    this.doctor_file = doctor_file.equals("hcp");

}


public Lesson() {
}


public Integer getId() {
    return id;
}
public String getName() {
    return name;
}
public String getType() {
    return type;
}
public String getPath() {
    return path;
}
public Watch getWatch() {
    return watch;
}
public boolean getDoctor_file(){ return doctor_file; }


//----------------------------------------------
public void setId(Integer id ) {
    this.id=id;
}
public void setName(String name) {
    this.name=name;
}
public void setType(String type) {
    this.type=type;
}
public void setPath(String path) {
    this.path=path;
}
public void setWatch(Watch watch) {
    this.watch=watch;
}
public void setDoctor_file(boolean doctor_file) { this.doctor_file=doctor_file; }

}

The activity I want to reference it in is ListHCPLessonsActivity I copied this code from my another lessons activity which is for another group which will also use the assets folder but will have no filter like what I am trying to achieve with this one. I can’t pin point myself at what what point exactly it goes to the assets folder and shows it in my Activity.

ListHCPLessonsActivity:

public class HCPLessonAdapter extends ArrayAdapter<Lesson> {

private List<Watch> watchs;


public HCPLessonAdapter(Context context, List<Lesson> lessons, List<Watch> watchs) {
    super(context, 0, lessons);
    this.watchs=watchs;
}


@NonNull
@Override
public View getView(int position, View convertView, @NonNull ViewGroup parent) {

    if (convertView == null) {
        convertView = LayoutInflater.from(getContext()).inflate(R.layout.row_lesson_for_list_lesson, parent, false);
    }
    HCPLessonAdapter.LessonViewHolder viewHolder = (HCPLessonAdapter.LessonViewHolder) convertView.getTag();
    if (viewHolder == null) {
        viewHolder = new HCPLessonAdapter.LessonViewHolder();
        viewHolder.text = (TextView) convertView.findViewById(R.id.Row_lesson_for_lesson_text);
        viewHolder.img_mp4 = (ImageView) convertView.findViewById(R.id.Row_lesson_for_list_lesson_img_mp4);
        viewHolder.img_pdf = (ImageView) convertView.findViewById(R.id.Row_lesson_for_list_lesson_img_pdf);
        viewHolder.circle_bg = (RelativeLayout) convertView.findViewById(R.id.Row_lesson_for_list_lesson_circle_bg);
        convertView.setTag(viewHolder);
    }

    Lesson lesson = getItem(position);
    if (lesson != null) {
        viewHolder.text.setText(lesson.getName());
    }
    else{
        viewHolder.text.setText(R.string.error_unknown);
    }
    lesson.setWatch(null);
    if(watchs!=null){
        for(Watch watch: watchs){
            if(watch.getLesson_id()==lesson.getId()){

                lesson.setWatch(watch);
                viewHolder.img_mp4.setBackground(getContext().getResources().getDrawable(R.drawable.circle_green));
                viewHolder.img_pdf.setBackground(getContext().getResources().getDrawable(R.drawable.circle_green));
                break;
            }
        }
    }
    if(lesson.getType().equals("pdf")){
        viewHolder.img_mp4.setVisibility(View.GONE);
    }
    else {
        viewHolder.img_pdf.setVisibility(View.GONE);
    }

    return convertView;
}

private class LessonViewHolder{
    public TextView text;
    public ImageView img_pdf;
    public ImageView img_mp4;
    public RelativeLayout circle_bg;
}
}

I really hope I have made myself easy to understand. I also hope someone knows how I can do this as simply as possible and if there is another class or adapter I should be looking please let me know. Need any more info? just drop a comment.

Get SharedPreferences value

I’m trying to get the value of my switch1 which I’m setting with:

switch1.setOnClickListener(new View.OnClickListener() {
  @Override
  public void onClick(View view) {
    if (switch1.isChecked()) {
      SharedPreferences settings = getSharedPreferences("preferences", 0);
      SharedPreferences.Editor editor = settings.edit();
      editor.putString("reminder", "0");
      editor.commit();
    } else {
      SharedPreferences settings = getSharedPreferences("preferences", 0);
      SharedPreferences.Editor editor = settings.edit();
      editor.putString("reminder", "1");
      editor.commit();
    }

  }
});

And to get the value:

SharedPreferences settings = getSharedPreferences("preferences", 0);
String silent = settings.getString("reminder", "1");

But what do I have to put in if? Something like…

if (Objects.equals(settings, "1")) {
  switch1.setChecked(true);
} else {
  switch1.setChecked(false);
}

Artifactory, Maven and SHA256

I want to use Artifactory to store the generated java artifacts for a project build using Apache Maven.

Sadly, by default Apache Maven does not generate other checksum than SHA1 and MD5, while on the other hand I need to use SHA256 and I cannot afford manually generating the checksum or query an API call for each artifact I submit to the repository.

I have read here that it is somewhat “automated” from Artifactory version 5.5, however (I have currently 5.5.1) I cannot see the SHA256 for any artifact unless I manually tell the server to generate it.

I’ve spent some time playing around with the Artifactory server yet I cannot find a way to do this.

What am I missing here? How can I automate this procedure? I would really love avoiding “re-inventing the wheel” for this.

New Spring Starter project is not working with maven

I am using eclipse luna and installed spring tool suite 3.7.3 release through eclipse market place. When i am creating a new spring starter project with maven the following error is coming and i am unable to proceed forward.

Error: ‘Import getting started content’ has encountered a problem.
NoClassDefFoundError: org/apache/maven/model/Model

Please help me in resolving this error.

Java hexBinary needs to be even-length

Basically the file contains 16 bytes of text but when its more than 16 bytes it throws out the error:
hexBinary needs to be even-length.

Error at: byte[] result = cipher.doFinal(DatatypeConverter.parseHexBinary(content));

Do i need to use other cipher methods or padding?

public static void main(String[] args) throws Exception {
convertToHex(System.out, new File("E:\TESTS\kristersss.txt"));
//write the output into a file
convertToHex(new PrintStream("E:\TESTS\kristersssHex.txt"), new File("E:\TESTS\kristersss.txt"));

System.out.println( "  " ); 
System.out.println( "128-bit hex key example: ffffffffffffffffffffffffffffffff" );
String content = new Scanner(new File("E:\TESTS\kristersssHex.txt")).useDelimiter("\Z").next();
System.out.println("----------FAILA SATURS----------");


System.out.println(content);

        System.out.println("------------------------------");    
  Scanner scanner = new Scanner( System.in );

System.out.println( "Enter 128-bit hex key: " );
final String keyHex = scanner.nextLine();

final String plaintextHex = "aaaaaaaaaabbbbbbbbbbbccccccccccff";
SecretKey key = new SecretKeySpec(DatatypeConverter
    .parseHexBinary(keyHex), "AES");

Cipher cipher = Cipher.getInstance("AES/ECB/NoPadding");
cipher.init(Cipher.ENCRYPT_MODE, key);

byte[] result = cipher.doFinal(DatatypeConverter
    .parseHexBinary(content));

 String a = DatatypeConverter.printHexBinary(result);
 System.out.println("----------FAILA SATURA ENKRIPTACIJA----------");
System.out.println(DatatypeConverter.printHexBinary(result));
BufferedWriter output = null;
try {

    File file = new File("E:\TESTS\kristerssEncrypts.txt");
    output = new BufferedWriter(new FileWriter(file));
    output.write(a);
} catch ( IOException e ) {
    e.printStackTrace();
} finally {
  if ( output != null ) {
    output.close();
  }
}

Cipher cipherd = Cipher.getInstance("AES/ECB/NoPadding");
cipherd.init(Cipher.DECRYPT_MODE, key);

byte[] result2 = cipherd.doFinal(result);
System.out.println("----------FAILA SATURA DEKRIPTACIJA----------");
System.out.println(DatatypeConverter.printHexBinary(result2));
BufferedWriter outputt = null;
String aa = DatatypeConverter.printHexBinary(result2);
try {

    File file = new File("E:\TESTS\kristerssDekrypts.txt");
    outputt = new BufferedWriter(new FileWriter(file));
    outputt.write(aa);
} catch ( IOException e ) {
    e.printStackTrace();
} finally {
  if ( outputt != null ) {
    outputt.close();
  }
}

Representing objects with negative coordintaes in JavaFX

I have to represent Objects on the screen (let’s say circles). I already have a list of those, and their coordinates are also given.

The problem is that the given objects can also contain negative values of x and y. And as we know in JavaFX the coordinate system goes from the left upper corner starting with 0, and basically has only positive values.

Is there any way to somehow get to see the circles that are also on the negative side?

Can it be solved with scrolling?

How to query in mongodb for two level of dbref

I have three document TenentPool, Tenant and Product. Tenant is dbref in TenantPool and Product is dbref in Tenant. I need all TenantPool by ProductCode or ProductId. My documents are as below.How I can achieve this using spring data mongo repository?

public class ImsTenantPool  {
 .....
  @DBRef
  private List<Tenant> tenants;
.....
}

public class Tenant  {

 ......
  @DBRef
  private Product product;
...
}

public class Product  {

@Id
  private String Id;

  private String code;
....
}

form submission java in jsp normal page

i faced some question , for submitting java form.

here is my code:

<form method="POST" action="">
<div class="col-lg-4 pull-right">
            <div class="form-group">
                <label for="txtUserId">ID:</label>
                <input type="text" name="txtUserId" id="txtUserId" class="form-control input-lg" />
            </div>
            <div class="form-group">
                <label for="txtUserName">NAME:</label>
                <input type="text" name="txtUserName" id="txtUserName" class="form-control input-lg" />
            </div>
            <div class="form-group">
                <label for="txtUserLastName">LastName:</label>
                <input type="text" name="txtUserLastName" id="txtUserLastName" class="form-control input-lg" />
            </div>
        </div>
</form>

first question: can we handle post request at .jsp file? or we must get it from java class only?

second question: how can check which button is clicked?

like: if(isset($_POST['btnSAVE']) in php.

best regards.