jwenting 1,905 duckman Team Colleague

you can test whether you're getting an HttpURLConnection (you well may) using the instanceof operator.
Would open up a lot of nice extra functionality dedicated to http processing.

Yes, always close connections. If it's already closed there may be an exception thrown, the documentation will help (or else a good book on network programming, I like O'Reilly's book).
That's not just true for this class, you should always clean up after yourself no matter what you're using (so Connections, Sockets, Streams, etc.).

jwenting 1,905 duckman Team Colleague
10 GOTO 20
20 GOTO 40
30 PRINT "Hello World!"
40 GOTO 30
jwenting 1,905 duckman Team Colleague

I wasn't claiming Pascal isn't versatile, but quite obviously you didn't understand that. What I was saying (and you seem to have either ignored or didn't understand) is that your claim that C++ isn't versatile is complete and utter nonsense.

I suggest you start reading and understanding what people say before you start ranting about their statements ;)

jwenting 1,905 duckman Team Colleague

1) goto is mainly used by people with no clue as to how to avoid the need to use it.
2) people saying goto should never be used typically have no understanding of when and how it might be the most natural and/or efficient solution.
3) teachers will generally say to never use goto to prevent situation 1) but the end result is often that their students become the people meant in situation 2)

Is there a use for goto or similar constructs? Sometimes.
Is there enough of a use for them to advocate their use in general programming practice? Certainly not.

Java doesn't have goto (or rather it does have it as a reserved word but it isn't implemented and its use will cause a compiler error), maybe that's why Narue doesn't like the language ;)
I've myself never missed it (and I DID grow up using goto, seeing as my first programming language was IBM BASICA in the 1980s which had no other way to call different sections of code (named procedures didn't exist).
In fact I rarely (but not never) use the closest thing to it that Java does support, the labelled jump out of a loop.

jwenting 1,905 duckman Team Colleague

1) for HTTP why not use HttpURLConnection instead?
2) HTTP is a stateless protocol meaning the server will close the connection for you.
3) if you close all streams you get from the URLConnection the connection is gone.

jwenting 1,905 duckman Team Colleague

a map of function pointers using the received bytes (turned into a string maybe) as a key would work nicely.

jwenting 1,905 duckman Team Colleague

No, probably it wouldn't...If you have any problem, why don't you post here?

well, it would be easier for him/her... Which shows (s)he's lazy.

jwenting 1,905 duckman Team Colleague

After Taking The plunge, and going ahead and deleting rundll32.exe, I found some things in the system DID NOT WORK. So, it turns out that the OS (WINDOWS) actually DOES use rundll32.exe. It's not just some program that's fun to have. It wouldn't let me load properties of my computer (right click on my computer, properties) and things of that nature. :)

That's what "internal use" means, it's used internally by Windows :p :mrgreen:

jwenting 1,905 duckman Team Colleague

a safer way to disable the indexing service is to go into "my computer"->administrative tools->services, double click the indexing service, and change its status to "disabled" (from manual or automatic).

jwenting 1,905 duckman Team Colleague

"versatile" language like Pascal?
Don't make me laugh. Quite obviously you have no idea what you're talking about if you think C++ is not versatile.
If anything the main fault to be found in C++ is that it's TOO versatile, TOO flexible, and as a result there are no real standardised solutions for many problems, leading people to have to reinvent the wheel a lot.
But with a decent collection of libraries in your posession that gets reduced a lot, just as it is with other languages.

jwenting 1,905 duckman Team Colleague

You could start learning English.
This includes proper punctuation and use of capitals.

Knowing and strictly applying that knowledge to natural languages will help you remain focussed on doing the same while programming.

jwenting 1,905 duckman Team Colleague

you do seem to do a lot of string manipulation which may not be necessary at all.

string s = poly;
s = "+" + s;

would be more efficiently written as

string s = "+" + poly;

for example.

