Bench 212 Posting Pro

It sounds as if your server and router are on different IP networks or subnetworks.

What are the IP addresses of your Server, your router, and your PC?

What IP Address do you get when you obtain an IP Address automatically?

to find this information, type ipconfig /all in the command prompt.

Bench 212 Posting Pro

Take a look at this file I/O tutorial -
http://www.cprogramming.com/tutorial/cfileio.html

Bench 212 Posting Pro

Why are you using a keygen when you've bought the software?

You should contact the people who created the software, perhaps they will provide you with an activation code.

Computers come with all sorts of different codes & serial numbers for the individual hardware and software components, but fitting these components together doesn't give you some sort of magical code for your whole computer - that just doesn't exist. Perhaps you're after the product key or OEM number which comes with Windows (should be printed on the CD Case of your windows CD, or in the form of a sticky label)

Bench 212 Posting Pro

That's a totally nonsensical question, what are you trying to do? Machine code is the very low-level instruction set that your computer's processor uses.
Are you looking to learn how to program in an assembly language?

Bench 212 Posting Pro

So, is the wireless connection working?

have a look here for more info
http://practicallynetworked.com/sharing/

Bench 212 Posting Pro

Why don't you just import the accounts over to one machine? This will save you alot of hassle, and you'll get to keep your contact lists, saved emails, etc. Since I don't use outlook, I don't know the exact procedure to do this on outlook (But its very easy on Thunderbird)

Bench 212 Posting Pro

Not seeing anything wrong in device manager doesn't necessarily mean you have the correct driver, it just means that windows can't see any problems (This is often the case when windows installs some generic driver from its own database) - have you attempted to install the latest driver from Abit's website? (Making sure all traces of the old drivers are gone before you install the new one)

Edit : You should also check the speed & duplex settings in the NIC's Advanced properties are set to Autonegotiate

Bench 212 Posting Pro

Did you try this? - HP Support FAQ

The problem listed sounds somewhat similar to the one you described

Bench 212 Posting Pro

Right I made a Crossover cable plugged it in (this time I placed all the PCs on the switch rather then some on the router and some on the switch). Now it seems that the network is available i.e can browse My Network Places but the internet is what seems to time out.

On one of the PCs I was browsing normally whilst on another one there was no internet whatsoever.

Well, that's a good start I suppose - We can be 99% certain that the switch isn't at fault.

Isn't there suppose to be a uplink port on the switch? On this particular one it doesn't actually specify which port to plug it in to. Just for safe keeping I plugged the crossover cable into Port 1.

Thanks for your patience :)

Some switches do have uplink ports - but the fact you can connect to the internet on even one machine through the switch (And can connect to other workstations on the switch) means that's not the cause of the problem (The switch is doing everything it needs to do - relaying ethernet frames between its interfaces)

Are you able to ping the router's IP address from all the workstations on the switch? and are you able to connect to the router's web interface (or telnet) from each workstation?

If you can connect to the router's web interface from any workstation, that means the physical and logical connections from that workstations to the router are …

Bench 212 Posting Pro

Out of curiousity, what happens to the 3Com switch portion of your network when the connection to the router is removed completely? do the workstations on that switch communicate to each another without timing out?

Your router's ethernet ports will be using the same pin layout as the switch's ethernet ports, and a straight-through cable just isn't appropriate for connecting two matching devices together - the transmit (Tx) pins of both devices will be firing data at each another, leaving the Recieve (Rx) pins idle. A Crossover cable swaps these pins at either end (Hence the name cross-over :) ). Exactly the same rule applies when connecting two workstations together with a single cable, too.

If, as you say, the lights are on when the cable is connected, then I suspect both devices are confused by being able to detect the presense of another device, but unable to autonegotiate with each another. If each segment of the network works independently without the two devices connected, then its almost certainly the cable.

Bench 212 Posting Pro

Well, a bitwise AND operation is performed using the '&' operator between two numbers
eg,

int n = 6 & 12;
// 0000 0110
// &
// 0000 1100

'n' will be 4

You'll need to know about Bitwise operations - (Binary arithmetic)
http://en.wikipedia.org/wiki/Bitwise_operation

In C++, the <bitset> library may come in useful.

have a look here for a 2-to-4 decoder
http://en.wikipedia.org/wiki/Image:Decoder_Example.svg

Bench 212 Posting Pro

What sort of ethernet cable did you use to connect the switch to the router? did you use a crossover or a straight-through?

