Jump to content

Wikipedia:Reference desk/Computing

From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by 90.209.235.54 (talk) at 16:15, 31 May 2022 (→‎Guitar fret buzz on only one fret and one string). 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:

May 25

Household power use

Multiple TV programmes in the UK have said that leaving things plugged in in wall sockets uses a lot of power, even when they're switched off. I one today that said a phone charger uses £1.50 if the phone is never connected to it, a microwave uses £16 if it's never use a TV uses £20 if it's just on standby, and a laptop charger uses £60 if the laptop is never connected. My mum has been saying this for years but I've never believed it.

The phone cable is literally just a metre of wire, without and current being drawn, so it's not clear why that uses electricity at all as no power needs to go on it. The microwave is just an LED display for the clock, which should use no power as you can get an LED clock to run on a 9V battery for less than a year. The TV is just an LED light to say it's on standby. And the laptop admittedly has the transformer, but it doesn't need to be transforming anything if it's never plugged into a laptop. I've never believed my mum or the clips she shares of reputable TV programmes constantly repeating that these things really do use a lot of power.

The question is, why do they use so much power when, in the case of the phone charger, all it is is a little wire, and in the case of other things, all it is is an LED. I just don't understand?? It seems weird that we had to switch things off at the mains and that's better than just switching off or unplugging the devices. 2A00:23C8:4384:FB01:F997:2CDA:CD0E:2582 (talk) 15:29, 25 May 2022 (UTC)[reply]

Your phone charger will also contain a transformer. What does the other end of the little wire plug into? The TV will have an internal transformer. Microwaves also need to do amusingly massive voltage changes (up rather than down). The question is whether all these idle transformers are using power (and producing a bit of heat from it) or not.  Card Zero  (talk) 15:46, 25 May 2022 (UTC)[reply]
Even if there is no load connected to the secondary circuit of a transformer, there are energy losses; see the section Transformer § Energy losses.  --Lambiam 16:18, 25 May 2022 (UTC)[reply]
Thank you both. It amazes me that the average house is wasting hundreds of pounds per year in electricity, as the economic and ecological cost on an individual and society-level basis is massive. I don't know a lot about electricity so I just assumed that they would have figured out how to get transformers to switch off when they're useless. Now I know!! 2A00:23C8:4384:FB01:75B9:9E61:A6F9:25CE (talk) 16:44, 25 May 2022 (UTC)[reply]
Most modern DC power supplies do not use transformers - they use a Switched-mode power supply. This has almost zero power consumption when it is not actually charging. It's quite simple to check this with a power consumption meter. So all the reports of massive costs with leaving "vampire" devices plugged in are nonsense. Consider the power supply question - if they were consuming electricity, that would have to go somewhere. And the only possible thing it can do is heat the device up. Do they get warm? Nope. So they're not consuming significant power.--Phil Holmes (talk) 07:32, 26 May 2022 (UTC)[reply]
Multiple TV programmes in the UK have said that leaving things plugged in in wall sockets uses a lot of power, even when they're switched off. Yes, many programs have made such claims. The BBC reported the same quite recently. Well, the BBC repeated claims made by British Gas. Let's see if it bears up to evidence. The British Gas report says TVs on standby are a big offender. The relevant EU regulation, adopted into British law (and still in effect after Brexit) is No 642/2009, which says "From August 2011 ... The power consumption of televisions in any condition providing only information or status display, or providing only a combination of reactivation function and information or status display, shall not exceed 1,00 Watt." (note that means 1W, not 100W). My 2017-ish LG TV actually consumes less than 0.2W on standby. So what do British Gas claim a TV uses - per the BBC, they say "a TV clocks up £24.61 per year". What does my TV actually cost? Leaving my TV on standby for an hour consumes 0.2Wh. There's 24 hours a day, 365.24 days a year, so (0.2 * 24 * 365.24) my TV on standby consumer 1.753 kWh. How much is that costing me? Per Ofgen, the capped rate for electricity is currently "£0.28 per kWh" (remember 1kWh is 1000Wh). So multiply that and we get ... 49p. Per year. Wow. So not even the true benchmark of prices in the UK, a Caramac bar.
My TV is unexceptional; I'd guess it's about average in age, size, and quality. You can check your own usage (search shops for "plug-in meter" - they cost about £15 (about 25 Caramac bars)).
So, British Gas is claiming my TV costs 50 times more to keep on standby than it really does. Why would it do that? A cynic might argue that energy companies might be motivated to change the narrative on energy bills, even toward very minor contributors. -- Finlay McWalter··–·Talk 17:50, 25 May 2022 (UTC)[reply]
Thank you. I've seen it on BBC, ITV, Channel 4, and Channel 5. They've been saying it for years but now energy rates are so high, it's back on the agenda. I don't yet pay energy bills so I don't know what they cost but those numbers sounds just so high to me. I might just buy an energy meter, as you suggest, and see what it says! 2A00:23C8:4384:FB01:75B9:9E61:A6F9:25CE (talk) 18:24, 25 May 2022 (UTC)[reply]
Our Standby power article may be of interest. CodeTalker (talk) 05:52, 26 May 2022 (UTC)[reply]
Let's keep in mind that during the heating season (only), this wasted warmth can be subtracted from the household heating burden, although if you have a form of heating that costs less than 100% efficient electric heating, this economic benefit will be reduced. But that 49p a year might in practice only mean about 35p!!!! (But if you use air conditioning, my point completely fails....) Hayttom (talk) 16:28, 26 May 2022 (UTC)[reply]
There is a device in the U.S. called Kill-a-Watt that you plug into the wall and then plug your device (charger, tv, etc...) into it. The device tells you how much power is used over time. I used one a very long time ago to discover that my Westinghouse TV pulled the exact amount of power when turned off as turned on. So, I put it on a switched outlet so I could truly turn it off. I've used it for many other things, but the rule is rather simple. Unplug stuff if you don't need it. If you have switched outlets, use them and turn off the switch when not in use. 97.82.165.112 (talk) 19:17, 26 May 2022 (UTC)[reply]
For "rule", see social pressure and cargo cult.  Card Zero  (talk) 12:02, 27 May 2022 (UTC)[reply]