while (index != string::npos)
{
   s = s.substr(index+1);
   chars = sscanf(s.c_str(),"%lf *x** %d",&cof,&exp);

are you sure you want to do this?
My guess is you intend to do something along the lines of

while (index != string::npos)
{
    chars = sscanf(s.substr(index+1).c_str(),"%lf *x** %d",&cof,&exp);

P.S. Use C++ style braces and indentation.
Also use code tags when posting code...

jwenting 1,905 duckman Team Colleague

Also amongst other features, c++ allows me to write DLLs so that software components can be shared and I can code much faster (I do not know if java can do this, or any other form of software re-usability. just look at c++ class libraries and inheritance!)-> you could be right in that I need exposure to more java, (as having lost faith in it a while back im not really interested in it) but all in all what I have got is powerful and easy to use, something I have never seen from java. Would you be able to post some links to some information for the latest JAVA specs, then perhaps we will see if it can rival c++ or not.

Java classes effectively work much like DLLs do in that you can hotplug them (often) into an application without needing to recompile the rest.
There are some products that will compile Java into platform native code, maybe these can produce DLLs as well, I can't say as I've never had a need to use one.

Java has as much (if not more) code reusability than does C++. The C++ class libraries are as nothing to the standard Java library in completeness and versatility.
Whether you find it easy to use is a personal preference and experience. Myself I find the Java standard library easier to use than the C++ one, but then I've far more exposure to it than I do to the C++ …

jwenting 1,905 duckman Team Colleague

String handling in C++ is NOT generally to be done using char[] or char*, but using the class string which is available in <string>.
Far easier and more safe.

So instead of the code you have you'd simply do

string s;
cin << s;
jwenting 1,905 duckman Team Colleague

hmm, my earlier response seems to have been lost in the depths of the web ;)

Let's try again: the class File (which you use to open and handle disk files as well as in-memory files) has an option to delete a file if it exists and you open it with write access.
If you use that you need to do nothing else.

More details in the API docs.

jwenting 1,905 duckman Team Colleague

Unix is written for about 90% in C, the rest is a mix of ASM and mainly shellscripts.

As Alex says, you could create an OS in which the core consists of a JVM and the entire rest is in fact written in Java. You could even put that core into hardware and have the entire OS in Java.
Sun has done this as an experiment for embedded devices and it works (it just didn't sell, shame really).

It looks to me like the one lacking (realworld) experience is Richard...

While I don't always see eye to eye with Narue about everything I do recognise her as an experienced professional.

jwenting 1,905 duckman Team Colleague

File has a method to clear an existing file on opening (or rather a flag to the open() method if I'm not mistaken).

jwenting 1,905 duckman Team Colleague

One thing I notice immediately is that you're throwing away the result of your sortArray method.
That means you're never sorting your array at all (or at least, you're sorting it but then keep on using the unsorted array).

jwenting 1,905 duckman Team Colleague

The speed increase you're seeing is mostly psychological. The real performance increase in the machine is small enough you'd hardly ever notice it (unless maybe in extremely CPU starved applications where it may make a difference between behaviour that is just fluid and behaviour that is just stuttering).

jwenting 1,905 duckman Team Colleague

switch statements work only on integer values.
In Java the values you switch on also are required to be constant values (either integer literals or defined constant values), C++ might be more relaxed about that.

If the string represent an integer (for example "1") you can use itoa to turn it into an int.
If it doesn't there's no easy way, but you could use a hashtable with the strings as keys and integer constants as values and switch on the value found in that hashtable.

jwenting 1,905 duckman Team Colleague

add

std::string dummy;
cin << dummy;

your cin.get() was probably reading the enter you pressed...

jwenting 1,905 duckman Team Colleague

Don't trust everything (if anything) you see. The first faked pictures are already appearing (as are hosts of scams trying to look like charities).

jwenting 1,905 duckman Team Colleague

Two possible reasons:
1) there's something you didn't catch which keeps reloading the stuff
2) you keep visiting the same old websites (or running the same old applications) which got it onto your machine in the first place.

The following look suspicious to me. Maybe there's a few there that you know are safe (or that someone else recognises as safe) but most should be removed (I included realplayer in there because it's spyware infested).

C:\Program Files\Common Files\Real\Update_OB\realsched.exe
C:\Program Files\Synaptics\SynTP\SynTPLpr.exe
C:\Program Files\Synaptics\SynTP\SynTPEnh.exe
C:\WINDOWS\System32\ywujzel.exe
C:\documents and settings\jared\local settings\temp\yRNnWlpj.exe
C:\documents and settings\jared\local settings\temp\qBbj.exe
C:\WINDOWS\System32\IEHost.exe
C:\WINDOWS\System32\carpserv.exe
C:\documents and settings\jared\local settings\temp\Sd.exe
C:\Program Files\CSBB\CSV7P72.exe
C:\windows\system32\saie.exe
C:\WINDOWS\System32\winupdtl.exe
C:\WINDOWS\schk32.exe
C:\WINDOWS\System32\secure.exe
C:\WINDOWS\System32\cidscfg.exe
C:\Documents and Settings\Jared\Application Data\othb.exe
C:\Program Files\Web_Rebates\WebRebates1.exe
C:\WINDOWS\System32\sapsspcm.exe
C:\WINDOWS\System32\w?wexec.exe
C:\Program Files\Greetings Workshop\GWREMIND.EXE
C:\Program Files\CxtPls\CxtPls.exe
C:\Program Files\Web_Rebates\WebRebates0.exe
R1 - HKCU\Software\Microsoft\Internet Explorer\Main,Search Bar = file://C:\WINDOWS\System32/left.html
R1 - HKCU\Software\Microsoft\Internet Explorer\Main,Search Page = http://websearch.drsnsrch.com/sidesearch.cgi?id=
R1 - HKLM\Software\Microsoft\Internet Explorer\Main,Search Bar = http://websearch.drsnsrch.com/sidesearch.cgi?id=
R1 - HKLM\Software\Microsoft\Internet Explorer\Main,Search Page = http://websearch.drsnsrch.com/sidesearch.cgi?id=
R1 - HKCU\Software\Microsoft\Internet Explorer\Search,Default_Search_URL = http://www.searchdot.net
R0 - HKLM\Software\Microsoft\Internet Explorer\Search,SearchAssistant = http://websearch.drsnsrch.com/sidesearch.cgi?id=
R0 - HKLM\Software\Microsoft\Internet Explorer\Search,CustomizeSearch = http://websearch.drsnsrch.com/sidesearch.cgi?id=
R1 - HKCU\Software\Microsoft\Internet Explorer\SearchURL,(Default) = websearch.drsnsrch.com/q.cgi?q=
R3 - URLSearchHook: (no name) - {CA0E28FA-1AFD-4C21-A8DC-70EB5BE2F076} - C:\Program Files\SurfSideKick 2\SskBho.dll
O2 - BHO: IE Agent - {00000000-0000-0000-0000-000000002230} - C:\Program Files\CSBB\CSBB.DLL
O2 - BHO: MxTargetObj Class - {0000607D-D204-42C7-8E46-216055BF9918} - …

