Jump to content

Wikipedia:Reference desk/Computing

From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by 91.155.192.188 (talk) at 16:41, 6 February 2018 (Why can't I play embedded YouTube videos from webpages I've saved?). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Welcome to the computing section
of the Wikipedia reference desk.
Select a section:
Want a faster answer?

Main page: Help searching Wikipedia

   

How can I get my question answered?

  • Select the section of the desk that best fits the general topic of your question (see the navigation column to the right).
  • Post your question to only one section, providing a short header that gives the topic of your question.
  • Type '~~~~' (that is, four tilde characters) at the end – this signs and dates your contribution so we know who wrote what and when.
  • Don't post personal contact information – it will be removed. Any answers will be provided here.
  • Please be as specific as possible, and include all relevant context – the usefulness of answers may depend on the context.
  • Note:
    • We don't answer (and may remove) questions that require medical diagnosis or legal advice.
    • We don't answer requests for opinions, predictions or debate.
    • We don't do your homework for you, though we'll help you past the stuck point.
    • We don't conduct original research or provide a free source of ideas, but we'll help you find information you need.



How do I answer a question?

Main page: Wikipedia:Reference desk/Guidelines

  • The best answers address the question directly, and back up facts with wikilinks and links to sources. Do not edit others' comments and do not give any medical or legal advice.
See also:


January 30

Bitcoin theft

Almost every week we read about some unfortunate bitcoin exchange suffering a multi million dollar theft. How can it happen? The way the bitcoin is described, it is a code, perhaps a string of digits, existing in a "distributed ledger" that is it's a sort of a community property controlled by participants. Everyone, or perhaps, every "miner" holds the entire database of bitcoin transaction from day one, year 2009 or so. Any new miner can get a copy of this database any time, correct? At this time the size of the database is about 50 GB, big deal! How such an object can be stolen? In essence every bitcoin has an ID and this ID is everywhere. The fact of the theft must be again recorded in thousands of computers and such a massive transaction may reveal the perpetrators. Besides such a transaction can be marked "illegal" or otherwise illegitimate. Still the exchanges get in massive troubles, why? Perhaps the idea itself is not properly implemented or what? I want to get some answers to my questions. Thanks, - --AboutFace 22 (talk) 16:17, 30 January 2018 (UTC)[reply]

Bitcoins are protected by a public/private keypair. To start a transaction with a bitcoin, you need the current private key for the bitcoin. Once stolen, the person with the private key is in control of transactions. That person can return the stolen bitcoin, but why would he do that? There no bitcoin authority of any kind. That is the entire point. Bitcoin is based on "trust no one." So, it purposely has no authority. Nobody can say "Hey! You stole that! Give it back!" You could beg the thieves to give the bitcoins back. Do you think that would work? You can threaten them. I could probably get one to give back bitcoins after a month or so chained up in my bathtub. I personally think they would crack before I'd need to get the bleach. Then, there is legal recourse. Right now, bitcoin is not legal tender. It is a virtual commodity, no different than a magical sword in an RPG game. Legal systems around the world aren't really ready for virtual-theft cases. It would be an international issue as well because it is very likely that the person who steals your coins will be from another country. So, in the end, the whole point of bitcoins is that when you get hold of one, it is yours. It doesn't matter how you got it. It is yours. 209.149.113.5 (talk) 19:11, 30 January 2018 (UTC)[reply]
In fairness to the original question, it would be possible to surgically "undo" a questionable transaction that is considered to be a theft. At any time after a disputed-transaction (or outright theft), it is possible to fork: to discard all disputed transactions, and replay all other transactions, and to then build forward from that last-known-good point. But this is very uncommon: part of the appeal of the block-chain is that transactions are not reversible: every time a transaction is committed between two participants, it is permanent - even if one of the participants changes their mind; and even if one of the participants did not participate!
A transaction has occurred if and only if the block-chain carries a record of that transaction. This makes it difficult to define "theft" - there are simply transactions in the ledger; and sometimes, there are even transactions in the ledger that some people wish did not happen. Any time somebody wants to "undo" a transaction, they can ask every other participant to review it, and consider eliding it by accepting a different ledger that does not contain aforementioned transaction.
But there is no incentive for individual participants to conduct a review for any specific disputed transaction; and there is no regulatory authority that can force individual participants to do so. The dubious, illicit transactions are honored because more than 50% of the participants choose to honor them. Most people who are participating in a cryptocurrency scheme do not care to investigate every request to discard a transaction. By extension, they do not investigate any request to discard a transaction. The status-quo is that money can be pilfered, as long as it affects few enough participants.
Nimur (talk) 00:20, 31 January 2018 (UTC)[reply]

