Wikipedia:Reference desk/Archives/Computing/2020 November 28

From Wikipedia, the free encyclopedia
Computing desk
< November 27 << Oct | November | Dec >> Current desk >
Welcome to the Wikipedia Computing Reference Desk Archives
The page you are currently viewing is a transcluded archive page. While you can leave answers for any questions shown below, please ask new questions on one of the current reference desk pages.


November 28[edit]

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)[reply]

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)[reply]
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)[reply]

Bool(e)an algebra[edit]

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)[reply]

Brevity. --174.95.161.129 (talk) 03:04, 28 November 2020 (UTC)[reply]
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)[reply]
Presumably for the same reason we have int and not integer.--Phil Holmes (talk) 11:19, 28 November 2020 (UTC)[reply]
In the reference language of ALGOL 60 it is Boolean with a capital B; see e.g. the example declaring "Boolean out;".[1]  --Lambiam 14:07, 28 November 2020 (UTC)[reply]
They'd use three letters if "boo" was acceptable. In format strings where s=string, i=integer, f=float, you may find b. It can be binary or Boolean. 97.82.165.112 (talk) 18:14, 4 December 2020 (UTC)[reply]

Is there a specific reason Timex watches display 14th October in their marketing materials[edit]

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)[reply]

@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)[reply]
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)[reply]
Maybe this question should be moved to another RD.Bumptump (talk) 21:40, 28 November 2020 (UTC)[reply]
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)[reply]

Perl bigint[edit]

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?)[reply]

m:Extension:SyntaxHighlight -- Finlay McWalter··–·Talk 21:44, 28 November 2020 (UTC)[reply]
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
333329833345499986
333330833339499995
333331833335499999
333332833333500000
333333833333500000

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)[reply]
I have the problem at
999948892559695
999969692833424
999990493395600
1.00001129424623e+015
1.0000320953853e+015
1.00005289681283e+015
I am running on Win 7 using Padre 0.842 With Strawberry Perl 5.12.3. -- SGBailey (talk) 11:15, 29 November 2020 (UTC)[reply]
And I've found a fix, add zero each time an op is done.
999948892559695
999969692833424
999990493395600
1000011294246225
1000032095385301
1000052896812830
  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)[reply]