Jump to content

Aeternus

Senior Members
  • Posts

    349
  • Joined

  • Last visited

Everything posted by Aeternus

  1. A good example of why software patents are a retarded idea and why when they keep popping up in Europe, we keep knocking them down (although I hate how large corporations can just keep bringing up the same crap, trying to get it through when no-one is looking). Also, a) they've said they won't - http://www.informationweek.com/news/showArticle.jhtml?articleID=199501831 b) It would be horrific publicity (although not a patent issue, look at SCO etc) c) If they lost, it would be rather damaging to their patent portfolio (remember patents can be thrown out of court if prior art is found or if the patented concept is found to be too obvious (although this is difficult to judge especially as so many concepts in these areas have been popularised now)) d) Lots of linux companies (Canonical/Ubuntu being one) aren't based in the US, and so I highly doubt they can be sued for anything although people who use them such as Dell might
  2. IIRC, Merge sort is similar in idea to Quick sort, you pick an element and then put some elements to the left and right and call merge sort on them. The difference between the two is that in the case of quick sort, you put all the elements say less than the pivot to the left, and greater than the pivot to the right, so if you pick a bad pivot, things can become rather one sided with only a couple of values to the left and lots of values to the right. This is why quicksort's worst case is O(n^2) rather than O(nlogn) (not sure if you understand O notation, if not check wikipedia gain, it answers all). In the case of merge sort, it doesn't bother to check whether something is less than or greater than a pivot, it just shoves half the values in group A, half in group B and then runs merge sort on each group. That will return in each group a sorted list of values in that group and then you can just merge these two back together into the full sorted list by just taking the smallest element from the front of each list and making that the next element. This means that there is slightly more work at each step than quicksort but overall it works out as O(nlogn). However, because mergesort does that little bit of extra work merging things together and potentially create additional lists etc depending on the implementation, quicksort tends to be somewhat quicker in practice than mergesort (from what I remember) (as it's average case is O(nlogn)). At least that's as far as I remember, a review of the wiki page will probably tell you more but hopefully this might help. WRT Heap Sort, IIRC, it just chucks things into a Heap, a tree based structure that just guarantees that things either get bigger or small (well actually satisfies a given heap property but meh) as you go from parent to child down the tree. So if you have say a minimum-heap, the least value is at the top and values get bigger as you go down the tree. Building this tree and inserting elements is fairly trivial (just like inserting into a binary search tree with a few minor changes) and then you can take the root off as the first value of the sorted set of data, the new head is the minimum of the two (or more, I think a heap is general enough) children and you rearrange the tree fairly simply to maintain the heap property, and then you just keep repeating this, removing the root and making it the next element in the sorted result (as it is always the minimum in the heap). You might want to look this up a bit more as my explanation has probably been poor.
  3. bascule, have you considered ObjC? It does message passing nicely apparently, has a lot of cool language features, ObjC 2.0 apparently has native garbage collection etc - http://www.informit.com/articles/article.asp?p=665128&seqNum=3&rl=1 . Plus things like GNUStep etc might make developing cross platform stuff easier.
  4. Yeah, that's pretty much what I've been thinking, purely ignorance of the science behind what is going on, and the belief that we are somehow going to create hybrid children :\
  5. http://news.bbc.co.uk/1/hi/health/6230945.stm Wondering what peoples opinions are on this? Are the people complaining simply religious nuts or is there actually a valid ethical argument (I don't see how "it is against nature !!" is really any argument at all)? If you agree with this (ie with the research), any thoughts ? If you are an expert in the area, could you explain a little of the likely benefits and perhaps some of the potential downsides ? If you don't, can you please explain why... (I honestly can't see it, although I will admit my understanding of the subject area is horribly inadequate).
  6. That's not quite right, they do provide binary drivers for linux, just like nvidia, it's just that they are rather half assed about it compared to their windows version and so their support is "substandard" (and so things often go wrong, don't work or aren't supported by the drivers).
  7. IIRC the Mozilla in the User-Agent is a throwback from the browser wars when IE was being blocked from some sites because they only supported Netscape so IE put that in there to fool them and allow their users access and therefore help gain marketshare (kind of like how Opera allows you to set your User-Agent to pretend you are using IE or some other browser if the site is being silly). http://en.wikipedia.org/wiki/User_agent#User_agent_spoofing
  8. As far as I am aware, using the default PHP session handling, the data for each session is stored in a file in the directory listed in "session.save_path" in the config. Your best bet if you want to treat it like a database is to use session_set_save_handler to customise the behaviour of the session handling so that it writes and reads it's information from a database that you can query. Another option might be looking for files of the right filenames and so on in the correct directory but this is certainly not guaranteed to give you just your sessions (depending on how the server is setup to run php and how php is configured) and is not an ideal solution. Alot of people will suggest that if you are planning for this to ever run of a shared server and the session data should be kept secure, you should probably write some form of custom session handling to keep away from the php default, as it is entirely insecure, as it is trivial for other people being hosted on your webserver to look into the directory used for storing temporary session files (using /tmp/ on linux). Theres alot more info here - http://uk.php.net/manual/en/ref.session.php
  9. Although unlikely (given that this is a home connection and you'd never really use a second IP), it could be that they allow you to be assigned another ip address for your own use (an IP is not infact unique to a computer, or strangely enough even to a network interface), so you could use that other IP for various things (often it can be useful for having multiple webservers or various other services). Or again, although unlikely, it could be that they are rolling out IPv6 across their network and they are informing you that you are being assigned an IPv6 IP and won't have to use one of the various 6-to-4 gateways. The other explanations are more likely, but I just thought I'd list a few more possibilities.
  10. Heh, he could always use mod_mono... although I doubt that would work perfectly (I'm certainly not suggesting it but it is an option if he wanted to use ASP.Net My vote goes with PHP or possibly Rails or some other framework (never used it but if I don't say it... bascule might hurt me))
  11. I don't really know anywhere you can find out about certification but have you considered volunteering at some local IT firms in the area to gain some references and so on. I'd imagine real work experience and the references to back that up would go a long way and some of the firms you volunteer for might turn around and hire you if something comes up, although I understand that if you are working anyway, it can be hard to find the time.
  12. The angled brackets are for passing type arguments to classes/methods etc when dealing with generics (feature new to java in 1.5).
  13. Although I agree with Klaynos, that you would be best learning to use the command line utilities first, there are plenty of IDEs (Integrated Development Environment) that do what you want. Netbeans is one, as Atheist mentioned, Eclipse is another. A really simple one, aimed at teaching Java to students is BlueJ. Just try searching on googl e for "java ide".
  14. Seems like a good idea to me (although I have no authority and am a dumbass ). Lets people learn from your code and you get some healthy criticism and advice.
  15. I think XFig (or WinFig?? for windows) does most of that although the interface is a bit clunky imo (can definitely output in a variety of postscript derived formats and also into various latex usables formats). I personally think Inkscape is quite well done. It's not specifically designed for what you want (it's just a general vector graphics app) but you can include greek characters using it's unicode support (just press ctrl+u and then type the unicode sequence for that character, or just copy that character in from another application - Inkscape Manual Ref - Unicode Character Code Charts). It does circles and connectors (so if you move the circle the line follows etc) and you can curve connectors and lots of other things. It also saves to .ps, .eps and it seems to save to LaTeX with pstricks as well.
  16. The idea is that you don't have your friends field but instead have another table with the fields user_id and friend_id. When a person has a friend, you add a row to the friends table (user_id = their_id, friend_id = their_friends_id). You can then get a list of a users friends by just getting all rows in the friends table for a given user_id, or if you want to see who has X as a friend, you just search for all the rows with the friend_id=X etc. You can even get all the data about these friends (ie their name etc from the users table) by doing JOIN with the user table. This also allows you to add additional information later on about a particular friendship (for instance you might want to store the time the friendship started so you can say "you have been friends for X"), as this would simply be an additional column in the friends table.
  17. Why not move things out into another table called user_friends or something? In that table you could have a - user_id | friend_id - and then you can simply query that table for all friends of a particular user id. That makes it easy to avoid any possible length of field problems (ie if you are using something with a fixed or at least a maximum string length, you will reach a point where you won't be able to add more friends) and searching for friends will be a hell of a lot faster as you won't have to use LIKE on every field and you can index on either or both of the fields in this new table depending on what you are usually searching for. This would also make it easier to remove things as with your current method you have to move around that string and remove things from the middle etc whereas with this it is a simple delete query.
  18. If he just used the ready made Web Browser control again like he did here - http://www.scienceforums.net/forums/showthread.php?t=15189&highlight=web+browser - it really isn't impressive at all.
  19. Aeternus

    PIC Project

    OOOooo nice, you made the thread Will you be posting some pictures etc of some of the various stages of build / work? Could you post some information on where you are buying the kit from and what other kit you might be using etc (for anyone who might be looking at getting into electronics)
  20. From the Set class - So try to avoid changing what the hashcode is once you've put things into a set. If you are going to change it, take it out and reinsert it? or perhaps if you are doing alot of operations on it, do the operations over the set and then create a new set (which will then remove any duplication). You might also be able to achieve the same behaviour with addAll() or you might be able to find a class that does something more akin to what you are looking for by looking for the things that implement the Set interface and trying them out or reading their docs. http://java.sun.com/j2se/1.5.0/docs/api/java/util/Set.html
  21. You can use the private modifier for a class, you just can't use it on a class that isn't a member of another class. The reason being, in that context, what would the private modifier actually mean. Normally the private modifier implies that the field or class being defined is only accessible within the confines of encapsulating class. In the case you are describing, there isn't anything encapsulating the class for it to be private in. You could suggest that it might be private within a package but there is a seperate keyword for that. The same is true with protected, as that implies that the class/field using that keyword is only accessible in the encapsulating class or any classes derived from it and within the same package (as the encapsulating class). In the case you are providing, the first example won't compile and will give the error - A.java:1: modifier protected not allowed here protected class A { ^ 1 error If you are suggesting that they should both be encapsulated in some class B then it all depends on whether A is in a seperate package to where it is being used. public A with private methods etc will be accessible anywhere it's encapsulating class is which means that is some class derives from B then in that class we can derive a class from A which can access all the fields etc. However, protected classes are only accessible within the same package, so if you do the same with the setup with protected A, it will not work, as you can't derive from A because you aren't in the same package. Therefore the two are not exactly equal although may work out to be in SOME cases. Here is the code I'm referring to - // Directory /t/ package t; public class B { public A x; public B () { x = new A(); } protected class A { int a; int b; void meth1(){}; void meth2(){}; public A () { a = 5; } } } // Directory /b/ package b; public class B { public A x; public B () { x = new A(); } public class A { protected int a; protected int b; protected void meth1(){}; protected void meth2(){}; protected A () { a = 5; } } } I had to remove the static keywords otherwise it wouldn't compile as you can't have static methods in a non-static inner class. // Compiles and prints out "5" import b.*; public class D extends B { public E testing; public static void main (String args[]) { D cheese = new D(); cheese.testing.print(); } public D () { testing = new E(); } public class E extends A { public void print() { System.out.println(a); } } } // Fails to compile and gives the error shown below import t.*; public class D extends B { public E testing; public static void main (String args[]) { D cheese = new D(); cheese.testing.print(); } public D () { testing = new E(); } public class E extends A { public void print() { System.out.println(a); } } } # Error [/somedir/] javac D.java D.java:17: a is not public in t.B.A; cannot be accessed from outside package System.out.println(a); ^ 1 error
×
×
  • 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.