- Strength to Increase Rep
- +0
- Strength to Decrease Rep
- -0
- Upvotes Received
- 18
- Posts with Upvotes
- 18
- Upvoting Members
- 15
- Downvotes Received
- 3
- Posts with Downvotes
- 3
- Downvoting Members
- 3
126 Posted Topics
Hey everyone, I have the following list in my code public class order { private float amount; public float getAmount() { return this.amount; } } and in main function I have the following list List<List<Order>> ordersList I want to iterate the list through Streams in java 8 in order to … | |
Re: I think there's a LocationManager class in android that can help you. | |
Re: 2. use a new Process to run the java jar bundle in C# and pass the text file path as a parameter. In java program, get the text file path from arguments passed to main | |
![]() | Re: make the radiobuttons fall under the same radiogroup by giving the same name e.g. <input name="gender" value="Male" type="radio"> <input name="gender" value="Female" type="radio"> Then in PHP code $gender=$_GET['gender'] ![]() |
Re: Try this http://www.appyet.com/ | |
Re: - make a webservice using php/jsp/asp which links to the database - call the webservice from the android app for CRUD database operations - display the data from the database on your php page | |
Re: i think it is a database problem..i hope the following table will handle the problem you're facing 'msg_table' msg_id msg from to seen msg_sent_time msg_recv_time when X sends msg to Y msg_id msg sender receiver seen msg_sent_time msg_recv_time 1 hi Y X Y N 3.00 PM null when X logs … | |
Re: public class Bird { .... .... /*static method*/ public static void eat() { } /*instance method*/ public void fly() { } } so inside your main Bird myBird=new Bird(); /* call instance method */ myBird.fly(); /*call static method*/ Bird.eat(); see how instance methods need an object to be called?? and … | |
Re: If you are trying to connect to a real server..you need to configure the server allowing remote database connections..like adding your IP address on the remote connection list | |
Re: you can use jsp, asp, php etc. to build the website and also create web services to feed data to the mobile application | |
Re: seems like your table is empty try inserting some data into it | |
Re: while ( kb.hasNext() ) { s = kb.nextLine(); /* end the loop if EOF */ if(s==null || s.equals("")) break; /* check if the input is valid or not */ int newNum=numValid(s); if(newNum<0) { System.out.println("The number \"-1\" is invalid.") } else { /* if the number is valid, add it to … | |
Re: for(int r=0;r<numRows;r++) for(int c=0;c<numCols;c++) mat3[r][c]= mat1[r][c]* mat2[r][c]; | |
Re: try { /* get text from textfield and convert it to integer */ //Integer.parseInt(txtbox.getText()) } catch(NumberFormatException e) { //show error message } | |
I need to create stateful web pages consisting of various forms to be filled up by the user. I want to make UI tools look something like that DOJO framework provides. My problem is what tool is better suited for this type of website?? DOJO+JSP ? (but i'm confused about … | |
Re: use can store your items like this where integer stores the row/position number : Row1 [HashMap<Integer,Image>,HashMap<Integer,Image>,HashMap<Integer,Image>] Row2 [HashMap<Integer,Image>,HashMap<Integer,Image>,HashMap<Integer,Image>] Row3 [HashMap<Integer,Image>,HashMap<Integer,Image>,HashMap<Integer,Image>] | |
| |
Re: i think you need to type "hello" as the secret word..and debug | |
Re: suppose the data struture is like this public class Node { public int data; public Node left; public Node right; } int searchData = 569; Node node = rootNode; //point to the root node of the binary tree then the loop would look something like this: while(node.left != null && … | |
Re: URL url=new URL("(http://mysite.com/adduser.php?username=alice&password=bob"); HttpUrlConnection con=(HttpUrlConnection)url.getConnection(); con.setRequestMethod("GET"); be sure to encode the url parameters using UrlEncoder.encode(..) | |
Re: shouldn't it be `$('#poamt').val(bal1);` instead of ` $('#poamnt').val(bal1);` | |
Re: may be implement an interface in the controller and pass its instance to the Dao Object create an interface: public interface IMyInterface { public void rollback(Transaction transaction); } in the controller: public class MyController implements IMyInterface { .... .... public void someDatabaseLogic() { Dao dao=new Dao(this); } @Override public void … | |
could anyone tell me how to dynamically select an item in a listview?? i tried `listview.setSelection(1);` and `listview.performItemClick(listview,3,listview.getItemIdAtPosition(3));` both of them don't work..please help me. ![]() | |
Re: I hope this helps : <form> First Name: <input type = 'text' name = 'firstName'/></br> Last Name: <input type = 'text' name = 'lastName'/></br> Username <input type = 'text' name = 'userName'/></br> Password: <input type = 'password' name = 'password'/></br> <input type = 'submit' value = 'View' onClick='f();'/></br> </form> <script> … | |
Re: I hope this helps : <c:forEach items="${pal}" var="p"> <tr> <td><c:out value="${p.pid}"></c:out></td> <td><c:out value="${p.pname}"></c:out></td> <td><c:out value="${p.pdesc}"></c:out></td> <td><c:out value="${p.pestd}"></c:out></td> <td><a id="popa" href="#" onClick="myFunc(${p.pid})">Allocate</a></td> </tr> </c:forEach> <script> function myFunc(pId) { //do whatever you want to do with pid return false; } </script> | |
Re: create a background service which keeps checking if there is any new data from the php api..if there is new data, just invoke the android function | |
Re: you can redirect a page using window.location.href="http://www.google.com"; on what event do you want to redirect the page?? | |
could anyone please tell me what's the difference between getApplicationContext() and MyActivity.this.."MyActivity" being a class that extends Activity class..somethimes getApplicationContext() doesn't work and I need to use MyActivity.this when the constructur asks for a context... for example, if i use `ProgressDialog p=new ProgressDialog(getApplicationContext());` it gives an error however, if i … | |
I'm packaging my java program as a jar..it includes mysql-connector.jar..it runs fine when i run it in eclipse..now i need to distriute the jar file..I packaged the jar file and when I run it through command line using java -jar myprogram.jar, it throws ClassNotFoundException: com.mysql.jdbc.Driver could anyone please tell me … | |
i'm having a hard time handling multiple screen sizes (meaning supporting different devices with different screen sizes)..could anyone guide me into the right path?? | |
Re: if you're using an emulator...use 10.0.2.2 to connect to your localhost in your computer | |
Re: suppose the Collections.sort() function is comparing obj(i.e.Apple) and obj2(i.e. Orange)..in that case, name => Apple and o.name => Orange when you're using System.out.println(name +" "+o.name); that's why you are not getting the same output because, you're printing "name" of different objects. | |
Re: You haven't started a connection in your starting code.. -start a connection to the server(either HTTP or socket) -open the connection -send the message | |
Re: store all the details in a class implementing Serializable interface..then save it in the file system..when the program starts you can initialize the class directly from the file. | |
Re: if you are using a browser..just type http://localhost:11880/path and it will automatically make a GET request to http://localhost:11880 with /path as the requested document..GET simply means the browser is asking for the document specified by /path so, you need to read the document from the file system and send write … | |
Re: try this List<Object[]> list=(List<Object[]>)query.list(); In order to loop through the records in the list for(Object[] row:list) { Integer id=(Integer)row[0]; String name=(String)row[1]); } | |
i have a simple note and images storing java program that stores data into the server..i'm confused about what to use for building the server..should the server be built using sockets?? or which listens for http requests (the client sends json data)?? could anyone please tell me which one would … | |
i want to develop a simple download manager..i have seen download managers downloading a file..but they have multiple download points e.g. suppose i have a file like this on a web server ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| download points : 1 2 3 4 5 they are downloading from all the points 1,2,3,4,5 simultaneously..i'm … | |
Re: use gregorian calendar to handle date specific functions Calendar cal=new GregorianCalendar(); cal.setTimeInMillis(timeInMillis); //set the long integer that denotes milliseconds since 1/1/1970 int dayOfWeek=cal.get(Calendar.DAY_OF_WEEK); //dayOfWeek can be Calendar.SUNDAY,Calendar.MONDAY,Calendar.TUESDAY,etc. you can get timeInMillis by creating a date object using SimpleDateFormat Date requiredDate=new SimpleDateFormat("yyyy/MM/dd").parse("2010/12/05"); timeInMillis=requiredDate.getTime(); | |
Re: could you post the table too? | |
Re: use System.getProperty("user.home") to get the home directory of the user..works on both windows and linux E.g. String uploadPath=System.getProperty("user.home")+File.separatorChar+"your-directory-name"; | |
Re: <input type="radio" name="fromAccountId" value="${ad.accountId}" <c:if test="${shouldBeChecked==true}"><%= "checked" %></c:if> /> where "shouldBeChecked" is the attribute that you send from the controller to the view | |
Re: public Card[] getAllCards() { Card[] arr=new Card[allCards.length()]; int i=0; for(Card c:col) { arr[i++]=c; } return arr; } | |
Re: select the table..and click on the Properties Editor tab, there you should be able to specify the border's thickness | |
hey how can I handle no-mapping found exception in spring dispatcher?? so that, if no-mapping to a controller is found in the dispatcher, I would like to redirect the user to a separate Resource not found page Suppose I have only 2 pages in my web application, "/about", "/help" and … | |
Re: could you post that part of your code?? | |
hi everyone. i've used the following way to store the uploaded files into D: drive of my windows machine from Tomcat server and it works pretty goood. private final String directoryPath="D:\\uploadedFiles\\"; File f=new File("D:\\uploadedFiles\\"+fileName); InputStream in=file.getInputStream(); OutputStream out=new FileOutputStream(directoryPath+fileName); byte[] buff=new byte[4096]; int count=0; while((count=in.read(buff))!=-1) { out.write(buff, 0, count); } … | |
The End.