Wikipedia:Reference desk/Archives/Computing/2012 April 20

From Wikipedia, the free encyclopedia
Jump to: navigation, search
Computing desk
< April 19 << Mar | April | May >> April 21 >
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.


April 20[edit]

What sized go-board could a Matrioshka brain solve in a few days?[edit]

Go, the game 1001 x 1001? a million and 1 x a million and 1? Am I horribly wrong? What about 100 years?

Yes. You're horribly wrong ;). Consider Go in the context of the Bremermann's limit, as described at Transcomputational_problem#Implications: "Problems involving vast numbers of possibilities will not be solved by sheer data processing quantity." --Tagishsimon (talk) 00:09, 20 April 2012 (UTC)
(edit conflict) Assuming you're talking about brute force, probably 8x8 or less. According to Go and mathematics, there are around 10^{38} legal positions in a 9x9 game. There are something like 10^{80} atoms in the universe, and a single Matrioshka brain is only a small part of the universe. Working out any actual numbers would require figuring out how generous we're willing to be with Moore's Law, but my gut says that 9x9 is going to be physically impossible in 100 years, no matter what. Paul (Stansifer) 00:31, 20 April 2012 (UTC)
Please don't conflate "universe" with "observable universe". --Trovatore (talk) 00:39, 20 April 2012 (UTC)
Matrioshka brain is so speculative as to be more on the level of a sci-fi thought experiment. Apart from the generalized computational infferences we can make, such as the above answers, asking specific questions about what it can or can't do in a specific timeframe is meaningless. Vespine (talk) 01:37, 20 April 2012 (UTC)
So quantum computing won't help this, right? Why does it work on cracking password keys though? (Or at least it might, if we can figure out how to make it work) Sagittarian Milky Way (talk) 21:22, 21 April 2012 (UTC)
Quantum computers run quantum algorithms. There are fast quantum algorithms for cracking all of the popular public-key cryptography systems and certain other problems, but for most problems the fastest known quantum algorithm is as slow as the fastest known classical algorithm. I wouldn't rule out the possibility that quantum computers could provide some sort of insight into games like Go, but you would have to develop quantum algorithms for that. You can't automatically make an analysis go faster by running it on a quantum computer. -- BenRG (talk) 16:44, 22 April 2012 (UTC)

C++[edit]

I want to learn how to code preferably in C++, have no clue how to start. I Think I am supposed to learn C first If i'm not mistaken. Any advice to get going to help kickstart my passion? — Preceding unsigned comment added by Darkspartan4121 (talkcontribs) 01:13, 20 April 2012 (UTC)

