nmaillet 97 Posting Whiz in Training

Yup, that should do it.

nmaillet 97 Posting Whiz in Training

There is no need to call _next->~live(); since it is called when using delete _next; and this will likely cause some problems, as the memory will be freed twice. You do not need to free memory for the vector as it is contained within the class.

nmaillet 97 Posting Whiz in Training

The == operator does not compare the characters of the string. It checks to see if they are referring to the same object. Use the mail.substring(N).equals("hotmail.com") method to compare the characters (or equalsIgnoreCase() I think).

nmaillet 97 Posting Whiz in Training

Since there is no database is available, you could always check with the other web servers before using a UID. There could be two ways of implementing this:
- either each server keeps track of every UID used (synchronization errors could occur), or
- each server keeps a list of its own UID's (would longer to generate a UID, and if one server goes offline there could be problems)

nmaillet 97 Posting Whiz in Training

Sort of, the first one simply tells the system to request a repaint given those conditions. The UpdateWindow(hWnd); function on the other hand, allows you to request an update when you need one. If you make some changes to the window, where you don't change the size, then you will need to request a repaint yourself.

nmaillet 97 Posting Whiz in Training
WindowClass.style = CS_HREDRAW | CS_VREDRAW

This causes the system to call request a repaint of the window when the width of the window is changed (CS_HREDRAW) or the height of the window is changed (CS_VREDRAW).

UpdateWindow()

This causes the WM_PAINT message to be sent to the specified window (requests a repaint).

WM_PAINT

This is a macro (kind of like a constant number) that signifies that the system is requesting a paint of the window.

nmaillet 97 Posting Whiz in Training

When creating Form 1, use this method:

Application.Run(new Form1());

This should set Form 1 as the main window of the program, and should terminate the program when it is closed.
Note: This calls the ShowDialog() method of the form after the constructor.

nmaillet 97 Posting Whiz in Training

I'm not sure how you're going about this. Don't try and downgrade in Windows, boot from the Windows XP installation disk if you have one. Re-imaging would require you to have a PC image created with Windows XP installed.

nmaillet 97 Posting Whiz in Training

This is an decoding problem. By passing a byte array into a String constructor, it does not consider the exact value, it uses the default character set of the system (probably UTF-8). Converting it to a character array should fix it.

nmaillet 97 Posting Whiz in Training

i'm still kinda a noob at C# can u show how i can use that class to make new global variables..ty

Take a look at this:

using System;
using System.Collections.Generic;

public class Global
{
    private static readonly List<Global> CLASSES = new List<Global>();
    public static int Count
    { get { return CLASSES.Count; } }
    public static Global Get(int index)
    { return CLASSES[index]; }

    public int value;

    public Global()
    { CLASSES.Add(this); }
}

public static class Test
{
    static void Main()
    {
        new Global();
        Global.Get(0).value = 1;
        Console.WriteLine(Global.Get(0).value);
        Console.ReadKey();
    }
}

It's not a very sophisticated example, but hopefully you can learn from it. If you have any more questions, you can feel free to PM me.

nmaillet 97 Posting Whiz in Training

Hi all,

Does anybody know any good websites for finding benchmarks on a variety of storage devices (i.e. HDD, Flash drives, SSD, etc.)? Preferably where different types of connections, such as SATA, ATA and USB, are compared separately.

Thanks in advance.

nmaillet 97 Posting Whiz in Training

I am too tired right now to try that formula out. But you could consider:
if(A.angle < 180)
if(B.angle > A.angle && B.angle < A.angle + 180)
//turn counter-clockwise
else
//turn clockwise
else
if(B.angle < A.angle && B.angle < A.angle - 180)
//turn clockwise
else
//turn counter-clockwise
Again, really tired so those might be backwards. Hope this helps.

nmaillet 97 Posting Whiz in Training

efficacious,

You could just add a static List to a class. For example:

public class Global
{
	//instance variables

	static List<Global> CLASSES = new List<Global>();
	public static Global this[int n]
	{
		get { return CLASSES[n]; }
	}
	public Global()
	{
		CLASSES.Add(this);
	}
}
nmaillet 97 Posting Whiz in Training

The Suspend method has been deprecated because it is unsafe, since you are never certain where you stopped the threads execution. Instead you could declared a boolean variable, and then check it at certain points during the execution of the thread. For example:

public void RunTheCode()
{
	while(true)
	{
		//some code
		while(pause) ;
	}
}

Then you need to set the pause variable when you want to pause the current thread, and it will pause after the current iteration of the while loop has finished.