Do the four ethernet ports on your router allow the router to act as a switch? (In other words, are the workstations who plug directly into the router all on the same network? - I'll assume so, since most home routers seem to work this way)

Usually, this sort of switch-to-switch connection requires a crossover cable, unless the 3Com switch has a specific router uplink port.
(In which case, I'd suggest you connect the router to one of the switch's workstation ports using a crossover cable - using the uplink port on a switch to another switch is always a bad idea)

Bench 212 Posting Pro

Would anyone know the command to block tcp/ip traffic through a port, ie port 1863 on a cisco 1601 ?

Which interface? (ethernet? serial?) .... and which direction? (Inbound/outbound)

For cisco routers, you usually need to set up an Extended Access Control List (ACL) to block specific ports. Then you need to apply them on a per-interface-per-direction basis


eg, (Not tested, but should work) If I were to block all TCP traffic inbound from connections on a serial interface (say, S0/0 for example) for port 1863, I would use the following -

Router> enable
Router# conf term
Router(config)# access-list 101 deny tcp any any eq 1863
Router(config)# access-list 101 permit ip any any
Router(config)# int s0/0
Router(config-if)# ip access-group 101 in
Router(config-if)# exit
Router(config)# exit
Router# show run

Note - only do this if there are no access lists already set up for that particular interface in that direction - and ensure that you've not already got an access list 101 (Extended access lists must be in the range 101-199 - so just use a different number)

Bench 212 Posting Pro

thanks a lot for your response. I was about edit my post. Actually I have vector of container class pointers ( eg: vector<container* > ops; ) . So I guess I can make those pointers to point to non-homogenous objects. All Iam saying is that since vector stl requires the objects to be homogeneous I will have container class pointers as the type for vector and then I would use them to create non-homogenous user-defined class objects. Also I have trouble figuring out how to build the class container ??
I hope i made some sense.
thanks
kiran

The vector isn't actually storing the objects, its only storing pointers to them - as long as your 'container' class (The base class, or interface class) has some virtual functions, you can use polymorphism to access the overridden functions in the derived class objects.

Bench 212 Posting Pro

thanks, I found the dll that was missing; I add it and it worked.:cheesy:

but I won't always know what dll is missing ahead, so is there a way to create a setup that will include everything needed? without needing to go back and forth until the problem is understood and the solution is found?

None that I can think of. I'd guess the reason goes back to my example of DirectX - neither the compiler nor the IDE can make any assumptions about the target machine - so thats left up to the developer to know what external files the program is using (And to specify minimum system requirements if necessary - eg, some DLLs may only be available under NT/2K/XP/etc ).

There's probably an issue of licensing too - If you ended up using half the DLLs from Windows, then you'd probably not be (legally) allowed to redistribute Microsoft's own content with your installers.

Bench 212 Posting Pro

What's the name of the DLL? That might be a help..

Chances are its not just one DLL thats missing, but a whole package. For example, if you used Direct3D in your program, and attempted to run the program on a computer without DirectX installed, you'd probably get an error that there's a missing DLL, wheras in fact, DirectX has a whole bunch of DLLs (among other things).

In this case, you couldn't simply get away with bundling your program with some DLL files taken from DirectX, you'd need to supply the whole DirectX package, and insist that the user installs it (This is what most games do).

Whichever file is missing, I doubt that its anything specific to the development environment, its more likely to be some windows package or driver thats missing on your target system.

Bench 212 Posting Pro

It may help if you elaborate on "Doesn't work on a non-development PC" ... What sort of error did you get when you tried to run it? (Assuming you got an error)

What kind of app did you create in VS2005? - Was it a Win32 console app, or something else?

Did you use anything from any DLL's (Or maybe included headers from some Windows-specific APIs)? and did you compile it in Release Mode (rather than debug mode)?

Bench 212 Posting Pro

thanks for your answer.
i wanted to know, do we have any conversion function in C to convert ascii to long double as the same way we do for atof()?

You've already been shown how to do it in both C and C++ - whats wrong with those methods?

Bench 212 Posting Pro

edit - deleted, got it wrong.

Bench 212 Posting Pro

Don't know why all foreigners dislike being addressed as Mister. This is what we are taught in our country to give utmost respect to everyone.;)

Saying Mister is not an indication of you going old or being superior to someone. For me its always being "what goes around comes around".

But still if you don't like it, I will try to refrain from saying it the next time, though there are no guarantees...;)

Well, I guess kids these days don't get taught any respect! ;)

Actually, its used the same way over here - although usually only on really formal occasions (Such as in a courtroom, an interview, or in a formal letter). most of the time we're all just too lazy for all that!

Bench 212 Posting Pro

I'm no expert with scanners/printers/etc, but do you mean you reinstalled the HP software? or the java platform? (Is this even a software development problem?)

It may be worthwhile making sure you have the latest versions of both.

Official java website - http://java.sun.com
Hewlett Packard = http://www.hp.com

Failing that, I would contact HP's technical support.

Bench 212 Posting Pro

Interesting.... And after all these years, too. Out of curiosity, when you go to a restaurant, when the pink & orange spike haired girl with tattoos and piercings asks for payment, do you hand your credit card to her and she disappears with it? ;)