Yes, a power meter (Kill-a-watt here in the US, but that might not work for UK mains voltage) is worth buying. The rule of thumb here used to be that 1 watt of steady consumption costs $1 a year. I can believe that an idle laptop charger could use a few watts, but it would be nowhere near 60 watts. Phone chargers might be in the 1 watt range though I think manufacturers have been making some effort to keep it lower. Phones, on the other hand, keep consuming more and more power. 2601:648:8202:350:0:0:0:738F (talk) 21:36, 26 May 2022 (UTC)[reply]

Switchmode power supplies (and older conventional transformers) do leak a little power even when not under load, but it's barely noticeable. Rule of thumb, if a wall wart isn't warm to the touch it's consuming less than 2 watts. Some older devices, such as CRT monitors and televisions, did have substantial standby power draws, but anything relatively modern should not. (CRTs were the big offender, the fast start circuitry in them tended to draw a lot of power, especially as they aged.) 108.54.196.111 (talk) 08:59, 29 May 2022 (UTC)[reply]

May 27

Regex

With regular expressions (I am using the perl variety), how do you capture a character and then match any character except that one?

I tried /(.)[^\1]/ but apparently back references don't work in groups. I tried to match (say) "banana" with something like /(.)(.)([^\1])\2\3\2/ which doesn't work. -- SGBailey (talk) 06:43, 27 May 2022 (UTC)[reply]

It is not valid to use backreferences like \1 inside a character class [ ... ]. That is why it doesn't work. Unfortunately, that is the limit of my RegEx knowledge. 97.82.165.112 (talk) 14:44, 27 May 2022 (UTC)[reply]
I haven't got a complete answer yet, but (.)(?!\1) will match the first character not followed by the same character. I picked that up from here: "Negative lookahead is indispensable if you want to match something not followed by something else." So (.)(?!\1). matches a character and then any character except that one.
OK, I think a parallel of what you tried to write for "banana" is (.)(.)(?!\1)(.)\2\3\2
This says "some first character, some second character not followed by a repeat of the first, some third character," and then obviously the \2\3\2 repeats characters 2, 3 and 2 again. This will match banana, but will also match baaaaa. Note that (?!\1) is not in itself a character or group - my terminology might be wrong here, but anyway, I mean you can't refer back to it, it's not \3. It just looks ahead past the preceding character to check a fact about the next one.
Then there's the variation (.)(.)(?!\2)(.)\2\3\2
This says "some first character, some second character not followed by itself, some third character," then second, third, second again. So it matches banana, bbnbnb and bababa.
My super ultimate banana-matcher in its final form is (.)(?!\1)(.)(?!\1|\2)(.)\2\3\2  Card Zero  (talk) 14:44, 27 May 2022 (UTC)[reply]

Thx -- SGBailey (talk) 06:21, 29 May 2022 (UTC)[reply]

May 28

Question about SSD wear-leveling

Dear Wikipedians:

My SSD holds mostly big movie files that are not written to, but only read from. The files that change most often are Word and PowerPoint files that I work with on a day-to-day basis as part of my job. Would my SSD be smart enough, from a wear-leveling perspective, to know to write these Word and PowerPoint files to the SSD cells occupied by the big movie files, so that wear-leveling can be evenly distributed to ALL cells in the SSD, and not just those cells in the SSD marked as "free space"?

