1,443 Posted Topics
Re: Does this need to remain in STL C++? Do you have any other options like .NET or MFC? | |
Re: Yes, start at the RIGHT-most (highest) element and work your way backwards. When you run across a value that's higher, it's a leader. | |
Re: If you keep track of the sort (or shuffle) order, you can just refer to that position in a fixed array. [CODE] arr_strCards = [ "AS", "2S", "3S", "4S", "5S", "6S", "7S", "8S", "9S", "10S", "JS", "QS", "KS", "AH", "2H", "3H", "4H", "5H", "6H", "7H", "8H", "9H", "10H", "JH", "QH", … | |
Re: Have you downloaded and installed the SDK (Software Development Kit) from Sun? [url]http://java.sun.com/javase/downloads/index.jsp[/url] | |
Re: [code] /// Are you looking for THIS? String^ str = "Hello \"Hello\" Hello"; [/code] | |
| |
Re: javaAddict is right. Use the String.split() function which returns (an array of Strings) String[]. You can get the length of the String[] to determine how many words there are. Do you have any code for this already? | |
Re: First thing, your class should be called "Find" based on your command-line requirements. The only imports necessary are: import java.io.*; import java.util.*; Since all of the parameters are entered on the command-line, Scanner is not necessary. The first parameter, then, is the search element, so: String toFind = args[0]; ...but … | |
Re: If the data is separated by linefeeds and/or carriage returns, just read it in line by line and concatenate the lines together. StringBuilder [url]http://java.sun.com/javase/6/docs/api/java/lang/StringBuilder.html[/url] Once you've done that, you can remove and modify anything you want. | |
Re: Does it fail without the compression? | |
Re: Are you first saving the encoded text as a Word document? If so, are you using any Office Automation for this or just saving bytes? Have you thought about saving it as XML, then loading it in WORD? You can get the WORD XML tags by saving a simple document … | |
Re: You can go here and type SDK in the search window to get one of the Dot Net SDKs: [url]http://www.microsoft.com/downloads/en/default.aspx[/url] If you change your mind and want Visual Studio, too, you can download the express edition for free from here: [url]http://www.microsoft.com/express/download/[/url] | |
Re: instead of while, use "if" [code] if(x == 12) { System.out.println("December " + x);//put a space after the month also. } [/code] | |
Re: Grn Xtrm is right. Remove the semi-colons. Also, check this: [code] import java.util.*; class minmax { public static void main(String[] args) { //assuming the "store" is a Vector of Doubles Vector<Double> store = new Vector<Double>(); // store.add((double)8); store.add((double)3); store.add((double)7); store.add((double)9); // double dblMin = store.get(0); double dblMax = dblMin; //Do … | |
Re: Examine these: [url]http://www.daniweb.com/forums/post486992.html[/url] [Slide 44] [url]http://www.scribd.com/doc/15961341/Automata[/url] [url]www.cs.wmich.edu/~zijiang/CS5810/Chap3-2.pdf[/url] | |
Re: Yes. Between your close and open parenthesis there should be some type of operator like a * or a + maybe like: [code] area_ans = ( sqrt( semi * (semi - side_a)+(semi - side_b)+(semi- side_c) ) ); [/code] | |
Re: Was the problem the SPACES in the column names that needed to be wapped in tick-marks or single quotes? | |
Re: Have you ensured the length of the data you're feeding to QuadWordFromBigEndian is 8 (or more) bytes? ...Either by forcing the call to IsLegalKeySize() or by running it in Debug mode with an assert... [CODE] private static UInt64 QuadWordFromBigEndian(byte[] block) { System.Diagnostics.Debug.Assert(block.Length.Equals(8)); UInt64 x; x = ( (((UInt64)block[0]) << 56) … | |
Re: What happens when you run the TC command from the command-line? Can you install the Visual C++ Express as an alternative? [url]http://www.microsoft.com/express/download/[/url] | |
Re: use the word "AND" in your update SQL rather than && | |
Re: [url]http://www.microsoft.com/express/download/[/url] Easiest, free, best (for the money). Visual C++ Express. Anything better will cost money. | |
Re: [url]http://www.dreamincode.net/code/snippet530.htm[/url] | |
Re: What do you mean you want to store the data in a single file? Do you mean FOLDER? ...or do you mean something like a ZIP file? | |
Re: What else do you have affecting the value of "f"? If both "f" and "a" increment at the same time, do you need two variables? You could do it all in the same for loop. The center element of a for loop is a boolean test and can have more … | |
Re: [QUOTE=shakunni;1039303]Hey, How do you read from the command line in C? I need to read 10 arguments from the command line. Can I use char* argv[] as a parameter in the main function to do so? Thanks.[/QUOTE] You can use that or int main(int argc, char** argv) where argc is … | |
Re: [opinion] Any of the .NET languages would be a good "option". It might be easier to start it in VB or C# and do the back-end assemblies in C++. [/opinion] | |
Re: I like this one a lot. Here is step 1: [code] namespace MatrixProblem { class CMatrixProblem { static void Main(string[] args) { int[,] arr_arr_int = new int[5,5] { { 1, 6,15,10,21}, {14, 9,20, 5,16}, {19, 2, 7,22,11}, { 8,13,24,17, 4}, {25,18, 3,12,23} }; } } } [/code] | |
Re: A default constructor is one that takes no parameters and sets the initial values for the class. [CODE] public class CSomething { public int iFred; public CSomething() { // default constructor iFred = 0; } public CSomething(int iSetFred) { //non-default iFred = iSetFred; } } [/CODE] | |
Re: Could you load the smaller repository into RAM (into a Dictionary/Hashtable) and compare the larger repository to it line-by-line? If both are too large for RAM, you could scan the XML for certain keys, and index the XML file (seek) then query back into the file when the DB record … | |
Re: Is this a question? Where is the question mark? Here is a search-engine search I would use to find a pre-made LR Parser: [url]http://bit.ly/3bGauc[/url] | |
Re: If you were to assume the "count" is incremented in another loop, you could have the test for the value of "count" exit sooner, which could potentially be more efficient depending on the size of the test for "x" IF count > 10 THEN WHILE x < 0 DO INPUT … | |
Re: So, on your READ, you want to create an empty file if one does not exist? Also, if you put a try/catch block around it, the problem could be revealed. Also, StreamReader and StreamWriter will take a filename as a parameter, so you can avoid the extra step of the … | |
Re: For your original question, you can use a "for" loop or a "while" loop depending on your needs. [code] for(;;) //infinite until break (or return) { //do stuff here. } [/code] Please create a new thread for your second question. | |
Re: I took a swing at this in C# since I don't do much Perl. I put the data into a file and read it in 1 line at a time. I created a hash table (Dictionary) containing a string as the "key" and a list of strings as the "Value". … | |
Re: 1) How fancy are you allowed to get with this? 2) Since you KNOW the input file name, do you need to scan for it? 3) I would suggest multiple functions to help keep the actions separate and your design clean. [Functions I would suggest] 1) main 2) public static … | |
Re: Does this actually need to be a VPN or would a Peer-To-Peer (p2p) connection work? If p2p would work, you could use WCF or just sockets to communicate. | |
Re: Depending on the carrier, you can use a pre-built Web Service that sends SMS messages for instance: //http://www.webservicex.net/sendsmsworld.asmx [CODE] using DW_SendSmsWeb.WS_WebServiceX; //http://www.webservicex.net/sendsmsworld.asmx namespace DW_SendSmsWeb { class Program { static void Main(string[] args) { SendSMSWorld svc = new SendSMSWorld(); svc.sendSMS("fred@fred.com", "USA", "2125551212", "MessageGoesHere"); } } } [/CODE] | |
Re: It sounds as if you just need to iterate through files in a directory. Here is an example of that: [CODE] using System; using System.IO; namespace DW_FileLoop { class Program { static void Main(string[] args) { string strRootDir = @"C:\Users\Mark\Documents\VoteResults2"; string[] arr_strFiles = Directory.GetFiles(strRootDir, "*.xml"); foreach (string strFile in arr_strFiles) … | |
Re: I'm not truly understanding the problem. Are you saying you're getting an invalid decryption or an invalid public key? Are you decrypting a message or just a password? If you're only validating a password, do you actually need to decrypt? A technique that can be used is to store the … | |
Re: What does the document contain and what is it to look like when you're finished? | |
Re: Simply, it's failing because you do not have a constructor that takes two longs. | |
Re: If you're debugging, you can set a breakpoint on the last closing curly brace on your "Main" and it will allow you to see the output before the window closes. |
The End.