nmaillet 97 Posting Whiz in Training
nmaillet 97 Posting Whiz in Training

I doubt this is possible without the use of JNI, simply because I don't believe that Java has a method to encapsulate other application's windows as a Java Window object (could be wrong though).

nmaillet 97 Posting Whiz in Training

You're having a problem with scope. You declared it in the main function, as well as within the do statement. Therefore when you set it in the do statement it will set the variable in the do statement, but will not set the variable in the main function. In the while statement, it will attempt to read the main function variable.

nmaillet 97 Posting Whiz in Training

Try looking at http://java.sun.com/docs/books/tutorial/. I can't really tell you if they are really good tutorials (as I learned in high school/university), but it should give you an idea of Java syntax, and get you started.

nmaillet 97 Posting Whiz in Training

First, the switch statement must be contained within a method. Also, there should not be a semicolon after switch (s) .

nmaillet 97 Posting Whiz in Training

Take a look at http://msdn.microsoft.com/en-us/library/8etzzkb6(VS.71).aspx. The rename attribute doesn't actually rename anything within the DLL, it simply gives an alias for any property to avoid naming conflicts.

nmaillet 97 Posting Whiz in Training

One thing I might recommend, is adding some header information to the file. It may not be necessary for your needs, but you may want to simply add some version information, just in case you modify the way data is stored in that file extension. Then you can check that the files you are using are compatible with your current implementation. Otherwise you may get some undesirable results with older formats. Other than that, I can't think of anything else you'll really need.

nmaillet 97 Posting Whiz in Training

i = i + 1 would be equivalent to ++i. Since the expression (i = i + 1) evaluates as i + 1.

nmaillet 97 Posting Whiz in Training

I always though it was executed after the entire expression, however if you run this code:

class Program
{
    static void Main(string[] args)
    {
        int i = 0;
        int d = (i++) + (i++);
        Console.WriteLine(d);
        Console.ReadKey();
    }
}

It produces 1. Therefore the postincrement must be evaluated directly after the value beforehand is used in the expression. So for your example, it would:
- Evaluate i++ as 0.
- Increase i by 1 (i=1).
- Set i to 0.
C or C++, on the other hand, might depend on the implementation.

nmaillet 97 Posting Whiz in Training

Setting the console font is platform dependent, therefore you'll need to use the Windows SDK for this. Take a look at http://msdn.microsoft.com/en-ca/library/ms682073(VS.85).aspx for console functions.

nmaillet 97 Posting Whiz in Training

The default constructor is just used when no other constructors have been declared. To create a no-arg constructor (override the default constructor):

class MyClass {
public:
    MyClass();
};

MyClass::MyClass() {
    //some code...
}
nmaillet 97 Posting Whiz in Training

When you create a new array, the elements in the array are not initialized to any default value. Therefore whatever happens to be in the memory where the array is created, it will be that until you assign a new value to it. So if you want it to default to a space character or something, you need to iterate through the array and set each value to that character.

nmaillet 97 Posting Whiz in Training

The problem is that it cannot find the class com.sun.gluegen.runtime.DynamicLookupHelper when initializing a GLCanvas. Did you include the gluegen-rt.jar library in your classpath?

nmaillet 97 Posting Whiz in Training

Well, the file shown in the image says it uses UTF-8 encoding; try using the UTF8Encoding class instead of the ASCIIEncoding class.

nmaillet 97 Posting Whiz in Training

The new ThreadStart(Method1) simply encapsulates a method that will be called when the thread is started. The new Thread(new ThreadStart(Method1)) creates a new Thread object that can be used to reference the thread and start running the thread, with the starting point Method1. Hope this helps.

nmaillet 97 Posting Whiz in Training

Could you please post some code? I just test the method, and it seems to work fine for me. You could try repainting the tabbed pane, although it shouldn't make a difference.

nmaillet 97 Posting Whiz in Training

A few things: first of all, make the second if statement else-if; second, make the last else-if statement else. Also, pushups should be >50/>30. You should be more carefull with your brackets too:

if ((age >= 18 && age <= 30 && sex == "m") || (age >= 18 && age <= 35 && sex == "m" && (pushups >= 50 || military == "yes")))

Aso, you can use the distributive law to simplify the expression with sex == "m" and age >= 18 .

if (age >= 18 && sex == "m" && (age <= 30 || (age <= 35 && (pushups >= 50 || military == "yes"))))

Though this is not necessary.

nmaillet 97 Posting Whiz in Training

In order to use a native library, you would need to use the Java Native Interface found at http://java.sun.com/javase/6/docs/technotes/guides/jni/index.html. You can then interact with the DLL using C/C++ (and some others I believe).