jwenting 1,905 duckman Team Colleague

Maybe you should get better in C then before attempting to solve complex problems.
Studying that more complex code is one way which will help you get better yourself.

jwenting 1,905 duckman Team Colleague

I was thinking of PHP ;)

jwenting 1,905 duckman Team Colleague

Your computer doesn't freeze. The program is loaded in the debugger and waiting for you to take action through the debugger.

jwenting 1,905 duckman Team Colleague

Well, I'm not so sure about every language having a purpose (unless you define annoying users as a purpose ;) ).

jwenting 1,905 duckman Team Colleague

You are using parts of the Struts framework.
Either (and that's what I prefer as I don't like it one bit) ditch it or change your classpath to include the necessary jar file (which you should have if you installed Struts).

jwenting 1,905 duckman Team Colleague

Most likely the crack installs the malware whenever you run the game (I guess that's what you cracked, you pirate).
Your own fault, let it be a lesson.

jwenting 1,905 duckman Team Colleague

Many C++ compilers have an option to output assembly code as part of the compilation process.

jwenting 1,905 duckman Team Colleague

Your friend is dead wrong. Excel DOES include VBA which is a scripting language based loosely on VB but that's about it.

All of the MS Office applications expose a series of COM controls which you can use to manipulate their documents.
I don't have the documentation for them at hand but you should be able to find examples in the MSDN library at http://msdn.microsoft.com and elsewhere.

There are likely also other systems to access and manipulate the documents available through third parties.

jwenting 1,905 duckman Team Colleague

Asking private help in public forums is considered extremely rude and should never be done (or in case it is done, honoured).

There are several ways in which you can implement a data access layer. You could use EJB, JDO, or roll your own DAO and/or DTO system using for example JDBC.
Or you can create something completely customised to your requirements, maybe using RMI, SOAP, CORBA, or any other technology you want or can use.

jwenting 1,905 duckman Team Colleague

no, I haven't tried that.
But I'd not be surprised as the SDK needs the runtime (during debugging sessions for example).
Newer runtimes may well be able to substitute for old ones so as long as you install them oldest first you may be fine.

jwenting 1,905 duckman Team Colleague

If you compile a small application with debug info using BC55 you can then load it into TD32 and use that to step through the code line by line like you would a debugger in an IDE.
If there's no debugging info you'll get assembler code instead.

jwenting 1,905 duckman Team Colleague

What I do is carry all my sources and documentation on a flashdrive (together with an installer for VI) so that I can at least edit everywhere.
I also often carry at least an installer for a compiler with me.

I mainly work in Java though, and installing a JDK doesn't violate any license such as installing VS would on someone else's machine.

jwenting 1,905 duckman Team Colleague

Some other free compiler systems try to take over your computer, smearing their files all over, that I don't like!

you probably refer to the Microsoft VC++ free compiler. It doesn't do anything except upgrade (if required) your .NET runtime environment which is a good thing (if it didn't something else would do it sooner or later, probably Windows Update).

jwenting 1,905 duckman Team Colleague

http://www.borland.com/products/downloads/download_cbuilder.html and select "compiler".
This will give you a (nearly) fully ANSI compliant compiler.
http://www.microsoft.com/downloads/details.aspx?FamilyID=272be09d-40bb-49fd-9cb0-4bfa122fa91b&displaylang=en will give you the latest Microsoft compiler.

