Saw this from a web search I did months ago so I'm not exactly sure if it's efficient so I'd like remarks from other members about it
int c;
while ((c = getchar()) != '\n' && c != EOF); //discards the \n stuck in the input stream?
Saw this from a web search I did months ago so I'm not exactly sure if it's efficient so I'd like remarks from other members about it
int c;
while ((c = getchar()) != '\n' && c != EOF); //discards the \n stuck in the input stream?
you can access the array by either using a constructor or a method that contains the puzzle[row][col] at its class
Could you be more clear with that...
As I understand you need to show a multiplication table based on the input right?
then use a loop and a counter to multiply with the input
at line 39 use .equals() in comparing strings like so
if( accountName.equals("keenan") )
1. How important do you consider computer security?
Quite a high priority based from experience and news
2. Do you use Anti‐virus/Anti‐spyware software? yes
i. When was the last time you updated this software?
it automatically updates whenever an update is available
ii. When was the last time you complete a full scan of your system?
Last week, I do it monthly
3. which operating system do you consider most secure?
I'd say windows because of the frequent updates
4. Do you use names, dates, or cities as your password?
not really
5. have you been a victim of identity theft? if not do you take extra precautions so you do not?
no, i'm always careful whenever I use my accounts in public
If you want to have multiple Jpanels and use a Button to show one at a time
the I think you should use CardLayout
If anyone has a more efficent idea to compare 25 variables than the use of many if statments feel free to post it
Could you post the part of the program where you use those 25 variables so we can have a better idea on how to the program works
anyway I think you should use a 2d array to store those variables then use a loop to compare each element instead of many if statement
up to what topic have you learned so far?
Here's a link on a thread describing the concepts about 2d and 3d arrays
http://www.daniweb.com/software-development/cpp/threads/104403
The end should justify the means
import java.io.IOException; import java.io.PrintWriter; import java.sql.Connection; import java.sql.DriverManager; import java.sql.Statement; import javax.servlet.ServletConfig; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; /** * Servlet implementation class NewUser */ @WebServlet("/NewUser") public class NewUser extends HttpServlet { private static final long serialVersionUID = 1L; /** * @see HttpServlet#HttpServlet() */ public NewUser() { super(); // TODO Auto-generated constructor stub } /** * @see Servlet#init(ServletConfig) */ public void init(ServletConfig config) throws ServletException { // TODO Auto-generated method stub } /** * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response) */ protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // TODO Auto-generated method stub } /** * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response) */ protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String s = null;// TODO Auto-generated method stub response.setContentType("text/html"); PrintWriter p=response.getWriter(); String str_username = request.getParameter("username"); String str_password = request.getParameter("password"); String str_confirmpassword = request.getParameter("confirmpassword"); String str_male = request.getParameter("male"); String str_female = request.getParameter("female"); String str_email = request.getParameter("email"); String str_phoneno = request.getParameter("phoneno"); if(s.equals("submit")) { try{ Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con = DriverManager.getConnection("jdbc:odbc:real"); Statement st = con.createStatement(); int i= st.executeUpdate("insert into register values('"+str_username+"','"+str_password+"','"+str_confirmpassword+"','"+ str_male+"','"+str_female+"','"+ str_female+"','"+ str_email+"',"+ str_phoneno+""); System.out.println(str_username +"is now registered."); System.out.println("<p align=\"center\"><a href=\"login.htm\">sign in</a></p>"); }catch(Exception ee){System.out.println("2nd"+ee);} } }}
Start your own thread if you want help with that then add more details on what you need with
for (int number, numbers) {
this is not how you should make a for loop, your missing the increment and a proper condition
it should have a format like so,
for (initialization; termination/condition; increment)
try the suggestions qiven in the link
http://stackoverflow.com/questions/2041871/video-playback-in-java-jmf-fobs4jmf-xuggler-fmj
maybe it's Xuggler that'll do what you need
@MrNo - What the h... dude? Walt is actually giving you assistance with your code, NOT writing it for you, and encouraging you to develop your understanding and knowledge your damn self
Stop being a complete ass and learn a thing or 2, your comment you state you've only been learning this on the side for a while? so LEARN!!! dont mope and insult people encouraging that...
This forum is actually a set of decent people helping each other and you attitude is simply going to make LOADS of people ignore you and not offer any assistance any more...
Although the thread is posted pretty recently(just November last year and his last activity being december 2nd) I don't think MrNo will give a proper explanation less likely a proper reply, I think this thread should be left alone now or maybe closed... just saying
set this at the topmost
package bus;
the package is different than the public class, it doesn't affect the class name only the access to it
check these links for more info
http://docs.oracle.com/javase/tutorial/java/javaOO/accesscontrol.html
http://stackoverflow.com/questions/215497/in-java-whats-the-difference-between-public-default-protected-and-private
PS. if the problem is solved then you can mark this thread as solved, have a nice day :)
1.
int x = findFirstEmpty();
remove this you don't need to find an empty seat
2. use a loop to check the content of the array
3. use public void cause there's no need to return anything
But what do I return?
I think it's better if you use public void so there won't be a need for a return statement cause all you need is to change the value
as for checking if the name is equal, loop through the array then
if (name.equals(names[x]))
delete the contents of that array index
Did you try to search through Google before asking that question?
Oh! That made it work a lot better. My notes from class said I had to do that every time. So, when I was trying that, was it just emptying the array over and over again instead of filling it?
It will not overwrite the contents if you use a new variable other than n1, though I think you don't need to in this case
I know there is something wrong with my getOff method.
instead of trying to find an empty seat like,
int x = findFirstEmpty();
I think you just need to find the array index with the name you need to remove,
As for the swap you need to use the array and swap the values in them
If it's 2d platform games then I suggest java or c++
here's a tutorial for a mario like game made in java where you can download the source code at the bottom
http://javacooperation.gmxhome.de/PlatformGameBasicsEng.html
note: though as of now it uses some deprecated methods but it should still work
SchoolBus n1 = new SchoolBus();
Instantiate only once, like only at line 144 and removes other initializations like
n1 = new SchoolBus();
you need not to create a new object everytime and overwrite the contents
Hi,all!
i want to know which programming language, I should use for game developement.
You should start by informing us what programming languages you know and what kind of game do you want to develop before we can give our opinions
Checking the forums through the menu and seeing each thread seems easy to do for me,its not exactly time consuming...
I think the "forum index link" isn't such a but idea but after reading deceptikon's post it seems it would be a lot of work for Dani to make it possible
though Dani is currently working on Daniweb's new version so I think it's better if we hear it from her of what she thinks about this
could you explain what your program is supposed to do? some comments on particular lines would be nice
...just a note, always have a return 0; statement at the end of int main to properly stop the execution, it might work without it on linux but the code should be able to be compatible on all compilers
That can be done with just a few clicks... probably less than 5 or 10 minutes
why make it hard for Dani
is there a place for forum games?
Community center->Geeks' lounge->Posting Games
oh and where is the edit button
The edit button appears right beside your every post between the flag bad post and post reply button but you can only edit your post for at most 30 minutes then it dissapears
and what do each those println show?
Edit: Anyway I think JamesCherrill's reply might suit best for your needs, you should have said that you were reading a file in the first post so I could have posted a more concise reply :)
like what I said my last post
Then could you post your code so we may see how you did it
we'll find out whats wrong if you post your code
| and : have it's own special character like endline
not really I was able to pull it off without a special character
Then could you post your code so we may see how you did it
Is it even possible to have a recursive function without a return statement? :-/
"Twenty years from now you will be more disappointed by the things that you didn't do than by the ones you did do. So throw off the bowlines. Sail away from the safe harbour. Catch the trade winds in your sails. Explore. Dream. Discover " -Mark Twain
...the minecraft ending quote
Wrap your code around code tags it will make your code a lot easier to read
Now for the garbage value try to print the string at all parts of the program(before and after initializaations and assigning values to it ) to see where it gets its garbage values
what do you mean by
desplay record is in row i want it in column.
display the output vertically?
you need to be more elaborate about this
What you think this is a Unix/Linux based system?
my bad... is it windows.h then?
^what masijade said several years ago :icon_rolleyes:
print the value of r[j] in the loop and you'll see that all its element's value is 0
if DotComBust class is an object then it has its own state and behavior
maybe these Oracle docs will help you clarify some things
http://docs.oracle.com/javase/tutorial/java/concepts/object.html
http://docs.oracle.com/javase/tutorial/java/concepts/class.html
try to include the header unistd.h
Damn! You saw right through my attempt to appear poly-lingual. I've been snowed in for a week, bored, bored, bored, and desperate for entertainment. Embarrassing or what?
Can't you have a bit of fun in the snow?
or does saying that make me sound childish :D
besides that I woudn't recommend doing another non english post,last year 1 replied to me in the same way and an admin deleted his post and downvoted him saying english only
@OP don't mind us just continue with trying to get the correct values for the shapes you'll get it eventually
Its a feeble attempt at a joke for zeroliken - the snow over Europe has me stuck indoors with nothing better to do. Just ignore it. J
Let me guess,there's a certain translator that helped you ;)
@OP it's gonna be trial and error if you have no idea about the exact coordinates you need for the certain triangles
If you can draw a right triangle then I think you'd be fine in doing the isosceles or equilateral triangle by just tinkering with the line position and their sizes until you get the desired looks
Then it must be my computer? :[
Did you solve it?
in case not yet, try using using cout statements for all the variables at all parts of the code to know where the problem is by knowing which of these variables is giving garbage value.
try it before and after the initializations and at the end of the functions
use "wb" and "rb" for writing and reading in data files
hmm..I tried running the program and I was able to successfully get the sum and average? did you compile and saved the changed code?
Thank you!
I am having trouble with:
int nn = begin; while(nn < end) { nn++; sum += nn; avg = sum/nn; }
is there something I am missing or have incorrect?
could you explain the "trouble" with it
...if it's the average put avg = sum/nn; after the loop
you forgot the
and use nn in the loop condition instead
while(nn < end)
int nn = begin;
put this outside the loop and use nn in the loop condition instead
will only run if I enter the biggest number first, & it's suppose to be smallest first.
which variable are you talking about?
plus could you explain your operation