What is T(2)? It isn't defined by your recurrence relations (1 < i < n)
kind regards,
Jos
User Profile
Collapse
-
We don't do your homework here; do it yourself and when you're stuck ask a specific question; a small hint: when you don't know f'(x) (i.e. the first derivative of f w.r.t. x) use (f(x+h)-f(x-h))/2h for a small value of h.
kind regards,
Jos...Leave a comment:
-
Don't do that; implement a public toString() method that returns a String representation of the object; PrintStreams and Writers call that method when they have to print a non-primitive value; it's much more flexible like that.
kind regards,
Jos...Leave a comment:
-
-
Search for "hangman" (top right of the page); I once showed a complete implementation of the game using regular expressions; it is short without all the kludgy logic and is a complete spoonfeeding giveaway.
kind regards,
JosLeave a comment:
-
Check the Java insights section, it has a three part article on Sudoku, including the reading and initializing, solving and printing the darn thing.
kind regards,
JosLeave a comment:
-
Think of an alphabet of digits 0, 1, 2 ... 9 and think of the decimal expansion of PI. Is that sequence random enough?
kind regards,
JosLeave a comment:
-
A very specific answer: Java isn't Javascript; they're two different languages; try the Javascript forum (look right, near the top of the page).
kind regards,
JosLeave a comment:
-
@gisto moss: are you also JavaNut13 on the Sun Java forums? If so: people don't like crossposting.
kind regards,
JosLeave a comment:
-
What tastes better: chocolate icecream or french fries. Such questions don't make sense and just can start religious wars.
kind regards,
JosLeave a comment:
-
The sequence nCm can be easily generated; for every element in nCm generate all its permutations mPm (which is also easy).
kind regards,
JosLeave a comment:
-
It would be better if you'd post a short example, not a large listing that uses a lot of different Swing components that obfuscate what it's all about: a JPanel that is supposed to draw a circle with a radius that can be changed by a JSlider. Now the reader has to plough through JTrees, JScrollbars, JButtons, JFrames, JScrollPanes and almost the entire collection of available components ...
kind regards,
Jos
...Leave a comment:
-
You need at least a bit of native code (e.g. JNI) because Java can't do such operating system and platform dependent stuff.
kind regards,
Jos...Leave a comment:
-
JosAH replied to How to access particular character of a string without using pre defined functions?in JavaStrings are immutable so it won't let you fiddle with its internal data buffer at all, you have to use the methods it supplies for that purpose (such as charAt(...)). It doesn't supply any methods for changing that buffer at all, you can only read from the buffer.
kind regards,
JosLeave a comment:
-
You also wrote you wanted reflection; well here's a bit of reflection:
Code:import java.lang.reflect.Field; public class AAA { public static void main(String[] args) { try { Class[] classes = Integer.class.getDeclaredClasses(); for (Class clazz : classes) { if (clazz.getName().endsWith("IntegerCache")) { Field cacheField = clazz.getDeclaredField("cache");
Leave a comment:
-
Have fun:
Code:public class AutoBoxing { public static void main(String[] args) { Integer i = new Integer(42); Integer j = new Integer(42); boolean result = !(i < j) && !(i > j) && !(i == j); System.out.println(result); } }
Jos...Leave a comment:
-
-
Suppose you have a unit cube with one of its corners in the origin O. The average position of the cube is at A = (1/2, 1/2, 1/2). Translate the entire cube over the vector -A so that the origin O will be at the middle of the cube.
In general: for points v_1, v_2 ... v_n, find A = sum(v_i)/n; next translate all v_i over -A, i.e. v_i-A and project those points according to your camera position.
kind regards,
...Leave a comment:
-
Unfortunately that doesn't work. The toArray() method returns an array of Objects (Object[]) that can't even be cast explicitly to a double[]. Autoboxing is a meager implementation of generic types. You have to pass an 'exemplar' to the toArray() method and it has to be an array of some type of objects, e.g. Double[]. Here autounboxing won't help you either ...
kind regards,
Jos...Leave a comment:
-
If the camera is positioned at a point (x, y, z) and always 'looks' at the origin O = (0, 0, 0) then you have to translate the subject towards that origin O. A simple translation finds the average of the subject (x', y', z') and uses that vector to translate the subject towards the origin O.
kind regards,
Jos...Leave a comment:
No activity results to display
Show More
Leave a comment: