Search results for query: *

  • Users: haki
  • Order by date
  1. H

    Favorite Version of Linux

    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...
  2. H

    Create a recursive function in prolog

    Aside. If you are using SWI Prolog, I recommend to use the debugger for tracing the execution - it is not great but it helps.
  3. H

    Create a recursive function in prolog

    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...
  4. H

    Create a recursive function in prolog

    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?
  5. H

    Odd Graph Algorithm assignment

    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...
  6. H

    Odd Graph Algorithm assignment

    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...
  7. H

    Odd Graph Algorithm assignment

    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...
  8. H

    Odd Graph Algorithm assignment

    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...
  9. H

    Odd Graph Algorithm assignment

    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...
  10. H

    Getting started with Prolog

    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.
  11. H

    Getting started with Prolog

    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...
  12. H

    Why are computers not getting faster?

    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...
  13. H

    New CS student needs help choosing a laptop

    Yeah, you can't go wrong with a ThinkPad. If money is not a problem get the T series (T61 or T60) other-wize Z and R series are nice aswell.
  14. H

    Comparing Python and Java: Performance & Standard Libs

    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).
  15. H

    WHen did you learn what language or what CS field.

    Just one quick question: What do you think about the reduce() in python? Should it really be removed?
  16. H

    Java Sorting an Array in Java

    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>()...
  17. H

    ReplaceString method

    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...
  18. H

    Static Variables: Are They Really Static?

    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?
  19. H

    Help with a method

    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...
  20. H

    Laptop recommendations

    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.
  21. H

    Laptop recommendations

    You can't go wrong with a ThinkPad.
  22. H

    A good book please?

    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.
  23. H

    A good book please?

    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...
  24. H

    A good book please?

    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...
  25. H

    Is Win XP key transferable

    Ok, thanks there are just numbers.
  26. H

    Java Java programming help

    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...
  27. H

    Is Win XP key transferable

    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.
  28. H

    Is Win XP key transferable

    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?
  29. H

    New ideas for programming languages?

    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...
  30. H

    An absolute beginner

    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...
  31. H

    An absolute beginner

    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...
  32. H

    An absolute beginner

    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...
  33. H

    Get a server running locally to run a Struts app

    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...
  34. H

    GUI without WinAPI. Possible?

    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.
  35. H

    Which programming language is the best ?

    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...
  36. H

    Which programming language is the best ?

    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...
  37. H

    Which programming language is the best ?

    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...
  38. H

    C/C++ Server-client(s) loop in C/C++ (Windows)

    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...
  39. H

    C/C++ Server-client(s) loop in C/C++ (Windows)

    -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...
  40. H

    Advice on purchasing new laptop

    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...
  41. H

    What is the most useful algorithm ever written?

    It is like saying what is the most useflul theorem in Math? Hard to say since they are all darn important.
  42. H

    Program needed - for drawing electronic circuit diagrams

    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...
  43. H

    How to provide network security on steganography

    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...
  44. H

    A safer alternative to nuclear weapons?

    Why not focus on something more constructive? How about free medical care instead of nukes? A lot safer alternative if you ask me.
  45. H

    Searching for a Smaller Laptop: Dell Inspirion vs. Mac vs. Dell D420

    I am very fond of ThinkPads, check out X60. http://laptoplogic.com/reviews/detail.php?id=127
  46. H

    Calculators TI-89 Titanium equation Help

    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...
  47. H

    Counting problem.

    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...
  48. H

    Counting problem.

    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...
  49. H

    Counting problem.

    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...
  50. H

    Is 'var' weak type.

    Thanks for the answer. Yeah, I wouldn't dream of using var exept if I would write JavaScript.
Back
Top