http://www.parashift.com/c++-faq-lite/how-to-learn-cpp.html ¦ Reisio (talk) 03:06, 20 April 2012 (UTC)
It is unfair to send a novice to the C++ FAQs without also linking to the C++ FQAs. Unfortunately, most of the frequently questioned answers will only make sense after many years of software experience. Nimur (talk) 05:05, 20 April 2012 (UTC)
You could try javascript... (But would be only for webpages)190.158.212.204 (talk) 03:19, 20 April 2012 (UTC)
If you've never programmed before, It's by no means a "consensus" but I've heard a lot of people recommend to start with Python. Vespine (talk) 03:29, 20 April 2012 (UTC)
I have two suggestions. (1) Buy a book, it probably doesn't matter that much which one, they all cover the same ground. (2) Install Linux on your computer -- it provides a much more supportive environment than Windows. I personally think C is a better language than C++, but you might as well learn whichever one you intend to use. Looie496 (talk) 04:23, 20 April 2012 (UTC)
I highly recommend The C Programming Language. If you choose to learn C++, I highly recommend The C++ Programming Language. These books are better than most other books, including those "quick start tutorial style" books, because learning to program isn't a process to rush through. Just to reduce your confusion: you do not need to learn C before learning C++. The two languages are related, historically; but it is not necessary to learn C prior to learning C++. Most C++ programmers can read and understand most C programs. The reciprocal is not always true, because C++ adds so many language constructs that do not exist in C; but I contend that neither C nor C++ programmers can understand most C++ programs. I also recommend learning Linux or Unix (or a Unix derivative); these operating systems are designed to help programmers and computers cooperate; many other operating systems are designed to improve usability for non-programmers at the expense of increasing programmer effort.
Keep this concept clear: you are undertaking several different tasks. You are learning how to program, which requires learning some mathematical formalism and structured, logical thought processing. You are also learning some basic computer architecture, which will require a bit of detailed theoretical and practical knowledge about your machine. (Because you have chosen C or C++, languages that intentionally expose programmers to the machine's inner workings, you will need to learn these concepts and details well). And finally, you are also learning the syntax and structure, as well as the stylistic conventions, of a particular language (C or C++). These tasks can interfere with each other; when you hit some early bugs, it will be hard to know if you've got a logic bug, a syntax error, or maybe your linker isn't doing what you believe it should be doing. Unlike some other languages (Python, mentioned above; or perl, or Java...), C and C++ are harder for novices because they really require you (the programmer) to determine whether your bug is due to an error in logic, syntax, or engineering-practical-details Use tabs, not spaces, in your Makefiles; and don't skimp on studying linker precedence rules, because "symbol not found" is a useless unhelpful error message for a novice!. As a novice, this is difficult; so many prefer to start with easier languages and develop experience. However, C is a great first language; it's like learning to fly a Cub. You will need to learn to do it correctly, or it won't work at all. Later, when you transition to other projects with complex engineering needs, you will already have sharp skills and good techniques. Nimur (talk) 05:05, 20 April 2012 (UTC)
<off-topic>They require you to determine whether your bug is due to an error in logic or syntax. Maybe that's because (IIRC) C/C++ is context-dependent? while other languages are not (e.g. Java, IIRC again) --151.75.56.185 (talk) 15:43, 20 April 2012 (UTC)</off-topic>
Having programmed in C++, I can confirm that the complaints presented in Nimur's link above about the language are 100% correct. C++ is the most unwieldy third-generation programming language I've ever used. So it depends on the reason you're learning to code: if it's to gain a general understanding of what coding is about and its ins-and-outs, I suggest starting with C++, just because it will force you to do the mundane things that other languages do automatically. Otherwise, you might be better off choosing another language. Magog the Ogre (talk) 11:51, 21 April 2012 (UTC)

Legitimate or pirated copy[edit]

How do I know if this video is legitimate or a pirated copy? I'd rather buy the product if I would be watching it illegitimately. 98.235.166.47 (talk) 09:51, 20 April 2012 (UTC)

You can't really know without contacting the BBC or the Discovery Channel, but I've never heard of either of these organizations relinquishing copyright; and if they'd made it available for free online viewing it would not be at such a reduced quality, and probably not split up either. ¦ Reisio (talk) 22:41, 20 April 2012 (UTC)
I'm not arguing just for the sake of arguing, but I see quite a bit of both pirated and legitimate BBC stuff here: [1]. And that documentary is almost 20 years old; video from that era is often degraded. 98.235.166.47 (talk) 07:18, 21 April 2012 (UTC)

CQuote[edit]

Resolved

I want to use the CQuote template on a wordpress site. How would I go about doing it? --Drogonov 10:35, 20 April 2012 (UTC)

With this CSS…
blockquote {
	position: relative;
	padding: 0 40px;
}
blockquote:before, 
blockquote:after {
	position: absolute;
	font: bold 35px 'times new roman', serif;
	color: #b2b7f2;
}
blockquote:before {
	content: '“';
	left: 0;
	top: 0;
	line-height: 30px;
}
blockquote:after {
	content: '”';
	right: 0;
	bottom: 0;
	line-height: 5px;
}
blockquote + p {
	font-size: small;
	text-align: right;
	padding: 0 4% 0 0;
}
…and this HTML…
<blockquote>
	<p>Terrorism is the war of the poor, and war is the terrorism of the rich.</p>
</blockquote>
<p>— Peter Ustinov</p>
¦ Reisio (talk) 23:37, 20 April 2012 (UTC)
Thanks that's helpful. If I don't want it to overide the normal blockquote behaviour I have to define it as a class, is that right? Or can I replace blockquote with "cquote" in your above CSS? And then use <cquote> ... </cquote> (I doubt this will work) --Drogonov 07:40, 21 April 2012 (UTC)
Yes, the former (using a class) is the proper way to do it. Regards, - Jarry1250 [Deliberation needed] 13:09, 21 April 2012 (UTC)
Indeed, you could just replace instances of blockquote in the CSS given with blockquote.cquote and <blockquote> in the HTML given with <blockquote class="cquote"> (to be absolutely clear :p). ¦ Reisio (talk) 17:22, 21 April 2012 (UTC)

javascript[edit]

Resolved

In an earlier question I asked how to open links containing &number= into tabs in Firefox using greasemonkey javascript, and the solution worked perfectly. However, I now need to do exactly the same thing except leave out links containing #. For example, I want to open http://example.com/&number=12 but not http://example.com/&number=12#top. The code I have right now is as follows;

var elems = document.getElementsByTagName("a");
for (var e in elems) {
    var s = elems[e].href;
    if (s.indexOf("&number=") !== -1) {
        GM_openInTab(s);
    }
}

82.45.62.107 (talk) 15:29, 20 April 2012 (UTC)

if (s.indexOf("&number=") !== -1 && s.indexOf("#") === -1) {

--151.75.56.185 (talk) 15:40, 20 April 2012 (UTC)

Thanks! 82.45.62.107 (talk) 10:28, 21 April 2012 (UTC)

How do I save a screen shot?[edit]

Resolved

I have the email ready to attach it and I have pressed "Prt Scr". I have Windows Vista.— Vchimpanzee · talk · contributions · 19:13, 20 April 2012 (UTC)

Easiest way is to open Microsoft Paint, then paste, then save. - Jarry1250 [Deliberation needed] 19:17, 20 April 2012 (UTC)
Done, thanks.— Vchimpanzee · talk · contributions · 19:30, 20 April 2012 (UTC)

See also Snipping Tool. ¦ Reisio (talk) 22:42, 20 April 2012 (UTC)

If you just want a screen shot of the active application, Alt-PrtScrn does this.--Phil Holmes (talk) 11:29, 21 April 2012 (UTC)

Dafualt Theme font (Office 2010)[edit]

In office 2010 (MS Word), I noticed that the default theme font is calibri and its size is 11. I want to change it permanently to "times new roman" along with font size 12 whenever I open MS office 2010. I tried to make this change in font dialog box, but apparently failed. Is there any way to do that? Thanks in advance--NAHID 21:48, 20 April 2012 (UTC)

Usually with Word what you want to do is change the "Normal" style (the default text style upon which most others are based) within the file "Normal.dot" (the default template) which is hidden somewhere in your MS Word directories (use your file search to find it). --Mr.98 (talk) 04:08, 21 April 2012 (UTC)
An easier way... right click and choose "Font..." and you should see something like the this font dialog (I presume Word 2010 is similar enough to Work 2007 for the dialog to be almost the same). Change to Times New Roman, 12 point. Click the "Default..." button on the bottom left. Astronaut (talk) 13:40, 21 April 2012 (UTC)
  • Thanks. It worked in 2010 too.--NAHID 19:51, 21 April 2012 (UTC)