3,183 Posted Topics
Re: Your company's IT department will have either an installation disk or a repair disk for your computer. The former requires a product key that the same department will have, though they'll probably ask to install it themselves rather than give it out to you. Since it's your company's property, I … | |
Re: > Which is faster and why? It's difficult to say, but I'd wager the first would be fastest because the compiler is likely to be substantially better at unrolling loops in the most efficient manner. However, there's an implicit assumption that the loop would be unrolled, so as with any … | |
Re: You'd want to execute a long running method in a separate thread to avoid the UI thread becoming unresponsive. Just make sure that there's something for the user to look at or interact with while the method is doing its thing, or it won't matter whether the UI is responsive … | |
Re: `cout << thingie` is symbolic for "send `thingie` to `cout`". `cin >> thingie` is symbolic for "send something to `thingie` from `cin`". The angle brackets denote the direction that data moves. Whether `>>` and `<<` are the best symbology for the behavior is up for debate, but it works reasonably … | |
Re: Depending on how familiar you are with Java (and programming in general), both should be relatively simple to pick up. All three are in the same family, after all. However, I suspect you'd find C++ more comfortable initially since it directly supports OOP. | |
Re: `getline` isn't a standard function, so your book is correct. The problem is your compiler supports that function as an extension, so the easiest approach would be to change the name of the function in your code to something else. | |
![]() | Re: In your `KeyPressEventArgs` object is a `Handled` property. Set that guy before returning from the event handler to disable subsequent control logic on the event. |
Re: Daniweb is not a homework service. Please provide evidence that you've attempted a solution on your own, as per our [rules](https://www.daniweb.com/community/rules). | |
Re: > But, when I use using namespace std, then I also have to use "string" header file. So what is the difference between them? The header provides you with declarations. `using namespace std` simply tells the compiler to pretend you had qualified a name with `std::` if it can't resolve … | |
Re: [Clickie](http://msdn.microsoft.com/en-us/library/ff602939(v=vs.110).aspx) | |
Re: I like the idea in concept, of course the details need to be hammered down carefully if money is involved. In particular I'd like to see a handful of things in particular: 1. The bounty amount can be set from the asker's available pool. This benefits higher priority questions or … | |
Re: You say you need help, but only posted your homework assignment. Please be more specific about what you want help with. | |
![]() | Re: Assuming you're using the Visual Studio designer, what I do is keep part of the default name and replace the useless number with the same tag as the related control. The tag is chosen based on what the controls do or represent. Often if the controls are bound, the tag … ![]() |
Re: Hopelessly vague question and mention of a file with no details or examples. Please try again, kthxbye. | |
Re: > How bout putting the database file into the same directory as your .exe file? That's risky. If the application isn't run with administrative rights, extraneous files may not be accessible if they're in the application folder. A better approach would be to use something like `Environment.SpecialFolder.CommonApplicationData` and storing the … | |
Re: How is the second one faulty? The most notable potential problem is you're incrementing `num1` rather than `count`, but whether that's a bug depends on what you expected to happen. | |
Re: > Why doesn't this work in C#? Because you should be using `||` in your loop rather than `&&`. With `&&`, `jaar` will only be compared to 1582 if `TryParse` fails, which is somewhat nonsensical. | |
Re: Posting actual code might help instead of paraphrasing lines onesie twosie. | |
Re: Hmm, either my understanding of CLR integration in SQL Server is woefully out of date, or there's a disconnect somewhere. CLR functions are *server side* entities. You still need vanilla connection strings and T-SQL in your client application. So your problem boils down to two things as I see it: … | |
Re: > The design of how this works is really bad. It kind of depends on what controls and how the controls can only be operated by the keyboard. But I'll take your word for it. :) > I don't know if I have the ability to 'hook' into it with … | |
Re: The error is correct. `nameLabels` is a `string` (as denoted by your `ToString` call earlier to convert the cell value), and `string` is most certainly not a compatible type with `string[]`. Without more details on what values the `"FaceName"` cells contain, I can only speculate, but judging by your description … | |
Re: We can't really help unless you ask a specific question. | |
Re: > You could count the number of zeroes inside a number N with the following algorithm And if the number *begins* with zeroes? What if the number exceeds the range of your numeric type? The best approach to handle input as it's typed is to work with it as a … | |
Re: Ditto cgeier. I'm not a fan of directly managing data sources in Visual Studio; it just feels too inflexible compared to doing it manually with ADO.NET. | |
Re: Um...what? Convert how? And does the picture of the dress need to be processed in some way? Your question is exceptionally vague. | |
Re: Well, the most widely supported method would be the ctime library: #include <ctime> #include <iostream> #include <utility> #include <string> using namespace std; pair<string, int> weekday(int month, int day, int year) { tm date = {0}; // Set the date properties date.tm_mday = day; date.tm_mon = month - 1; date.tm_year = … | |
Re: > I tried but it dosn't work ... "Doesn't work" is not a helpful problem report. Please be specific about *how* it doesn't work. However, at a glance there are two immediate problems. One is subtle and the other is glaring: > char* s="Ctor of class Brain Called"; While compilers … | |
![]() | Re: Hmm, my initial reaction is to suggest fixing the circular reference. You could try using reflection to invoke methods in a compiled assembly from the other project, but that strikes me as more of a Band-Aid than a solution. ![]() |
Re: Define "easier" for your needs. With a vector, I'd probably do the same thing you've done, but there are serialization libraries ([Boost](http://www.boost.org/doc/libs/1_57_0/libs/serialization/doc/index.html) comes to mind), but they can be non-trivial to use. | |
Re: It sounds like your professor wants you to play with different string representations. Specifically, how to determine length at any given time as that's the usual difference between string types. There are three common ones: * Terminated strings: An extra slot is allocated for storage of a terminating character (usually … | |
Re: > my first question is whether a deck of cards should have a base class of card It doesn't make sense to me, personally. A deck of cards is not a card, it's a collection of cards, so composition is the better choice over inheritance: public class Deck { public … | |
Re: Well, a database *is* the way to go, but that's really a pointless statement. What you really want is a [CMS](http://en.wikipedia.org/wiki/Content_management_system). They'll use a database on the back end, but support record metadata for indexing and filtering such that you store only a single instance of the item yet can … | |
Re: > Why does this not need to be int main? Prior to C99, omitting a return type causes the compiler to assume you meant `int`. This is called "implicit int", and it created enough confusion that C99 removed that "feature". > Why no return 0? Either the code is correct … | |
Re: Off the top of my head, the C standards don't disallow that code in any way. Further, my tests with gcc don't mesh with your results. Please post a complete compilable example *and* the full compiler output including your instantiation of gcc. | |
Re: It's valid syntax, but guaranteed to be confusing and very likely to become incorrect as more members are added to the class. The `private` qualifier only explicitly applies to `suit`, and the `public` qualifier will only apply to your constructor. `value` will have default visibility, which in this case is … | |
Re: > Isn't the hash/salt value stored in the database table when the user first registers Yes. When the user registers, you generate the salted hash and store it in the database. When the user logs in, you do more or less the same thing with entered credentials and compare with … | |
*Warning: This code is tested, but not as-is. I combined multiple files to simplify the snippet.* One of my specialties is document imaging, and custom tools to handle it. A common request for both scanner sources and file import is correction of when pages are not properly oriented. To avoid … | |
Re: [This](http://www.eternallyconfuzzled.com/tuts/datastructures/jsw_tut_bst1.aspx#traverse) may help. | |
Re: The code you've linked to doesn't compile due to undeclared variables. Could you post the updated code which produces a segfault here, please? | |
Re: That code is weak in that it makes an assumption about the bit representation of characters. In particular ASCII upper and lower case letters differ only in whether the 6th bit is set, so that code ensures that the bit is the same before doing a comparison. A much better … | |
![]() | Re: By second programming language do you mean a language you know but don't really use? It seems kind of silly to think in terms of first, second, third, etc...; you should learn as many languages as practical to benefit your skillset. So let's start with this: what language do you … |
Re: 1. I'm of the opinion that it's always worth learning different languages. However, more important than learning a language in the same family (eg. C# is in the same family as C and C++), learning completely different languages rounds you out as a programmer because you often have to think … | |
Re: > Done :) The result set must *include* delimiters, not remove them. ;) Try this little one-liner: var parts = Regex.Split("abc,123.xyz;praise;end,file,clear", @"([\.,;])"); | |
Re: > How can you make sure that the replies and info we receive are correct? Trust, but verify. If only one source tells you something and others contradict it consistently, that source is likely in the wrong. If multiple sources say the same thing, it's probably correct. | |
Re: > The problem is i don't even know programming. Yep, that's a problem alright. A big one. I'd start by searching for tutorials on how to write an operating system; there a surprising number out there on the web. Once you have an idea of what's involved, you can start … | |
Re: > PLEASE PLEASE Please read our rules concerning homework. If you need help with anything specific, ask a specific question. Nobody here will do the work for you. | |
Re: Your question is essentially "how do I write a program using functions?", which is extremely vague and basic. Do you know how functions work and the syntax for defining them? | |
Re: This sounds like a variation of a repository library I wrote. The ID structure wasn't quite that simplistic, but the concept is similar. Something like this would be a start for you: private void buttonLoad_Click(object sender, EventArgs args) { var path = GetImagePath( Folder, Convert.ToInt32(numericUpDownImage.Value), ".tif"); if (File.Exists(path)) { // … | |
Re: > Even Daniweb promises to never go through private messages. Which seems like a mistake on our part. Daniweb's TOS should probably include a qualifier that PMs may be reviewed in extreme cases (such as excessive harrassment) or shared with law enforcement to assist in any investigation. |
The End.