407 Posted Topics
Re: Well, if you're using the String.split() method, it handles creating the array for you. Maybe explain how you are splitting things up, like do you have to handle each line individually? Or is it all going to be one line? Etc. If you have to handle the split yourself, then … | |
Re: Show us some code, and explain the issues you are having. | |
Re: Could you be more specific about what is not working? Also, dumb question, but couldn't you just copy and paste the file? | |
Re: Did you try taking out the parentheses after `Next`? | |
Re: Could you elaborate? I have no idea what you are trying to accomplish. | |
Re: Have you tried simpler test cases, such as `SELECT FirstName, LastName FROM ClientNCar` to ensure the connection and column names are all correct? Also, is your database case-sensitive, and if so, are you accouting for that? Another thing, be careful with that code, I don't think SqlCommand makes any effort … | |
Re: A StackOverflowException is usually caused by recursive function calls. Try taking a look at the method(s) that instantiate a new instance of the Settings class (or post them here). There is probably something that calls the method again, or another method that ends up calling the method. If your IDE … | |
Re: Also keep in mind that local variables may not even take up space on the stack. Depending on the architecture, instruction set, compiler, etc., local variables may only exist in registers. | |
Re: > Won't getch() do the trick? It's not part of the standard library. Microsoft includes getch() it in the conio.h header, but I'm not sure what's used (if anything) with other compilers/operating systems. | |
Re: You could handle the increment of i inside the for-loop like so: for(int i = 0; i < lotto.Length; ) { check = rand.Next(1, 41); Console.WriteLine("Random number to be checked is -> "+check); if (lotto.Contains(check)) { //You could do another WriteLine() here. } else { //Only add check and increment … | |
Re: What software are you using to convert text to speech (because if you made it all by yourself you should be able to answer that question)? Also, I don't think this is the right place to ask about speakers... | |
Re: If you want help here, you're going to have to show some work, then ask questions if you get stuck. Don't expect anyone here to do your homework for you. | |
Re: Why limit yourself to 20? You could use either of these: * `(<tab>){2,}` * `(<tab>(?:<tab>)+)` See the [Quick Reference](http://msdn.microsoft.com/en-us/library/az24scfc(v=vs.100).aspx) from the MSDN for more info. Both are simple ways to capture two or more tabs. Also, are you looking for the string "<tab>" or tab characters? You would use the … | |
Re: They won't work due to the == operator. The "strings" are really just character arrays. When you use the == operator, you're comparing the memory addresses, not the characters. Take a look at [strcmp](http://www.cplusplus.com/reference/clibrary/cstring/strcmp/) in the cstring header. If you're used to working with C# (or possibly Java, but I … | |
Re: > I don't know how to do that, teach me please You would set that up in the constructor (or Form.Loaded event handler) with something like this: textBox7.Tag = "First Name"; textBox7.Leave += textBox_Leave; textBox8.Tag = "Last Name"; textBox8.Leave += textBox_Leave; ... The Tag property simply holds any object. The … | |
Re: > how to convert from UDP to TCP Just Google some C# TCP socket tutorials and read through the MSDN class reference for the Socket class. There is alot to go over, so I'm not going to post everything here. For starters though, during Socket initialization, you'd change it to … | |
Re: First, I wouldn't recommend using the ReadToEnd() method or storing everything in a StringBuilder before writing it to a file. In your example, it is not so bad, since you are essentially doing one line at a time, but when you go to read that file with 10000 lines, it … | |
Re: > Jason, Since this is the C forum, why all the C++ suggestions? Steer him correctly to C solutions. To me, it looks like he was trying to explain the difference, since the OP doesn't seem to understand. Wouldn't the correct solution be better than the C solution? EDIT: > … | |
Re: Take a look at [strtol](http://www.cplusplus.com/reference/clibrary/cstdlib/strtol/) for signed long integers or [strtoul](http://www.cplusplus.com/reference/clibrary/cstdlib/strtoul/) for unsigned long integers. In particular, look at the example from the first link; it could easily be made into a loop that can handle your problem. | |
![]() | Re: There are a number of libraries that deal with large integers, such as [GMP](http://gmplib.org/). |
Re: If it's simple enough, you could use the classes in the [System.Drawing.Printing](http://msdn.microsoft.com/en-us/library/system.drawing.printing(v=vs.100)) namespace. | |
Re: How is that method still "active"? Are you creating a second thread for each movement action? Generally, if you want to explicitly move something, you would have a method set the object's speed, then the actual movement is handled each step through the main game loop. Something like this: function … | |
Re: Take a look at the [System.Net.Sockets](http://msdn.microsoft.com/en-us/library/sb27wehh(v=vs.100)) namespace. You would start by initializing a Socket class. I'll assume you are using TCP (if you aren't, it can vary). You'll have to call the Bind() method on both the server and client sockets. On the server end, you call Listen() and on … | |
Re: Nobody's going to do your homework for you. Show some work and we'll help. Although it isn't a best practice, since it's a 6-bit number, you could do it with 6 for-loops, which I think is what their looking for. ![]() | |
Re: Yeah... I have no idea what you're trying to show here... Why don't you start by explaining what you are trying to do, give some code of problem areas, explain what it is doing wrong and what is should be doing, and any unexpected exceptions you are getting (and where … | |
Re: You could give SqlCommand.Cancel() a try, although I hear it isn't very reliable. Another option is to close the connection. Closing the connection should immediately raise an exception (which you'll have to deal with). | |
Re: That isn't a trivial task. Even if you only wanted to be able to support one platform (Windows, Linux, etc.) the Java API is huge. It would take several experienced programmers (or maybe one really dedicated programmer) a good amount of time to implement/test it. Also, why would you really … | |
Re: This also depends on your network as well. Many modern switches provide layer 3 support as well; that is, they are IP aware. If they do, they will keep routing tables, and usually only forward it to one port. Some commericial switches have a specific port that all packets are … | |
Re: You could use a loop. First, if your CSV files get very big, this is going to consume a large chunk of memory to store the entire file at once. I would recommend using a StreamReader with the ReadLine() method in a loop. You can start with something like this: … | |
Re: You generally use the Children property of any class that derives from Panel. For example: stackPanel.Children.Add(x); WPF handles layout differently than WinForms. In WinForms, each control can handle its own position (although a LayoutEngine can override this). In WPF, the parent control positions its children. A StackPanel will position controls … | |
Re: Create a for-loop, that iterates through each character, and ensure their [ASCII](http://www.asciitable.com/) (assuming you are not working with international representations) value is numeric, a hyphen or a decimal. At the same time, make sure you're checking for a hyphen at the beginning only, and only one decimal. You could also … | |
Re: Assuming you're using WinForms, you could try handling the GotFocus and LostFocus events. Detecting whether a new program has been opened could cause issues, especially during startup, since you can't be sure your program is opened last, and Windows could be starting up a bunch of programs. | |
Re: I will start by saying that I'm not an experienced game developper, I've learned little bits and pieces when I find the time. In either case, you could take a look at these (you'll never get a definitive answer on which is best, its all subjective): * Unity: I have … | |
Re: In what context? If you're just doing standard mathematical computations, work your way up using order of operations. If you're doing it for a compiler construction course, it gets a bit more involved. Nobody's going to do your homework for you, so show some work. | |
Re: What CLR data type are you using? Should be decimal if I'm not mistaken. | |
![]() | Re: You could use the clock() function in the time.h header. The 0 value has nothing to do with real world time (it can be based on the time the program started, but is implementation specific). It gives you the number of clock cycles (ticks) that have ellapsed, so you have … ![]() |
Re: What exactly do you mean? Something like this? string.IsNullOrEmpty(all_prices[0][0]) ? 0 : int.Parse(all_prices[0][0]); That example just returns 0 if it's null or empty, otherwise it parses the string (you could use float/double/decimal instead), but I'm not sure if that's what you're trying to do... If it is, could I ask … | |
Re: Can you show your code, an example of the output, and what you would expect it to look like? In most cases, not using special characters like & is breaking the XML standard (or at the very least creating issues for parses). | |
Re: Yes, but it's not built in to the language or standard libraries. You'll need to use a third-party library to create and manage threads. For Windows, you can use the WinAPI; here is the [Process and Thread Reference](http://msdn.microsoft.com/en-us/library/windows/desktop/ms684852(v=vs.85).aspx). | |
Re: What have you tried? Do you have any source code? What results are you getting? | |
Re: It shouldn't be anything wrong with the code. Check the cells where the pivot table is getting its data from. At least the first row shouldn't contain any empty cells. See this [article](http://support.microsoft.com/kb/141286). | |
Re: You're using a char array (ie. a string), which the switch statement cannot work with. I tested it with `switch(Pl.Level[0])`, and it compiles. On the same note, `Pl.Level='1';` would change the address of the pointer, not the first value in the array. | |
Re: Access provides a file based database. This is quite different than an Oracle or SQL Server database. The latter have several processes which work as a middle-man between the client and the physical file(s). This would allow (I certainly **should** be possible, albeit I've never attempted it) the processes to … | |
Re: Take a look at [this](http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Double.html#doubleToLongBits(double)). Basically, you'll want to use `Double.toLongBits(f)` or `Double.toRawLongBits(f)` (the difference between the two pertains to NaN values; see the documentation). These will give you a long integer, which you should be able to use `Long.toHexString()` to get the actual IEEE 754 value. | |
Re: There are some capitalization errors. C# is case sensitive. If you have any more problems, please post the error you're getting and any relevant information. | |
Re: Do a google search for java io and java encryption. Should be pretty straight forward. Once you have done some research and tried coding, feel free to ask some specific questions if you get stuck. Good luck. | |
Re: ++t is an increment operator, it is essentially equivalent to t+=1. Although it does not matter in this situation, note that there is a difference between ++t and t++ (just Google it if you're not sure about it). As for the string[t], strings (in C) are an array of characters … |
The End.