Wikipedia:Reference desk/Computing

The Wikipedia Reference Desk covering the topic of computing.

Welcome to the computing reference desk.
Want a faster answer?

Main page: Help searching Wikipedia

How can I get my question answered?

  • Provide a short header that gives the general topic of the question.
  • Type '~~~~' (that is, four tilde characters) at the end – this signs and dates your contribution so we know who wrote what and when.
  • Post your question to only one desk.
  • Don't post personal contact information – it will be removed. All answers will be provided here.
  • Specific questions, that are likely to produce reliable sources, will tend to get clearer answers.
  • 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.
Choose a topic:
See also:
Help desk
Village pump
Help manual

November 26Edit

Formatting on another wikiEdit

Hello! I just posted a question at the Help Desk and was told I should post it here as well. It's about doing some wiki editing off-Wikipedia, specifically for Weezerpedia. Thank you! --Jasondanielboxer (talk) 00:32, 26 November 2020 (UTC)

Better link: Wikipedia:Help desk/Archives/2020 November 26#Off-Wikipedia editing questionTamfang (talk) 03:41, 30 November 2020 (UTC)

Python coding questionEdit

Let's say that I have this specific Python code:

class President(object):
    def _init_(self, age):
        self.age = age = None
    def get_age(self):
        return self.age
    def get_name(self):
    def set_age(self, newAge):
        self.age = newAge
    def set_name(self, newName=""): = newName
    def _str_(self):
        return "President:"+str(":"+str(self.age)

What would it take to get:

"President: George Washington: 67" (as in, the contents of "_str_(self)") returned to me? Futurist110 (talk) 05:56, 26 November 2020 (UTC)

  • The answer to the question as asked is p._str_() where p is an adequately-defined instance of the class.
However, I wager that what you really want is print(p) to return this string, in which case you should use def __str__(self): ... instead of def _str_(self): .... Note the double underscores. See the documentation about that special method. TigraanClick here to contact me 08:52, 26 November 2020 (UTC)

Linux/KDE Plasma Bluetooth handling for audio devicesEdit

Hi there. I have Ubuntu 18.04.5 running KDE Plasma, on an old ASUS motherboard with an Intel i5-2400.

I recently dug up a 3.5mm-jack Bluetooth audio transceiver. It works a treat with my Android tablet, passing both microphone and speaker data to my plugged-in wired earphones.

However, on Plasma, I use the GUI Bluetooth manager to connect to the Belkin Q78 device, and it pairs just fine. Then I check the audio devices available to switch to. It's not there! I don't know how to refresh the list, either. Mostly stuff just populates in there by itself. So how can I even troubleshoot this? I don't know where the logs might be, or how to interpret them. Is it a BT layer or a Pulseaudio layer issue? SOS! 2600:8800:1880:902:5604:A6FF:FE38:4B26 (talk) 19:51, 26 November 2020 (UTC)

Hi IP, for me when I connect your bluetooth driver on Linux should automatically create a PulseAudio sink to use, that's what's listed under KDE's sound options. PulseAudio is a massive pain but you should check that it's being recognised as an audio device, and that your user might require extra privileges? There could be a whole number of issues that are hard to diagnose, but you should look up on, somebody has definitely had the same issue as you at one time or another. Ed talk! 12:00, 27 November 2020 (UTC)
Maybe check - that might contain an answer for you? Ed talk! 12:01, 27 November 2020 (UTC)
Thanks Ed! Well, pavucontrol doesn't see the device either. I ran the a2dp script and its output is Cannot find `bluez_card.88_C6_26_D1_DB_09` using `pactl list cards short`. Retrying 11 more times ad nauseam. pulseaudio -k, which I've tried before, gives me no love. I've added the bluez PPA, which is usually a good idea; I'll reboot and letchoo know. 2600:8800:1880:902:5604:A6FF:FE38:4B26 (talk) 14:42, 27 November 2020 (UTC)
I have decided that this is an issue with my user account's pulseaudio config, because the other accounts on the machine are working OK. I have done a few things to kill/restart the daemon, to purge and reinstall the apt packages, and to rm -rf ~/.config/pulse but now it's a bit worse: no speaker icon in my plasmashell panel at all. So... oops. 2600:8800:1880:902:5604:A6FF:FE38:4B26 (talk) 15:04, 27 November 2020 (UTC)
per this thread 2600:8800:1880:902:5604:A6FF:FE38:4B26 (talk) 15:45, 27 November 2020 (UTC)

Impossible or not?Edit

Is it cryptographically possible to design a system without a single point of trust (like bitcoin) that asks the citizens if they want a particular war that is a secret ballot if nays exceed yeas yet somehow allows the identity of the yeas to be figured out if yeas exceed nays and a draft lottery becomes necessary so that the yeas of age 18 to 39 or whatever become the first lottery pool? Sagittarian Milky Way (talk) 23:00, 26 November 2020 (UTC)

Any system that enables the identities of any voter(s) to be figured out is not a secret ballot. -- Jack of Oz [pleasantries] 01:50, 27 November 2020 (UTC)
If you could somehow incentivize the yeas to try to decrypt the votes and the nays to add computational difficulty and use a method where whoever has over half the computing power wins then that's almost this except there's no way to make sure the computing power per vote is the same for both sides. Is there some cryptologic trick around this? Sagittarian Milky Way (talk) 03:51, 27 November 2020 (UTC)
One possible approach is to use a threshold cryptosystem using public-key cryptography combined with key escrow. The private key is distributed over the members of the escrow body, about which later. Each yea-voter's identity, after salting it, is encrypted with the public key; the list of cryptids (encrypted identities) is stored securely in a vault, with an "air gap" so as not to allow on-line penetration attempts. When the time has come for the lottery, the vault is opened and the requisite number is selected randomly from the list of cryptids and handed over to the key-holding body, which decrypts each cryptid, thereby revealing each selected yea-voter's clear identity. The key-holding body could be a trusted group of individuals of size n, say supreme-court justices, each of which has only part of the private key, so that a qualified majority m (the "threshold") is needed to form the complete key. This can be achieved in many ways, one being the use of an error correction code in which a bitstream is turned into n concurrent bitstreams such that at any position only m need to be received in uncorrupted form to reconstruct the bit at that position; before distribution, then, at each position, nm of the bits – chosen at random from the vector of n bits at that position – are corrupted intentionally. This can be combined with cloaking by XORed combinations of one-time pads to ensure that any colluding group of partial-key holders can obtain no information whatsoever as long as they fall short of the required threshold.  --Lambiam 07:30, 27 November 2020 (UTC)
This does not yet meet the requirement of guaranteed secrecy if the yeas did not have it. In that case, do not store any information; just throw all data away.  --Lambiam 07:36, 27 November 2020 (UTC)
  • I suspect the scheme is not possible without some trust in election officials (see Lambiam's last step of "throw all data away if some condition occurs"). You have to define carefully what "secret ballot" means; using the definitions of this abstract, what you would like is that the ballot (or parts of the ballots) be only "confidential" if yes wins but "untraceable" if no wins. The trouble is that if ballots are untraceable (i.e. the branch of the procedure if "no" wins), you cannot audit the result (i.e. you have no way to detect vote-rigging). TigraanClick here to contact me 15:16, 27 November 2020 (UTC)
    A ballot can consist of two physically separable parts, one for recording the vote, and one (for yea votes) for the voter's identity. If the vote fails, the identity parts can be removed and discarded while the parts recording the votes are retained for audits.  --Lambiam 01:40, 28 November 2020 (UTC)
As an aside, in UK general (and probably local) elections, when you arrive at the polling both and they check you are on the list of voters for that polling station, they cross your name off the list (to say you have voted) and write the number of the voting slip they hand to you down beside your name. Therefore they have the ability to identify voting slips to individuals, but I don't think it is ever used and the actual vote is considered a secret ballot. -- SGBailey (talk) 13:24, 28 November 2020 (UTC)
In NZ, for general elections they do the same thing, but the number of the voting slip is used to remove the votes of anyone who voted more than once [1] [2] [3] [4] (see 22 and 27-29). As I understand it, to preserve ballot secrecy [5], the person who removes the votes is not supposed to know the identity of the voter who's ballots they are removing. For special declaration votes, they do come in 2 parts. The declaration is in one envelope and the ballot paper in another. (See 20 to 21 of the last source.) If the declaration is rejected, the ballot paper is never opened. (If it's okay, I assume the envelope is added to a pile to be opened and counted by someone who never saw the declarations.) Local elections are a little different as they are all mail ballots and no declaration is required it it's a standard mail ballot paper sent back. Nil Einne (talk) 17:06, 28 November 2020 (UTC)

November 28Edit

How to mass-process and mass-upload a group of Commons images?Edit

Portuguese cured meats at an unidentified restaurant in Lisbon.

There are quite many photographs on Commons of Portuguese food someone took at an unidentified restaurant in Lisbon. Pretty much all of them are far too dark. I fixed one image which is shown at the article Portuguese cuisine by downloading it, running "White balance" and "Colour enhance" on GIMP, and uploading it back. But doing it for several tens of other images seems far too much work. I can download all the images easily, but what I want to know is if it is possible to:

  1. automatically run "White balance" and "Colour enhance" on GIMP for all of them, and
  2. automatically upload all the resulting images back to Commons?

JIP | Talk 01:31, 28 November 2020 (UTC)

As for #2, Vicuna Uploader will allow you to upload a batch of photos to commons. I use it, but it isn't great and hasn't been updated in a long time. You select the photos you want to upload and it displays them with fields to fill in - name of the file, description, and categories. If these are mostly the same, you can fill in the first one and use a button to copy that information to the next one. It automatically adds a number to the next file name, and it copies the description and categories. You can still edit those if they need to be changed. If there is a better way, I'd like to know about it.
As for #1, I think programs like the full version of Photoshop can do that. Bubba73 You talkin' to me? 03:52, 28 November 2020 (UTC)
Yes, you'll probably need to apply for bot authorisation, then you can either use a macro program to first apply those filters in GIMP, then upload the replacements to commons. Ed talk! 14:47, 28 November 2020 (UTC)

Bool(e)an algebraEdit

There is a datatype bool in Java, C# and many other languages. It is named after the Boolean algebra, which in turn is named after its inventor George Boole. So why is it called bool instead of boole? JIP | Talk 02:06, 28 November 2020 (UTC)

Brevity. -- (talk) 03:04, 28 November 2020 (UTC)
In Pascal, Ada, and Modula-2 it is "boolean". My guess is that "bool" is short for "boolean", not "Boole". Bubba73 You talkin' to me? 03:54, 28 November 2020 (UTC)
Presumably for the same reason we have int and not integer.--Phil Holmes (talk) 11:19, 28 November 2020 (UTC)
In the reference language of ALGOL 60 it is Boolean with a capital B; see e.g. the example declaring "Boolean out;".[6]  --Lambiam 14:07, 28 November 2020 (UTC)

Is there a specific reason Timex watches display 14th October in their marketing materialsEdit

Whilst I'm aware of the trope of showing an analogue watch's hands at either 1:50 or 10:10 in marketing material, with the second hand (if any) at around the 30 second mark (to get them out of the way of the branding), I was tickled to learn that Timex do that on their digital watches too, setting them to 10:09:36.

However, it seems that they go one step further and set the date to Wednesday 14th October. Is there a particular reason for this date? I have been unable to find one. Eatingworms (talk) 10:36, 28 November 2020 (UTC)

@Eatingworms, I've only been able to find this tweet by TIMEX, I can't find anything else. It could a release date, or it could just be random, I guess the only way is to ask TIMEX themselves. Ed talk! 14:45, 28 November 2020 (UTC)
It's not the case in older models. Just checked in Amazon, and although most are set to this date, not all are. I'd speculate together with User:Ed6767 that that's a release date. Other brands don't do this, so there's no obvious advantage contrary to the case of the watch's hands, which is norm apparently followed by all. Bumptump (talk) 21:38, 28 November 2020 (UTC)
Maybe this question should be moved to another RD.Bumptump (talk) 21:40, 28 November 2020 (UTC)
Thank you both. I agree that it probably isn't the best location, but it's the best location that I could find. Eatingworms (talk) 23:15, 1 December 2020 (UTC)

Perl bigintEdit

The following code seems to do the same whether bigint or bignum. What I want is output as a multi-digit "decimal", I do NOT want scientific 1.76503051884985e+015 .

Code used

  use bigint ;
  print 2 ** 512, "\n" ; 
  my $sum ;
  for my $in ( 1 .. 1000000 ) {
    my $sq = $in * $in ;
    $sum += $sq ;
    print $sum, "\n" ;

The 2**512 prints fine. The $sum goes scientific once it gets big enough. -- SGBailey (talk) 13:17, 28 November 2020 (UTC) (PS what markup should I use for a code fragment?)

m:Extension:SyntaxHighlight -- Finlay McWalter··–·Talk 21:44, 28 November 2020 (UTC)
I ran your program under Perl 5.16.3 and also under 5.18.4 and I do not see the effect you describe. In both cases the last 5 lines (lines 999997 through 1000001) are

What version of Perl are you using? And at what point do you see scientific notation output start to appear? CodeTalker (talk) 03:24, 29 November 2020 (UTC)
I have the problem at
I am running on Win 7 using Padre 0.842 With Strawberry Perl 5.12.3. -- SGBailey (talk) 11:15, 29 November 2020 (UTC)
And I've found a fix, add zero each time an op is done.
  use bigint ;
  print 2 ** 512, "\n" ; 
  my $sum ;
  for my $in ( 1 .. 1000000 ) {
  my $sq = $in * $in + 0 ;
  $sum += $sq + 0 ;
  print $sum, "\n" ;

-- SGBailey (talk) 11:20, 29 November 2020 (UTC)

December 2Edit