Thanks. You said, I quote: "To start a transaction with a bitcoin, you need the current private key for the bitcoin." So, every bitcoin or part thereof has a private key, is it correct? It is hard to imagine that there is only one private key for the entire distributed ledger (the database). Isn't it true? I know someone who mines bitcoins. They says they make $2.30 a day. I don't know if it pays for electricity they consume. I should ask them if they have new private key for every day if mining. If every small chunk of bitcoin has a separate private key how could you steal all private keys to walk away with 180 million dollars? And how about the public key? Is it like a single public key for the entire database? Could you answer all these questions please? As you see I am not interested in legal aspects, only in software. If I understand well how the system works I may end up writing my own software for virtual currency. Thanks AboutFace 22 (talk) 21:58, 30 January 2018 (UTC)[reply]

@Nimur, the theft of 500+ million dollars is not something that affects "a few." I am talking about the theft not of Bitcoin but a Japanese virtual currency, CoinCheck. Listen here: Japan's Coincheck suffers record $530m virtual currency theft[1] How do you like it? It happened last Friday, bingo! AboutFace 22 (talk) 01:58, 31 January 2018 (UTC)[reply]

It likely affects only a few of the miners responsible for maintaining the blockchain. Large miners are unlikely to keep a significant amount of assets on an exchange, so their personal money was unlikely to have been stolen. It is the miners that would have to be convinced to accept a hard fork in order to clawback stolen assets. As Nimur says, most would have little incentive to do so, and there is no regulatory authority with the power to force them to do so. Also, by way of clarification, what was a stolen was a cryptocurrency called XEM (also sometimes known as NEM). CoinCheck is the name of the Japanese exchange that was robbed. CoinCheck deals in multiple cryptocurrencies, including Bitcoin, but the theft only involved XEM. Dragons flight (talk) 10:48, 31 January 2018 (UTC)[reply]
@AboutFace 22, there is a separate private key for every bitcoin (or other cryptocurrency) "wallet", the equivalent of a bank account. The bitcoin article explains some. The way huge thefts happen is someone manages to get the private key of a wallet containing a large amount of coins, such as a coin exchange's wallet. That's like being able to write unlimited checks against Citibank's own account. Bitcoin mining today takes huge amounts of special equipment. If someone is making $2.30 a day at cryptocurrency mining, they are probably mining an altcoin rather than Bitcoin proper. 173.228.123.121 (talk) 07:09, 31 January 2018 (UTC)[reply]
Trying to fill in some explanatory gaps: cryptocurrencies are based on public-key cryptography. You have a keypair, consisting of a public and private key. The public key, as the name suggests, you give out publicly. You can then use your private key to sign a message, and anyone with your public key can use that key to verify that something was signed by the associated private key. All that a cryptocurrency adds on top of this is a ledger, usually referred to as the "blockchain", that keeps track of who owns all the units of the currency. Important detail: by design, there are no "real-world" identities or anything like that involved. The "who" here is just a public key. So to "prove" you own a Bitcoin, you sign a message with your private key. To transfer a Bitcoin, you tell the "blockchain", "I am Foo, and I am sending 1 Bitcoin to Bar." The computers maintaining the blockchain check the message against your public key to verify that you are Foo, and then record the transaction. Since the keypair is the only "thing" that the Bitcoin network considers as "owning" Bitcoin, whoever has the key has access to all the Bitcoin it owns. Obviously, this implies if someone steals your private key, they can spend all your Bitcoin. You could think of the private key like the combination to a safe with cash inside: anyone with the combination has access to the money. Not every "chunk" of Bitcoin has its own private key. The blockchain records public keys and the amount of Bitcoin assigned to them. A key (usually called an "address" in Bitcoin context) can have .00001 Bitcoin assigned to it, or 10000. Bitcoins only "exist" as entries in the blockchain. --47.157.122.192 (talk) 00:55, 1 February 2018 (UTC)[reply]