Pink & orange spiked hair with tattoos...? What sort of restaurants do you visit? ;)

Bench 212 Posting Pro

I have to put the following block of code in a loop. It is to display a 10x10 array that will hold char values for a message encrypted in a transposition cipher.

I have not been able to figure out a loop or a system of loops that can do this. I need to do the loop for 10x10, 5x20, and 4x25, and 2x50. The snippet below is for 10x10, but if I can figure out how to do it for 10x10, I imagine it should be easy to do the other array dimensions too.

Have a close look at the repeated patterns in that code you've just pasted.

Remember that a 'for' loop is for repetition. Any code inside that loop is typically repeated a set number of times.
Try creating a for-loop that counts from 0 to 9 ..... (It will repeat 10 times)
- How would you repeat that for-loop, so that the loop itself gets executed 10 times..?

Bench 212 Posting Pro

most nobs would be lost witha book by say, oriely or mspress so its a good idea to get them interested with something like sams or for dummies then step them up when they have a basic understanding

That doesn't necessarily say anything about "for dummies" or "sams teach yourself XXX" books, moreover, it highlights that O'Reilly and MSPress maybe haven't got a great selection of C++ books.

IMHO, the publisher who seem to attract the best C++ authors is Addison-Wesley Professional. Books such as those in the C++ In Depth series, edited by Bjarne Stroustrup, as well as The C++ Standard Library (Josuttis), C++ Primer (Lajoe, Lippman), and The Complete C++ Programming Language (Stroustrup).

Not to say that AWP doesn't publish plenty of terrible books too (As i'm sure they do), but I'd wager that they publish most of what are considered to be the 'best of breed' books.

Bench 212 Posting Pro

I think that was more of an awful copy and paste job than a part of the problem description. ;)

Heh, quite possibly ;) its hard to tell with some people :)

Bench 212 Posting Pro

It's called a quine. They're completely harmless diversions.

If I understand the OP's intentions correctly, its not just a quine - the description looks to me as if it would be an infinite recursive loop, that would increasingly swallow more and more memory & HD space :

This source code, in turn, should compile and print out itself. turn, should compile and print out itself.

Bench 212 Posting Pro

it could be correct if b and d were both of type int* - but since the OP's assignment doesn't say otherwise, a safe assumption is that these are just plain old numbers (or perhaps literals)

Bench 212 Posting Pro

Write a program that, when run, will print out its source code. This source code, inWrite a program that, when run, will print out its source code. This source code, in turn, should compile and print out itself. turn, should compile and print out itself. :p

Sounds like a virus to me... You won't find anyone to help you out with that here.

Bench 212 Posting Pro

I disagree with the timeframe, but not the concept. Start with a higher level language like C/C++. Once you get a good grasp of programming concepts, then take assembler to see what's under the hood. Trying to learn the terse programming of assembler while trying to understand the concepts of programming in general is just too much IMO.

I agree with that. Another poind i'd like to add is that alot of people only pick up a programming language as a passing interest, or maybe study it as part of a non-technical course. IMHO, there'd be little point in working at such a low level for someone whose main focus is elsewhere (such as website design, or business-IT)

Bench 212 Posting Pro

Rather than sharing an entire drive or partition, perhaps you could just share a folder? To partition the drive you generally need to reformat the whole thing, and reinstall Windows from scratch, unless you buy a copy of Partition Magic (or some similar program).

Bench 212 Posting Pro

Every motherboard is different, but this is almost certainly something you should be able to disable in the BIOS. Check your motherboard manual, or the motherboard manufacturer's website, and it should tell you how to change it.

Bench 212 Posting Pro

If they're both connecting to the router, then there's nothing wrong with the network - you need to configure both machines with File & Print sharing, and enable NetBIOS over TCP/IP.

