Jump to content

albertlee

Senior Members
  • Posts

    1259
  • Joined

  • Last visited

Everything posted by albertlee

  1. learning assembly language is not to accomblish any real thing, but to understand computer at a more detailed level. Do you know people where unicode is stored?
  2. Try type in Chinese if you are a Chinese, and I will respond in Chinese.
  3. My 1st programming language is Java. My preferable route--> 1)start from python (because it is easy, free, and has concepts related to Java) 2)Java (because it is powerful and easier than C++, and you learn a lot, not only programming, but computer related technology like network, hardware architecture if you are designing program for mobiles) 3) C++ 4) Assembly language
  4. thanks for the response. But, to be more specific, I am saying method Hiding vs method Overriding. not varriables. First of all, do you know people why, when I "rewrite" the static method of the based class in its sub class, I "hide" instead of "override" the static method?? Please refer to Java language itself. thanks
  5. I have been programming in Java for a while, but I can't clarify between Hiding and Overriding, which I thought they are basically meaning the same, ie, change the method implementation. But in fact, no. However, the only difference I can clarify is the term "Hiding" is used for static method, and "Overriding" is used for instance method. Is that it?? if not? can any one demonstrate an example that distinctly explain the difference between these two?? thanks
  6. thanks Atheist In fact, I did the comment, not the original creator. What was the creator thinking about?? I could create a less complicated and cleaner code to do the same thing. In addition to that, every varriable of an object has constant size, because each one only holds an address, but the actual object can varry in size, situated in the heap, which could influence the system overall performance. any way, thanks for the response, because all I want is to assure myself that the code line commented is vacuous.
  7. import java.util.Enumeration; public class LinkedList { private static class Node { public Node prev; public Node next; public Object data; public Node(Node prev, Node next, Object data) { this.prev = prev; this.next = next; this.data = data; } } Node head; public LinkedList() { head = null; } public void add(Object data) { Node n = new Node(null, head, data); [b]/*if(head != null) head.prev = n; */[/b] head = n; } public Enumeration elements() { return new LLEnum(); } private class LLEnum implements Enumeration { Node current; public LLEnum() { current = head; } public boolean hasMoreElements() { return current != null; } public Object nextElement() { Object data = current.data; current = current.next; return data; } } } and import java.util.Enumeration; public class LinkedListTest { public static void main(String[] args) { LinkedList ll = new LinkedList(); for(int ii=0 ; ii<args.length ; ii++) ll.add(args[ii]); Enumeration enumu = ll.elements(); while(enumu.hasMoreElements()) { System.out.println("Next linked-list node: " + enumu.nextElement()); } } } the 1st code behaves like a "growable" array, cappable of inserting different kind of object as its element. the 2nd code is just given the main entry point to execute the program from another class. Question, as the 1st code, LinkedList class apears, I dont know exactly what is the code within the comment mark does if I un-comment it. The codes are sample, and I was trying to understand its algorithm by drawing UML cases every time a Node object is reallocated as the parameter within another Node object's constructor. Can any one tell me is there a reason for the code that's in comment mark in bold?? from the creator's point of view?? because with or without it, the code makes no difference. To my understanding, it just makes the Node head object bigger in size by storing a reference to an object that has a refernce to itself. thanks
  8. Well, the last scene (nearly about the end of the movie) showed that the machines were defeated, that is, they collapsed on the "residues" in the city.
  9. Oh, To Swansont, I concluded that the wheel's energy will loose, but since bettina said she had one. From all your posts I thought space wheel can run for a very very long time as "virtually forever". [/b]I merely wanted to ask about how "thermodynamics" is involved.[/b] From the idea from Bettina, I thought the space wheel maybe is so pefectly made that the friction is so low and kept in a vacuum. Sorry for the misinterpretion. :-D Albert
  10. yes, without a battery, as suggested by Bettina
  11. So, if the space sheel can run "virtually" forever, then what are the physics involved?
  12. I dunno. French cinema has all its movies in French. Microbes?? I didnot any scene that they actually kill them. Secondly, why do they need human blood?
  13. It takes no battery at all. Just keeps moving forever.
  14. My friend has invited me to watch the movie called "War of the Worlds" However, unfortunately, it is in French. My French isn't capable enough. ANy way, Do you people know why all the tripod machines are defeated? I mean, Tom Cruise only blew up only one tripod machine, and simultaneously, all the others were either weakened or froze, vulnerable by human attacks. For example, there was a scene that the US air force bombers and helicopters were inefective to the shell of the machine. But once one was blown up by Tom, even the infantry could blow up the machine with a bezooka. Btw, what were those birds doing on the machine?? ps, I would like to borrow this novel at the beginning of my school year. Albert
  15. Have you heard or known about "space wheel"?? It is a small wheel with 3 larger metal bits struck out in one dimension, and two cylindrical sticks coming out in another dimention horizontally, and is placed on a two-panel curved platform, which holds the wheel by the cylinderical sticks. The wheel just keeps rolling from one end of the platform to another, never stopping. WHat physics are involved?? it says three: 1) potential and kinetic energy, I know this one. 2) the law of thermodynamics 3) other mysterious forces I dont know 2) and 3) Any one?
  16. I kinda figure that out by myself :-D the real, important question is, is there way to treat algorithm as mathematics?? Designing an algorithm??
  17. I have made three classes: CalculateFib.class public class CalculateFib{ public static void main(String sad[]){ Fib2.fib(300); Fib1.fib(300); } } Fib1.class public class Fib1{ public static long fib(long n){ if(n==0) return 1 if(n<0) return 0 long high = fib(n-1); long low = fib(n-2); return high+low; } } Fib2.class public class Fib2{ public static long lastFibIndex = 0; public static long lastFibValue = 1; public static long fib(long n){ if(n==0) return 1 if(n<0) return 0 if(n==lastFibIndex) return lastFibValue long high = fib(n-1); long low = fib(n-2); lastFibIndex = n-1; lastFibValue = high; return high+low; } } It is very nice of you if you guys can oblige me by giving a try on compiling these codes and try them. If so, you will see how fast Fib2 is compared to Fib1. Why's that?? I dont know why those extra lines in the Fib() method speed up the computation so much quicker, ie: if(n==lastFibIndex) return lastFibValue and lastFibIndex = n-1; lastFibValue = high; As I said before, the only difference is the sample code (faster one) has those two ambiguous class varriables, which I dont see any much point of them in the computation of fib number, because the sample code is the same as my own shorter one, except with extra codes. Any body please explain why?? thanks
  18. btw, is thermodynamics related to thermochemistry?? I am reading about this on a book called College Chemistry By Jerome L. Rosenberg and Lawrence M. Epstein. Albert
  19. Well, I am just trying to fit my chemistry knowledge with what you guys have told me, consistently. I know that all reactions are either endothermic or exothermic. The great things about this thread are the thermodynamics and kinetics of reactions I learned. However, I am still "shaky" on this notion, applying them to different other reactions. What I am thinking now is to connect these with Chantelier's principle and exothermic/endothermic reactions, and see what theoretical conclusion I can come up whenever I do an experiment at school. Albert
  20. If the energy level decreases in product from the reactants, it is considered to be endothermic, right??
  21. Do bond energies tell how energetic the reactants are?? Or are they irrevalent?? ps, dont panic, the thread will stop not so long.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.