345 Posted Topics

Member Avatar for AssertNull

I've been debating where to put this. Maybe the Community Center. Feel free to move if necessary. I'm sticking it in Software Development because it has to deal with Software Development, but it's more of a general topic involving different levels of expertise and familiarity, what one's "lane" is, and …

Member Avatar for AssertNull
0
241
Member Avatar for Jovanie_1

http://www.cplusplus.com/reference/ctime/localtime/ The example above gives TODAY's date/time. To get yesterday's data, subtract the number of seconds in a day, as below. In addition, using the strftime function, you can isolate just the date. http://www.cplusplus.com/reference/ctime/strftime/ /* localtime example */ #include <stdio.h> /* puts, printf */ #include <time.h> /* time_t, struct tm, …

Member Avatar for deceptikon
0
4K
Member Avatar for Mr.M

> The Idea is that the file can be distributed with special CD/DVDs which we will recommend to our customers, and they can insert the removable media that contains the files to the media player, if the file is MP3 then they will just play it, but I don't want …

Member Avatar for AssertNull
0
972
Member Avatar for Suzie999

I have no C# or Visual Studio advice to offer. I'm a Code-Blocks C/C++ guy, so if you need something specific to C# or Visual Studio, stop reading here... ;) Disqualifiers aside, is this a continuation of your earlier threads sending class objects down a TCP stream socket? I'm unfamiliar …

Member Avatar for Suzie999
0
381
Member Avatar for AssertNull

I am a member of another forum and forgot my password, so I clicked the "Forgot password" link and was told "fill this form out and we'll send you your lost password" or words to that effect. It occurred to me that I had never seen language like this and …

Member Avatar for AssertNull
0
280
Member Avatar for Peter_36

> I love this topic. I love this topic too. What I DON'T understand is why `srand(time(NULL))` and `rand`, which is what we're all taught to use, are such lousy random number generators and you have to look elsewhere if you want decent random numbers. It's an interesting topic, but …

Member Avatar for AssertNull
0
264
Member Avatar for TĦɇ Ãðît

Regarding conio.h, getch, clrscr, not everyone has conio.h. You might try changing iostream.h to iostream. "void main" should probably be "int main" and your main function should return 0. Those "problems" might allow it to compile on your machine and not on others, but the actual errors are below. 1. …

Member Avatar for tinstaafl
0
304
Member Avatar for Wilda_1

Your method is inefficient. Suppose len1 equals 5 and len2 equals 15. I have an input file containing a million words and my goal is to create 10 files ("5-length-pass.txt", "6-length-pass.txt", ..., "14-length-pass.txt"). You are trying to read the in the entire input file 10 times. That's inefficient. How about, …

Member Avatar for AssertNull
0
364
Member Avatar for sumod

This is a variable scope error. You declared the variables salesman_ind, prod_ind, salesman_hs, max_prod in the code bracketed by the brackets starting on lines 10 and ending on line 40. That means you cannot use those variables outside lines 10 to 40. They go "out of scope" after line 40 …

Member Avatar for sumod
0
2K
Member Avatar for V3N0M

You still have a bit of the same problems as your last thread. I switched the input around so you call a function to get a letter and a function to get a float. Error checking and gobbling up white space is done in those functions. You have some obsolete …

Member Avatar for V3N0M
0
323
Member Avatar for Suzie999

EDIT: Below was my original post, before how little memory Transaction requires sunk in. I'm thinking now that the real issue might be Little Endian versus Big Endian and the internal storage of the data on each machine versus the very small amount of data to be transferred (32 bytes?). …

Member Avatar for pritaeas
0
388
Member Avatar for Peter_36

Here's roughly how the compiler processes this code if (Name == "Peter"|| "John") { cout << "Hello, master! How are we feeling to day?" << endl; cin >> Mood; } else { cout << "Hello, " << Name << "!!!"; } This if (Name == "Peter" || "John") is not …

Member Avatar for AssertNull
0
369
Member Avatar for Sandeep_21

> Note what item they listed first. And note what item they listed last. Surprised at that one. Seems like "communicate clearly" and "get along with co-workers" should be grouped together at the top of the list. What good are good communication skills if you can't get along with anyone? …

Member Avatar for AssertNull
0
261
Member Avatar for Jeff-Bennett

> Please elaborate. Yes. More info is needed. I was thinking about this one and it's clear that Stagnant and I already interpreted this problem differently as far as how the "thick line" would be drawn. Regardless, I concur that this is a Geometry problem, not a problem of Windows …

Member Avatar for Stagnant
0
503
Member Avatar for AssertNull

1. Log In 2. Click Inbox 3. I see the PM page 4. Click "Log Out" from "AssertNull" dropdown menu to the left of "Finder" dropdown menu. 5. Directed to Dazah permissions page: "DaniWeb uses Dazah to power its social features and requests the ability to: Manage your Dazah user …

Member Avatar for Dani
0
619
Member Avatar for V3N0M

Not sure why you'd be getting that behavior. What is the exact input you are using? What is the corresponding output? Your code runs fine for me. The only thing I can think of that might be happening is that between getchar and scanf and whatever you are typing in, …

