637 Topics
| |
assuming everything else works...i'm having trouble with the output...the if else statements are driving me crazy. it is outputting the date twice when i enter 7/3/12 code displays todays date....displays "payday" entered......adds 7 days to "payday" to show NEXT payday. void Date::addDays(int month, int day, int year) { _day = … | |
Hi, I want to get last working day data from database(SQL database). For example, if today is Tuesday, I want to get Monday data. I can get the data directly using strtTime = Date.Now.AddDays(-1).ToString("yyyy/MM/dd") & " " & "06:15:00" But the problem is if today day is Monday. Since the … | |
I was looking at some sample code [here](http://www.kernel.org/doc/man-pages/online/pages/man2/mmap.2.html) and it had this for error handling: #define handle_error(msg) \ do { perror(msg); exit(EXIT_FAILURE); } while (0) If I remember correctly do {} while (0) would execute only once, so what is the point of this? | |
I'd like to search this before asking a question but I'm not sure exactly what to search for. Posting for help is always a last resort for me. What I'd like to find is I think it's called a loop? or foreach? I think.. What I want to do is … | |
Hello, I was working on some code, when I ran into this: foreach ($products as $product). One problem, it was not defined. How could this be? Here is the book I got it from: http://english-common.googlecode.com/svn-history/r100/trunk/huyliem/01-Murach.PHP.MySQL/Murach.PHP.and.MySQL.Nov.2010.pdf . It is on 161-163. I don't understand where the $product came from. And one … | |
I am trying to input an int into the end of a singly linked list. I have already created the code to put a number at the end of the list but when I go to print it out, it only prints out (in my test class) the int that … | |
My assignment is to randomly generate a password based on the selection chosen by the user. So far, my code is unfinished but that's because I've run into a problem. For the second selection(Lowercase and uppercase letters). My password will display lowercase and uppercase letters but it won't be enough … | |
I need a program that will ask 16 true or false questions. The game needs to keep going until the user either answers 8 questions correctly or 8 inncorectly. A message should inform the user wether they won or lost and ask if they would like to play again, at … | |
Hi there i am trying to write a java code that will essentially be like a gps but a lot simplier and i need to make a mini map about 4 by 3. where Dunada and Government is the first intersection and i have already done so by using multiple … | |
// #include <iostream> #include <iomanip> using namespace std; int main() { float assign1, assign2, assign3, assign4, examScore; float assignWeight; cout << " Welcome to UOW Score System" << endl; cout << " " << endl; cout << "Enter the scores for Assignment 1 / 2 / 3 / 4" << … | |
horizontal scroll from while loop Hmmmm, I accidently posted this in the wrong forum. Is there a way to move it? Hey, ive been trying for several hours now to get the list horizontal with scroll instead of vertical. the divs stacks up to the right but wraps at the … | |
Hey all. All I need is to collect every `id` from `servers` where `active ='1'` and then cycle the results in a loop right until the end for each individual id. (I've written this on daniweb, might be typo's or errors. I'm not interested in code errors it's the process … | |
For an array of n int variables, When does binary search perform better than ternary search?? Also, reverse case, ie when does ternary search perform better than binary search? Why is binary search a more preferred method of searching for integers entered in an array?? | |
I have an assignment where I have to produce a rectangle or square based off of input values. For example; the user inputs height = 3 and width = 3 *** *** *** But I also need to make a hollowed out box, so it's like this height = 4 … | |
Hi guys, I'm working on a little script that generates all combinations of a given input string. My problem is, it's generating the combinations perfectly fine (I checked with an echo), but not inserting them in to an array. Here is my code: function check($width, $position, $base_string, $charSet) { $combinations … | |
public void inOrderTraversal(TreeNode node) { if(node == null) { return; } inOrderTraversal(node.getLeft()); System.out.print(node.getKey() + " "); inOrderTraversal(node.getRight()); } I wrote this code for going through a binary search tree and printing out the items in order from low to high. it works just fine but i need to get it … | |
Hello. I am having a tough time understanding the concept of double linked list. For now, i understand double linked list has 2 links, one forward and another one previous. data is in the middle. when inserting must check where to insert. if previous is equal to null, then can … | |
if($username&&$password) { $connect = mysql_connect("localhost","root","") or ("Couldn't connect!"); mysql_select_db("phplogin") or die ("Couldn't find db"); $query = mysql_query("Select * FROM users WHERE username='$username'"); $numrow= mysql_num_rows($query); i just wont to know the IF statement when it stars what is his function in the code. | |
Dear all, I have stuck with one problem. I have taken one Hashmap, Performing some input operation,remove operation on it. So after performing remove operation, i want value of 2 successive key in two different array. Also i want to match 1st key's value with all other keys' value. Like … | |
hi, i'm working with php short hand for the first time and i'm trying to edit this code: <?=($c->is_admin == 'Yes')?'<a href="msg_update.php" input type="submit" class="button" value="protected page">Update Home Page Message</a>' : ' <p> This is not the page you were looking for. </p> ' ?> i want to do something … | |
I am working on a open source script at the moment, but I am struggling on one final aspect of the script. I am a bit of a newb to PHP at this level, I have a working knowledge of PHP and MySQL, but this seems to be a little … | |
i have some code i am working on andit keeps throwing an expression expected error. this code is designed to cheeck a RichTextBox form and highlight text, specified by a dictionary. Dim location As UInteger = 0 Dim dict As Dictionary(Of String, ULong) = getWords(rText1) Dim wcount As Integer = … | |
Hi Everyone. It's been a while since I was on here last, but ran into an interesting problem with a nested for loop that I cannot solve. Hoping someone here will know the answer. I placed breakpoints in my code at the For x=1 to 10 line and after to … | |
Hi Everyone! I'm a user of Turbo C++ and my professor gave me an activity to make a Fibonacci sequence. No I already have the Code for it and it is working. The only problem is. I don't know how the FOrmula Works. I will show you the Code below: … | |
I am trying to make a program that generates a random number and asks the user to input the random number generated by the computer. Anyone know how to do this? This is my program: #include <iostream> #include <cstdlib> #include <ctime> using namespace std; int main() { int one; time_t … | |
Hi, everyone! This is my first post ever here in Daniweb. I experienced a problem in printing the sorted array of 5 numbers, as the following code only prints the first iteration of the loop, and it does not print the array input. Here's the code: section .data i db … | |
I am having trouble with this code block: if($row['banned'] == 1) { header( 'Location: http://www.awsomechat.comuv.com/ban/userbanned.php' ); } elseif ($row['banned'] == 2){ header( 'Location: http://www.awsomechat.comuv.com/ban/userbanned.php' ); } Ive also tried this: if($row['banned'] == 1 or $row['banned']== 2) { header( 'Location: http://www.awsomechat.comuv.com/ban/userbanned.php' ); } But none of this works... I am trying … | |
I am pretty new to programming in VB.Net, but I have been programming in other languages for a couple of decades now, including VB5/6 and C++. When I am using a **Try** - **Catch** block to handle exceptions, what is the point of a **Finally** section? Wouldn't it be just … | |
Can anybody share the algorythm to perform inorder traversal of a binary search tree using parent node(without stack or recursion) | |
Hello, i wanted to know what you guys use with PDO. Do you use ->fetchAll() or ->fetch() + while based on some reading i have done, it seems that PDO->fetchAll() is faster but uses more momory... |
The End.