Wikipedia:Reference desk/Archives/Computing/2011 December 13

= December 13 =

reboot?
if a computer supposedly turns itself off when you tell it to reboot, but turns itself back on, does that mean that some part of the computer stays active and reboots the rest, making it not a total reboot, just a reboot of the main stuff? 99.43.78.36 (talk) 04:00, 13 December 2011 (UTC)


 * Called a Soft_reboot. In most cases everything significant is cycled, but you're right, the power remains on to at least some components. The software doesn't actually stay in control of the machine the whole time, the hardware is designed so that once the operating system is done unloading, it can trigger a reboot, and the hardware will handle the actual reboot process. APL (talk) 05:08, 13 December 2011 (UTC)

ssh problem
Hi. I am trying to log in to my work computer from my linux box at home and make X work properly. I have two machines, say, A and B at work. I want to log in to machine B, but cannot log in directly from outside; I can only log in to machine A. When I am at home I can log in to machine A with "ssh -X " fine, and then "xeyes", for example, shows up on my screen at home. But if I then log into machine B, again with "ssh -X", I expected that "xeyes" will work and show up on my screen at home, but it doesn't.  I get a "can't open display: " error. How can I make ssh -X follow through? Robinh (talk) 08:02, 13 December 2011 (UTC)


 * I don't know what's going wrong, but a possible workaround is to ssh into machine A with a port from your home machine forwarded to B:22, and then ssh -X through the forwarded port. Before trying this you should check to make sure port forwarding is permitted, though I don't see any reason why they would forbid it.


 * You could also try tunneling VNC or NX instead of X, since they work over a single TCP link -- but again you'd better check that they're permitted. -- BenRG (talk) 03:19, 14 December 2011 (UTC)


 * By default in many Linux distributions, X forwarding is disabled in SSH. In your sshd config file (/etc/ssh/sshd_config on my machine), you will find the X11Forwarding option. If it is set to "no", you cannot forward X from the machine even if -X is requested. It must be set to "yes" and then the sshd server must be restarted. -- k a i n a w &trade; 03:36, 14 December 2011 (UTC)
 * (OP) thanks for these, guys.  I am afraid that my technical knowledge is not up to much.  I don't really understand how ports work.  Could you give me a quick 'hello world' example of forwarding to port B22?  Kainaw, VNC seems to be a good suggestion, but would I need to install it on all three machines?  cheers, Robinh (talk) 07:43, 14 December 2011 (UTC)


 * You shouldn't need to set up ports or VNC. I regularly ssh -Y (similar to -X) into one machine, then ssh -Y into another machine and the display on the furthest machine appears on my local machine. But, I had to allow X11Forwarding on the machines that I ssh'd into. Going about it another way is just adding a headache to the problem. They should allow simple X11 forwarding. If they don't, you haven't fixed the problem and trying to work around it will likely hit the same problem again from another angle. -- k a i n a w &trade; 14:15, 14 December 2011 (UTC)


 * Great. I've checked the ssh_config file and there is a line that says "ForwardX11Trusted yes", which tells me that either my home machine or machine B isn't trusted.  Thanks again, Robinh (talk) 19:49, 14 December 2011 (UTC)


 * It is better to use trusted forwarding. Instead of using "ssh -X" (untrusted), use "ssh -Y" (trusted). -- k a i n a w &trade; 20:15, 14 December 2011 (UTC)

MCA or MCS
I am a BSc(Computer Science) final year student.i am not very good in coding.i am confused about doing masters in Computer Application(MCA) or MCS.I want to know which degree is suitable for getting into testing field after masters, MCA or MCS i.e MSc in Computer Science.i am really confused as some people say MCA is good if you want to go into testing and some say the reverse.please help me. — Preceding unsigned comment added by Srichabagchi (talk • contribs) 09:25, 13 December 2011 (UTC)


 * It will depend on the syllabuses of the degrees and what precise field you want to work in. Don't worry as much about the title of the degree as what they actually teach.  Decide what area you want to work in (desktop apps, server/web apps, games, low-level, embedded, smartphone, etc), and see which degree has a syllabus that most closely matches your needs; also if the degree requires a project think what you might do and see if that fits with the course and the interests of the teachers; and see if they offer work experience or placements in industry.  A general Computer Science masters should be good for many areas of work, but for the best career possibilities you need to seek relevant experience through placements, the topics you study, and the tools (operating systems, development tools, applications like databases, etc) you use. --Colapeninsula (talk) 11:30, 13 December 2011 (UTC)


 * A masters for testing? Testing is often the starting position for software developers, I'm not sure why a masters degree is suitable for someone pursuing a test position.  If I were you I would try to get a testing position at at a company and use your current skills to get paid to learn as you go. TheGrimme (talk) 16:25, 13 December 2011 (UTC)