Either will serve you well. Neither comes with an IDE or full documentation (that's what you pay for if you buy the full products).
The Microsoft compiler is newer but that shouldn't bother when learning.

For best learning ANSI C++ try your creations with both, if it works in one and not the other (IF both are correctly installed and configured) your source is likely not fully ANSI compliant.

jwenting 1,905 duckman Team Colleague

Like I said, it was a bit blind and couldn't read your very small typeface text. Had you just used a 50 point bold font instead of 40 point bold everything would have worked first time.

jwenting 1,905 duckman Team Colleague

What's a few hundred megs total?
Install everything, you can always remove parts if after a few months it turns out you never use them ;)

jwenting 1,905 duckman Team Colleague

Define "best"...
Also define your operating system...

Microsoft has a good free compiler, but if you're working on unix or mac that will do you little good.
Borland has a good free compiler as well.

What do you want from your compiler. Some have better standards compliance, others may generate faster applications or smaller ones.

jwenting 1,905 duckman Team Colleague

Check out the J2EE documentation.
web.xml is the configuration file for your web application. It tells the servlet engine what servlets map to which URIs, maps your filters, security settings, etc. etc. etc.

The format and function are defined by Sun, not the Apache group.

jwenting 1,905 duckman Team Colleague

>Which part of written in 100% pure Java you don't understand
It's impossible to write an operating system completely in Java. If you knew half of what you pretend to then you would realize this.

Actually it's not theoretically impossible. If you were to provide a JVM implementation in hardware the entire OS COULD be written in Java.
This was the idea behind JavaCard which is in active use as well as JavaOS which never left the prototype stage.

In fact, device control through hardware implementations of a JVM was one of the original ideas when creating the language and runtime environment (though I admit it wasn't all the success Sun thought it would turn out to be in that line of business).

jwenting 1,905 duckman Team Colleague

What "step up" are you referring to?
If you mean the Wireless Optical Desktop Pro I'd consider that money well spent.
But then I'm already using a $100+ keyboard in the Logitech Cordless Desktop Comfort and don't think spending that kind of money to prevent my hands and shoulders from hurting like hell after a day of coding is money wasted.

I've a hard time finding the Optical Desktop Pro though, seems hardly anyone over here stocks it.
The listed price is about 50% higher than that of the Natural Keyboard, not twice as high.

jwenting 1,905 duckman Team Colleague

What OS and stuff are you using on the laptop?
I've got Morrowind installed and running fine on Windows 2000.

I did notice Morrowind is a bit picky as to sound and videosettings, but those only come AFTER installation.
Render failure could be that, an incorrectly configured videosystem. Try different resolutions and bit depths and if that fails different drivers.
You should update your videodrivers anyway when installing a new operating system, the ones on the installation disk are always hideously out of date and not optimised for your hardware, get the latest from the manufacturer of your chipset.

jwenting 1,905 duckman Team Colleague

wat? how is that? $25 for the USB cable, god knows how much for the Soldering Iron, etc? Could u post pics, 3 in 1 sounds phat! also, where did u get it that cheap?

If you only ever use the soldering iron once it's more expensive, but it can be used more than once.
Solder same thing. You may pay $5-$10 for a roll but that will last for weeks or months depending on how often you use it.
The cable is the most expensive but can be had cheap as well, as can the connectors (but you may want to shop around some).

jwenting 1,905 duckman Team Colleague

Don't use applet classes outside applets, they won't work outside the applet sandbox.

If this is an applet, remember you can not access ANY resource that doesn't reside on the same server as the one from which the applet main class was loaded.

jwenting 1,905 duckman Team Colleague

Check your class definition.

Your main class MUST be public (though some runtime versions (especially older ones) may have permitted default access that's no longer the case and was never recommended).

jwenting 1,905 duckman Team Colleague

Long answer:
It all depends on what you want to do with it.
You can certainly CREATE an image object of some 3rd party library without explicitly importing Swing, and probably manipulate it as well using that same library.
You can then probably save it again as well.

You WILL however most likely have a hard time showing it on screen (unless you use some other GUI framework like SWT).
That other library may well import Swing classes itself of course.

Short answer:
Of course you can, just explicitly import all the classes you need instead of importing the entire package ;)

jwenting 1,905 duckman Team Colleague

sure you can plot a histogram in console mode.
After all it's just a collation of data with one column or row for each value (a barchart).

Easiest on the commandline would be to use a line for each value and just print a single block or something for each number in your count.

Say you want to plot the array [2,3,4,6,3,4] which is the number of occurrances of something in your file (say specific words).
you'd print something like

++
+++
++++
++++++
+++
++++

That's easy enough to arrange for...

In a Swing application collecting the data works identically but you need something to create the graphical representation, which is where most people will indeed tend to use existing graphics packages but using a simple Graphics or Image object you could get there as well.

jwenting 1,905 duckman Team Colleague

hey, so did my tarot cards just last week :)