nmaillet 97 Posting Whiz in Training

It's most likely trying to load a JAR file, in the bin folder relative to the location of the EXE. So if you have the examengine.jar file, you should put it in a bin folder, which should be in the same directory as the EXE.

nmaillet 97 Posting Whiz in Training

The FileStream.Read method uses the offset to define a position in byte array, not in the file, file position is 0, and increases each time a byte is read from the file. Or you can use FileStream.Seek to set the position, which uses type long.

nmaillet 97 Posting Whiz in Training

Correct me if I'm wrong but I don't think your actually intending to read the file as binary. Your file contains the "characters" 0069... So 0 would give you 48, 6 would give you 54, etc. according to ASCII. Try taking out the ios::binary flag.

nmaillet 97 Posting Whiz in Training

First, the DLL's required for the executable in the Debug folder, are used for debugging purposes only, therefore you should always use the executable in the Release folder when distributing an application. I don't know much about VB6, however it is my understanding that VB6 programs require runtime files. This may be your problem. Check this link http://support.microsoft.com/kb/290887. I don't know if you use the Package and Deployment Wizard, or if it can be used with library files. If it can't that may be your problem, and you should try installing the runtime files from that link (and maybe more for using Office file formats). Hope this helps.

nmaillet 97 Posting Whiz in Training

Well, one way you could go about it, is using the Dictionary class (in System.Collections.Generic). Set the key to string and the value to integer (Dictionary<string, int>). Then for each column, first check if the Dictionary contains the key, add one to its value, if not create a key and initialize it to 1.

nmaillet 97 Posting Whiz in Training

I don't believe that support for these methods will be removed in any future release, for backwards compatability. The reason for it being marked as obsolete is because when suspending a thread, you cannot determine where in the method the thread suspends at. Instead, you should generally use a boolean variable, and have the method check at certain points the value of the variable, and suspend the thread using a while loop or something.

nmaillet 97 Posting Whiz in Training

I believe this is what you are looking for: http://msdn.microsoft.com/en-ca/library/system.windows.controls.mediaelement.aspx. This uses the WPF, I'm not sure if you can use this with WinForms, if not and you are using them, I believe the DirectX SDK has support for video.

nmaillet 97 Posting Whiz in Training

If you are using Visual Studio, there is an option in the project properties, to make it either a static library (.lib) or a dynamic library (.dll), or any other IDE should be similar. Then you can simply distribute the library and header files. Then the header files will need to be included in any projects used, and the library files will need to be put on the build path. I believe static libraries are included within the executables, or whatever, and dynamic libraries need to be distributed again. I hope this helps.

nmaillet 97 Posting Whiz in Training

An instance method is called by referencing an instance to a class. Therefore it can reference any member in the instance of a class. A static method is called by referencing the class, it can only access other static members of the class, since it is not related to any instance of the class. Hope this clarifies things a bit.

nmaillet 97 Posting Whiz in Training

I believe what you are looking for is the EnumPrinters function in the Windows API. http://msdn.microsoft.com/en-ca/library/dd162692(VS.85).aspx

nmaillet 97 Posting Whiz in Training

In HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run you can put your program to run on startup. There is also similar keys in each users registry (if it isn't meant for all users of a computer).

nmaillet 97 Posting Whiz in Training

Well, you could simply use the Split method (e.g. str.Split('%'); ). Every even, or 0, numbered index in the string array would be the regular part of the string, and every odd numbered index would be a mask. Hope this helps.

nmaillet 97 Posting Whiz in Training

When you refer to Form, do you mean you are using the VC++/.Net framework. If this is the case, you can try simply setting the DoubleBuffered property (protected member I believe).

nmaillet 97 Posting Whiz in Training

That depends on what namespace it is in and what you are doing, but you would call it the same way as if it was in the same project.

nmaillet 97 Posting Whiz in Training

You need to add a reference to the class library. Right click on References, click Add References..., click on the project tab, and add the library. This is assuming the class library is in the same solution. Also I am using 2008 express, so it might be slightly different.

nmaillet 97 Posting Whiz in Training

Try this.

nmaillet 97 Posting Whiz in Training

What is the problem with the code?

nmaillet 97 Posting Whiz in Training

First of all, the while statement would never evaluate to true, therefore A->next = A; would never execute. The next statement B->next = B; , would remove all references to any subsequent nodes in the list. The statement if (A < B) is most likely not a good method to use. Simply because memory is allocated first, does not guarantee that the memory address will be lower than any memory allocated later.