Rashakil Fol 978 Super Senior Demiposter Team Colleague
char a1='-';
char a1='x';

The first time you mention 'a1', you have to indicate what type it is. This is what you did in char a1='-';. But afterwards, when assigning a new value to a1, you don't need (or want) to specify the type. So use a1='x'; as to assign to a1.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

He said "factorial," zyruz.

Iamthwee, you know what a for loop is, right? Start 'answer' at 1 and multiply answer by all the numbers from 1 to n.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Hello,

I've a question: is it possible to pass a variable from perl script to HTML form.
I want this variable $ztable value to be send to this form.
<input name="dirname" size=15> its post method form.

Thank you in advance.

What is stopping you from something like

print "<input name=\"dirname\" size=15 value=\"$ztable\">"

(Assuming you've already replaced <, >, &, and " in $ztable with &lt;, &gt;, &amp;, and &quot;)

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Not really. Validation is a tool, but not an end in itself. For example, <nobr> is not valid HTML, but it's the most reliable way of preventing a region of text from having a line break.

But then again, their errors are just from sloppiness - things like writing onMouseOut when XHTML requires onmouseout.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

For the getdata member function to be called, it has to be defined first.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

http://phpservers.com

Invalid XHTML.

http://phpservers.info

Invalid XHTML.

http://enovanti.com

Valid.

Haven't checked CSS.

Validation doesn't matter anyway.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

On second thought, your question makes no sense at all. What is a "polynomial algorithm"? Polynomial with respect to what? For example, factoring large numbers is a polynomial algorithm with respect to the value of the number you're trying to factor. For example, to factor n, you only need to check at most sqrt(n) numbers, using a naive algorithm. But measuring with respect to the length of n in digits, factoring does not run in polynomial time.

So, would your 'boolean function' be sqrt(n) large or exp(n) large?

Also, your question makes no sense because runtime is measured with respect to the size of the input. Your boolean function would have be a fixed length. And if it consists of 'boolean operations' then it would take the same amount of time to run, every time. Then could you give it any size input and have the algorithm run in constant time? No. For instance, a generic sorting algorithm cannot beat O(n log n) worst case, but your 'boolean function' would do just that, taking O(1) time no matter how many millions of items are in the input.

Does not sound possible.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

It might depend:

What operations do you specifically mean by "boolean operations"?

Unless you have a wide-ranging definition of "boolean operations", the answer's no.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Of those three, I'd guess you'd have the best time with Java. If not that, then C++. But get around to learning Python anyway, because isn't learning a programming language fun in itself? ;-)

