1,443 Posted Topics
Re: Your best bet would be to create a test project with the same types of objects on both sides of the = sign. Fill the right side with values and watch it copy from right to left in the debugger. Also, when I converted an MFC project to MFC+CLI, I … | |
Re: Do you need actual return values from the Java project? If not, I would just create a batch file that sets the directory and calls the java module, but spawn the batch file from C# using System.Diagnostics.Process.Start(...); | |
Re: If getdate() is coming from the database, don't use a parameter with it; just hard-code it like what is in your example. You can use a parameter with everything else. | |
Re: 1) You can store the user data in a database and read it from each application. 2) You can use Sockets to send messages between the apps. 3) You can use WCF (and the like) to send messages between the apps. | |
Re: With a little help from Linq, you can reduce the number of lines of code. [CODE] using System; using System.Collections.Generic; using System.Linq; namespace DW_371861 { class Program { static void Main(string[] args) { Console.Write("\t\t\t** Developed by : GE **\n\n" + " Enter number here in range 0-50 : "); string … | |
Re: If you're using the ADO classes, you'll never need anything like this. The only thing I've seen on MysqlDump is a reference to a command-line tool for backking up the database. [url]http://dev.mysql.com/doc/refman/5.1/en/mysqldump.html[/url] | |
Re: There is a problem when the items you're capturing are wrapped in something that can be caught by the Regular Expression. You might need to remove some unwanted elements before using a Regex. Are you reading this as one string or multiple? Does it really need to be a regular … | |
Re: Since no database type was specified, I'll make this generic. Assuming you have an ODBC data source and it is set up in your Odbc Administrator... [CODE] using System; using System.Data.Odbc; namespace Dani_368900 { class Program { static void Main(string[] args) { using (OdbcConnection conn = new OdbcConnection("DSN=...")) { conn.Open(); … | |
Re: If you are using Visual C++, there are a lot of libraries available. Oracle is probably the most popular. If you're using Visual Studio, you would add a reference to System.Data.OracleClient. ...then (in your code) add [CODE] using namespace System::Data::OracleClient; [/CODE] | |
Re: Even though the thread is old... [CODE] using System; using System.Linq; namespace Dani_312188 { class CDani_312188 { static void Main(string[] args) { string[] arr_strDays = {"Tuesday", "Thursday", "Saturday" }; DateTime? dt1 = null; int intRnd = (new Random(DateTime.Now.Second)).Next(); if (0.Equals(intRnd % 2)) dt1 = DateTime.Parse("18-June-2011"); bool blnIsMatch = ( null … | |
Re: Do you mean something like this?: [CODE] #include <stdio.h> #include <string.h> int main(int argc, char** argv) { char strData[128] = {'\0'}; int intMiddle = 0; do { puts("Please enter some data"); gets(strData); } while(NULL == strData[0]); intMiddle = (int)(strlen(strData)/2); printf("The middle is [%c]\n", strData[intMiddle]); } [/CODE] | |
Re: I changed the name because ECHO is a dos command. [CODE] ; anEcho : Compiled with A86 (http://eji.com/a86/) ; This program shows how to get user input with echo. ; mov ah, 09h mov dx, askName; int 21h ; Ask for user name mov cx, 0ah mov si, userName ; … | |
Re: What kind of numbers? The easiest thing might be to convert the number to a string, then use interrupt 21H/9H to show it. | |
Re: [url]http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlcommand.executenonquery.aspx[/url] | |
Re: Do you have DEBUG? You can run this through DEBUG just like in your last post. | |
Re: You can type in the code using DEBUG at the DOS command-line and step through each command and watch the registers. [CODE] C:\science>debug -a 1424:0100 mov ax, 1010 1424:0103 mov ah, 5 1424:0105 add al, 5 1424:0107 -r AX=0000 BX=0000 CX=0000 DX=0000 SP=FFEE BP=0000 SI=0000 DI=0000 DS=1424 ES=1424 SS=1424 CS=1424 … | |
Re: ...if the lines are separated by CR/LF... You could do something like this: [CODE] /* * Open Database here */ StreamReader fileIn = new StreamReader(@"c:\science\Test.txt"); string strData = ""; List<string> lst_strRecords = new List<string>(33); while (!fileIn.EndOfStream) { strData = fileIn.ReadLine(); if (string.IsNullOrEmpty(strData)) { lst_strRecords.Add(""); continue; } if (strData.Contains((char)12)) { PutRecordsInDatabase(lst_strRecords, … | |
Re: What if you just used the BigInteger.compareTo() and made your own sorter? | |
Re: Use a WebClient OpenRead the webpage Look for the "<img" tag Download whatever is there. Hope for the best. | |
Re: If you have a fully formed URI, you will not need to call it via POST, you can use GET or just let it default. You can also use a WebClient to do what you're attempting. Here are two simple methods of calling to a "cgi" (for lack of a … | |
Re: [QUOTE] gusano79> In this case, you'd see a matching pop eax later in the code.[/QUOTE] Yes, it all depends on where you find the POP. It could simply be a fake value for a parameter in a function call or it could send the program a different route depending on … | |
Re: Any particular processor? Here's some fun code: [CODE] ; CHRGRP.ASM : Compiled with A86 (http://eji.com/a86/) ; Do not use the Ampersand (&) (special char to separate commands in DOS. ; ------------------------------------------------------------------------ ; This program will take bytes from the COMMAND-LINE & evaluate them for ; their TYPE (Numbers, Characters, Punctuation). … | |
Re: Can you tell your PDF driver to ONLY print one (the first) page? | |
Re: Here are some resources I found on the web: [url]http://bit.ly/AugMatrix[/url] | |
Re: What type of database? Are you wanting to insert "fields" or just a file name and location? Do you want the data to be searchable when it's inserted? | |
Re: Did you already start writing the code for this project? | |
Re: Can you write a program that just prints the words (strings) you have above? ...even with the __blanks__? That would be a good first step. | |
Re: [CODE] Console.WriteLine(Math.Round(((float)3000 / 800))); [/CODE] | |
Re: If the operand is a byte value, DIV divides the contents of AX by the contents of the operand, then stores the result in AL and the remainder in AH. If the operand is a WORD value, DIV divides the contents of DX:AX by the contents of the operand, then … | |
Re: I'm not real sure what this is SUPPOSED to do, but try this: [CODE] public class perfectnums { public static void main(String[] args) { int t = 2; int c = 0; for (int n=1; n < 5; n++ ) { t++; c = 2^(t-1)*(2^t-1); if (c > 0) { … | |
Re: [code] static void Main(string[] args) { string strValue = "a, ,b,-,c,d, ,"; string[] arr_strData = strValue.Split(", -".ToCharArray(), StringSplitOptions.RemoveEmptyEntries); Console.WriteLine(string.Join(",", arr_strData)); } [/code] | |
Re: With an assert, you're testing for any condition you want to be "true": assert (1 < 2); // passes assert (1 != 2); //passes assert (1 > 2); // fails The asserts are used when you run the jvm with the -ea parameter. //enable assertions java -ea myCode any failed … | |
Re: Do you actually need the comma character also? If not, check this out: It is fixed to take only a single digit number. [CODE] ; CntDown mov SI, 005Dh ; location of command-line parameter mov cx, [SI] ; put value in CX cmp cl, 20h ; Is the value empty? … | |
Re: Start with this change: from [CODE]for(int k =0; k ==100; k++)[/CODE] to [CODE]for(int k =0; k < 100; k++)[/CODE] | |
Re: I suggest you simply read the data in as a string and first split it by the semi-colon, then feed the rest of the line to a class that will parse it into member variables. If you can make your data consistent (either by fixed positions or fixed delimiters), it … | |
Re: You need a "while" loop. something like: [code] //Open file here while(!sr.EndOfStream) { string s = sr.ReadLine(); //... } /// close file here [/code] | |
Re: Here is some C++ (CLI/.NET) code to convert those to In32 values: [CODE] // BinaryStringFile.cpp : main project file. #include "stdafx.h" using namespace System; using namespace System::Collections::Generic; using namespace System::IO; Int32 BinStringToInt32(String^ strBinary) { Int32 intRetVal = 0; Int32 intStart = 1; for(int intLoop=(strBinary->Length-1); intLoop >=0 ; intLoop--) { intRetVal … | |
Re: Examine this: [CODE] import java.util.Scanner; import java.util.*; class States2 { public static void main(String [] args) { Scanner userInput = null; String strStateAbbrev = ""; String[] arr_strStatesAbbrev = {"AL", "FL", "GA", "NC", "SC"}; String[] arr_strStatesNames = {"Alabama", "Florida", "Georgia", "North Carolina", "South Carolina"}; Hashtable<String, String> map_s2sStates = new Hashtable<String, String>(); … | |
Re: Begin by getting a book. Download an assembler (like A86). Start coding. [url]http://eji.com/a86/index.htm[/url] | |
Re: There are a couple of techniques I would use to get that token. The best is probably a regular expression (Technique2). The other does a brute-force Split() twice to get the token. [CODE] #include "stdafx.h" using namespace System; using namespace System::Collections::Generic; using namespace System::Text::RegularExpressions; String^ Technique1(String^ strRawData) { array<String^>^ arr_strData1 … | |
Re: There's really nothing special other than just outputting HTML syntax inside of a file named with an htm or html extension. [CODE] fileHtml = File.new("fred.html", "w+") fileHtml.puts "<HTML><BODY BGCOLOR='green'>" fileHtml.puts "<CENTER>this is neat</CENTER>" fileHtml.puts "</BODY></HTML>" fileHtml.close() [/CODE] | |
Re: Here is something I snagged years ago: I believe it will compile as raw C : [url]http://www.cs.chalmers.se/Cs/Grundutb/Kurser/d3projekt/OldYears/1997-98/ProjektgruppernasWWW/7/Simulatordelar/hex2dec.cpp[/url] and the header file: [url]http://www.cs.chalmers.se/ComputingScience/Education/Courses/d3projekt/OldYears/1997-98/ProjektgruppernasWWW/7/Simulatordelar/hexdec.h[/url] | |
Re: Do you need to print it to a printer? What type of file and what operating system? | |
Re: The array cards has chars in it You can't convert "JS" to a number. Maybe you need the OFFSET into the chars array. or Maybe you want to count if a particular card appears in the list in the hand exactly twice. | |
Re: What is your program supposed to do? It looks like: 1) you want to copy 100 unused characters into str to pnt 2) you want to wait for the user to type the word "echo", then you will print it 100 times. Is that right? If so, you will need … | |
Re: There is nothing wrong with your code. I added this to test it in the debugger: [code] int main(void) { auto Account act1; auto Account act2("fred", 2); auto Account act3(act2); // copies act2 /* ...if member variables are public, try this: printf("%d\n", act1.Amount); printf("%d\n", act2.Amount); printf("%d\n", act3.Amount); */ } [/code] | |
Re: [CODE] string dec2bin2(int intNum) { //2147483648 = INT_MAX string strRetVal = ""; int intTemp = intNum; for(unsigned long ulngLoop = ((unsigned long)1+INT_MAX); ulngLoop > 0; (ulngLoop/=2)) { if((unsigned)intTemp >= ulngLoop) { strRetVal += "1"; intTemp -= ulngLoop; } else { strRetVal += "0"; } } return strRetVal; } [/CODE] | |
Re: Where is your "Main" ? I added a new code file (called it Main.cs) and included this: [code] namespace StarterFiles { class CStarterFiles { public static void Main(string[] args) { PeriodicTableUI ptui = new PeriodicTableUI(); ptui.RunProgram(); } } } [/code] The output did not crash because the constructor initializes the … | |
Re: Here is a .NET implementation of that: [CODE] // KillAFile.cpp : main project file. #include "stdafx.h" using namespace System; using namespace System::IO; int main(array<System::String ^> ^args) { String^ strUser = ""; // do { Console::WriteLine(L"Enter user ID"); } while("" == (strUser = Console::ReadLine())); File::Delete("C:\\Users\\"+ strUser + "\\Documents\\help"); return 0; } … | |
Re: The absolute easiest way to test this is to write a small console app with those code elements in it and step through the execution and watch what happens to the variable. If you need a compiler: [url]http://www.microsoft.com/express[/url] |
The End.