Here here. Ubuntu is great. Like mentioned packet manager/repository. Doesn't come with the kitchen sink but just what you need (the rest can be easily installed). Also IMHO great hardware support. Painless to get external devices up and running (I do not share the same experience with Fedora 9...
Are you familiar with the syntax of the lists? namely [H|T]? Notice that you can use [H|T] for your 'return' variable not just for 'incoming' variable this is what I mean:
e.g.
sum([1,2,3,4,5],Sum,ReverseSteps).
Sum = 15
ReverseSteps = [15, 14, 12, 9, 5]]
you are familiar with this...
This is 'Hello World' level for lists in Prolog.
For starters create a 'function' that sums a list.
sum([1,2,3],X).
X = 6.
You should get the idea.
Do you self study Prolog?
The salesman should not visit any node more than once.
In the 5 point star graph, if I'd put it in my problem solver let's say the solver is PS(G,N) where PS is the solver, G is the graph(not-connected, undirected, weighted) and N is the number of stations to visit.
for...
What if my arbitrary graph is
6 train stations where the geometric layout is like the 5 stations are at the edges of a 5 pointed star with 6th station being in the center as the hub, and the 5 stations are only connected to the hub station i.e. G({a,b,c,d,e,h},{a-h,b-h,c-h,d-h,e-h}).
There...
There is just a slight problem, if I am not mistaken the TSP requires that the graph is complete.
But my graph is not complete - it is more like railway diagram, where the vertices are train stations and edges are the rails, it is connected but not complete and I want to visit N train...
silly me, will look into TSP algorithms, just need to modify not to go trough all the points but just N points. Since the graph can have M points but I am interested in visiting only N points and not all.
For starters something along the lines of a simple BFS with heuristic to always select...
I've got a small assignment to do on graphs but it's a bit frustrating that no standard algoritms such as Dijkstra, Bellman-Ford, etc. can be used or at least I don't know how could they help.
Given a graph one is to find shortest path through N points. That's it. Starting point can be...
Thanks, looks promising specially the link found on the site to
http://lernen.bildung.hessen.de/informatik/swiprolog/indexe.htm
this is something I was looking for.
I wish to do some Prolog programming,
How to set up the environment? Which implementation, IDE is easy on the beginner? Ofcorse it has to be free at least for personal use.
Any hints would be very welcome. I googled Prolog and all what I could find was some Win 3.1 looking programs, surely...
Why focus only on the CPU? There are other parts of the Computer that are getting faster day by day, such as Memory and I/O systems, not to mention the Video Cards (stronger GPU, more RAM). As for CPUs goes I think we will see more and more of multi-core CPUs.
Btw: How fast is fast enough? I...
Why does Python have such a poor performance on the language shoot out page?
http://shootout.alioth.debian.org/gp4/benchmark.php?test=all&lang=java&lang2=python [Broken]
I tought that the power of Java lies in the VM (it does dynamic optimization rather than compile time static optimization).
Vector<int> MyVector is not a valid code
Vector<Integer> is valid, since you cannot pass primitives into the <> tags.
It is generally recommended to use ArrayList instead of Vector class.
That is one can do
ArrayList<Integer> integerList = new ArrayList<Integer>()...
You should use Java docs and the standard library. The Java Way:
/**
* Replaces each occurrence of the find string in original string with
* replacement string
*
* @param original
* @param find
* @param replacement
* @return replaced string.
*/
public static String...
Just out of curiosity how can you have a static variable declared within a method? Tought that is not possible.
function void something(...){
static int xyz = ...;
}
Shouldn't one do
static int xyz = ...
function void something(...){
xyz = ...;
}
instead?
Well, I would stay away from switch statements if possible.
I would first check if the String(bottom line it is sequence(array) of chars) is of length 1 if not return false.
if(str == null || str.length != 1){
return false;
}
now since the string is of length 1, let's get the char and...
True, but the R series aren't that much more expensive. Money well spent if you ask me.
Usually you buy a laptop for a long time for at least 3 years or so. Therefore the bitternes of low quality remains long after the sweetness of low price has faded.
Sorry but I just can't help not to comment: Why did you buy 8 books if you don't like the style of the books?
Except for Core Java they are pretty expensive too.
We just recommended you some books.
In my library I see on a lot of books with "Not for sale in the USA" tags but that doesn't mean they are defects.
If you don't like cheap books maybe you can try eBooks. I believe that Thinking In Java 3rd Edition is a free - you can legally copy it...
Glad to see you are interested in Java. I would go to a library and pick up at least 5 books on the subject, read one chapter from each book and go with the one that is the most clear and readable for me.
My recommendations are
[1]Big Java, one of my all time favorite book on Java...
IMHO: Sun's tutorials are very bad, I would stay away from them.
I worked a little with .Net I found it very bloated and fragile. I was shocked when I saw that this line of C# returns false;
(myClass is ISomeInterface) returned false, while ISomeInterface.isAssignableFrom(myClass) returned...
Thanks for the input. Argh, registered to: <my name>. That isn't very good or is it? I have no intention to use the key of the PC, my laptop has its own legal cd key.
I own a legal(ofcorse) Win XP key but I don't need it anymore, may I sell it? Reason being, I am thinking of selling my desktop, just wondering should I include win xp in the price or format the drive entirely?
Yeah, in ideal case you could put your programming assignment text and compile it, the AI would take care of the details, if something is not totally clear it would ask you what to do... But if that were possible 99 % of computer engineers would be out of work! You don't wan't that to happen do...
Your words: "Java and C++ are very different". How can that be true if the former is the derivate of the latter?
Maybe it would be more correct to say that Java was influenced by C++. But never mind. Waste of posts for this.
Couldn't resist: "C# was not derived from C++" should this be...
You got to be kiding me.
Porhaps you were not reading the article very good, it is written "The language itself derives much of its syntax from C and C++"[1]. There is a difference between deriving syntax in contrast to deriving the language and platform itself.
Note C++ and Java are...
Java is NOT a derivate of C++!
For learning programming or a new computer skill I have the following algorithm: Go to the library, pick at least 5 books on the subject that look promising, read a few pages of each book,borrow the book that suites you best(I value simplicity and clarity of...
Well if nothing else you should be able to produce a war file. War is like a jar but suited for deploying on a web server. You put the war in the auto-deploy directory of the server, and when the Tomact or whatever Java server you have running it will deploy the web app from the war. Then you...
One alternative would be to use Java (Swing is the name of the gui library). You need not use any windows api. Other Java alternative would be SWT but Swing is more programmer friendly.
There is Ahead of Time compile aswells there is JIT.
For security: Yeah bytecode can be easily decompiled but there are tools called obfuscinators, they make the bytecode close to imposible for a human to read while the obfuscinated code produces the same results on the VM as...
Yeah, that is what I had in mind JIT and some other stuff. Btw: if Java would be really that slow I doubt very much that large corporations would consider running their software on Java EE servers. But yeah for some complicated computations Java is not the best choice but for the rest I think it...
Sorry but I could not help it:
How the F^@$ do you know that Java is slow? Did you do benchmarks? It really pisses me off when people say that, ok when Java first came out version 1.0 you could say that it was slow, but version 5.0+ is quite fast enough.
Yeah, if you learn Java you must...
I think that thread per client is not scalable at all. Note: When your machine reaches N threads its CPU jumps to 100 % and then your machine is useless. Imagine having 10,000 clients connected, chances are you need not service 10,000 clients at the same time, 3,000 might be just connected and...
-Job- you are not correct on saying that not going for thread per client approach (having just a few threads or one thread) has worse performanse. A colleague of mine did just that (having just a few service threads) as part of his ph.d, he got up to 4x the troughtput compared to conventional...
You can't go wrong with Lenovo ThinkPad T series, in short they pack more features than a swiss army knife with a build quality of a tank. I have T43 and I wouldn't trade it for anything other than a T60.
As Toshibas goes I strongly advice against buying a Toshiba. I know 2 persons who bought...
Had that lab a year ago, we used Electronics Workbench, surprisingly I found it very easy to use despite is it is very heavy weight. Version 4 is very nice to use, but it is not free, I suggest you ask the lab assistant to lend you a copy or use the computer at the faculty that have the...
You need secure communications over internet?
IF so try SSL
http://en.wikipedia.org/wiki/Secure_Sockets_Layer
If you are using Java Technology you have SSL features in the standard library.
http://java.sun.com/products/jsse/index.jsp
I would naively say just use SSLServerSocket...
As far as I understand significant digits..here goes:
I noticed that your inputs are of 4 significant digits accuracity excluding 2, meaning your output should not be in any way more precise(more significant digits) than the input (4 SD). Maybe instead of -1.999 write -1.99900 that should...
I would know if my reasoning is correct. Who is yamini?
y = x - 25; by law of something y can be written as y = - 25 + x, take a look at my diagram I have it like that NOT like 25 + x.
Guess it only makes sense if the number is non-nengative, thefore 25 have completed all 3 homeworks for...
How annoying, I have put my Venn diagram on the picture yet it cannot be displayed. Anyway I get -25 + x for people who have just solved the first problem and 25 - x as the intersection of 2nd and 3rd homework. How can I get a negative value on the diagram? I get that 58 are missing a homework...
Homework Statement
There are 285 math students. First homework was completed by 166 students, second by 148 and third by 129. First and second was completed by 108 students, first and third by 83 and second and third by 25 students. How many students have not completed at least one homework...