I don't really know anything about Geographic Information Systems, but I am guessing that right now you don't need to learn lower level details that C++ has. (And there's a more of a risk that the C++ course will be taught really badly.) If you learn VB, learn it as a later language, not your first.

Rashakil Fol 978 Super Senior Demiposter Team Colleague
int main(int argc, char *argv[])

You can name them whatever you want, but these are the normal names.

argc is non-negative. It gives the number of useful elements in argv.

If argc is positive, argv[0] contains the program name. Then argv[1] through argv[argc - 1] point to character arrays that contain the program's command line arguments.

For example, if I run a program at the command line, such as
unzip filename.zip,

argc will equal 2; and argv[0] will compare equal to "unzip"; and argv[1] will compare equal to "filename.zip".

When I open up a BASH shell and run perl -e 'print "Hello, world!\n"', perl gets an argc of 3, with argv[0] pointing to "perl", argv[1] pointing to "-e", and argv[2] pointing to the string containing

print "Hello, world!\n"

(to represent that string in C syntax, that would be "print \"Hello, world!\\n\"")

Different command line shells use different ways of quoting arguments -- most separate arguments by spaces, with either single or double quotes used to allow arguments with spaces, as seen in the perl example -- this is all invisible to the program, though. In Windows I'd have to write, perl -e "print \"Hello, world!\n\""

Rashakil Fol 978 Super Senior Demiposter Team Colleague

To find values x, y, z for equations

ax + by + cz = r
dx + ey + fz = s
gx + hy + iz = t

You could use the formulas

x = (e*i - f*h) * r / (g*b*f - g*c*e - d*b*i + d*c*h + a*e*i - a*f*h) - (b*i - c*h) * s / (g*b*f - g*c*e - d*b*i + d*c*h + a*e*i - a*f*h) + (b*f - c*e)*t/(g*b*f - g*c*e - d*b*i + d*c*h + a*e*i - a*f*h)

y = -(-g*f + d*i)*r / (g*b*f - g*c*e - d*b*i + d*c*h + a*e*i - a*f*h) + (-g*c + a*i)*s / (g*b*f - g*c*e - d*b*i + d*c*h + a*e*i - a*f*h) - (-d*c + a*f)*t / (g*b*f - g*c*e - d*b*i + d*c*h + a*e*i - a*f*h)

z = (-g*e + d*h)*r / (g*b*f - g*c*e - d*b*i + d*c*h + a*e*i - a*f*h) - (-g*b + a*h)*s / (g*b*f - g*c*e - d*b*i + d*c*h + a*e*i - a*f*h)+( - d*b + a*e)*t / (g*b*f - g*c*e - d*b*i + d*c*h + a*e*i - a*f*h)

Rashakil Fol 978 Super Senior Demiposter Team Colleague

And what is "2 *= x -= 3 *= y = == 4" suppose to mean? This is completely nonsensical notation.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Of the syntax you used to state the problem and the syntax in your sample input, I'm not sure which makes the least sense.

You could be helpful and explain your problem better. Using sentences. Right now, I'm thinking that _maybe_ you're trying to solve a three-by-three linear system. And "2 *= x -= 3 *= y = == 4" makes no sense whatsoever.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

People should be free to say whatever they like so long as what they say does not hurt or offend others.

This offends me!

Rashakil Fol 978 Super Senior Demiposter Team Colleague

The ideas are orthogonal!

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Bah, just use clean, erm, XSLT.

<xsl:template name="blah">
    <xsl:param name="x" select="2"/>
    <xsl:param name="y" select="5"/>
    <xsl:param name="swapped" select="0"/>

    ...

    <xsl:choose>
        <xsl:when test="$swapped = 0">
            <!-- First we run this code. -->

            <!-- And say we want to swap x and y! -->

            <!-- Oh no, we can't change their values! Curse!  Recurse!!-->
            <xsl:call-template name="blah">
                <xsl:with-param name="x" select="$y"/>
                <xsl:with-param name="y" select="$x"/>
                <xsl:with-param name="swapped" select="1"/>
            </xsl:call-template>
        </xsl:when>

        <!-- In the spirit of XML, they picked the most verbose name
        out of the choices 'else', 'default', and 'otherwise.' -->
        <xsl:otherwise>
            <!-- Now x and y are swapped! -->

            ...
        </xsl:otherwise>
    </xsl:choose>
</xsl:template>
Rashakil Fol 978 Super Senior Demiposter Team Colleague

I do not understand the need for polymorphism in this case.

Could you explain it?

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Use CODE tags and post the code for all relevant datatypes.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

t + 1 moves t over one position, based on the width of the datatype t is addressing.

For example, if t is a pointer to doubles (which usually take eight bytes of memory), t + 1 will return a memory address eight bytes away from t. If t is a pointer to ints (which usually take four bytes of memory), t + 1 will return a memory address four bytes over. This means that (t + 1) is the next element of the array.

So, when you dereference t, t+1, and friends, here's what you get:

double t[] = {10.0, 20.0, 30.0, 40.0, 50.0};
double a = *t;
double b = *(t + 1);
double c = *(t + 2);
double d = *(t + 4);

Now 'a' is equal to 10.0, 'b' is equal to 20.0, c is equal to 30.0, and d is equal to 50.0.

The idiom, *(t + n) is so useful that there is special syntax for it: t[n]. Array subscripting is just a synonym for adding to a pointer and dereferencing. (C++ allows this operation to be overridden to mean other things, though.)

a back to back address?

Yes, and since the items in an array are stored back to back, this is useful.

Rashakil Fol 978 Super Senior Demiposter Team Colleague
if(n==1)
return(1);

Also, this should be

if (n == 0)
    return 1;
Rashakil Fol 978 Super Senior Demiposter Team Colleague

Definitely way less than 1/2 gram. A cubic centimeter of water is one gram.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

The full code would really help show what you're trying to do.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

I don't understand your problem. If your perl script and your perl module are in the same directory, then just 'use' the module. For example, I had a 'grouper.pl' and a 'CSV.pm' file in the same directory. The 'grouper.pl' contained the line,

use CSV;

and it works. It's supposed to work.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Thanks for the tip.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

I see the problem in IE. So I used the user stylesheet option in IE to add a user stylesheet that puts a 1px red border around every single box on the page.

Here's a screenshot: (see attachment)

You'll notice the red lines hovering right above your navigation images. To the left, I get the regular cursor; to the right of the line, I can click the link. This happened because some positioned object is lying above the navigation menu. What happens is that you have a table with width 701 pixels aligned center and a table with width 124 pixels aligned right. If the page is too narrow, they overlap. Maybe you want to use this code instead, which puts the tables in separate table cells, avoiding overlapping.

<html>
<style type="text/css">
<!--
.style3 {
	color: #FF9900;
	font-size: 30px;
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-weight: bold;
}
.style4 {color: #FF9900}
-->
</style>
<head>
<title>HOME</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

</head>





<table width="85%" border="0" height="557" align="center">
  <tr>

    <td height="500" width="701">
      <table width="701" height="487">
        <tr> 
          <td height="2" colspan="2"> 
            <p align="right"><b><font face="Verdana, Arial, Helvetica, sans-serif" size="2"><img src="buttons/blank.gif" width="150" height="25"></font></b><img src="buttons/blank.gif" width="150" height="25"><img src="buttons/blank.gif" width="150" height="25"><img src="buttons/blank.gif" width="150" height="25"><img src="buttons/blank.gif" width="150" height="25"></p>
          </td>
        </tr>
        <tr> 
          <td height="465" width="87">
            <p align="center" class="style3">H</p>
            <p align="center" class="style3"><font face="Verdana, Arial, Helvetica, sans-serif" color="#FF9900">O</font></p>
            <p align="center" class="style3"><b><font face="Verdana, Arial, Helvetica, sans-serif" color="#FF9900">M</font></b></p>
            <p align="center" class="style3"><b><font color="#FF9900" face="Verdana, Arial, Helvetica, sans-serif">E</font></b></p>
            <p align="center"><b></b></p>
            <p align="center"><b></b></p>
            <p align="center"><b></b></p>
          </td>
          <td height="465" width="602">
<blockquote>
<blockquote>
                <blockquote> 
                  <p align="center"><b><font face="Verdana, Arial, …
Rashakil Fol 978 Super Senior Demiposter Team Colleague

Then be more specific. Which of the following do you want to do:

1. Find all the x in S that are not in T.
2. Find all the x in S or T that are not in both.
3. Find all the x that are in both S and T.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Whether you include the DTD or not is largely irrelevant in the grand scheme of things. Browsers don't look at the DTD itself; they just say, "Is the DTD there? It is! So I'll assume the coder knows what he's doing, so I won't replicate the bugs of IE 5.5." The DTD says nothing about how to render a document; it just contains a formal description of what is and isn't valid syntax. It's not that browsers try to simulate the proper rendering of the code, it's that they simulate _improper_ rendering of code, for backwards compatibility.

Of course, to be a valid HTML document, one must have a DTD.

So what I'm saying, randallj, is that everything you said is basically wrong. :o

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Go to google, type in "compare C++ maps", and press the I'm Feeling Lucky button.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

>Inserting into a linked list is expected to be a constant time O(1) operation.
Only if you make certain assumptions, like that the insertion will only be at the head of the list, or at the tail and then only if there is a tail pointer. The average expected time complexity for inserting into a linked list in the general case is O(N/2).

And the worst case time complexity is O(N/100000000).

:cool:

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Is it wrong to have a very long program if i did not find another way?

It is if you should have found another way.

Why do you have your offsets in some crazy order? (15, 5, 9, 14, ...)

Rashakil Fol 978 Super Senior Demiposter Team Colleague

It's not pure C, because C does not have namespaces.

So it's C++.

The C++ compiler chokes because the <stdlib.h> and <stdio.h> header files do not use the std namespace. There is no 'std' namespace as far as the compiler is aware, since none of the source files mention it. If you used <cstdlib> or <cstdio> then 'using namespace std;' would work properly.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

I experienced the problem in IE on my home machine. But if I copy the code to a local file and delete the Geocities code, the problem goes away in the local copy.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Here's one example where a linked list is the appropriate structure for this: hashing, with linked lists used to handle collisions. Or any other situation where the linked list is short.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Ah, "crap" was referring to the weird behaviors that generally happen when you trust a wysiwyg editor's code to work on multiple browsers, not anybody's particular code.

You could replace it with "problems" and it would mean the same thing.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

I was not being impolite; that statement is simply true and observant of the fact that you'll get different results in different browsers if you don't have a general idea about HTML and CSS.

And you're right, it does not help the other poster solve his immediate problem. So what? How much help do you expect now that the URL's deleted?

Rashakil Fol 978 Super Senior Demiposter Team Colleague

well in theory if you hover the mouse anywhere over the jpg image shouldnt the cursor change? To show that its an hyperlink? It only seems to want to do that if you move the mouse to the very right of it

The cursor changes for me. I get a hand. Crap like this is what you get when you try to make a web site without knowing HTML and CSS.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

hyperlink removed by moderator

basically the buttons dont work like they should, I've made the buttons using photoshop and importing them to dreamweaver, from there creating the button as a hyperlink. In theory the button should therfore on mouseover display the behaviour as an active link.

I don't understand what you mean. The links work fine. I don't understand what theory states that your image should display "the behavior" on mouseover, whatever you mean by that. Perhaps you could be more specific as to what you're expecting.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

So could you show what you have tried?

Rashakil Fol 978 Super Senior Demiposter Team Colleague

You could try paying attention in class. You should not be producing anything so misformed as that.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Get the MingW compiler with Dev-C++ 5. This is free too, and it's not a zillion years old.

This should resolve your problem (of getting a compiler).

Rashakil Fol 978 Super Senior Demiposter Team Colleague

By "run them together" do you mean end one of the threads? Or do you mean simply to have them run concurrently? I am guessing you already found both of these resources, but here they are anyway:

http://www.rubycentral.com/book/tut_threads.html
http://www.rubycentral.com/ref/ref_c_thread.html

What code do you have right now?

Rashakil Fol 978 Super Senior Demiposter Team Colleague

I'd go with the doubledouble special datatype, since the regular double can only barely hold enough precision for your digits -- and if you do any interesting math with the numbers, the floating point error will be too much.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

No prob. Here you go.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

I really don't. I use large integers frequently enough.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

How about some sample output then.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

What HTTP headers are you sending?

Rashakil Fol 978 Super Senior Demiposter Team Colleague

freemind, ever heard of RSA public key cryptography?

Rashakil Fol 978 Super Senior Demiposter Team Colleague

These are simple. Now code multiply to work in O(n log n) time instead of O(n*n) time. Come back when ready ;-)

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Instead of ((expected1 / hours1) + (expected2 / hours2) + ...) / N, use
((expected1 + expected2 + ...) / (hours1 + hours2 + ...)). It makes more sense for me to use total time over total time, because if somebody takes 1 hour for one task and 199 for another, he's just as efficient as one who takes 100 hours for each task.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

I found a book on Ruby in my book store. Wonder what Ruby is named for?

http://www.ruby-talk.org/cgi-bin/scat.rb/ruby/ruby-talk/394