look in the properties for the network connection on both machines, and make sure File & Print sharing is installed. Then look at the advanced TCP/IP Properties, and ensure that NetBIOS is enabled.

Bench 212 Posting Pro

That's odd - if intellisense is telling you that there's no information available, that suggests its not been disabled (I'm not even sure if you can disable it anyway) I'd suspect either a bug in MSVC++, or something has gone wrong with intellisense's lookup (maybe its database has gotten corrupted somehow?)

Sometimes in MSVC++ 2003 it gets confused by template template types (Especially if you manage to make a typo), and that can cause it to stop working, but usually only temporarily.

Maybe it would be worth creating a whole new Win32 Console project, just in case something 'weird' has happened to your current one. Try writing a 'hello world' app or something simple just to see if it works in there.

JoBe commented: Very helpfull +3
Bench 212 Posting Pro

I assume the feature you're talking about is MSVC++'s IntelliSense. You should be able to show the list by pressing CTRL+J after the scope operator for classes/namespaces, or the period operator for objects.


Note - This works in MSVC++ .NET 2003 SE. If it doesn't work for your version, check Microsoft's site for IntelliSense.

Bench 212 Posting Pro

The compilers might let it slide, but the language standard says it's undefined behaviour. That's legalese for 'not allowed'. ;)

In which case I stand corrected :) I haven't got access to a copy of the standard right now - although i'm somewhat surprised that Comeau allowed that through without even throwing a warning.

Bench 212 Posting Pro

The class is fine (And data members should always be private unless you have a compelling reason to do otherwise. since that stops them being accidentally modified by external objects or functions ).

Perhaps you could find other ways to use your point objects which don't involve getX() and getY() - for example, where you need to compare two different points, maybe you could provide your point class with an is_equal() function, which accepts a point object, and returns a true/false value depending whether the coordinates match.

You could also add a function which acccepts a point object as input, and calculates the scalar distance from that point.

Bench 212 Posting Pro

It's also not allowed. The language standard doesn't let you redefine keywords.

Actually, I don't think there's anything which stops it. Consider the following code

#undef private
#define private public

int main()
{
}

On at least 2 different compilers in strict mode, this compiles without error nor warnings.

Although i still think its a very bad idea. And, as you correctly mention, this doesn't change the fact that a class defaults all its members to private.


for the OP - Re-read the requirements of your problem. It sounds to me as if you've probably misinterpreted it.

Bench 212 Posting Pro

Is there a way to start program not via dos? Im writng a shell script after all...it's kind of cheating...

DOS has nothing to do with it. Nor does the 'command prompt' which is often incorrectly referred to as 'DOS' :)

What you're doing by calling system() is using the OS's command interpreter (Windows Command prompt is merely a commandline interface for the Windows command interpreter). The Windows command interpreter does exactly the same thing regardless of whether you're calling from Command prompt, from a C++ program, from the "run" box in the start menu, from a shortcut icon on the desktop.......

There's probably another way to do what you want which doesn't involve the OS's command interpreter, but for that you'll have to find some library with your compiler, or search around for some API which directly interacts with the OS, and bypasses the command interpreter altogether. If you want the easy option, use the system() function :)

Bench 212 Posting Pro

Bearing in mind that if this is a console application, there's a finite number of characters for any given line which you can output without the code spilling over to the next line, and completely ruining your formatting anyway.
Therefore, it may be simplest to put in an upper limit to the number of lines the program can produce, given the constraints of your environment.

The number of digits/characters that each number has will increase as you get further down the triangle, so you need to take that into account when working out the spacing between each character.

Bench 212 Posting Pro

Thats because the forward slash is actually not required for the purpose you are trying to achieve. You can do system( "dir c:" ) and get the same results.

That was a bad example. dir C:/WinNT might be a better one :)

Bench 212 Posting Pro

my command prompt in Win2K doesn't like forward-slashes when used with commands (such as ' dir c:/ ' - the command complains that i'm using an invalid switch ). Although its ok when specifying the path of an executable - eg ' c:/winnt/explorer.exe '

Bench 212 Posting Pro

C++ can do anything which you could do from the command prompt, using the system() function - eg, (Assuming some version of DOS or Windows)

system("dir"); //DOS Command to show a directory listing
system("pause");  //DOS command to make a pause happen
Bench 212 Posting Pro