Well, the challenge will be met :=) The people who mine bitcoin making $2.30 a day are actually my daughter and son-in-law, a very adventurous couple. They said: BITCOIN and I believe them. They have no special equipment, just good Hewlett Packards. They wanted to set up the applications on our computers but I said, NO. Thanks, - --AboutFace 22 (talk) 13:36, 31 January 2018 (UTC)[reply]

A few years ago, one could mine Bitcoin on conventional PCs and expect a return, but the technology has moved on since then. At the current Bitcoin network hash rate, with a good GPU a single computer would be expected to solve 1 block every ~40,000 years resulting in $125,000 in Bitcoin at present value. That translates to a little less than 1 penny / day. ASIC Miners, which is what the main players use today, can solve the same block every few years, giving a very high rate of return and completely dominating the market. If they are still mining bitcoin on PCs, they are probably just throwing electricity away. Dragons flight (talk) 16:44, 31 January 2018 (UTC)[reply]
On the topic of fun ways you can get paid to run software on an idle computer, you can get paid more money to host a spam mail server, or an open proxy, or any of a variety of other low-human-effort background software jobs that a simple home computer can accomplish when connected to the internet. None of these things are rational in the technical sense of that word, as applied to economics: these tasks all cost more to operate than the revenue they return to the operator, and what's worse is that they carry nontrivial externalities in terms of legal liability, software and information security concerns, and the expense of human time. If your computer can earn even so much as a few bucks each day, but requires even an hour of your time each month in maintenance... well, we have to start asking pertinent economic questions! If a user is skilled enough to perform computer maintenance, they could be gainfully employed - almost certainly at a higher hourly-rate - by some local or internet-based computer software company! And if a computer is powerful enough to compute the cryptography software problems of cryptocurrency, it is powerful enough to be gainfully employed as a useful server or development workstation to force-multiply the economic impact of its human owner!
Even if the operator claimed the outrageous net-profit-per-day of $100 - perhaps they are some kind of super-efficient mega-genius who is really good at computers - they'd be doing the difficult work of a software engineer - managing a server farm and maintaining all its software - and they'd still be earning far less than the wage of a median software engineer, who earns dollars at four times that rate in each unit of time! ...And just so there is no uncertainty: a modern bitcoin miner cannot extract $100 per day; as described above, this is almost 10,000 times more money than a real bitcoin miner is likely to earn; so that means that the typical bitcoin miner is actually earning something like 40,000 times less than a software engineer, or, (hey, fun with statistics!), 40,000 times less than a typical top executive. Needless to say, there are outliers in all industries, but in all games of statistics, the median is a profoundly useful data mark!
It is extraordinarily unlikely that you can ever make money mining bitcoin, or any other cryptocurrency. Rather, if there is any money to be had, it is by taking money from other people who haven't done this math - essentially, by duping other investors into the ponzi-scheme or speculation bubble.
Nimur (talk) 17:25, 31 January 2018 (UTC)[reply]
Collateral damage from the cryptocurrency bubble - this page at PCPartPicker shows the horrible spike in the prices of nVidia consumer graphics cards just over the last month - driven by cryptocurrency miners who *think* they can make a fortune. 87.115.246.245 (talk) 18:16, 31 January 2018 (UTC)[reply]

Yes, I've read an article recently that raised concern over the negative impact of the bitcoin mining on the climate because of increased electricity consumption. Increase in price of GPU's is a bad news for me. I have thought about purchasing some not for bitcoin but for parallel processing some numerical integration. Hopefully this fad will pass. However I've made it clear in the OP that I am interested in technical aspect of bitcoin only. I got some information here that I wanted. Thanks, AboutFace 22 (talk) 21:34, 31 January 2018 (UTC)[reply]

Well, I now have corrected information about my family members doing bitcoin mining. They have only one dedicated bitcoin computer working around the clock, as my son-in-law said, "in the kitchen." It is an HP Pavilion. I did hear the amount $2.30 a day but now they deny it. I suspect it was what they made cumulatively over a few days after they started. The things get fuzzy sometimes. He said that the maximum they've ever made a day was $0.87 and now because of the bitcoin price drop they are making about $0.53/day. Sure it is a good conversation piece, but it beyond the scope.....Thanks, - AboutFace 22 (talk) 01:34, 1 February 2018 (UTC)[reply]