Member Avatar for V3N0M
0
338
Member Avatar for Violet_82

>That's all well and good but how about making it modern? That is, why must it have a convert button at all? If one were to respond to >changes in the entry boxes then it would be instant conversion from F to C and so on. >Think mobile, phone users. …

Member Avatar for JamesCherrill
0
1K
Member Avatar for Jose_12

I note that you have both C and C++ tags on this. I assume you are using a C compiler. If C++, then consider using a vector of C++-style strings. vector and C++-style strings are both dynamic, but you are not responsible for keeping track of the memory. Assuming this …

Member Avatar for AssertNull
0
694
Member Avatar for Jayvis

> I'm assuming that the entered trans_code is to be either 'a' or 'b'. I agree with hericles in his input assumptions and his solution. I will add that it is a good idea to display to the screen what the legal options are, like so: System.out.println("Please enter a single …

Member Avatar for JamesCherrill
0
1K
Member Avatar for Jose_12

You could keep track of the LAST character type you extractedand compare it to the current type (i.e. digit). So when you grab a '1', you don't immediately assume you are done extracting the number. You grab the next digit '2' and notice that it's a digit, so you keep …

Member Avatar for Jose_12
0
519
Member Avatar for Jose_12

The coding is secondary to the algorithm in projects like these. This is a pencil and paper exercise till you figure out what process you want/need to use. A few things to consider... 1. You need to determine exactly what you have to be able to handle in this program. …

Member Avatar for AssertNull
0
298
Member Avatar for bijutoha

Bounce rate might not be a terrible thing, depending on the site. I would guess that my and most people's Stack Overflow bounce rate is fairly high, but that's from a search engine, not social media. Google "makefile no rule to make gcc" or something similar and the first half …

Member Avatar for AssertNull
0
478
Member Avatar for can-mohan

> I need to make sure my integer variable doesn't store more than 2 bytes. The integer will "store" however many bytes it is defined as having. See sizeof() as rproffitt says. No test is required to make sure that a 2-byte integer will store only two bytes, so the …

Member Avatar for AssertNull
0
522
Member Avatar for surfingturtle

Are you using C++98 or C++11? The function definition for "new" is slightly different between the two. http://www.cplusplus.com/reference/new/operator%20new/ http://www.cplusplus.com/reference/new/operator%20new[]/ If you are making a custom "new" operator, you should look at the links above and make your override function match exactlyn (and again, be aware that the C++98 and C++11 …

Member Avatar for surfingturtle
0
248
Member Avatar for Ed Genes

If the file you are reading from is not sorted, you'll want to set up a container for all these records. Vector seems like a good choice. You'll read them all into the vector, then print them all. You can use Vector's built-in sort function or you can write your …

Member Avatar for AssertNull
0
370
Member Avatar for Alif_2

Before commenting too much on the code itself, I want to make sure I understand what the goal is. This is an inventory management program, correct? The file you have listed above shows that you have four different products with names (Spritzer, Pencil, IPhone, GUNNAROPTIK) and corresponding ID (1,2,3,10). I …

Member Avatar for AssertNull
0
265
Member Avatar for Steven_14

I've aways used the free ones in my hobbyist/private life. Every C++ IDE that I've had to pay for in the business world would have been free for the hobbyist. Visual Studio is now free for Hobbyist developers (Visual Studio, not just Visual Studio Express). NetBeans, Eclipse, and CodeBlocks arre …

Member Avatar for Steven_14
0
361
Member Avatar for Suzie999

pritaeas's code seems efficient AND readable to me. You potentially have two calls to the Contains function in your original if statement. Your question seems to be asking if you can avoid the overhead of making a third call to Contains by doing something fancy, if I am reading it …

Member Avatar for JamesCherrill
0
311
Member Avatar for rakesh.menon.16

A few possibilities. I'm not familiar with getkey(), but I imagine it gets called and the program stays there until a key is pressed, then it returns the key pressed. That's my assumption of the expected behavior due to the design of the loop. If that's your expectation, make sure …

Member Avatar for AssertNull
0
326
Member Avatar for ice_3

The wording in your program is a bit confusing. The user is supposed to enter a number from 1 to 50, representing the number of random numbers to be generated. However, the prompt says -10 to 10, the RANGE of the random numbers to be produced. I might run your …

Member Avatar for AssertNull
0
321
Member Avatar for Reverend Jim

I'm seeing an uptick from both the Trump and Hillary camps in preparing for violent riots in the days before and after the election (people buying guns, stocking food and water, generators, etc.). These are mainstream folks, not apocalyptic survivalist types. I've also seen an uptick in wariness between the …

Member Avatar for Reverend Jim
1
270
Member Avatar for Lp_baez

I'm going to chime in with a bug-detecting technique rather than point out the actual bug. One, initialize your arrays with some printable value that is not in either file, like 'X' (as opposed to A,B,C,D,F). You want to get a printout of printable characters. It's tough to debug when …