In order to parse the string properly, you need to have some way to identify where each record begins and ends. You could do this by adding some kind of delimiter character (One which won't be used in any other part of the string), eg, using a delimiter of '$'

char Ambiglist[] = "STEPHEN COMPANY LTD;TN25 8a7$JOHN JACKSON LTD;98asHHS$HUMBURG LTD;8JSHAKS$";

Then you can search through the string to find the position of the end of the first record/beginning of the second record, and extract this to a new string - repeat until you've seperated each record from the string.

Bench 212 Posting Pro

Your random_shuffle() uses rand() to generate the shuffle and rand() is always seeded by default to 1. You can just change the seed each time and get something different.

Edit - sorry, I misunderstood your post

Be careful with how you phrase that bit of advice. Seeding rand with time is a good idea, however, the call to srand() should only occur once - usually at the beginning of the program will do, in order to use a different seed whenever rand() is called.
Multiple calls to srand() will generally have the opposite effect

Bench 212 Posting Pro

For converting from a mark into a grade, you should look up If/Else blocks in your book.

For other parts of the program, one approach you could use may be to store a true/false value (a boolean value) for whether or not the assessment has been passed.

here's some pseudocode snippets, based on your description of the problem-


Has the student achieved the minimum for both components?

[I]assume the student has passed until we find out they've failed..[/I]
assessment passed = true;
if ( Exam mark is below the threshold OR Coursework mark is below the threshold )
    assessment passed = false
end if

Has the student passed both components and achieved 39%?

if ( assessment passed is true, AND overall mark is 39% )
   adjust overall mark to 40%
end if

Has the student achieved over 40% but failed one of the components?

if ( assessment passed is false, AND overall mark is 40% or more )
   adjust overall mark to 39% 
end if

Try implementing these in C++ - After this, you should be in a position to calculate the final grade.

The best thing you can do is have a go at it and post your code here if you get stuck.

Bench 212 Posting Pro

I didn't find the IRQs... The System information wasn't there... Is there another way?

After a quick google search, it seems that Windows XP is different. According to Microsoft's website, you can open System Information by doing the following

Start -> Run -> type msinfo32 and press enter.

Bench 212 Posting Pro

How do I change it in the BIOS then? I didn't find where you do it

the Computer Management window is merely for viewing information about the computer's hardware. Does this mean you found that your network controller is using a conflicting or shared IRQ? What was it sharing with?

the BIOS is a small bit of software embedded into a chip on your motherboard. The usual way to access your BIOS is to press the 'delete' key as soon as your computer powers up, but this depends entirely on your system. From this point, the best thing to do is read the motherboard's manual, which should contain all this information. (If you haven't got a paper copy, usually you can get a .PDF on the Asus website)

Before you dive into it, realise that the BIOS provides direct control over every bit of hardware in the computer - if you're not sure what something does, then don't change it. Unlike Windows, the BIOS doesn't protect you from changing something which shouldn't be changed.

Bench 212 Posting Pro

Which language are you learning, C or C++? (The two languages are very different) and how far have you managed to get with the problem? you're likely to get more useful feedback if you post your attempt at a solution so far.

One way to begin with a task like this is break everything down is to bite-sized pieces. Often it helps to write some kind of informal pseudocode. (If not in a text editor, then on a sheet of paper)

certain parts of the problem should be very straightforward, such as converting a number of marks out of 50 into a percentage.

Other parts of the problem, such as determining the pass/fail status of a student will need a bit more thought - and, depending how much of the language you know, there are different ways you could solve it (You probably want to break the solution down into several functions, to make life easier, and avoid repeating code).

Bench 212 Posting Pro

First of all, I suggest taking a look at the short tutorial on random numbers here - http://www.daniweb.com/tutorials/tutorial1769.html

Bench 212 Posting Pro

The easiest way is... (Note this is going by Win2K - may be slightly different under WinXP)

Go to Start -> Settings -> Control Panel

Find the icon in control panel called Administrative Tools

This will open up a new window - from here you run the tool called Computer Management

in the Computer Management window, look down the Tree (The left-hand-side) for System Information

In there, open the Hardware Resources folder, and then the IRQs sub-folder.

in the right-hand-pane, you'll get a fairly long list of devices. Look for your Ethernet Controller in that list, and see which number it uses. Then check to see whether there are any other devices in the list which are using the same IRQ number.

Note - Some devices are fine to share IRQs, and you will almost certainly have a few devices which are sharing, - you can ignore these, because the only ones we're interested in are any which have the same number as your Ethernet Controller.