MediaWiki extension for drop-down search suggestions
How does Wikipedia implement the search suggestions that drop down when one begins typing in the search bar? Is it through an extension to MediaWiki? If so, what is the name of the extension? If not, is it something that can be easily ported to other wikis? Cheers, 182.239.212.112 (talk) 11:41, 13 December 2011 (UTC)

open source prohibited in app stores?
This article says that the new Windows 8 store will "allow open source apps", and that this is a distinguishing feature with respect to the Mac and other app stores. The clear implication is that the others somehow disallow open source apps. Is that true? And if so, on what basis? (That is, what sort of app store suitability clause disallows open source apps?) —Steve Summit (talk) 12:21, 13 December 2011 (UTC)
 * Various sources like   and Mac App Store mention the GPL conflicts with the TOS Apple imposes on their app stores (both the Mac one and the iTunes one, I guess both are relevant when it comes to Windows 8). Of course, other open source licences like the BSD one may not have this problem. Also this doesn't seem to be the same for Google's Android Market. E.g.  where someone who's part of the FSF suggests the TOS are unfair to consumers but aren't fundamentally incompatible with it. I know a number of apps which AFAIK are released under the GPL and some of them are in the Market. (To be fair, I don't know if they are re-using code or accepted contribs from others, obviously the copyright holder can additional release it under whatever licence they want.) I don't know about other Android, or other platform (including Chrome), app stores, like the Amazon one. Nil Einne (talk) 12:48, 13 December 2011 (UTC)
 * Aha. So the headline I quoted is doubly misleading.  It's not open source apps that are at issue here, but rather GPLed ones.  And it's not that the app store's terms of service explicitly prohibit the GPL (or open source), it's that there's a lurking incompatibility in the TOS that conflicts with the GPL.  If anything, it's the GPL that prohibits distribution through the app store(s) in question, not the store's TOS.  Makes sense.  Thanks. —Steve Summit (talk) 14:27, 13 December 2011 (UTC)
 * Actually, I think the implication is that Microsoft having anything to do with open source is newsworthy. -- LarryMac  | Talk  12:56, 13 December 2011 (UTC)


 * Microsoft, Sony, and Nintendo all prohibit copyleft licensed software to be part of any console game on their systems. Comet Tuttle (talk) 17:50, 13 December 2011 (UTC)
 * Ah, I guess they would, due to the razor and blades business model that underlies those consoles and the games that run on them. —Steve Summit (talk) 18:08, 13 December 2011 (UTC)
 * Do they disallow all copyleft, or only products that are fully copyleft? Because content and engine are usually licensed separately. APL (talk) 03:15, 15 December 2011 (UTC)

MATLAB Question
Anyone out there know how to select a particular digit from an at least two digit number in MATLAB? Specifically, I want to convert a number m from decimal to binary and then recover m as the sum of powers of two, which I will know from the binary expansion. Thanks. 92.19.253.37 (talk) 21:02, 13 December 2011 (UTC)


 * In general, you can use something like rem(fix(x/b^n),b) to get the nth digit of x, base b. Since you're working in binary, bitand is potentially a better way to go.

x = 42; bit = 1; list = []; while x >= bit if bitand(x,bit) ~= 0 list(end+1) = bit; end bit = bit + bit; end
 * Bobmath (talk) 14:19, 14 December 2011 (UTC)


 * Or you can turn the number into a string and work with it that way.
 * >> s = dec2bin(42)
 * s = 101010
 * >> s(1)
 * ans = 1
 * >> s(2)
 * ans = 0
 * 130.76.64.120 (talk) 18:23, 14 December 2011 (UTC)


 * If you want to express a number as a sum of powers of two, that's essentially the same problem as converting it to base two. But you don't have to "convert it from base ten to base two" first, because it's not really meaningful to say that a number stored in a computer is in base ten, or in base two -- it's a number.  (Internally, probably, it's stored in base two anyway, but you can't really see that.)


 * If you want to express a number as a sum of powers of two, first find out if it's even or odd. You can do that using a modulo operator.  If it's odd, add 1&times;20 to your sum.


 * Then, divide it by two, discarding any remainder. Then, determine again if this new number is even or odd -- if it's odd, add 1&times;21 to your sum.


 * Continue this process until dividing by two results in 0.


 * I don't know MATLAB, but here's a quick implementation in C, which illustrates the algorithm I'm talking about, and shouldn't be too hard to express in MATLAB, either. The number to be decomposed is , and it should be declared as an integer, or whatever it takes to ensure that when you divide it by 2, the remainder is discarded.




 * —Steve Summit (talk) 03:52, 15 December 2011 (UTC)

Thanks all, that's been very helpful. 92.19.250.34 (talk) 20:32, 15 December 2011 (UTC)