There is no way to make a profit mining bitcoin on an HP Pavilion or other general purpose computer unless you're getting free electricity somehow (i.e. externalizing the cost of operating the box). Yes an HP Pavilion can theoretically mine bitcoins (at a very low rate) but it will cost more in electricity than it will produce in mining income. Profitable bitcoin mining requires ultra-efficient special purpose (ASIC-based) equipment.[2] They are mostly in industrial-like facilities in China and (at least for a while) Iceland, again due to cheap electricity, but there are some consumer-level ASIC rigs so it's sort of possible your folks are using one of those. Electricity isn't an incidental input to mining--its cost is a substantial part of mining costs. You need cheap power and efficient gear. 173.228.123.121 (talk) 02:41, 1 February 2018 (UTC)[reply]
Another possibility is that the computer is not mining Bitcoin (as in "creating new ones"), but processing transactions and getting the transaction fee to do so. TigraanClick here to contact me 13:22, 1 February 2018 (UTC)[reply]
In Bitcoin, and things patterned after it. mining and transaction processing are the same thing. The newly-mined Bitcoins are granted to the miners as incentive to perform the transaction processing. The section you linked to describes how someone can pay an extra transaction fee along with their transaction, generally to get their transaction processed faster. Essentially, they're paying for "rush processing". --47.157.122.192 (talk) 03:52, 2 February 2018 (UTC)[reply]

Sorry, I forgot to mention, or rather considered it unimportant, that they have Solar Panels on the roof. I don't know if the electricity the panels generate is truly free for them, if the initial investment has been paid off, but this OP is not about any profit. It is about an attempt to understand how certain events happen technologically. AboutFace 22 (talk) 13:38, 1 February 2018 (UTC)[reply]

In a number of countries you can sell the power from small scale generation back to the grid, sometimes at retail prices, so it may not affect any net profitability calculations. Anyway I think this talk about net profitability is missing the point. If Dragons flight's calculations are correct and a very quick check suggests to me they could be, it's simply not possible to make $0.53/day gross mining bitcoin with a single computer, even if you stuck 16 GPUs on it. I guess it might be possible with some altcoin. Nil Einne (talk) 07:35, 2 February 2018 (UTC)[reply]
Yeah it sounds like they're counting the solar electricity as "free". Even with free electricity I'm surprised you can get 50 cents a month from CPU mining, given how much more efficient ASICs are. Mining BTC seems like a silly idea anyway, since if it's a reasonably fast PC they can probably make $10-20/month mining other coins like XMR (Monero) or whatever. I know that it's winter now and cold in lots of places, and some people in some of those places are silly enough to have electric heat. That sounds almost worth to replacing the heaters with mining rigs. 173.228.123.121 (talk) 09:00, 2 February 2018 (UTC)[reply]

They are making $.53 a day, not a month. This whole thread went on a tangent with a discussion of how much money could be made with bitcoin. It is not my interest at all. I was trying to understand how the system could allow such a large theft, on a purely technical grounds. --AboutFace 22 (talk) 15:09, 2 February 2018 (UTC)[reply]

But that's the point. Even in terms of gross profit, it's simply not possible to make $0.53/day mining bitcoin with a single computer. if you're not able to understand this, I don't know if there's much point further discussing how the theft was possible, as it sounds like even the existing discussing is too complicated for you. Note as I said, it might be possible with some other cryptocurrency/altcoin, but again if you still don't understand there are plenty of cryptocurrencies besides, probably there's no point discussing further. As already mention this matters to your original point since the theft you referred to was not of bitcoin, but of NEM. These are very basic points, and you really need to be able to understand them before you can hope to understand the anything further. Nil Einne (talk) 13:11, 5 February 2018 (UTC)[reply]

Brussels Sprouts Seeds

Where on the Brussel Sprout plant do the seeds get produced? Are the brussel sprouts we eat the seeds? 185.165.168.117 (talk) 18:32, 30 January 2018 (UTC)[reply]

