Wikipedia:Reference desk/Archives/Computing/2009 September 16
Computing desk | ||
---|---|---|
< September 15 | << Aug | September | Oct >> | September 17 > |
Welcome to the Wikipedia Computing Reference Desk Archives |
---|
The page you are currently viewing is an archive page. While you can leave answers for any questions shown below, please ask new questions on one of the current reference desk pages. |
September 16
[edit]Quick Java question
[edit]Hello! Just a quick couple of questions I've been wondering: Is there a memory disadvantage to importing an entire package (e.g. import java.io.*) instead of individual classes? My guess is no, because I learned that Java loads classes lazily. My second question is regarding the finally{} block. Does it really serve a purpose? Once an exception is caught, as long as the catch{} block does not call java.lang.System.exit(int), the following code is executed, whether it's in a finally block or not. Thank you!--el Aprel (facta-facienda) 02:10, 16 September 2009 (UTC)
- Import has no effect on the compiled bytecode. Only the compiler sees the import statements, the JVM that executes the code (or compiles it into machine code) doesn't know what you imported.
- Often the code after the try/catch/finally structure is not executed. The catch block might not be present, or it might log the exception and re-throw it. Or the catch might catch something like IOException, but if there is a programming error and a NullPointerException is thrown, the catch won't handle that. So finally becomes the right place to close file handles and such. 62.78.198.48 (talk) 04:37, 16 September 2009 (UTC)
- It's been a while since I wrote Java code, but I think that if it didn't have the finally feature you would have to change code like this:
try {
somethingThatMightThrow();
} catch (SomeException e) {
// handle SomeException
} finally {
// clean up stuff from the try block
}
...
- to this:
try {
somethingThatMightThrow();
} catch (SomeException e) {
// handle SomeException
} catch (Throwable t) {
// clean up stuff from the try block
// and then rethrow t
throw t;
}
// clean up stuff from the try block
...
- That's not great, since you have to duplicate the cleanup code, and the rethrow will mess up your stack trace (I think). Exception handling is an area where C++'s RAII idiom is a lot easier to work with than languages like Java where you have no idea when/if destructors will run. --Sean 14:50, 16 September 2009 (UTC)
- Except of course, when the cleanup itself can fail. As we know, destructors must not throw. Thus, you end up having to use the second alternative above anyway, even in the presence of deterministic destruction. Still, RAII is great for many common cases. decltype (talk) 14:58, 16 September 2009 (UTC)
- C++ Destructors may throw as they wish. The danger is that a throwing destructor, might throw during stack unwinding too, confusing the environment as we suddenly have two exceptions to deal with at the same time. I would expect Java to get equally confused if, while executing a finally() block due to an as-of-yet unhandled exception, the finally block causes another exception to be thrown. Unilynx (talk) 21:36, 16 September 2009 (UTC)
- That is why exceptions are scoped in Java. The compiler will require a unique name for each exception, including those in the finally{} block. Another try/catch/finally or throws clause must exist for an exception thrown in a finally block. There can be no ambiguity about which exception is being processed by a given catch block. Nimur (talk) 22:34, 16 September 2009 (UTC)
- It's not correct to say that C++ gets confused by two exceptions at the same time. The behavior -- terminate() -- is well-defined, but not what most people want to happen. --Sean 13:13, 17 September 2009 (UTC)
- Java doesn't get confused in this situation, it just has a "last exception wins" policy. An exception thrown from a catch or finally clause just leaves the function immediately and forgets about the exception that was being handled. I guess C++ couldn't use this approach because it doesn't have native garbage collection, so things still on the stack would never have their destructors run. --Sean 13:39, 17 September 2009 (UTC)
- They would, because unwinding picks up where it left off whether or not the original exception is replaced by another. I don't think it would be hard to destroy the preempted exception object either, since there must be a mechanism for doing that in the catch (...) case. I assume they must have chosen terminate() because they thought it was the right thing to do. I'm not sure Java's choice is a good one, since errors that occur during cleanup from a failure tend to matter less than the original failure. On the other hand, C++ is kind of inconsistent, since the usual idiom for cleaning up only on failure is catch (...) { /*cleanup*/ throw; }, and there the last exception wins. -- BenRG (talk) 14:39, 17 September 2009 (UTC)
- I've just read in D&E that the big debate at the time was whether to allow exception handlers to resume at the point-of-throw after doing some resource-freeing or whatever, which would have been deeply weird for us non-Schemey-types. --Sean 16:06, 17 September 2009 (UTC)
- They would, because unwinding picks up where it left off whether or not the original exception is replaced by another. I don't think it would be hard to destroy the preempted exception object either, since there must be a mechanism for doing that in the catch (...) case. I assume they must have chosen terminate() because they thought it was the right thing to do. I'm not sure Java's choice is a good one, since errors that occur during cleanup from a failure tend to matter less than the original failure. On the other hand, C++ is kind of inconsistent, since the usual idiom for cleaning up only on failure is catch (...) { /*cleanup*/ throw; }, and there the last exception wins. -- BenRG (talk) 14:39, 17 September 2009 (UTC)
- C++ Destructors may throw as they wish. The danger is that a throwing destructor, might throw during stack unwinding too, confusing the environment as we suddenly have two exceptions to deal with at the same time. I would expect Java to get equally confused if, while executing a finally() block due to an as-of-yet unhandled exception, the finally block causes another exception to be thrown. Unilynx (talk) 21:36, 16 September 2009 (UTC)
- Except of course, when the cleanup itself can fail. As we know, destructors must not throw. Thus, you end up having to use the second alternative above anyway, even in the presence of deterministic destruction. Still, RAII is great for many common cases. decltype (talk) 14:58, 16 September 2009 (UTC)
- You are neglecting to consider try-finally blocks. You should only catch the exceptions that you can appropriately handle. Anything else should not be caught. This scenario introduces a common pattern: try-finally blocks without any exception catches. In this case, a finally block is the only way to guarantee a chance for cleanup. Another common pattern is to return values from within a try block. Again, a finally block is the only structured way to allow for any necessary cleanup. try-catch-finally may not technically be necessary, but, just as in a try-finally, putting any cleanup code in a finally block is best practice, regardless of the possibility of exceptions. It also promotes clearer and more maintainable code. 124.214.131.55 (talk) 15:55, 16 September 2009 (UTC)
Google Chrome: Recent Bookmarks bar
[edit]Yesterday, Google updated Google Chrome, but I didn't see any changes until this morning (even though I had the computer downloading all night). The New Tab page now holds 8 instead of 9 most visited pages and the blue bar with recent bookmarks has completely disappeared. Has anyone got an idea how to restore this, or at least get the recent bookmarks feature back? —Preceding unsigned comment added by 131.211.211.117 (talk) 08:00, 16 September 2009 (UTC)
- Do a system restore, or, there are some previous builds here http://build.chromium.org/buildbot/snapshots/chromium-rel-xp/
- 77.86.47.174 (talk) 10:12, 16 September 2009 (UTC)
- You could tell them you don't like the new one via http://www.google.com/support/forum/p/Chrome?hl=en 77.86.47.174 (talk) 12:10, 16 September 2009 (UTC)
- There is a far better way below, ask if you get stuck implementing it.87.102.94.154 (talk) 19:37, 16 September 2009 (UTC)
See http://www.google.com/support/forum/p/Chrome/thread?tid=0fca9ffc66018150&hl=en 77.86.47.174 (talk) 12:18, 16 September 2009 (UTC)
- But thank God (or, more, appropriately, the Google Chrome developers) that HTML accesskeys are working again. --Andreas Rejbrand (talk) 12:43, 16 September 2009 (UTC)
Remote Desktop Server
[edit]I've come across references to this but the remote desktop article doesn't say what it is or what functionality it provides... FT2 (Talk | email) 13:18, 16 September 2009 (UTC)
- You are probably looking for Remote Desktop Services, which specifically describes the Microsoft implementation. The main remote desktop article is only a general overview of this type of software. Nimur (talk) 14:26, 16 September 2009 (UTC)
- Close, but still lacks basic information. There are several terms (or systems) used in the Microsoft world - Remote desktop connection, Remote Desktop Services, Windows Desktop Sharing, and Remote Desktop Server. I can't find a side-by-side explanation of what they each mean or the differences between them. FT2 (Talk | email) 15:53, 16 September 2009 (UTC)
- Terminal Server is the server. It typically runs on Windows Server, but can run on the professional desktop versions such as Windows Vista Business. Remote Desktop Client is the client. It is available on all Windows platforms since Windows 2000 (I think). Remote Desktop Protocol is the technical description of the connection scheme between client and server. Windows Desktop Sharing is a new technology which changes the login-session paradigm (i.e. you can connect to a "desktop" of an already-logged-in-user). Previously, Terminal Services created a new login session for each connected instance. What information are you seeking that was not already in the Remote Desktop Services article? "Side-by-side comparison" is not really suitable, because these are individual components of the Remote Desktop Services system, not interchangeable tools with comparable feature sets. Maybe the official Getting Started guide from Microsoft is the best place to start, if you don't know the terminology. Nimur (talk) 17:10, 16 September 2009 (UTC)
- Apparently (so it seems) "Remote Desktop Server" is a differentiating item between various versions of Windows 7. I couldn't find an answer what exactly this would do (or what its omission would prevent a user doing) to see what it was that was so significant as to differentiate two editions. There isn't a clear answer anywhere on the web what a prospective purchaser can do with this, that they couldn't do without it. FT2 (Talk | email) 01:17, 18 September 2009 (UTC)
- You are correct. As in previous Windows releases, the remote desktop server is only available in those versions of Windows which are branded for "Server", "Business", or "Professional" use. This means that these versions will be able to host remote desktop sessions - that is, your personal computer can operate as a server. (Are you still confused what "remote desktop server" means? It means that you can be sitting at a different computer, but connect to your server over the network, and use its applications, access its hard disk drive, and see the windows open on its desktop). All versions of Windows (including those which lack the remote desktop server) have the remote desktop client - so they can connect to other computers which are hosting remote desktop server. But only certain (more expensive) versions allow you to connect into the computer. Maybe if this is not clear you should read our article called client-server to conceptualize the distinction between remote desktop server and remote desktop client. Nimur (talk) 04:00, 18 September 2009 (UTC)
- I think you touched on it enough to explain the difference. So a lesser specification would imply one can connect to, but not be connected by (in any way)? I had thought "Server" meant it would allow some form of multi-user remote desktop conferencing or other more sophisticated functionalities. Simply being able to be connected into as a remote desktop by another user... that's basic these days for technical support and so on, to be able to connect to the remote machine and help the user directly. How will that work, when most new Windows adopters will be on PCs that don't have it and can't be connected into? Won't that be fairly detrimental to a wide range of IT support services in the domestic and corporate worlds? Any help finding a reference on this to read? FT2 (Talk | email) 04:10, 18 September 2009 (UTC)
- As I mentioned above, that is why the more expensive "Business" versions do include this feature. I linked the Getting Started guide above. There are lots of references from there, provided by Microsoft. Everything from tutorials to research and technical whitepapers can be found linked from the Getting Started guide. Nimur (talk) 15:29, 18 September 2009 (UTC)
- I think you touched on it enough to explain the difference. So a lesser specification would imply one can connect to, but not be connected by (in any way)? I had thought "Server" meant it would allow some form of multi-user remote desktop conferencing or other more sophisticated functionalities. Simply being able to be connected into as a remote desktop by another user... that's basic these days for technical support and so on, to be able to connect to the remote machine and help the user directly. How will that work, when most new Windows adopters will be on PCs that don't have it and can't be connected into? Won't that be fairly detrimental to a wide range of IT support services in the domestic and corporate worlds? Any help finding a reference on this to read? FT2 (Talk | email) 04:10, 18 September 2009 (UTC)
- You are correct. As in previous Windows releases, the remote desktop server is only available in those versions of Windows which are branded for "Server", "Business", or "Professional" use. This means that these versions will be able to host remote desktop sessions - that is, your personal computer can operate as a server. (Are you still confused what "remote desktop server" means? It means that you can be sitting at a different computer, but connect to your server over the network, and use its applications, access its hard disk drive, and see the windows open on its desktop). All versions of Windows (including those which lack the remote desktop server) have the remote desktop client - so they can connect to other computers which are hosting remote desktop server. But only certain (more expensive) versions allow you to connect into the computer. Maybe if this is not clear you should read our article called client-server to conceptualize the distinction between remote desktop server and remote desktop client. Nimur (talk) 04:00, 18 September 2009 (UTC)
- Apparently (so it seems) "Remote Desktop Server" is a differentiating item between various versions of Windows 7. I couldn't find an answer what exactly this would do (or what its omission would prevent a user doing) to see what it was that was so significant as to differentiate two editions. There isn't a clear answer anywhere on the web what a prospective purchaser can do with this, that they couldn't do without it. FT2 (Talk | email) 01:17, 18 September 2009 (UTC)
- Terminal Server is the server. It typically runs on Windows Server, but can run on the professional desktop versions such as Windows Vista Business. Remote Desktop Client is the client. It is available on all Windows platforms since Windows 2000 (I think). Remote Desktop Protocol is the technical description of the connection scheme between client and server. Windows Desktop Sharing is a new technology which changes the login-session paradigm (i.e. you can connect to a "desktop" of an already-logged-in-user). Previously, Terminal Services created a new login session for each connected instance. What information are you seeking that was not already in the Remote Desktop Services article? "Side-by-side comparison" is not really suitable, because these are individual components of the Remote Desktop Services system, not interchangeable tools with comparable feature sets. Maybe the official Getting Started guide from Microsoft is the best place to start, if you don't know the terminology. Nimur (talk) 17:10, 16 September 2009 (UTC)
- Close, but still lacks basic information. There are several terms (or systems) used in the Microsoft world - Remote desktop connection, Remote Desktop Services, Windows Desktop Sharing, and Remote Desktop Server. I can't find a side-by-side explanation of what they each mean or the differences between them. FT2 (Talk | email) 15:53, 16 September 2009 (UTC)
norton vs avast
[edit]Hi, I am running XP on a PC and Vista basic on my new laptop.
On my PC I use the free version of Avast which does fine. On my laptop I have 40 days left of Norton which runs very smoothly...
What do you recommend? Should I get a cheap 2009 version of Norton from Amazon or ditch it completely and use Avast free version on my laptop?
cheers! —Preceding unsigned comment added by 89.241.127.92 (talk) 16:05, 16 September 2009 (UTC)
- Have you considered alternatives like Comodo AV, Avira, NOD32, Kaspersky, or the upcoming Microsoft Security Essentials? (2 out of 5 are free, and I reccomend all over Avast and Norton). Btween Avast and Norton, I reccomend Avast though. —Preceding unsigned comment added by Caltsar (talk • contribs) 16:36, 16 September 2009 (UTC)
- Which of the two free ones is best? Are you ready for IPv6? (talk) 17:07, 16 September 2009 (UTC)
- I just recently dumped norton, which has annoying pop-ups every time you try to download or save something, and replaced it with avast, so far I've been very happy with it--Jac16888Talk 17:27, 16 September 2009 (UTC)
- I personally like MSE, but it's still in a limited beta. Before that, I was using Comodo, but I only like their AV product and not their firewall. Avast is definately good, but the interface and the general "speed" of it puts it just out of my top 5. Both Comodo and MSE are free. Avira has a free version, but it nags you to upgrade once a day/week or something. The most expensive on my list is NOD32, but it makes up for the price in having a very light footprint.Caltsar (talk) 18:39, 16 September 2009 (UTC)
- Which of the two free ones is best? Are you ready for IPv6? (talk) 17:07, 16 September 2009 (UTC)
- When I first moved to China I picked up a worm from my company's network that absolutely no virus scan could get rid of. I couldn't even google it because it was some domestic Chinese virus that just made a few hidden folders and tried to propogate via autorun. Chinese virusscan software was useless. I ended up getting Kaspersky, which was able to notice the virus' activity but wouldn't kill it because it didn't know what it was. Using their in-program instructions, I submitted the virus to them for analysis and they deconstructed and added it to the virus database within 48 hours. After my next update I was finally rid of a bug that's basically on every computer in NE China. I can't afford Kaspersky these days, but I'll never forget how satisfied I was with their service. 218.25.32.210 (talk) 01:08, 17 September 2009 (UTC)
Another alternative program is AVG, which is a amazing free antivirus, which has all the features of a paid-for antivirus program, which are sometimes really expensive when you can get all the same features and protection for free. I currently use it on my PC and it works brilliantly. Chevymontecarlo (talk) 12:14, 21 September 2009 (UTC)
Computerisation of the Nigerian Judicial System
[edit]please what can make up the chapter three of my project on the topic çomputerisation of the Nigerian Judicial System —Preceding unsigned comment added by Awugo (talk • contribs) 17:12, 16 September 2009 (UTC) Question restored by AlmostReadytoFly (talk) 08:05, 17 September 2009 (UTC)
- What makes up chapters 1 and 2? AlmostReadytoFly (talk) 08:05, 17 September 2009 (UTC)
Learning the R statistical language - any statistical textbooks that use R?
[edit]I would like to become proficient in R (programming language), and my statitical knowledge is a little rusty. Are there any statistical textbooks that use or teach R at the same time, especially with regard to time series? I am aware of R Commander. The online introductory material I've seen for either R or R Commander are just bare-bones listings of what they do. I'd like to be set for example exercises that start me using the language. I am not a programmer so need more than just a list of commands. Thanks 89.243.195.226 (talk) 19:18, 16 September 2009 (UTC)
- "Introductory Statistics with R" sounds promising. Also check out the "similar titles" section. --Sean 20:13, 16 September 2009 (UTC)
- I've got that one( Peter Dalgaard, "Introductory Statistics with R", 260 pages). It mainly covers how to perform standard statistical tests (hypothesis testing) in R, it's a "cook book" but doesn't really teach you how to use R as a programming language.
- In addition, I've got "The R book", by Michael J. Crawley, Wiley, 2007, 942 pages. It is a must if you want to be proficient in R as a programming language.
- I've also got Michael J. Crawley's "Statistics. An introduction using R", Wiley, 2005, 304 pages. It covers some of the same stuff that Daalgaard's book, but the approach is slightly more theoretical, and there is more focus on R as a programming language. It's a better choice than Dalgaards book for an introductory text, IMO.
- Finally, I've got "R graphics", by Paul Murrel, Chapman & Hall 2006, 291 pages. If you want to use R as a graphics engine (which I do), it, too, is a must.
- --NorwegianBlue talk 19:28, 17 September 2009 (UTC)
System freezing because of RAM ?
[edit]Hello there, Can a RAM Cause system to freeze (both randomly or running system for several hours)? (Screen or game freezes on desktop) Thank you--119.30.36.39 (talk) 20:00, 16 September 2009 (UTC)
- Yes, certainly. Searching for "bad RAM" shows that random lockups are a common symptom. --Sean 20:21, 16 September 2009 (UTC)
- There's freeware programs that can test your RAM to see if it's bad. Are you ready for IPv6? (talk) 21:24, 16 September 2009 (UTC)
- RAM can cause it, a bad HD can cause that, even overheating can cause that... test the RAM and see if it's really the problem before you replace it. You can test it with memtest86. --98.217.14.211 (talk) 21:26, 16 September 2009 (UTC)
- If you're computer is running slowly then it's probably in isue with the ram. i.e. you game looks like its lagging etc. if not then i would also suggest that if you're using a computer desk that has a "place" for your tower to sit in with a door in front of the tower to either A) open your door while the computer is on B) drill 2 inch holes in the back of the desk or C) take the tower out completely. If you have Low hard drive space this could also be an issue. If you're running Vista i would suggest no lower then 1 GB of ram ESPECIALLY on a laptop.
- --JD's Web Service 13:47, 18 September 2009 (UTC)