1,443 Posted Topics
Re: First, use printf instead of println Then check out this link for [URL="http://sharkysoft.com/archive/printf/docs/javadocs/lava/clib/stdio/doc-files/specification.htm"]format specifiers[/URL]: | |
Re: 3400 lines of code is a bit much to tackle all at once. Why don't you take a section (let's say one function), separate it into a new .VB file all by itself, then refactor that into smaller functions grouped by functionality THEN optimize the code. Once you're looking at … | |
Re: What are you supposed to do with the modified result? | |
Re: Let me see if I understand. The first number is a RANDOM number between 25-100. That number will be used to create THAT NUMBER of random numbers between 1-1000. Then you need the index of the smallest number Then you need the index of the largest number Then you need … | |
Re: If your code is running from ASP.NET, this is customary as you are not the local user. | |
Re: You can use a loop with an integer or double and use .ToString().PadLeft(n, '0') if you need the last n digits incremented. [QUOTE=shandoosheri;1695304]Hi every one I have this url [url]www.websiteaddress.com/0010001[/url] and i want to keep counting on it like it becomes [url]www.websiteaddress.com/0010002[/url] [url]www.websiteaddress.com/0010003[/url] and so on and i want all … | |
Re: Do you have the original source code? If so, change the extension to .cpp, add the source to your project, make sure you're using warning level 4 and re-compile. After you fix all of the (now-known-as) bugs, you'll be finished. | |
Re: In this example, you only put a few even numbers into the new array, but you're printing a TOTAL amount of numbers not just the even ones. When your nPozitive is delcared on the stack (and not initialized), it can have ANY values in it. | |
Re: What compiler are you using? | |
Re: GridView has a DataSource property that can be set to a collection or Linq result. | |
Re: On the surface this looks like it will work, but I (personally) would put all questions outside of the Average class. Are you supposed to have an array of something OTHER THAN the integers in the class? | |
Re: How about this?: [CODE] int gcd(int x, int y) { if ((x % y) == 0) return y; return gcd(y, x % y); } [/CODE] | |
Re: You probably want an AND in that case use the && | |
Re: WaltP, I think this is just a code snippet. jnmisa, you can remove the use of the bool "ValidateDegreeValue" and put the TryParse iside the "if" statement if you want. | |
Re: You will need to read that variable as a string and then convert it to an integer. | |
Re: [url]http://www.daniweb.com/software-development/cpp/threads/394152[/url] | |
Re: [url]http://www.daniweb.com/software-development/cpp/threads/394152[/url] | |
Re: You will need to send the files one at a time. using System.IO; using System.Net; Use the Directory.GetFiles() method to find the files you want to send. Use a WebClient and the .UploadFile() method to send the files to the remote server. There are other options for uploading, but this … | |
Re: As long as your key in the Dictionary/Hashtable is unique, it doesn't matter. Open the database, loop through the queried data, Add() the data to the Dictionary<string, string>. Close the database. | |
Re: Generically speaking, there are at least two methods of doing what you want. Here is a neutral example of how it can be done. You should be able to see how to modify your code when you see these two examples. If you are still (really) having problems, let me … | |
Re: Are you going to keep it flat-file based? How many users? Why c++? What have you written so far? | |
Re: You are mixing "a" and "ktr" in a manner that doesn't make sense. Did you mean for "a" to start at 1 and go to -1? | |
Re: [Cat is out of the bag] Did you wrap the value for [Task Name] in single quotes? Also, what is your data type of [Completion Date]? Is it a string (varchar)? Is it a DateTime? | |
Re: I would suggest using a List<string> to store your rows. You could also create a CLASS to hold your rows and store the rows in a List<CLASS> or a Dictionary<string, CLASS> where the key to the dictionary is the student ID. If you're into creating classes, it will make keeping … | |
Re: ...nore really sure with your version of ASM, but I use ORG 100h because I make .com files. | |
Re: How much do you know about Web Services now? If you are building the WS, you can design the interface to take the types of data you want. If you are just consuming the WS, you will need to adhere to the interface provided to you. If you are using … | |
Re: Check out spawnl() [url]http://qnxcs.unomaha.edu/help/product/neutrino/lib_ref/s/spawnl.html[/url] [url]http://www.cplusplus.com/forum/windows/1960/[/url] | |
Re: ...or... [CODE] using System; using System.Linq; namespace DW_370908 { class CDW_370908 { static void Main(string[] args) { int[][] int_arr_arr = new int[][] { new int[] {2,190}, new int[] {7,101}, new int[] {1,100}, new int[] {3,100}, new int[] {9,100} }; int[][] int_arr_arr2 = int_arr_arr.OrderBy(i => i[0].ToString()).ToArray(); int[][] int_arr_arr3 = int_arr_arr.OrderByDescending(i => … | |
Re: If you are running this from the debugger (or if the file is not in the same directory with the executable), you might need to give the full path of the file. | |
Re: The type of project you create will depend on where and how the DLL will be used. If you are going to continue to use MANAGED code, there is really no need to convert the C# to C++, just use the DLL and call its functions. If you are converting … | |
Re: If you're still interested in this one, I've always found specifically naming the columns will prevent problems with SQL Server [CODE]"INSERT INTO tblUsers (USERNAME, PASSWORD) VALUES(@USERNAME, @PASSWORD)" [/CODE] | |
Re: 1) Make a class that has ALL of the employee details EmployeeName, EmployeeNumber, Department, Age, GrossSalary, NetSalary 2) create (in the class) a method that returns a string that contains ALL of the employee details (delimited by {tab or comma}) 3) Read the Employee.txt into an array, list, vector of … | |
Re: It really depends on the layout of your input file and how you want to parse it. Let's say it is a numbered list, tab delimited. [CODE] 1 candy 2 beer 3 peanut butter 4 crackers [/CODE] ... you can use the code to put the data into a Dictionary … | |
Re: Are you saying you have a class that you want to place into a Hashtable, the retrieve elements of that from the Hash? | |
Re: C++ is such a rich language that you'll never "finish" with it. Even if you move to another language, like C#, you'll discover things you [I]could have[/I] done with C++ you'll go back and polish your old skills. Even with c++, there's still MFC and CLI and a host of … | |
Re: So you're saying you want to parse either the given word OR the words in the dictionary by the length of 3,4,5,6 and make new words for comparison? | |
Re: Check out System.Xml.Linq Use the XDocument.Parse() method ...or the XDocument.Load() method [CODE] Imports System.IO Imports System.Xml.Linq Module Module1 Sub Main() Dim xd As XDocument = XDocument.Load("c:\science\DaniWeb\DW_392100\DW_392100.xml") For Each node In xd.Elements("Table").Nodes Console.WriteLine(node) Next 'fileIn.Close() End Sub End Module [/CODE] | |
Re: When I use XML, I use the System.Xml.Linq namespace. It seems to be easier. [CODE] using System; using System.Collections.Generic; using System.Linq; using System.Xml.Linq; namespace DW_393489 { class Program { static void Main(string[] args) { XDocument doc = XDocument.Load("c:/science/DaniWeb/DW_393489/XMLFile1.xml"); List<XElement> lstElements = doc.Descendants("SYMBOL").ToList(); lstElements.ForEach(xe => Console.WriteLine(xe.Attribute("Code").Value)); } } } [/CODE] | |
Re: Remember: each loop has to print a loop of 10 (horizontally -- no line-feed) | |
Re: [CODE] public class Asterisk { public static void main(String[] args) { for (int i=5; i>0;i--) { System.out.println(""); for (int j=1; j<=i;j++) { System.out.print("*"); } } //System.out.println("*"); } } [/CODE] | |
Re: look up strtok() for splitting strings. /*It's not the prettiest thing you will ever see*/ | |
Re: I made a few assumptions about what you actually want, but this will give you somewhat of a start: [CODE] using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Net; using System.Text.RegularExpressions; namespace DW_392451 { class CDW_392451 { static void Main(string[] args) { string strURL = "http://www.daniweb.com/software-development/2"; string strBaseImageLoc = … | |
Re: [url]http://forums.asp.net/p/1355949/2784860.aspx[/url] | |
Re: It is the same as the scope of where the class is declared (subject to its visibility). [url]http://en.wikipedia.org/wiki/Method_(computer_science[/url]) [url]http://en.wikipedia.org/wiki/Scope_(programming[/url]) | |
Re: Take out the space (unless you are looking for lines with just one space) ^$ So, given a file called test.txt, JUST the sed part would be: [CODE] sed '/^$/d' test.txt [/CODE] | |
Re: When you compile, do you have the option to pack your structures on a 1-byte boundary? In my old Microsoft compiler, I could use /Zp1 ...otherwise, it would use the default size for every structure that went across the network. | |
Re: [url]http://www.daniweb.com/software-development/cpp/threads/393014[/url] |
The End.