Wikipedia:Reference desk/Archives/Computing/2012 June 25
Computing desk | ||
---|---|---|
< June 24 | << May | June | Jul >> | June 26 > |
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. |
June 25
[edit]how unsigned store negative number
[edit]Hi sir!My doubt is on unsigned integer.I know that unsigned integer ranges from 0 to 255 for 8 bit integer. But I am not able understand the how unsigned integer stores negative numbers. 1)in c negative numbers are stored in 2’s complement form. If I write int i=-5; Then -5stored in 2’s complement form.i.e 11111011(for 8 bits).if we convert it to decimal we can get -5. 2)But if I write like below Unsigned int i=-127; ->how -127 is stored in i? ->in my book I read that the above -127 is equal to 128.how it is possible? ->What bits are stored in i so as to get 128? I hope you help me. — Preceding unsigned comment added by Phanihup (talk • contribs) 02:11, 25 June 2012 (UTC)
- Unsigned integers do not store negative numbers. The "sign" in "unsigned" is the negative sign, so unsigned numbers can't be negative. The -127 and +128 have the same eight-bit pattern, so the way it is interpreted is whether it is a signed or unsigned integer. Bubba73 You talkin' to me? 02:18, 25 June 2012 (UTC)
- Agreed, but to clarify, the numbers are neither positive nor negative, they have no sign at all. You could then add a sign, say by assigning a separate bit to handle this, but you'd have to manage this yourself, giving you the equivalent of 9-bit signed integer. StuRat (talk) 04:47, 25 June 2012 (UTC)
- Right. And in programming languages that are not strongly typed, you can get in trouble mixing them (getting results different from what you would expect mathematically). Bubba73 You talkin' to me? 05:50, 26 June 2012 (UTC)
Windows Live Mail
[edit]Why does Windows Live Mail warn you that images will be removed if you send this Email? Do you want to send it anyway? There were no images on the Email to start with!!
Hamish 84Hamish84 (talk) 07:53, 25 June 2012 (UTC)
PS. To all who provide me with help please take it as read that I am grateful.
- I'm afraid I don't have a copy of Live Mail to duplicate the message, so this is a bit of a guess, but I expect that you are sending emails in 'plain text' format - that is, with no formatting, special characters, or indeed pictures. There's an article about the benefits of plain text emails here: http://www.mail-list.com/why-plain-text-email-messages-are-best-in-todays-internet/.
- What will be happening is that Live Mail sees you sending a mail in plain text, goes 'OMG! The recipient won't be able to see that lolz-full picture you might want to send! Must warn you!' - basically it is warning you that the message is not capable of sending pictures, whether or not you asked it to.
- One way to remove the message would be to send your messages in HTML format, which allows pictures. Find this option in the settings. Alternatively, get a better email client. Many exist; Mozilla Thunderbird is one of the most commonly mentioned free examples. - Cucumber Mike (talk) 06:54, 26 June 2012 (UTC)
why checked,unchecked exceptions in java
[edit]hi!In java some exceptions are checked exceptions,some exceptions are unchecked. Java compiler checks in compile time whether some exceptions are handled or not.such type exceptions are checked exceptions. ex:IOException The exceptions whose handling is not checked in compile time are called unchecked. Ex: ArrayIndexOutOfBoundsException
- Now my questions are
-> why some exceptions handling is checked at compile time(checked exceptions)? ->what is the use by checking whether some exceptions are handled or not at compile time? ->if we leave with out checking whether some exceptions are handled or not ,what is loss to us? If you consider the checked exception “IOException”,compiler only knows whether the input given by us is valid or not only at run time.then why should it‘s handling should be tested at compile time?
All the above questions for unchecked exceptions.but in reverse. -> why some exceptions handling is not checked at compile time(unchecked exceptions)? -> what is the use by leaving whether they are handled or not at compile time? ->if we handle unchecked exceptions’ handling at compile time ,what is loss to us?
I hope you help me. — Preceding unsigned comment added by Phanihup (talk • contribs) 10:18, 25 June 2012 (UTC)
- Ah, the great checked/unchecked exception controversy. You might want to have a look at Sun's (now Oracle's) POV on this here. IBM also has a good article about it here. - Letsbefiends (talk) 22:34, 25 June 2012 (UTC)
Waking a disk drive that's gone to sleep due to inactivity / power saving
[edit]I have a couple of Windows PCs (one XP, one 7 Ultimate) with hard drives that put themselves to sleep (eg stop spinning) to conserve power after some period of inactivity. One is an internal SATA drive, one is an external USB-connected drive. For various reasons it is either not possible or not desirable to disable the power saving function. I would like to be able wake the drives - ie get them spinning again, ready for instant use - on demand, under the control of a command script, and without writing anything to the disk. The simple approach such as "dir d:\" does not work, because typically the computer (or the drive hardware) has some data cached, and simply returns the data from the cache without spinning up the drive. I need a method that is does not depend on knowledge of what might be in the cache (ie previous use of the drive), and does not take very long (eg "dir/s on a drive with many directories/files works, but takes longer than waking the drive automatically).
Is there a simple and reliable way of forcing Windows to spin the drive up and get it ready for action? Mitch Ames (talk) 12:31, 25 June 2012 (UTC)
- I don't have such a sleepy drive to try this, but you might try reading something that definitely doesn't exist (and so can't be in cache) - e.g. d:\4334234\4695469643\23232, where the numbers are randomly generated (so the next try won't be cached either). -- Finlay McWalterჷTalk 12:37, 25 June 2012 (UTC)
- As always, things can get more complicated. Here's a whitepaper from Microsoft regarding idle power detection: Windows Disk Idle Detection, which is part of an entire series on ACPI and power management. Ideally, you want to send an ACPI event informing Windows that the disk is in use, not simply assume that reading a file will wake or reset the idle timer. In practice, reading an uncached file will usually reset the idle-timeout or wake the disk if it's already asleep, but that's an indirect way to accomplish the goal (telling the system that you want the disk to remain powered). In the whitepaper, detailed explanations are provided, but here's their example of overriding the power profile for the current disk:
C:\>powercfg -setdcvalueindex SCHEME_CURRENT SUB_DISK 80e3c60e-bb94-4ad8-bbe0-0d3195efc663 0 C:\>powercfg -setactive SCHEME_CURRENT
- You need to find your disk's guid, as explained in the whitepaper. And of course, your script should query, store, and reset the original powerstate when finished. Nimur (talk) 15:02, 25 June 2012 (UTC)
Regarding recording md5 format in jmeter
[edit]In my project there is a scenario that user will log in -> browse some pages -> then he will click on the logout link . to test this scenario in jemeter , i used csv config so that i can test this scenario for 50 users. during login to the system password are not sent in md5 format but during logout ,each user passowrd is sent as request in the md5 format. so can any body tell me how can i sent the password in md5 format in jmeter. if i use the the same variable which i used for passowrd during login , with encode option clicked , will it work. please help me — Preceding unsigned comment added by 202.90.110.220 (talk) 17:38, 25 June 2012 (UTC)
- I have no clue what 'jmeter' is, but any system that sends md5-hashed data over an unsecure connection would seem to be badly broken to me (or at least not understand the purpose of MD5). What is a 'csv config' and what are you trying to accomplish? Unilynx (talk) 19:14, 25 June 2012 (UTC)
- Since this is testing of a Web service, it probably refers to Apache JMeter. NeonMerlin 20:18, 25 June 2012 (UTC)
Semi-supervised text classification
[edit]What algorithms for semi-supervised text classification, and what methods of validation, are suitable for ongoing use on an evolving body of text, with little or no ongoing input of new labelled examples? NeonMerlin 19:45, 25 June 2012 (UTC)
- I can't understand your Q:
- 1) Does "semi-supervised text classification" mean the computer first tries to determine what kind of text it is, and then a human checks it ?
- 2) What "evolving body of text" ? Are these existing documents being automatically scanned ?
- 3) "Ongoing input" ?
- Basically, I think you should rewrite your Q without any assumptions or jargon, telling us exactly what you are trying to do, in simple English. StuRat (talk) 20:52, 25 June 2012 (UTC)
- StuRat, the question is very specific; it seems you're just unfamiliar with the subject. (1) In machine learning, supervised learning is the term for an algorithm that is trained on pre-processed data. (2) In natural language processing, a corpus is the body of text fed into the algorithm; the question is asking for an algorithm that can meaningfully process incremental additions or changes to the corpus. (3) New additions to the corpus would be unsupervised learning.
- NeonMerlin, maybe the best place to start is with a textbook on text classification: here are a list of several good NLP books. I seem to recall Jurafsky and Martin better than any of the others. Information Retrieval is also available for free online, and includes entire chapters on text classification using Naive Bayes, and the infamous Support Vector Machines. (We also have an article in Wikipedia: support vector machine, if you're unfamiliar with them). Nimur (talk) 00:04, 26 June 2012 (UTC)
- Thanks for the clarification. I still think a description of the problem with less jargon (or perhaps links to explain the jargon, like using "supervised" to mean "labelled") would have been helpful (and it sounds like this area is very jargon heavy). I've always suspected that academia uses unnecessarily complex jargon to make what they do sound more impressive than it really is. StuRat (talk) 00:21, 26 June 2012 (UTC)
- Certain topics, like algorithms for natural language processing, are best described with precise technical terms. This is not an easy subject, and whether you find it impressive or not does not change the fact that it will require many years of advanced study to master. Unlike sorting algorithms, which can be demonstrated graphically or explained procedurally, Bayesian classifier algorithms over infinite-dimension grammar spaces are not easily explained without resorting to advanced statistical and mathematical concepts, which is one reason that they are rarely learned until advanced studies. The first time I encountered classifiers in any tangible form was at least four years in to my math- and computing-heavy undergraduate curriculum; and I never really studied them until after I had completed my Master's degree. To this day I do not really understand their theoretical application to NLP (though I've programmed to a few engineering-approximation library APIs). NLP is a fascinating challenge, but I am not sure if these algorithms are meaningfully digestible for NeonMerlin at this point, as evidenced by his reputation for questions about much simpler topics. Nonetheless, study away: the only way to acquire advanced knowledge is to struggle through difficult topics. Nimur (talk) 15:30, 26 June 2012 (UTC)
- I still say they are trying to make it more complicated than it needs to be. Using Latin is a good sign of this, with "corpus" used where "body of text" would be so much easier to understand (and "corpus" is actually less specific, meaning only "body"). Religion and the law are two other places where they have used this strategy to intentionally make it less accessible to those "not in the club". StuRat (talk) 17:57, 26 June 2012 (UTC)
- By semi-supervised learning, I mean that both labelled and unlabelled examples are available for training, and that new documents will be available for model updating before they need to be classified. NeonMerlin 17:21, 28 June 2012 (UTC)
- NeonMerlin's question was perfectly fine and "corpus" is the term I've always seen. One more resource: http://machinelearningtext.pbworks.com has lots of good materials, though I don't remember anything particularly about semi-supervised classification. 69.228.171.149 (talk) 08:23, 29 June 2012 (UTC)