3,183 Posted Topics
Re: Here's an example that may help: #include <stdio.h> #include <stdlib.h> double uniform_deviate(int seed) { return seed * (1.0 / (RAND_MAX + 1.0)); } int main(void) { int lo = 3, hi = 50; for (int i = 0; i < 1000; i++) { double r = lo + uniform_deviate(rand()) * … | |
Re: Print out `search` and you'll see what the problem is. ;) | |
Re: You need to include `<string>` for the string class, not `<string.h>`. The latter is for functions inherited from C. | |
Re: 1. Read the [documentation](http://msdn.microsoft.com/en-us/library/microsoft.visualbasic.fileio.textfieldparser.aspx) 2. ??? 3. Profit I've written too many CSV parsers (*real* ones, not this naive comma split stuff) to be interested in doing it again. ;) | |
Re: Deploying a database can be tricky as well, even though it's straightforward to require that a database server be present for the application to work. In the past I've used three different deployment methods: 1. Build the database locally and provide a backup file that can be restored at the … | |
Re: > I am so happy I've quit .Net because Java is really fun !!! :-) I'm happy that you're happy, but it's obvious that most of your bullet points for why Java is better are heavily opinionated to the point of propaganda. Some are off topic (eg. Tomcat being "better" … | |
Re: > Guys .. u thought that I never tried .. I tried alot. Prove it. Not only does it show us that you're not just looking for a handout, but it also helps us to determine your level for tailoring help to you. Further, instead of a lot of back … | |
Re: > Main problem is that most of the links are nofollow now a days. Hmm, I wonder why that could be? :rolleyes: | |
![]() | Re: I wish you the best of luck, but strongly suspect that it won't end well one way or another. ![]() |
Re: I'm curious, what's wrong with breast milk? Completely free, and arguably healthier in the long term. | |
Re: I'd use public transportation if it were convenient and cheap for my area...but it's not. I'd ride my bicycle to work in a heartbeat...if it weren't a death trap. So I drive my car. | |
Re: One of the reasons votes don't contribute to reputation is for the folks who have strong rep power to apply a mildly negative opinion without the risk of decimating another's rep. We could have implemented a way to choose how many point are applied, but that makes things more complicated … ![]() | |
Re: [This?](http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqldataadapter(v=vs.110).aspx) ![]() | |
Re: That's MSSQL syntax. MySQL uses back ticks around column names instead of brackets: "INSERT INTO tblmysq(name,branch,sex,`dat`)VALUES... | |
Re: Can you post an example of the situation you're asking about? | |
Re: Do you have an example of what you're having trouble converting? A sepcific case makes it easier to clarify things for you. | |
Re: Two things to consider: 1. Make sure your project targets the full framework and not the client profile. 2. System.Web wasn't updated with .NET 3.5. You'll still find it in the 2.0 framework folders. | |
Re: `n` is typically represented as a collection of items being processed by the algorithm because that's easy to visualize. For example, if you have an array of 10 items, replace `n` with 10 for a specific calculation. | |
Re: Allow me to ask the obvious question, why would you want to recursively read a file? | |
Re: If you can connect to the web at all, it's completely open from the perspective of the Wi-Fi. Locking down access to specific pages or domains is the job of the firewall/router. To find out what's blacklisted or whitelisted, I think you would need administrative access to the firewall and … | |
Re: The best reference you can find in terms of details is [the standard](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3242.pdf), but it takes time to learn how to read for maximum value. | |
Re: > Why would anyone put there self through this language Because sometimes it's necessary when you want bare metal control, architecture-specific optimizations, or absolute performance. From my own experience, hardware drivers and the deepest bowels of compiler/library implementations tend to use at least a little bit of inline or straight … | |
Re: What exactly is meant by embedded C programs? I'd assume that you'll be *linking* with built C object code, but that may not be a safe assumption here. | |
Re: We've had an IRC channel for ages and ages, but nobody cared to use it even when it was linked directly on the forum. If you're interested it's irc.daniweb.com, channel #daniweb. But be warned, there's very little activity, so you'll no doubt find it boring there too. We're also looking … | |
Re: if (condition that evaluates to boolean) { // The condition was true } else { // The condition was false } | |
Re: Pseudocode has no standard definition, just make something up. It could be as free form as: declare an array of 20 integers Or more rigid like an actual programming language: declare array(20) of integer | |
![]() | Re: > Will this code work? No. That could easily be determined by trying to compile it. Let's remove the complication of functions for a moment and consider how to get the result you want. There are two issues: 1. "EMP" needs to be eliminated from the employee number result. 2. … ![]() |
Re: You have a number of options, but it depends what these programs are and do. Can you elaborate a little bit? | |
Re: The closest you can get without using the preprocessor is providing a default type: template <typename a = string> class test ... test<> a("hello"); | |
Re: Did you also delete your cookies and temporary files? | |
Re: The actual error is that you're adding an unnecessary level of indirection in the tokenise call. tokens is already an array of pointers, there's no need for the address-of operator. However, that said you still have issues in the program. Most notable is the next line tries to print `tokens` … | |
Re: > No programmer in his/her right mind would write that big of program without using functions to make it more readable. To be fair, it would be drastically shorter without all of the Turbo C++isms. ;) | |
Re: Set the `IsMdiContainer` property to `True` on your parent form. | |
Re: Good luck. Feel free to ask a specific question if you encounter any issues writing your program. | |
Re: Could you post a small but complete program that exhibits the problem here? We're not generally keen on downloading things, and it makes it harder to eyeball the code quickly. | |
Re: How about a different example? Let's say you have customers that have the option to enrole in a feedback survey. You want to get all of those customers to send survey emails. You could use `exists` to retrieve that list and exclude customers that didn't enrole. select c.ID, c.Name, c.Email … | |
Re: To add to clife's explanantion, `#ifndef foo` is functionally identical to `#if !defined(foo)`. | |
Re: > it gives me errors when i run them You didn't post any code or any errors. How do you expect someone to help you resolve them? | |
Re: "Plain text" is ambiguous. You'd need to determine what text encoding method is used (eg. ASCII or UTF-8). Not all encodings will use a leading byte order mark to tell you what you have, so some trial and error may be necessary. If it's just assumed to be ASCII, a … | |
Re: > Otherwise, I'm absolutely baffled that no error occured. It depends on the compiler. Modern compilers should error out if you don't properly cast the literal: int *ptr = (int*)12; I wouldn't be surprised if Turbo C allowed it without the cast. However, it's generally a bad idea to set … | |
Re: Daniweb is more of a Q&A forum for pointed questions and discussion. It's not well suited for teaching someone from scratch. Might I suggest [Khan Academy](https://www.khanacademy.org/cs/programming)? | |
Re: > but why these number and not other? Magic numbers for bit twiddling are typically chosen to be unique bit patterns. For example, in the case of flags that are intended to be OR'd together you'd typically want to choose numbers where a single bit is set: 0x01 = 0000 … | |
Re: > You'll understand that what I'm saying. While I understand what you're saying, I disagree. Learning the theory is indeed critical, but experience is equally critical. To gain experience, you need to work with data structures in an actual programming language. C is a good choice because it's low level … | |
Re: You need to get the console text attributes before changing them, then reset them after you're done (either before or after setting the cursor position). | |
Re: `cin` is in the `std` namespace. If you don't have a `using` statement somewhere to expose it, you need to qualify the name: `std::cin`. | |
Re: Your semicolon got loose and climbed the structure definition. | |
Re: It should already behave this way. However, because the lifetime of the window is tied to the lifetime of your program, you have to keep the window open long enough to see results. For example: #include <stdio.h> int main(void) { puts("Hello, world!"); getchar(); // Pause for input return 0; } … | |
Re: Looks fine to me. Though if you're not required to implement quicksort, I'd recommend simply using merge sort. Merge sort is better suited to linked lists because it [doesn't require random access](http://eternallyconfuzzled.com/tuts/algorithms/jsw_tut_sorting.aspx#merge). Quicksort on a linked list is tricky to implement efficiently due to the random access component, especially if … | |
Re: > but i still want to know if it can be done Yup, it can be done. *How* depends somewhat on how you're deploying the setup.exe, but typically for standalone installers you can either use the default user interface, tweak the default user interface, or define your own completely. For … |
The End.