172.97.199.147 (talk) 22:43, 28 May 2022 (UTC)[reply]

Yes any decent modern SSD will move what's on cells around as needed to ensure wear is fairly evenly distributed. Note that besides wear leveling reasons, SSDs need to check and potentially refresh used cells which haven't been written to in a while. (While like a lot of things with SSDs, there's a lot of misinformation, there is some risk if you leave an SSD unpowered for many months or even years, the data may no longer be completely readable.) IMO with modern SSDs and with TRIM enabled, it's unlikely the average consumer needs to worry about wear. The only things you might want to do are ensure that you leave a decent amount of free space and not do completely stupid things like try to optimise an SSD (other than whatever a modern OS which understands SSDs may choose to do). Nil Einne (talk) 09:04, 29 May 2022 (UTC)[reply]
Thanks for your excellent answer. I am reassured now. 172.97.199.147 (talk) 23:04, 29 May 2022 (UTC)[reply]
Resolved

May 29

wikipedia

I have a Wikipedia account. Does Wikipedia log the articles I've visited under my account? Obviously they log the articles I've edited. Therapyisgood (talk) 02:34, 29 May 2022 (UTC)[reply]

No it doesn't. But depending on your browser settings, your browser might record what webpages you've visited. Shantavira|feed me 08:09, 29 May 2022 (UTC)[reply]
@Shantavira: Sure? When I see an article's history, I sometimes see recent edits as "Updated since your last visit". Are they marked after cookies? --Error (talk) 18:01, 29 May 2022 (UTC)[reply]
@Error: AFAICT, you're referring to the updated since you last visited feature which is part of the Help:Watchlist Mw:Help:Watching pages#Recent and related changes, page history. If so, then yes this is definitely stored on the Wikimedia servers along with the watchlist. This doesn't seem particularly surprising though. I mean while having something on your watchlist doesn't mean you've visited it, it's quite likely you have. So frankly the fact you visited a page that is on your watchlist is not particularly revealing. When you visited it might be a bit more revealing, still the feature is there for a reason. If your not happy with it, then the best solution would be to not watchlist articles. Nil Einne (talk) 05:21, 30 May 2022 (UTC)[reply]
@Shantavira: Try logging in to Wikipedia from two different devices (or from two different user accounts on a single device) and see if a page visited from one of them remains unvisited on the other one. If so, it may be a result of a the cookie-based method. On the other hand, if the visited revisions appear visited on the other device, too, which does not share the same cookies, then you'll know it's based on server's records. --CiaPan (talk) 19:36, 29 May 2022 (UTC)[reply]
In twenty years of editing Wikipedia I don't believe I have ever seen that message, but I don't use a watchlist so, as Nil Einne suggests, I think it may be something to do with those settings. Shantavira|feed me 10:41, 30 May 2022 (UTC)[reply]
It can be complicated even if you use your watch list (intentionally or not), it only shows if there's been a change since you last visited the page with your account. So if you visit the page with your account then check the history as I guess people often do, it won't be there unless the page changed since you visited and clicked the history which is only likely on fairly active pages. You generally need to visit the history without visiting the page first, e.g. from your watch list, to see it. Nil Einne (talk) 16:08, 30 May 2022 (UTC)[reply]

May 30

Transferring android studio to D: drive

I have recently installed android studio in my C: drive. But now I realise it is taking too much space. I do have much free space in D and E drives, So how can I transfer everything to D:, so nothing breaks. I (stupidly) tried cutting .android folder and pasting it to D: but doing so, android studio is just recreating folder in C: so I undid that cut paste. -- 2409:4043:60A:E33D:9426:B9CA:2907:84B5 (talk) 17:15, 30 May 2022 (UTC)[reply]

Looks like people ask this question a lot, all over the web. So far I have found (sticking to Stack Overflow as reasonably trustworthy):
If I may ask (for my own benefit), what are the specs of your machine in terms of memory, drive space and drive type (SSD), and processor cores, and does Android Studio run OK? I wanted to install it myself but it seems to be a resource-demanding behemoth (presumably because it intends to do things like simulate a phone, which I wouldn't even want it to do). People claim that it runs so much better with absurd amounts of free memory, a huge solid state drive and multiple cores, but since I'd only want to make crappy little apps with it I get the impression that this is pretentiousness: and even the stated minimum spec is kind of excessive-sounding, so I'd like to know what the reality is.  Card Zero  (talk) 18:00, 30 May 2022 (UTC)[reply]

May 31

Guitar fret buzz on only one fret and one string

I don't know if this belongs in entertainment because of the subject, but it deals with guitar hardware, I guess.

For some reason, my electric guitar has buzzing on the first fret on the D string only. I think this came after I turned it up to a D# to play in an alternate tuning. Every other fret is fine, and playing the open string has no problem. I use one of those non-Fender brand Stratocaster model guitars. I lifted the string up the nut to see if that was the problem, but the buzzing still happened, so it's not a nut or fret height issue. Would the best solution be just to replace that string? I use Ernie Ball Regular Slinkies and the strings are around a month old when they were put onto the guitar. Pyraminxsolver (talk) 00:28, 31 May 2022 (UTC)[reply]

Because of standing waves, it might be that there's a raised fret (or a defect on the string) at one of the anti-nodes, where the string moves the most, in the position where the anti-node occurs when you fret the string at the first fret.  Card Zero  (talk) 02:04, 31 May 2022 (UTC)[reply]
There are multiple possibilities for the source of this, including (but not limited to) too little a break-angle on that string at the nut or saddle, or a slightly loose component somewhere in the instrument that happens to resonate with that note (this could even be the truss rod, or a loose internal brace end if its a hollow body though presumably a Strat design isn't): my first guess would be that the second fret has lifted in the middle slightly – they're often made with a slight over-curvature and pressed down into position, but may sometimes spring back slightly (though as Card Zero suggests, it could be another fret). Strings are cheap(ish) and you'll need replacements sooner or later anyway (and one can break a string at any time), so changing the string would seem worth trying.
Disclaimer: I'm in no way an expert, but I do watch a lot of YT videos by luthiers, including Ted Woodford (Channel = twoodfrd), Dave Gooch (Dave's World of Fun Stuff), Ben Crow (Crimson Custom Guitars), and Folkies Music. I'd recommend any guitarist (or guitar fan) to watch these and/or similar experts to learn more about guitar problems and solutions. {The poster formerly known as 87.81.230.195} 90.209.235.54 (talk) 16:11, 31 May 2022 (UTC)[reply]

Comparison between Fedora and Debian (Linux distributions)

Hello! I was wondering what the key differences between Fedora and Debian are? My main priorities (in order of importance) are security, speed, and user-friendliness. I'm not so worried about application support, because I'll be running Qubes OS, and this question is mainly geared towards if apps support both distros. Thanks so much! 🐶 EpicPupper (he/him | talk) 06:16, 31 May 2022 (UTC)[reply]

Type "compare fedora debian" into google (other search engines are available) and several hits are diplayed. Maybe look on distrowatch.org and read the reviews of each? I have used both professionally, and I think Fedora easier to administer than Debian, but that is because I have more experience of distros that come from Redhat. --TrogWoolley (talk) 11:51, 31 May 2022 (UTC)[reply]
As with any flavor of Linux, the difference is the package manager. Fedora uses dnf. Debian uses apt. They are not compatable. You cannot easily install an apt package using dnf. You cannot easily install a dnf package using apt. So, what is a package? Everything you install is a package. You want to install a graphics editor. That's a package. You want to install a web browser. That's a package. So, once you pick a distribution, you are tied to the package manager. There are attempts to make a universal package manager, like snap, but it hasn't gained enough traction to set aside this major difference. Is one better than the other? No. They are functionally equivalent.
Apart from the package manager, Fedora and Debian have very different mindsets. Fedora comes from Redhat. It is secure and legal. So, you end up with issues. For example, you want to make mp3 music files. You can't in Fedora because they don't supply the packages to install programs to do that. Why? Legal stuff. But, it is a non-issue for most people. You install a secondary package repository that has all the packages that Fedora doesn't include. Then, you can install them. Debian is more about stability and less about security and legality. Most people don't use Debian. They use Ubuntu, the more open and free version of Debian. What is the end result? You can easily install things like an mp3 editor on Debian without setting up a secondary repository. But, when it comes to tight SELinux controls, you have to turn those on - if you want them. Most people don't want them for home use. So, for home use, Debian is nicer. For business use, Fedora is nicer. But, I would suggest using Redhat for business and, if you are a Redhat administrator, using Fedora at home to be in a similar environment. If you aren't business and are not a Redhat admin, use Debian (or Ubuntu).
What about all the windows and start menu and graphics and all that? That is a window manager. You can use Gnome. You can use KDE. You can use XFCE. There are many others. All of them are easy to set up and use in both Fedora and Debian. So, don't let that be part of your decision. 12.116.29.106 (talk) 12:39, 31 May 2022 (UTC)[reply]

Why is }}} and nothing else three lines instead of zero?

Not putting the stuff inside the outermost {} on the same line as the outermost {} looks ugly as fuck. Sagittarian Milky Way (talk) 09:11, 31 May 2022 (UTC)[reply]

Do you mean like this?
void complain (void)
{
  if (2 + 2 == 4) {
    if (1) {
      fprintf(stderr, "more context needed");
      throw(FIT);
    }
  }
}
 Card Zero  (talk) 12:22, 31 May 2022 (UTC)[reply]