Hi, I have the program, which is a traffic simulation, and I have a few linked lists in it. I'd like to ask you what is the easiest way to check if I don't have duplicats in them? The code which runs it looks like that: public static void main(String[] args) { Simulation s = new Simulation(); s.addRoad(Road.Orientation.HORIZONTAL, 50, 5,3); s.addRoad(Road.Orientation.HORIZONTAL, 500,1,4); s.addRoad(Road.Orientation.VERTICAL, 100,3,2); s.addRoad(Road.Orientation.VERTICAL, 600,2,3); s.addRoad(Direction.DOWN, 1,300, 2,3); s.addRoad(Direction.RIGHT, 3 ,340,1,2); s.addRoad(Direction.UP,0,500,2,1); s.addRoad(Direction.LEFT,2, 400,1,2); s.addIntersection(0,2); s.addIntersection(3,0); s.addIntersection(2,1); s.addIntersection(1,3); s.start(); } Simulation extenst Thread, so first I build road system, then add intersection (if there is a T shape intersection …

Member Avatar
+0 forum 0

my project is sort score of Student using Linked List and sort algorithm can i coding loop for input from user and save value to node in linked list and export or sort value like this ? Thanks for help or discuss or give any idea (any code is idea from this blog) warning before post prob from this web (Curly braces { } may only be used when posting code.) package javaapplication19; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import static javaapplication19.LinkedList.addNode; import static javaapplication19.LinkedList.printLinkedList; public class JavaApplication19 public static void main(String [] args) throws IOException { BufferedReader input = …

Member Avatar
+0 forum 0

hello guys I want to know about dependency injection in angular 4 and spring , so I gonna start with what I know : in angular 4 we inject the dependency by setting the service ( or something else ) in the constructor's arguments of component, and despite we inject many times from many components the same service, the value of the variable in this service stay the same (I mean the value still intact) for example : if we have service S with variable VARS, and tow component C1 and C2, and we inject the dependencie to S by …

Member Avatar
+0 forum 0

Hi everyone, I'd like to ask for help modeling my JPA entities and their relationships with each other. I use more abstract class names as class names in my project[](https://phonty.com/), so I'm going to translate that into a "more tangible" example. I start from a festival where several gigs take place. Of course, every performance is assigned to exactly one festival. In a performance several instruments are played, each instrument is unique and accurately assigned to a performance. An instrument is only played by a musician and a musician plays only one instrument. The classes have the following JPA annotations …

Member Avatar
+0 forum 0

#Tutorial - Content extraction using Apache Tika From the official website: > The Apache Tika™ toolkit detects and extracts metadata and text from over a thousand different file types (such as PPT, XLS, and PDF). All of these file types can be parsed through a single interface, making Tika useful for search engine indexing, content analysis, translation, and much more. In this tutorial we will try and implement the four most important features of Apache Tika (as of version 1.14). ##Table of contents 1. Is this tutorial for me? 1. Requirements 1. How can I detect a file's type? 1. …

Member Avatar
+0 forum 0

Part 2 to Salesperson Java Application, still new to this. class SalesPerson { /** * Fixed Salary */ final double fixedSalary = 35000; /** * Current Commission Rate */ public double curCommissionRate = 0.15; /** * Accrued Commission */ public double curCommission = 0; /** * Total Compensation */ public double totalCompensation = 0; /** * Annual Sales */ public double annualSales = 0; /** * Parameterized Constructor * * @param annualSales The Salesperson's annual sales. */ public SalesPerson(double pAnnualSales) { annualSales = pAnnualSales; //set object member curCommission = (annualSales * curCommissionRate); //calculate current commission totalCompensation = fixedSalary + curCommission; …

Member Avatar
+0 forum 0

Hi all i have couple jsp pages and java class as follows below.Can you help me with the session on the handleForm .jsp As this page supposed to show all info entered by the user in the form.I did manage to display session object in thanks,jsp But have now a problem in doing it in handleForm.jsp. #1User class /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package business; public class User { public String getName() { …

Member Avatar
+0 forum 0

Hi guys, Here is the question: I have Activity A, Activity B. Now, A --> B . Now, pressed the home button. Now, go to any image & "open with" will show my app. when pressing my app as the option, it will hit Activity A. When it will hit A, intent is handled in this activity. At this stage, A & B are already in the stack. I want to discard all the activities except A. I have done it by restarting the activity using CLEAR_TASK intent (basically a restarter). But problem comes when my app was not opened …

Member Avatar
+0 forum 0

i Am new to selenium webdriver and I want to automate a webpage related to my project. I am currently working on login page, however I facing problem with the login button which I am confused which locator to use. The login button is below: a href="javascript:LoginSubmit('Log In')"> img border="0" src="/opensso/login_images/button_enter.gif" alt="enter / entrez" Can you guys please help me out how to use the above with xPath or anything related to JavaScript? Sorry if I am missing anything, as I am very new to this.

Member Avatar
+0 forum 0

Hi, I have been working on JNI. I have one doubt. When I call any native method from android activity (Java code), then we get jclass object from jobject instance we get in the native method as a parameter. Why do we need it actually? Here is a snippet from one website: JNIEXPORT void JNICALL Java_TestJNIInstanceVariable_modifyInstanceVariable (JNIEnv *env, jobject thisObj) { // Get a reference to this object's class jclass thisClass = (*env)->GetObjectClass(env, thisObj); // int // Get the Field ID of the instance variables "number" jfieldID fidNumber = (*env)->GetFieldID(env, thisClass, "number", "I"); if (NULL == fidNumber) return; // Get …

Member Avatar
+0 forum 0

Anyone here know a good java library for XADES signing? Tried my luck with Xades4j, but that didn't go anywhere, couldn't find any API for that. Please provide code examples if you can.

Member Avatar
+0 forum 0

I'd like to start from the basics if I may please. I've read a few tutorial here and there and I've just created a test application with probably the simplest RPC calls you can possibly have (basically I want to use the RPC call to call a method to print a string). I'm using Eclipse and I've created a maven project, loosely based on this tutorial and the following ones but things are not working very well (forgive me but I'm new to vaadin and still learning java). This is the structure of my project, including packages (the structure is …

Member Avatar
+0 forum 0

How to handle org.springframework.web.multipart.MaxUploadSizeExceededException in spring 4 am uploading a file in java it will accept only 2omb but i have uploaded 30mb its giving org.springframework.web.multipart.MaxUploadSizeExceededException how to handle in spring 4 How to handle org.springframework.web.multipart.MaxUploadSizeExceededException in spring 4 am uploading a file in java it will accept only 2omb but i have uploaded 30mb its giving org.springframework.web.multipart.MaxUploadSizeExceededException how to handle in spring 4

Member Avatar
+0 forum 0

I'm working on an Anagram Finder program. One of the methods I'm writing introduces the concept of **recursive backtracking** which I'm completely new to. I'm hoping to get some suggestions of how this works/how to make it work. I'm trying to implement recursive backtracking in order to display a list of words from a dictionary text file to form anagrams for an input phrase. Here's what I have so far: public void printAnagrams(String phrase, int max, List<List<String>> anagrams) { if (anagrams == null) { throw new IllegalArgumentException(); } else if (max != 0) { System.out.println("..."); } else System.out.println("..."); for (List<String> …

Member Avatar
+0 forum 0

Hi team, In hibernate one to many relation ship am updating parent setting with child data when am doing session.update(parent) (parent have set with child data) then am committing the its throwing exception saying that Caused by: java.sql.SQLException: ORA-01407: cannot update ("TPIA"."TPIA_TRANSACTION_DATA"."TRX_ID") to NULL.so please help will get appriciate.

Member Avatar
+0 forum 0

you must to clear the history (inside the netbeans), and restart the project,

Member Avatar
+0 forum 0

Greetings everyone, I'm still new to android programming and currently leanrning how to connect to DB. I'm following a online tutorial but I'm still facing problems. The tutorial is about creat a registration form and sending it to the database through volley. I'm using .hostinger.ae as host and Android studio. Everything seems fine until I click the register button it give me an error of (Couldn't register ) I couldn't locate the error so please I would appreciate any help dbconnect.php <?php define('HOST','mysql.hostinger.ae'); define('USER','--'); define('PASS','--'); define('DB','u853541076_tuber'); echo "access done"; $con = mysqli_connect(HOST,USER,PASS,DB) or die('Unable to Connect'); and this is the …

Member Avatar
+0 forum 0

Hi guys! im working with google places and i'm currently able to show 20 markers on the map. I have a FloatingActionButton on my map screen and once the user presses/clicks on it it should display the markers based on the next_page_token. Currently ive hard coded one in for testing and it works but im confused on how to implement it so that when the user clicks on the button then it finds new ones each time. My Maps class: package com.example.test.outandabout; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.net.HttpURLConnection; import java.net.URL; import java.util.HashMap; import java.util.List; import org.json.JSONObject; …

Member Avatar
+0 forum 0

I encountered a problem when trying to use hibernate to save details onto my database. > > SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder". > > SLF4J: Defaulting to no-operation (NOP) logger implementation > > SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details. > > Exception in thread "main" org.hibernate.HibernateException: /hibernate.cfg.xml not found > > at org.hibernate.util.ConfigHelper.getResourceAsStream(ConfigHelper.java:170) > > at org.hibernate.cfg.Configuration.getConfigurationInputStream(Configuration.java:2176) > > at org.hibernate.cfg.Configuration.configure(Configuration.java:2157) > > at org.hibernate.cfg.Configuration.configure(Configuration.java:2137) > > at hybernate1.Test.main(Test.java:33) > > C:\Users\Bartosz\AppData\Local\NetBeans\Cache\8.1\executor-snippets\run.xml:53: Java returned: 1 Class containing main class: public static void main(String[] args){ Hybernate1 user = new Hybernate1(); user.setUserId(1); user.setUserName("Bartosz"); //save object in database using HIBERNATE API //1 …

Member Avatar
+0 forum 0

hi all this is not a question, this is a message, thank you dani for writing to me, i receive your mail today and it was a pleasure of you to take time out to write to me. and sorry for not being on the site. guess ah got caught up with other things in life can you say hi to james cherrile stultuske for me. let them i still think of them daily. I will be posting a question soon.

Member Avatar
+0 forum 0

I'm trying to figure out why my removeProduct method won't actually remove the product from the list please give me some feedback. InventoryApp.java class package JayJuan; import java.util.Scanner; import java.math.BigDecimal; import java.util.Scanner; /* Main class used to add a product, remove a product, update a product, or view the product list */ public class InventoryApp { public static void main(String[] args) { while(true) { System.out.println("Enter add to add a product"); System.out.println("Enter remove to remove a product"); System.out.println("Enter update to update a product"); System.out.println("Enter view to view a product"); System.out.println("Enter quit to quit the menu"); Scanner sc = new Scanner(System.in); String …

Member Avatar
+0 forum 0

Hi,i want to use this ClassParser to parse another file(class) in another package , in my code i used ClassParser to parse only existing file (class) in existing package ,,,how can i use it to parse any file and from any package ,if i can't use it ,is there any other way or parse to do this in java. This is the code that have parser that previously talking about it. package javaapplication12; public class CyclomaticComplexity { ClassParser parser=new ClassParser(CyclomaticComplexity.class.getResourceAsStream("/javaapplication12/CyclomaticComplexity.class"),"CyclomaticComplexity.class"); JavaClass javaClass=parser.parse();} Now,if i want to parse another file (ex. Class filename in package filename )how can do this? /filename/filename.class …

Member Avatar
+0 forum 0

Hi all, Thanks for viewing this thread. I would like to do a remote debugging of WAR file that contain one Java servlet. Anyone tried that before? I tried to use cmd with the following command: java -Xdebug -Xrunjdwp:transport=dt_socket,address=8001,server=y,suspend=y -classpath "TestingServlet.war" MyServletName Not sure if the command above is correct, please enlighten me if it is not correct. I executed the command and then went to eclipse and right click on the project then choose "Debug Configuration" --> "Add new Remote Java Application" --> "Host = localhost" --> "Port: 8001" Whenever I clicked on the Debug button, the command prompt …

Member Avatar
+0 forum 0

I'm really having a hard time understanding this stuff and all the examples I find online just aren't starting from a place that makes sense to me. I missed my lab last week and the prof suggested those of us who missed it should go through the lab anyway because this stuff is going to keep coming up. Unfortunately the answers to the lab haven't been posted so I can't even reverse back the answer. So here's a question from the lab that I'd really appreciate some help with. 3) Consider the the algorithm given below and determine its time …

Member Avatar
+0 forum 0

Hi, how can I get inherited classes in java api , after parsing class .. For example: Public class h extends C ..... and C extends B and B extends A.....andso on... How can I get these inheritance classes (A, B, C), I parsing class h using api parser: JavaClass javaclass and I put the path of class h? Now , how can I get the inherited classes from main class using this parser ......

Member Avatar
+0 forum 0

I have a jsp page in which I add users and display users from the database . so there are two servlets for this functions, how do I invoke both this sevlets(controller) at the same time ?

Member Avatar
+0 forum 0

Hello I have a rest web service which implement oauth2.0 . Now I have my web application with a login which currently using spring security. I want to use the same login to authenticate with the rest web service using oauth2. My question is: Does this tutorial is suitable for me? [Click Here](https://raymondhlee.wordpress.com/2014/12/21/implementing-oauth2-with-spring-security/) I just want to authenticate my login with the rest webservice. My web application is using hibernate/spring. Please advise. Thanks

Member Avatar
+0 forum 0

I am trying to build a web application that can also run on mobile phones. Is the html code generated by imgmap_desktop can be run on both web and mobile? or rather web responsive type?

Member Avatar
+0 forum 0

I had created my Qt C++ application and now I am thinking to provide it as a plugin or as library in Eclipse. I know there is CDT plugin, but I don't won't to write my code again. Is there any way to achieve this? Snippet for QPushbutton in qt I have like as follow:- LibTest::LibTest() { QPushButton pb; pb.setText("Hello World !"); QObject::connect(&pb,SIGNAL(clicked()),&pb,SLOT(called())); } void LibTest::called() { qDebug()<<"It was called."; } here called() is a slot function and clicked() is a signal. I want to integrate as plugin or perspective in eclipse? Is there is a way to use SWT …

Member Avatar
+0 forum 0

Hello all, I need help with creating grammer for Antlr that would find class, variables, methods and relationship like is-a and has-a that would be later used for generating UML class diagram. Thanks in advanced.

Member Avatar
+0 forum 0

The End.