Search results

  1. E

    Dificult recurtion question

    Hi Ho! I think you can easily solve your problem if you imagine you have the following objects: 1. MarkedWheel 2. MarkedWheelsPermutationMachine A marked wheel is a wheel that can be turned in only one direction. Each turn will display one mark on its surface. A permutation machine...
  2. E

    A question in flipping a number

    If you use Java, you can just use its built-in function to do so: int fromBase = 10; int toBase = 2; Integer.toString (Integer.parseInt (args [0], fromBase), toBase); Next, you can just run your program conveniently like: java BaseNToMConverter 82733 Best regards, Eus
  3. E

    What is in all in a Makefile?

    Yes, you are right! Thank you very much for telling me that it is called double-colon rule and it is documented in the texinfo file. Best regards, Eus
  4. E

    Fminsearch - hold a variable constant

    I have never used MathLab before. Therefore, I think I cannot help you further. I hope someone else in this forum can help you with that. Best regards, Eus
  5. E

    What is in all in a Makefile?

    What is "::" in "all::" in a Makefile? Hi Ho! Executing GNU Make: If Makefile only contains the following lines, all: echo $@ it will produce echo all all If Makefile only contains the following lines, all:: echo $@ it will still produce echo all...
  6. E

    Why does an IP addreess need to be associated with an interface?

    Ah, you are right! Yes, thank you for reminding me about that important fact. Yes, that is the reason that the authors of the book should have written: An IP address needs to be associated with each interface instead of with the host/router that has the interface because, according to the...
  7. E

    Why does an IP addreess need to be associated with an interface?

    Yup, you are right that in the first case when an ARP request packet has been broadcasted, the sender will receive multiple replies because an IP address is associated with a host/router having multiple interfaces. Maybe this is the reason of the authors. But, the ARP stuff is the concern of...
  8. E

    Fminsearch - hold a variable constant

    Of course you can send in four variables vector through fminsearch (I assume that the program is written in C/C++). But, will the function that eventually opens the file know whether there is an extra variable in the vector that is passed into it? If it doesn't know anything about the extra...
  9. E

    The missing Indian Hill Guide (ftp:ftp.cs.washington.edu/pub/cstyle.tar.Z)

    Hi Ho! Could someone please help me in obtaining the latest Recommended C Style and Coding Standards (Updated Indian Hill Guide)? The file cannot be found any longer at [PLAIN]ftp://ftp.cs.washington.edu/pub/cstyle.tar.Z[/URL]. I don't know the reason why the file is missing from the...
  10. E

    Determinant in C programming

    Hi Ho! Isn't that you can just simply implement either the Gaussian elimination or Laplace formula as described on http://en.wikipedia.org/wiki/Determinant#General_definition_and_computation? Best regards, Eus
  11. E

    Why does an IP addreess need to be associated with an interface?

    Here is the complete paragraph in which the authors wrote the argument: So, because the paragraph is about the connection of hosts and routers into the network, as what I have explained before, it is not apt to say the the reason that IP requires each host and router interface to have its own...
  12. E

    The primary key of a relationship set in an E-R data model

    Hi Ho! I have posted this same question about three weeks ago on MySQL forum (http://forums.mysql.com/read.php?125,197805,197805) and on the mailing list of the book itself about two weeks ago (db-book-list@cs.yale.edu). But, still there is no response at all. Therefore, I try my luck by...
  13. E

    Java How to create an executable java application?

    I had tried it and I could run the JAR file nicely in the command line with the following command: java -jar ZnX.jar If you try to run the JAR file by double-clicking on the file and you use Windows, the icon of the JVM should appear in the tray icon. Otherwise, there might be...
  14. E

    Why does an IP addreess need to be associated with an interface?

    I just want to say that the reason why IP requires each host and router interface to have its own IP address is not because every host and router is capable of sending and receiving IP datagrams. But, the reason for that is to permit a router to interconnect two or more different networks with...
  15. E

    General best practices: commenting code

    I have read that thoroughly and indeed it is a good white paper. Ah, I have spotted some typos also and here I give you the revised version. Best regards, Eus
  16. E

    Why does an IP addreess need to be associated with an interface?

    Hi Ho! On page 322 of Computer Network: A Top-Down Approach Featuring the Internet, 2nd Edition by Kurose and Ross, which is published by Addison-Wesley, it is stated that: "Because every host and router is capable of sending and receiving IP datagrams, IP requires each host and router...
  17. E

    Java How to create an executable java application?

    Hi Ho! Sure, your teacher can run your Java program just by double-clicking the JAR file. The complete information is here: http://java.sun.com/developer/Books/javaprogramming/JAR/basics/manifest.html http://java.sun.com/j2se/1.4.2/docs/guide/jar/jar.html [Broken] Basically, just...
  18. E

    Class conundrum

    Hi Ho! member1=value; member2=value; member3=value; It should be: x.member1=value; x.member2=value; x.member3=value; because they belong to the object, not to the class. Also, printf("%d",x.member_function); should be printf("%d",x.member_function()); because you invoke a method...
  19. E

    Why not multiple inclusion of a header file if certain precautions are taken?

    Hi Ho! Ah, you are right! Because what I did was to include a header file once in each source file (this was what I thought as multiple inclusion of a header file), I did not get any error. But, when I included a header file two times in a single source file like what you have illustrated...
  20. E

    Why not multiple inclusion of a header file if certain precautions are taken?

    Hi Ho! I often heard people say that we should avoid multiple inclusion of a header file. And, they very often show how to do it. But, I myself haven't yet found the reason of not to do it when certain precautions are taken. What I am going to discuss here is C programming, not C++. I...
  21. E

    Newton-Raphson in Visual Basic 6

    Hi Ho! Isn't that if g(\mu)=\left ( \frac{b_{1}}{a_{1}-\mu} \right )^2 and v(\mu)=a_{1}-\mu then g(v(\mu))=\left ( \frac{b_{1}}{a_{1}-v(\mu)} \right )^2 g(v(\mu))=\left ( \frac{b_{1}}{a_{1}-(a_{1}-\mu)} \right )^2 g(v(\mu))=\left ( \frac{b_{1}}{a_{1}-a_{1}+\mu}...
  22. E

    Need Help in C Programming

    Hi Ho! I think the use of _gets () is not portable. I have revised the code to make it clearer and more portable. Just give it a try. #include <ctype.h> #include <stdio.h> #include <stdlib.h> #include <string.h> int main(int argc, char **argv, char **envp) { char words...
  23. E

    Newton-Raphson in Visual Basic 6

    Hi Ho! Your mistake is in the first derivative of your function. If F(\mu)=\left ( \frac{b1}{a1-\mu} \right )^2 + \left ( \frac{b2}{a2-\mu} \right )^2 + \left ( \frac{b3}{a3-\mu} \right )^2 - 1 Then F'(\mu)=2\left ( \frac{b1}{a1-\mu}\right ) \left ( \frac{a1 - \mu + b1}{(a1 -...
  24. E

    Fminsearch - hold a variable constant

    How does the GUI communicate with the program? By just invoking the program with a command-line? For example, if the user clicks a run button, the GUI will invoke something like this: execve ("program_name", list_of_args, list_of_envp); Or, by using the API of the program? How does the...
  25. E

    Need Help in C Programming

    Hi Ho! Let's do it bit-by-bit: Duplicated function declarations. Here is your zeroth bug. 'j' is not initialized. Here you have your first bug. Unclosed 'while' block in which 'j' is not incremented properly. Here you have your second bug. I think I must stop here till you...
  26. E

    Fminsearch - hold a variable constant

    Well, an array will do, won't it? If you can give me more details on what fminsearch is all about, I may be able to help you better. Duplicating the array into another temporary array will do the trick, won't it? Best regards, Eus
  27. E

    Newton-Raphson in Visual Basic 6

    So, why didn't you just post the code? Best regards, Eus
  28. E

    Newton-Raphson in Visual Basic 6

    Hi Ho! I think you should specify your problem in detail first before we can help you. What kind of problem do you have in resolving the equation? Parsing the equation? Or, what? Best regards, Eus
  29. E

    Exercising Loop: Pattern

    Hi Ho! Well, we are to define the rules based on the patterns we see. It is not said in the problem. But, based on my observation, "5" means that the pattern will be printed on a 5x5 square block of characters. We are to determine what number five has to do with the patterns...
  30. E

    Exercising Loop: Pattern

    Hi Ho! Given an input of 5, it is easy to produce the following pattern: xxxxx xx x x x x x xx xxxxx But, given an input of 5, how would you produce the following one? 1 7 14 21 2 8 15 22 3 9 16 23 4 10 17 24 5 11 18 25 I have implemented the solution below...
Top