1,443 Posted Topics
Re: If you brute-force convert the bytes to a BYTE[], what happens? [CODE] // ByteArrayTest.cpp : main project file. #include "stdafx.h" #include <afx.h> using namespace System; array<Byte>^ GetBytes(String^ str) { array<Byte>^ arr = gcnew array<Byte>(str->Length); for(int i=0; i< arr->Length; i++) { arr[i] = str[i]; } return arr; } void ProcessBytes(BYTE* byt, … | |
Re: 1) Create a setPosition method that has a parameter of an Employee object and parameters of the new values. | |
Re: Are you attempting to sign some code? Are you attempting to use a signed assembly that you have not trusted? | |
Re: What are you going to do with it when you convert it? Are you just trying to add it to a panel or something? | |
Re: [QUOTE=james6754;1698358]silly thing...does anyone else have this problem?[/QUOTE] In older versions I found that I needed to leave a blank line underneath the last closing brace or it would not compile. So, is it fixed? Do I need to make some sample code? :) | |
Re: When do you put a value in x? ...and is x supposed to be an array of three integers? | |
| |
Re: What is the color of the actual font? | |
Re: 1) Make a backup copy of your program. 2) Change the word "struct" to the word "class" 3) Attempt to compile. Once the errors are fixed, you will understand. | |
Re: You never set a value for the "temps" that is in main() before it is passed to DisplayTotals() | |
Re: Are the parameters for your connection string correct? Are you using a SqlConnectionStringBuilder? | |
Re: Well, with no code, how do we know where to offer help? | |
Re: If the arrays are the same size and sorted the same way, you can just associate them by their position 0-51 or 1-52. If they are always to be "together", you might as well create a class that contains the value and the image. | |
Re: [url]http://www.java2s.com/Code/JavaAPI/javax.swing/JButtonaddActionListenerActionListeneract.htm[/url] You should put the button listener in a new module (maybe called ButtonListener) that will hold and respond to your actions: [CODE] import java.awt.event.ActionEvent; import java.awt.event.ActionListener; public class ButtonListener implements ActionListener { ButtonListener() { } public void actionPerformed(ActionEvent e) { if (e.getActionCommand().equals("Login")) { System.out.println("User Clicked Login"); } if (e.getActionCommand().equals("Register")) … | |
Re: Well, you can encrypt the transactions with something like PGP. PGP has an API you can purchase. [url]http://www.symantec.com/business/netshare[/url] You can also use digital certificates on your server and require a certificate from your clients Here is an article on PKI [url]http://www.itechtalk.com/thread1656.html[/url] | |
Re: Start with something like this: [CODE] // DW_396087.h #pragma once using namespace System; namespace DW_396087 { public ref class WebSite { public: WebSite(void); WebSite(String^ domainName, String^ localPath); bool operator < (WebSite); String^ name; String^ path; }; } [/CODE] //...and the body... [CODE] #include "stdafx.h" #include "DW_396087.h" using namespace System; namespace … | |
Re: If you are planning to return the eventID and the eventDesc as an EventEntity, you will need to new them as an EventEntity. Something like (JUST GUESSING): [CODE] public List<EventEntity> GetDetails(string uid) { EventDBModelDataContext ct = new EventDBModelDataContext(); List<EventEntity> detail = ct.EventEntities.Where(d => d.eventID.Equals(uid)) .Select(d => new EventEntity(){ eventID=d.eventID, eventDesc=d.eventDesc … | |
Re: Cool. Be sure to mark things like this as a code snippet next time. | |
Re: Can you use the + operator? [CODE] public class StringThing { public static void main(String[] args) { String strOne = "hey"; String strTwo = "there"; String strThree = strOne + ", " + strTwo; System.out.println(strThree); } } [/CODE] | |
Re: One way is to modify the constructor for Form2 to contain a string parameter, so when it is instantiated, it will receive the string. [CODE] static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new Form1()); Application.Run(new Form2(Form1.strTransfer)); // <<<--- } [/CODE] | |
Re: Without "fixing" any of the code, I modified it enough to compile. [CODE] /////////////////////////////////////////////////////////// import java.io.*; import java.util.*; public class Main { public static void main(String arg[]) { int n[] = new int [10]; String fileName = "RandomNumbers.txt"; PrintWriter outputStream = null; Scanner inputStream = null; try { outputStream = … | |
Re: Can you just do all splits simultaneously when you ReadToEnd() ? [CODE] using System; using System.IO; namespace DW_396057 { class Program { static void Main(string[] args) { StreamReader fileIn = new StreamReader("c:/science/TomDigs.txt"); string[] arr_strData = fileIn.ReadToEnd().Split("\n\r,\t".ToCharArray(), StringSplitOptions.RemoveEmptyEntries); fileIn.Close(); } } } [/CODE] | |
Re: Starting with this: [url]http://docs.oracle.com/javase/1.5.0/docs/api/java/util/ArrayList.html[/url] and a sample that looks like this: [CODE] import java.util.*; public class TestArrayList { public static void main(String[] args) { ArrayList<Integer> arr_int1 = new ArrayList<Integer>(); arr_int1.add(1); ArrayList<Integer> arr_int2 = new ArrayList<Integer>(); arr_int2.add(50); arr_int2.add(75); ArrayList<Integer> arr_int3 = new ArrayList<Integer>(); arr_int3.addAll(arr_int1); arr_int3.addAll(arr_int2); System.out.println(arr_int3.size() + "\n==="); for(int i=0; i … | |
| |
Re: Maybe something like this. You'll probably have to fix the "press any key" thing. [CODE] #include "stdafx.h" #include<stdio.h> #include<conio.h> int main(void) { int DONE = 0; int grade = 0; //user input grade int n = 0; //loop controller int sum = 0; float average = 0.0; //calculated student average … | |
Re: That one was hard to see! [CODE] using System.Collections.Generic; using System.Collections.ObjectModel; namespace BookStore.Helper { public static class ExtensionMethods { public static ObservableCollection<T> ToObservableCollection<T>(this IEnumerable<T> source) { ObservableCollection<T> target = new ObservableCollection<T>(); foreach (T item in source) target.Add(item); return target; } } } [/CODE] | |
Re: I'm looking at line 81 with the uninitialized variable 'd' that is used in division. Is there something special about that? | |
Re: Of course, you can also read from tables and write to tables using SqlDataReader and SqlCommand without ever dealing with DataTables and DataSets. | |
Re: Are you familiar with LINQ? | |
Re: using namespace System::Collections::Generic, you can use a List<String^>^ It has a Sort method built in. | |
Re: Convert the user input to upper-case, then compare it to upper-case 'N'. | |
Re: [If you have an option] I would not suggest converting this to Linq-to-SQL if you are new to Linq. If this is for class, I want to be in that class because it's cool! | |
Re: That really depends on if you want the hex value or a string representation: This one gets the text value that can be converted to a byte (if necessary); Pardon the weird labels. [CODE] ; Compiled with A86 (http://eji.com/a86/) ; This program shows how to get user input with echo. … | |
Re: [CODE] char seating[seating = new int(50)]; //should be char seating[] = new char[50]; [/CODE] You could really create a "level" class that has a particular number of seats and can be asked if it is full. You can then make the Ferry have a collection of Levels. | |
Re: If the old code has ANY C++ (or MFC in it) and if you don't need to change how the program works, just compile the old source code with the new compiler. Of course, you will need to change all .c file extensions to .cpp and make a few adjustments. … | |
Re: I ALSO learned it by just hacking (at first) and watching others code in videos on [URL="http://dnrtv.com/"]DNRTV[/URL]. I knew C++ and a little Java, so that really helped in understanding. | |
Re: Yes, you're on the right track. Just write it and you'll see. | |
Re: I write and work on console apps EVERY day. I usually use C#, now, but 99% of server-side code is not graphical. Even if you are working on a GUI, you can still do it in C++. Even if you are working with web output, your modules can still be … | |
Re: Does it throw an exception on the FIRST loop? If you take out that <= and just make it <, does that solve the problem (as it would be looping 1 too many times)? | |
Re: Are you saying you want to have multiple CD objects? Use a list or an array (rather than a number) [CODE] List<CD> lstCD = new List<CD)(); ...then reference it with a ForEach or by its position. [/CODE] When you add a new CD, the count will auto increment. | |
Re: Read the user input as a string. Convert the string to an integer Start your loop at the top number and "decrement" the loop. | |
Re: You can use printf() or cout with formatting to print a format like that. As a matter of fact, you can do it a multitude of ways, but I'd stick with printf or cout. You can choose use spaces or tabs for your layout depending on how much of the … | |
Re: A static library is the opposite of a DLL (dynamic link library). They mean you can add their library to your linker step. That way, it will resolve the main/WinMain problem that may have been created by the project type you used for your application. The static library will usually … | |
Re: You can fix your class so that you don't pass it back to itself to make transactions. Remove the class parameter of the deposit method and have the class modify its own balance directly. | |
Re: You can also try the WebClient DownloadFile() method. If you're going to use this functionality a lot, you could just compile it into a DLL and link it into your other projects when needed. | |
Re: I would also test for the "*" on the next line and break out of the loop if found. | |
Re: First don't make a string[]. Just use a string. OR compare it to words[0]; | |
Re: Have you written any part of it, yet? |
The End.