Member Avatar for AssertNull
0
352
Member Avatar for Reverend Jim

No password problems here, but I keep getting diverted to Dazah to re-confirm the permissions.

Member Avatar for Reverend Jim
0
492
Member Avatar for Daniel_59

The question IS a bit vague, OP. I figured out what you meant, but only after going through the code, seeing what was wrong, then going back to your words. Perhaps a better phrasing might be something like... ***I wrote a hangman program. There is a text file containing at …

Member Avatar for AssertNull
0
379
Member Avatar for Tom_15

tallyLiveNeighbors appears to, at best, allow a total of one live neighbor. I imagine you want to change those "else if" lines to "if" lines.

Member Avatar for Reverend Jim
0
2K
Member Avatar for Benny Adams
Member Avatar for rubberman
0
109
Member Avatar for Clayton_2

> And too lazy to even ask a question. I had a professor who used to give out assignments like this. He would not provide the question that you were supposed to answer. Part of the assignment was that you had to think of what question could go along with …

Member Avatar for AssertNull
-4
202
Member Avatar for Wilda_1

It crashes because you are using i instead of j in a couple of places. Look at line 28. As for the program as a whole, it's too complicated. You have an array of integers and an array of pointers to integers. The array of pointers to integers point to …

Member Avatar for Wilda_1
0
472
Member Avatar for Tom_15

Hmmmmm. Just submitted a long thoughful post and it went... I don't know where. I'm not typing it all out again. Bummer. It was a good one. OP, stick a space between your neighborCount output so you can see which digits make up which cells on the printout. cout << …

Member Avatar for Tom_15
0
558
Member Avatar for Suzie999

> My question is, what is the correct way? Are you concerned about shallow versus deep copy? If so, don't be. C++ strings do deep copies or at least lazy copies (which you are not responsible for), so you don't need to be worried about shallow copies Both of your …

Member Avatar for Suzie999
0
3K
Member Avatar for AssertNull

OK, so I know an 18-year-old young woman who just graduated high school. She'd not related to me, but she's the daughter of a very close friend, I've watched her grow up, and I'm sort of an Honorary Uncle since she has no uncles who are blood relatives. She mostly …

Member Avatar for diafol
0
395
Member Avatar for Tom_15

You'll need to #include the cassert library. http://www.cplusplus.com/reference/cassert/ A valid row index will be 0 <= row < NUM_ROWS. So if a function is passed a parameter called row, you can stick this line at the top of the function: `assert(row >= 0 && row < NUM_ROWS);` For columns, substitute …

Member Avatar for Tom_15
0
696
Member Avatar for One-up

Line 54: else if ( grade = 0.00 && grade <= 64.99) The dreaded = instead of == bug. = is the assignment operator. == is the comparison operator. I'm not exactly sure what you want in that line, but I am extremely confident you don't want the assignment operator. …

Member Avatar for rubberman
0
233
Member Avatar for Sigmond_1

> I can't see where x$ is used Same for the $result33 variable. It's used, but not inside the loop and for nothing but to figure out the number of times to go through the loop. Hard to say what the solution is here since I'm unfamiliar with the database, …

Member Avatar for diafol
0
264
Member Avatar for Shuaibu_1

Seriously? You're doing a dissertation for a Master's degree and you don't know how to spell "dissertation"? Or capitalize "I". Or end a sentence with a period. Also, "software" is one word. What college did you get your Bachelor's Degree from again? > Go away and do some work yourself. …

Member Avatar for rproffitt
-2
210
Member Avatar for pritaeas

> only 8% of our overall traffic is on mobile. Interesting. I would have imagined it was much, much higher. I'm about 50-50 myself regarding mobile browsing vs. desktop/laptop. Now for actually POSTING on Daniweb, I do that almost exclusively on desktop/laptop since I have no word processor or programming …

Member Avatar for diafol
2
645
Member Avatar for Simple man

RProffitt mentioned that you weren't using the right tags with your posts in one of your previous threads. I'm wondering if one of the tags should be "keylogger". You mentioned this as your goal in a previous thread: > What i am trying to do is make a "tamil" language …

Member Avatar for AssertNull
0
275
Member Avatar for AssertNull

I am pretty much brand new to Python. I'm cramming this week trying to learn it and I've been handed some code samples to try them out and familiarize myself with them. Problem is that they were written years ago in Python 2. It's my own C++ code that I …

Member Avatar for AssertNull
0
1K
Member Avatar for John_116

Line 17: $holidays = array('2016-07-22','2016-07-21'); In this particular case, these are two days, one after the other. But if you changed it, for example to: $holidays = array('2016-07-15','2016-07-22'); This is an array of two days. Line 23 checks whether a date is either July 15, 2016 or July 22, 2016. …

Member Avatar for AssertNull
0
3K
Member Avatar for rproffitt

> And Area 51 is meant to serve as a blog of sorts for what's new around here. How does one get to Area 51? I somehow got there by accident, but damn if I remember how and I see no way to navigate there. The name itself seems to …

Member Avatar for Reverend Jim
0
382

The End.