Can just answer here. Brussel Sprouts are simply entire immature miniature cabbages, eaten whole or cut in half or quarter depending on size. They have not yet reached the age of maturity at which they would send up a flower spike (see the cabbage article), so they have not yet developed seeds. That's why they are "sprouts"--they are immature. μηδείς (talk) 18:55, 30 January 2018 (UTC)[reply]
Rubbish. Not immature cabbages at all. Axillary buds which grow on the stems of a different plant within the cabbage family. There is a photo here [3] of Brussels sprout plants in flower. The seeds are very small - like all Brassica seeds. Wymspen (talk) 21:27, 2 February 2018 (UTC)[reply]
It's not a different plant in the same family (biology). It's a different cultivar within the same species, Brassica oleracea (which to be fair does include other things people don't usually think of as cabbage, for example broccoli).
Just the same, Medeis is basically correct here, I think. --Trovatore (talk) 19:14, 5 February 2018 (UTC)[reply]
But what do Brussels sprouts have to do with computing? Basemetal 05:28, 6 February 2018 (UTC)[reply]

January 31

Laptop

I have a sony Laptop My problem when I turn my laptop on it will say you have a NTFS error and it say Don't turn your computer off then the screen turn blue then it shut down. Than you can't do any thing Please help me — Preceding unsigned comment added by 2003:C1:13DB:93B5:88A3:BEED:205B:4FE2 (talk) 18:51, 31 January 2018 (UTC)[reply]

NTFS is the file system (almost certainly on your hard drive), and a fault there is preventing your operating system (windows?) from loading. The cause is probably a faulty sector on the hard drive. It might still be possible to boot your laptop from a CD or from a memory stick. Sometimes hard drive problems are temporary, but often it means that you will need to replace your hard drive. Do you have a backup of all important data? If so, then it might be possible to reformat the hard drive and reinstall the operating system. If you have no backup then you have to decide whether it is worth paying for data recovery (or some software might attempt this for you?). Just a remote possibility is that the read head is slightly loose and turning the laptop upside down or on its side might enable the head to read the important sectors. It's perhaps worth a try, but not likely to cure the problem. Dbfirs 20:38, 31 January 2018 (UTC)[reply]
When you see the Blue Screen of Death, don't panic. There's often a solution. NTFS errors can usually be repaired. You need to boot from another device besides your hard disk (go into set up during boot, and designate a new bootup order). Then you need to use disk repair software. On another machine, Google the operating system name along with "NTFS error". Include the exact wording of the error message. "Fix boot failure" is another search term you can try. During your trouble shooting process, whatever you do, if anything asks you to reformat your hard disk (Y/N?)... don't!    The Transhumanist 01:29, 1 February 2018 (UTC)[reply]
Yes, my reformatting suggestion would only be a last resort. The Transhumanists's suggestion of fixing NTFS errors should be your first procedure if you can boot your computer from CD or USB thumb drive, or if your laptop will restart in safe mode. There are some suggestions here. Sony have a recovery procedure but it varies according to the model. Dbfirs 09:13, 1 February 2018 (UTC)[reply]
If your laptop was made in the past few years, you may have to disable Safe Boot in order to boot from something other than the hard drive. The way to do this varies from one computer to another, but it is usually done in the CMOS setup, which is where you'd be changing the boot order anyway. Googling "Sony laptop disable safe boot" should turn up more specific instructions.OldTimeNESter (talk) 14:30, 4 February 2018 (UTC)[reply]

February 1

Unspecified cellphone GUI

Please see File:Emergency alert.jpg, a cellphone (model not specified) displaying an alert sent out by a US federal government agency a few minutes after the 2018 Gulf of Alaska earthquake. Without knowing the model of cell phone, is it possible to determine how much of the display is the work of the cellphone's software's manufacturer, versus how much is {{PD-NWS}}? I assumed it was the latter, but someone submitted an OTRS that failed to provide permission, so clearly someone's expecting it to be the former. Nyttend (talk) 23:16, 1 February 2018 (UTC)[reply]

That looks like an Android status bar at the top, and as such it's probably under the Apache 2 License and conceivably ok for Wikipedia. See Android Open Source Project. 173.228.123.121 (talk) 08:54, 2 February 2018 (UTC)[reply]
I'm not sure any interface elements in there meet the threshold of originality to be copyrighted in the U.S. Of course the only way to know this for sure is to get a court ruling. Realistically, there's not the slightest chance that anyone who might own a possible copyright to any elements of the image would sue over it or even file a takedown request. If the "freedom or death" crowd make noises, just slap a fair use template on it. --47.157.122.192 (talk) 10:11, 3 February 2018 (UTC)[reply]
No way in hell that would pass under NFCC rules. It's also on commons, so you can't simply slap a template on it anyway. You'd need to upload it here and delete it on commons. Nil Einne (talk) 13:13, 5 February 2018 (UTC)[reply]

February 2

Power consumption of the same operation in two microchips

If you pick two microchips of different processing power, would they spend the same amount of energy for performing the same operation? --Hofhof (talk) 18:58, 2 February 2018 (UTC)[reply]

No. In particular, you've specified "the same operation" rather than "the same operation in the same time". It's very common that the same operation (in bulk) increases in power consumption with speed. Andy Dingley (talk) 22:23, 2 February 2018 (UTC)[reply]

February 3

I'm using Chrome in Windows 7. When I right-lick on a link I'm given the usual options (starting with "Open link in new tab"). If I pick "Save link as..." Windows Explorer opens and I'm given the choice of saving the link either as a "Chrome HTML Document" or as "All Files". What is that "All Files" thing for? When I try it I sometime get a file with no file type. Now when I open it with Chrome then the result is the same as if I had saved it as a "Chrome HTML Document". So it is saved as an HTML Document no matter what. So what exactly is the point? Thanks. Basemetal 15:03, 3 February 2018 (UTC)[reply]

It allows you to choose file extension. Ruslik_Zero 20:21, 3 February 2018 (UTC)[reply]
You should be able to partially choose extension without it. If you give the file a name like 'save file.txt' or 'save file.com' or 'save file.jpeg' or something with a recognised extension (I think recognised in Windows Explorer), it will not add an extension. If you give the file a name like 'save file.meow' it will probably add the extension, so the final file name is 'save file.meow.html'. If you choose the 'All files' option, it should never add an extension. The all files option will also show all files (except those hidden due to Explorer settings) in the target location. Otherwise you will only see those with the .html extension unless you put the * wildcard into the file name box and hit enter. Nil Einne (talk) 04:28, 5 February 2018 (UTC)[reply]
Thanks guys. I have another question: When you're displaying a page in Chrome and you right-click on it then the options you are given for saving (that is when choosing "Save as...") are "Webpage, complete" and "Webpage, HTML only". On the other hand when you right-click on a link in a page you get (when choosing "Save link as...") what I said above (namely "Chrome HTML Document" and "All files"). So my question is: Why the difference? Why not behave the same when right-clicking on a page and when right-clicking on a link in a page? Thanks. Basemetal 19:03, 5 February 2018 (UTC)[reply]
The laziness of Chrome's programmers. 78.0.213.2 (talk) 04:32, 6 February 2018 (UTC)[reply]

When to use what programming paradigm

Besides [4] I am having trouble finding more precise examples about when to use what programming paradigm. --Hofhof (talk) 19:34, 3 February 2018 (UTC)[reply]

You can look at Comparison_of_programming_paradigms. Ruslik_Zero 20:25, 3 February 2018 (UTC)[reply]
I already took a look at it. I was hoping for something more specific — a concrete example about a project that decided for this or that paradigm. --Hofhof (talk) 20:43, 3 February 2018 (UTC)[reply]
Often it will be guided by the system on which the end program will run. eg interactive systems Microsoft Windows, iOS will be event driven as the user does things, eg types, clicks, touches, turns the phone. A program on a mainframe to pay workers may be procedural, ie print out the check, move money, update account. But this may also be time driven- once a fortnight. A building automation system might be declarative, eg keep the tempeerature between 22 and 25°C, have lights on when there are people in the office. Graeme Bartlett (talk) 22:21, 3 February 2018 (UTC)[reply]
Modern desktop applications, and the operating systems that run them, are invariably object-oriented. This includes Windows, Linux, MS Office, Firefox, etc., and is because these programs all use large portions of existing code: the object-oriented paradigm is the only way to do this at scale. As such, it's really more of a super-paradigm, in that the other paradigms listed will also be object-oriented. That said, the only real difference I see today is between functional languages such as Python and Scala, and imperative languages like C++, Java, C#, etc. Even then, other than a few esoteric languages like Haskell, programming languages are a blend of paradigms, because programs have to do multiple things, and this gives the language (and the programmer) flexibility to choose the paradigm best suited to the task at hand.OldTimeNESter (talk) 14:45, 4 February 2018 (UTC)[reply]
In 40 years of programming, I've never had the choice of a paradigm (or even a language) unless it was something I was doing on my own. Professionally, management chooses everything. The programmer is just a code monkey. So, how does management choose? They invest in a paradigm or a language. Once invested, they need to show return on the investment. To show return, the programmers must use the paradigms and languages (and packages and tools, etc...) provided. It is a choice of what is best. 71.85.51.150 (talk) 19:36, 4 February 2018 (UTC)[reply]

February 5

Another HTML question

I've noticed something curious on a site I've been visiting (let me call it "www.site.com"). Going to www.site.com/directory/ gives (on that site) precisely the same result as going to www.site.com/directory/index.html as long as there is indeed in that directory an "index.html" file. On the other hand when such an "index.html" file does not exist in that directory, then going to www.site.com/directory/index.html gives a 404 page not found error and going to www.site.com/directory/ gives a directory listing. Is that completely standard HTML behavior? What I'm asking is: Does by default any "index.html" file in a directory become synonymous as a link to that directory? Can that be changed? For example is it possible to make say a "contents.html" file (instead of a "index.html" file) behave the same? What if there is an "index.html" in the directory but I want to force the link www.site/directory/ to give a directory listing nonetheless? Does the "index" file have to be an "html" file (not say an "htm" file)? Thanks. Basemetal 20:05, 5 February 2018 (UTC)[reply]

This behavior has nothing to do with HTML. It is just your web server. Ruslik_Zero 20:44, 5 February 2018 (UTC)[reply]
What you are describing is default Apache behavior. Apache is one webserver program. There are others. Some behave similar (though not exactly like) Apache. Some behave in an entirely different way. By default, if you do not declare a file, it will look for index.html and show it. If index.html does not exist, it will show a directory listing using default Apache icons for folders and files. If you declare a file that doesn't exist, such as index.html, you will get a 404 error. All of that can be customized. You can customize the default page to be a different file name or even a set of files. You can say "look for index.html or index.htm or index.php" if no file is given. You can customize the 404 error to go to an actual page. You can turn off directory listings or redirect directory listings to another page. A lot of people don't do that, but it is possible. 209.149.113.5 (talk) 20:45, 5 February 2018 (UTC)[reply]

Why can't I play embedded YouTube videos from webpages I've saved?

I've saved a webpage which contains an embedded YouTube video. That video plays fine on the site I've saved it from. However when I try to play it from the copy saved to my hard disk, it never works. All I get is that stupid TV static screen containig the YouTube error message: "An error occurred. Please try again later. (Playback ID: <16 character playback ID>). Learn More". And the "Learn More" link is useless. Can someone help, or at least explain? Thanks. Basemetal 20:49, 5 February 2018 (UTC)[reply]

The webpage doesn't "contain" the Youtube video, it links to it. As you didn't actually download the video and saving the webpage to your hard drive probably broke the embedding mechanism, it doesn't work. You cannot download a Youtube video simply by saving the page. 78.0.213.2 (talk) 04:34, 6 February 2018 (UTC)[reply]

Despite the implication of the answer to my query just above, I of course know that the actual video data of the embedded YouTube video doesn't reside on my saved webpage or on the original webpage for that matter and that I'm not actually downloading a YouTube video simply by saving a webpage that has an embedded YouTube video. My use of the word "contain" did not mean to imply anything of the sort. I didn't say "contain a video" but "contains an embedded video". That might be ambiguous but I've seen that phrase used everywhere and everybody understands what it means. If anyone has a better way to say it, I'm open to suggestions. Again: I know it is just a link to the YouTube video which resides on the YouTube server. Whew. I hope that's clear and out of the way now.

However the error message comes from YouTube. YouTube is incapable or unwilling to play the link when the request comes from my saved page as opposed to when it comes from the original webpage and sends me an error message. Why? Is there a way to fix that? The statement that "saving the webpage [...] probably broke the embedding mechanism", whatever it means, is too vague to be useful, as it is basically tautological. Yes, I know something "broke". That's why I'm asking questions here. The "embedded video" is still there (you know what I mean, the YouTube screen) and the link to the YouTube video is there too (because I can save the link with "Copy video URL" and then play it fine if I open another window and use that URL) so what "broke" and why? . Again the link to the YouTube video is still there on my saved page because the error message obviously comes from YouTube and because I can play the URL saved from the "embedded video". If anyone can help please ignore the previous non-answer and let's start again.

Thanks a lot.

Basemetal 05:22, 6 February 2018 (UTC)[reply]

So are you saying that your saved webpage contains a link back to YouTube, and when you click that link, YouTube tells you it doesn't work? And if you copy the link URL and paste it to a web browser to go to YouTube directly, it works? In such a case, one thing that comes to my mind is HTTP referers. Most browsers use a HTTP header denoting the referer, meaning which site the link that caused the request was located at. It might be that YouTube expects the referer value to be something different than what gets sent when you click the link from your saved webpage. JIP | Talk 10:07, 6 February 2018 (UTC)[reply]
How can one check that? Could you check you get the same problem when you save a webpage with an embedded video? Just to confirm everybody's got the same problem, which would sort of confirm your guess. If you've got the time, could you try with this Memsaab's Story page which has this Daily Motion video embedded. First check the video plays fine on that page when it's on the Memsaab's Story site, then save the page and try to play the same video from the saved copy. If it works for you then it's gotta be something else. In this case the error message I get is "Whoa, hold up" and "Yikes! There's been a server error". Contrary to the YouTube case the error message appears immediately, before I even try to play the video. Thanks. Basemetal 14:10, 6 February 2018 (UTC)[reply]
PS: The YouTube video I was having problems with was on this page. But as I said, it seems to make absolutely no difference whatsoever if its YouTube, Dailymotion, Vimeo, or whatever. Basemetal 14:21, 6 February 2018 (UTC)[reply]
  • This is because the world hates you and Donald Trump doesn't listen to Tim Berners-Lee.
In the TB-L web, "information wants to be, if not free, then at least neutral about it". YouTube would serve you a page of content, and links to content. If you saved that content (and the content that was at the far end of those links) then you could replay it offline. Clearly one can't do this.
One reason is streaming. There is no "content" at the end of those links, instead there is a server which dynamically serves portions of the content, as your playback client requests it. There just isn't any single monolithic downloadable resource for you to store. This is broadly a good thing - streaming allows us to watch the start of videos, or to skip to the middle, without first having to download and store the whole piece of content. With plausible values for bandwidth and storage space, this is much more useful, to more people. There are ways round this: the site may offer a different link, to a downloadable copy. Or you may use a client-side video downloader tool (there are many browser plug-ins) which can stream the video down, but also store it to such a format.
In the YouTube case though, it's because YouTube does not want you to download the videos. You might play them again without having to watch YouTube's ads. You might even upload them to a different site, taking away YouTube's business.
So the YouTube "web page" is far from a simple web page. It doesn't simply "link to" content (as TB-L's vision of an open web had it) it hides those links as closely as it can. It wraps them up in a client-side video player (maybe coded in Flash, or something equally opaque) to "improve the video watching experience" but mostly to keep them away from you. This player layer can impose DRM, location restrictions, age restrictions, or pay-per-view.
Trump's recent support of abandoning net neutrality means that this is the direction the web and internet are moving in. Expect to lose some YouTube content altogether - valuable content will instead retreat inside walled garden sites, where access needs to be bought. We're heading back to the days of AOL and Compuserve. Andy Dingley (talk) 10:31, 6 February 2018 (UTC)[reply]
The browser's "save as" function saves a bit too much stuff. "Save as" fetches a file from youtube.com. That file contains a bit of JavaScript that loads the embedded player. The JavaScript can't find the player because it doesn't know that it needs to go to youtube.com - it searches for it on your hard drive and fails. The JavaScript tells the browser "load the player from the same place you loaded this file", which is wrong when saved.
To fix, load the saved html file in a text editor. Find the line that starts <span class="embed-youtube". Open the original web page, do "view source" on it, and find the same line. Copy and paste the original line into the saved file. You'll notice there is a src="blah blah" - that is the bit that broke. 91.155.192.188 (talk) 16:40, 6 February 2018 (UTC)[reply]

My home computer's Linux system (Fedora 26) developed a strange problem just today. Whenever I click on any HTTP or HTTPS link in my e-mail, the browser goes to my home directory on my local computer (file:///home/jip/). The links themselves are OK, as copy-pasting the link to the browser works OK. Stopping and re-starting both the e-mail client and the browser didn't help. I use Evolution (3.24.6) as my e-mail client and Firefox (57.0.1) as my browser. Does anyone have any idea what is causing this? JIP | Talk 21:23, 5 February 2018 (UTC)[reply]

February 6