Jump to content

Wikipedia:Reference desk/Computing

From Wikipedia, the free encyclopedia
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 28

[edit]

What is "compute"?

[edit]

In researching LLMs, I keep coming across the term "compute" as a measure of... something. I was hoping to find out what it was in a wikipedia article, but the term does not seem to have an article, or even a subsection anywhere I can find. So... what is compute, exactly? I know that performance for an LLM AI "scales with compute", I've seem line graphs, I can infer that it has to do with computing power in some way, but I'm unclear as to the specifics.. Fieari (talk) 06:47, 28 January 2025 (UTC)[reply]

@Fieari You haven't supplied any context. Can you quote the complete sentence in which the word occurs? Wikipedia is not a dictionary so it's not surprising that there is no article. Have you looked at wikt:compute? Shantavira|feed me 09:22, 28 January 2025 (UTC)[reply]
Sorry, the term is just used so often throughout every piece of LLM literature I thought it was obvious. Here's one example: [1] This uses the word "compute" a lot, and in a way that is novel to me. Fieari (talk) 10:57, 28 January 2025 (UTC)[reply]
The linked article uses the FLOP as a unit of compute, where I assume 1 FLOP is 1 FLOPS- second, just like 1 joule is 1 watt-second. (N  --Lambiam 19:05, 28 January 2025 (UTC)[reply]
In this context, is the computing being done at training time, or at test time? Fieari (talk) 23:06, 28 January 2025 (UTC)[reply]
In the article it refers to training compute.  --Lambiam 11:45, 29 January 2025 (UTC)[reply]
Wiktionary defines the noun as "computational processing power".  --Lambiam 09:25, 28 January 2025 (UTC)[reply]
It comes up in Large_language_model#Scaling_laws and also en masse in Neural_scaling_law#Inference_scaling. It doesn't seem to be used in the sense of a "power" but rather as "effort". To me it looks like a term that could do with a quantitative definition. --Wrongfilter (talk) 09:28, 28 January 2025 (UTC)[reply]
I think you're probably using effort in the same way as computational power. It would be hard to define in an exact way because of the different systems used in bits per value, what the routing is like - various things that don't vary much on a conventional computer. Even actual electrical power used is reduced with better technologies on conventional computers. NadVolum (talk) 10:25, 28 January 2025 (UTC)[reply]
For decades, compute time and compute resources were the focus of optimization. It usually because a trade-off. You sacrifice time to use less resources or sacrifice resources to use less time. So, overall, there was no real improvement in compute time+resources. That moved on to the concept of compute power. If you decrease resources and increase time, you didn't change the overall power. If you decrease time and increase resources, you didn't change the overall power. Now, compute by itself is referring to the general concept of power, which is time and resources combined. You are looking at LLM models. Given any model, I can make it run faster by using more resources. I can make it use less resources, but it will take more time. Ignoring that tradeoff, we look at time and resources combined as simply compute (power). 12.116.29.106 (talk) 13:32, 28 January 2025 (UTC)[reply]
Just to clarify what I meant: To me as a physicist, power is energy (or work) done per unit time. "Compute" then seems to be analogous to power times time, which I chose to paraphrase as "effort" ("energy" is not appropriate). Your power seems to be my effort, your resource my power (not that I have any...). Is that correct? --Wrongfilter (talk) 13:52, 28 January 2025 (UTC)[reply]
Yes you're right. NadVolum (talk) 17:00, 28 January 2025 (UTC)[reply]

Likely easy in C or BASIC

[edit]

How do I mostly automate the repetitive manual work (painstaking even with find-and-replace-all & permutation list+number list making sites maybe with regex too) of making easily programmed big lists in an exact machine-readable format often demanded by geeky softwares+webpages (i.e. printf "-180≤RndxPrecisionInt≤180 , "; printf "-1≤RndMaxPrecisionInt≤1 , "; do sin-1 on last#; round last# to y decimal places; printf "0 , "; goto line 1 if loop counter isn't z yet; Halt). It's a pain to copy the stuff in box lines of a regular webpage then try to figure out how to use regex to make it the exact format (often comma-separated variable) & the stuff in the lines is only random if Earth was a rectangle instead of round (specifically one of the "squashed Mercator" projections called plate carree). I haven't found one single random geographic coordinates listmaker that doesn't have equal probability above 89 as 0-1 North). Or when say putting a point on each pole+a row of points on each non-|90| integer latitude with the nearest whole number of points to 360cos(lat) per row that can still be exactly expressed as a 2 or 3 significant figure number of longitude °'s between points would be close enough it's still a pain to make the equator part of the list within seconds then spend hundreds of times longer using a permutation/combination listmaking site to make the other rows one-by-one. If I then want say half the spacing I'd then need to paste about 720 rows to the 359 I already did. Sagittarian Milky Way (talk) 18:33, 28 January 2025 (UTC)[reply]

The "generic but unhelpful answer" is going to be "write a small program to process the input and generate your desired output". This is a common sort of text processing problem. Can you provide some example input and the desired output you want the program to produce, when given said input? For posting it here use <syntaxhighlight>...</syntaxhighlight> (see Help:Wikitext § Format), example:
Input:
-1 23 90 170
Desired output:
-1, 0, Equator, 80
--Slowking Man (talk) 02:30, 29 January 2025 (UTC)[reply]
More widely useful would be writing random coordinates to a txt file ie
print " 0,-180<Rnd6DecimalPlacesNumber≤180 "
print "-1≤RndMaxPrecisionFloat≤1"
sin<sup>-1</sup> last number written (degrees not radians but don't put degree symbol)
loop to line 1 but halt after n loops
I'd then need to manually delete " 0," from the start+add " 0" to the end before copypasting but who cares. Sometimes I'd need newline characters would \n work in strings in "newline is \n" languages like Python+C? Would ° and/or U+00B0 work in strings? Also my bad I didn't know integer's really integer not fixed decimal point though I suppose you could kludge ie -18 million≤RndInt≤18 million then add decimal points with more code. Sagittarian Milky Way (talk) 21:19, 31 January 2025 (UTC)[reply]
Is this the output or the program? What is the input? (General tip: if you put some effort in making the question understandable, you are more likely to get a useful answe.)  ‑‑Lambiam 13:16, 3 February 2025 (UTC)[reply]
Output could be
0.000000 0.000000 0,-123.456789 12.345678 0,98.765432 -9.876543 0,-31.415927 90.000000 0,180.000000 -90.000000 0,-179.999999 -0.000001 0
or at least something quickly fixable to that by hand except not the same output each time ((non-crappy) pseudorandom is ok). The probability of a place being in each latitude band must be proportional to the bands' areas. Also the example's far too little output but presumably it's easy to make the number of coordinates settable by changing a number in the source (if the output can't be copypasted it's useless). Also how would I do it without leading or trailing zeroes? Sagittarian Milky Way (talk) 18:29, 3 February 2025 (UTC)[reply]

@Sagittarian Milky Way: This is the kind of thing that falls into Perl's core strengths of text processing, doing manipulations of said text (mathematical or otherwise), handling a task where you just care about "getting the job done" without worrying overly about things some languages force you to ("whip-it-up-itude" as Perl hackers sometimes dub it). (In fact the PCRE regex microlanguage Perl grew proved so popular that everyone and their mother copied it.) So here's something as a starting point:

Extended content
#!/usr/bin/env perl
# LICENSE: CC0
# Arguments:
# 1) number of entries to generate
# 2) output filename (optional, defaults to stdout)

use v5.40;
use utf8;
use open ':std', ':encoding(UTF-8)';
# turn on full UTF-8 goodness

use autodie;
use diagnostics;
use sigtrap;
use strict;
use warnings;

use Math::Trig;
use Scalar::Util qw( looks_like_number );
# end boilerplate

# process arguments
my $num_items = shift;
my $outfile = shift;
die "Bad number of items given: $num_items\n"
     unless looks_like_number( $num_items );
$num_items = int $num_items;

# open output file
my $fh;
if ( $outfile ) { open ( $fh, '>', $outfile ) }
     else { $fh = \*STDOUT; }

my $bound = 180;
local $\ = ','; # output record separator

for(my $i = 1; $i <= $num_items; ++$i)
{
     
# avoid trailing , on last record
     if ( $i == $num_items ) { undef $\; }
     
# rand only gives output >= 0 so we have to ask for 2 * range
# then shift the range back down to centered at 0
     for(1..2) { printf $fh '%.6f ', rand( $bound * 2 ) - $bound };
     print $fh '0';
     
}
>perl.exe deg.pl 7
20.062334 131.616693 0,-69.358398 30.718280 0,134.573354 169.308955 0,-114.622610 22.322388 0,178.556397 -140.731559 0,-71.074462 127.699104 0,-48.464096 165.871788 0

I'm uncertain what if anything you wanted with inverse sine, based on that example output, so I just ignored that for the time being. Inverse sine function is in Math::Trig—you want asin_real to throw away any complex part from floating point imprecision, then rad2deg to convert that to degrees. Also that's a printf format string in, well, printf. This doesn't do the probability of a place being in each latitude band must be proportional stuff, which is a bit complicated to tackle but it's a start. Questions welcomed.

  • For Windows you want Strawberry Perl: [2]
  • Basic Perl crash course: [3]
  • Official Perl documentation: [4]

--Slowking Man (talk) 08:17, 6 February 2025 (UTC)[reply]

@Slowking Man:
The invsin is to make probability proportional to area. Fractional sphere height is fractional area so you can just arcsine randoms between 1 & -1 to get the latitudes. I got it to print the latitudes in sines how do I get it to print them in degrees without complex numbers? Sagittarian Milky Way (talk) 19:28, 7 February 2025 (UTC)[reply]
Extended content
#!/usr/bin/env perl
# LICENSE: CC0
# Arguments:
# 1) number of entries to generate
# 2) output filename (optional, defaults to stdout)

use v5.40;
use utf8;
use open ':std', ':encoding(UTF-8)';
# turn on full UTF-8 goodness

use autodie;
use diagnostics;
use sigtrap;
use strict;
use warnings;

use Math::Trig qw(asin_real);
use Scalar::Util qw( looks_like_number );
# end boilerplate

# process arguments
my $num_items = 10;
my $outfile = shift;
die "Bad number of items given: $num_items\n"
     unless looks_like_number( $num_items );
$num_items = int $num_items;

# open output file
my $fh;
if ( $outfile ) { open ( $fh, '>', $outfile ) }
     else { $fh = \*STDOUT; }

my $bound = 180;
local $\ = ','; # output record separator

for(my $i = 1; $i <= $num_items; ++$i)
{
     
# avoid trailing , on last record
     if ( $i == $num_items ) { undef $\; }
     
# rand only gives output >= 0 so we have to ask for 2 * range
# then shift the range back down to centered at 0
     for(1) { printf $fh '%.6f ', rand( $bound * 2 ) - $bound };
my $bound = 1;
     for(2) { printf $fh '%.18f ', rand( $bound * 2 ) - $bound };
     print $fh '0';
     
}
output:
-6.573737 0.121237970603885969 0,-23.570066 0.278581753553126532 0,156.862595 -0.906047692551538830 0,16.810529 0.382647899527157165 0,111.444776 0.810514385929764103 0,101.746542 0.599935795161357532 0,-114.727736 -0.027843755506609114 0,38.234078 0.751471330586568342 0,-158.316479 0.932623006634514695 0,-166.870517 0.696228224931488171 0
@Sagittarian Milky Way: That's not doing what you think it's doing. Firstly, the for(1)/for(2) are now pointless so just remove the loop structure: they're each just executing the loop body once. (The for loop was there in my example to execute that single printf twice.) And the second printf is just printing the second random # (to max 18 digits after the radix point).
So are you saying your desired output is: random #, arcsin in degrees of different random from -1 to 1, 0? And you want to just throw away the complex part? If yes, you feed the second random to asin_real; then that to rad2deg to convert to degrees:
printf $fh '%.18f ', rad2deg( asin_real( rand( $bound * 2 ) - $bound ));
Note: Perl uses typically the double precision floating-point type that the underlying system provides: C double. Typically that's 64 bits wide, which as the article tells us maxes out at 17 decimal digits total. So the second printf could just be merged into the print that follows it and drop the format string. But the explicit precision never hurts, and better safe than sorry, just in case this code ever winds up running on some funny system, or gets cut out and incorporated into different code. (When explicit control of numeric precision is needed, you switch from the default Perl types to using Perl modules giving explicit numeric precision types, just like switching from C double to long long or C99 int64_t where it's supported or to libraries like GNU MP (in fact a Perl module exists for the latter).) --Slowking Man (talk) 05:38, 8 February 2025 (UTC)[reply]

January 30

[edit]

The parable of the tailor

[edit]

Some 30 years ago, there was a story in wide circulation on the nascent internet, intended as a metaphor for the perils of software development. It was about a tailor who designed a wedding dress for a princess - the dress suffered from various issues that are encountered in software development when a project is poorly specified and there's inadequate consultation with the client. One of these issues was that the tailor did not know that the dress was going to move around while the princess was wearing it - another was that the dress developed "large rips and tears" after the original tailor had resigned, and his successor was unable to repair it.

Does anyone know where I can find the full text of the story? Thanks. 194.73.48.66 (talk) 14:56, 30 January 2025 (UTC)[reply]

I found a version of it on a Usenet posting from 1987. AndrewWTaylor (talk) 18:07, 30 January 2025 (UTC)[reply]
Here you can see it as it originally appeared in print.  --Lambiam 08:37, 31 January 2025 (UTC)[reply]
Thanks very much! The version I remember was in rather more prosaic language, but it's good to have the original. 194.73.48.66 (talk) 10:17, 31 January 2025 (UTC)[reply]

January 31

[edit]

Local prevention of EoL hyphen in LaTeX

[edit]

LaTeX 2ε lets one use \- to indicate the permissible positions of end-of-line hyphens, thereby overriding whatever might be prescribed in the spelling "dictionary". But how can one prevent any end-of-line hyphenation of a particular instance of a word? -- Hoary (talk) 06:38, 31 January 2025 (UTC)[reply]

Oh, and one more: How does one get a nonbreaking hyphen in LaTeX? -- Hoary (talk) 07:53, 31 January 2025 (UTC)[reply]

LaTex will not break \mbox{supercalifragilisticexpialidocious} or \mbox{supercalifragilis-ticexpialidocious} across lines. If there is a specific break you find disagreeable, like "supercal- ifragilistic", you can indicate your acceptable break points thus:
su\-per\-cali\-frag\-ilis\-tic\-ex\-pi\-ali\-do\-cious.
 --Lambiam 09:22, 31 January 2025 (UTC)[reply]
Thank you, Lambiam: mbox{whatever} indeed does the trick. -- Hoary (talk) 11:11, 31 January 2025 (UTC)[reply]
To get a non-breaking space, just use the tilde ("~") as in "See Fig.~\ref{myfig}". --Stephan Schulz (talk) 19:40, 6 February 2025 (UTC)[reply]

February 1

[edit]

Computing Programming and Coding

[edit]

What is the maximum age limit to begin learning coding?Tymer Repost (talk) 21:14, 1 February 2025 (UTC)[reply]

Is there basically a suitable programming language for a beginner?Tymer Repost (talk) 21:12, 1 February 2025 (UTC)[reply]

Is there a maximum age limit for one to begin learning programming and coding?Tymer Repost (talk) 21:11, 1 February 2025 (UTC)[reply]

There is no age limit on learning anything, although it may be more difficult to learn as one gets older. Python is popular as a learning language, and there's a tutorial on the website linked to in that article. You can very likely find books on programming in Python at your local library, but try to find ones dealing with a recent version of Python. If you can use the online tutorial, that will be right up to date.-Gadfium (talk) 03:13, 2 February 2025 (UTC)[reply]
Some (often self-reported) ages at which people learned to program, or even taught themselves programming:
Reportedly, someone learned to program at the age of 81;[16] the link given in this article is dead.
 ‑‑Lambiam 17:44, 2 February 2025 (UTC)[reply]
The book Bite-Size Python is advertized as being "ideal for those who are new to programming, giving kids ages 9 and up a beginners' approach to learning one of the most important programming languages". Most reviews on Amazon.com give the book five stars. From one of the less positive reviews: "when you get to age 13 or 14, this would not really be deemed suitable (as tested by my own 10 and 13 year olds!) as it feels to [sic] childish". Some adult learners are quite positive, though: "Since I struggled with other books, I bought a 'kids' book. It's great and what I needed. Plain English and easy to follow examples and instructions. I recommend this to anyone, child or adult, who is started to learn programming."  ‑‑Lambiam 07:32, 3 February 2025 (UTC)[reply]
I teach programming to the over 65 group at our university. They host free courses for over 65 people based on interest and a lot of them are interested in programming as well as database usage and web design. I often get many asking if we can do a class on hacking. They are a bit mischevious. Long long ago, I taught programming in an elementary school for the "delta" students, ones who were ahead of their classmates and needed more education to keep them from getting bored and in trouble. 12.116.29.106 (talk) 14:17, 6 February 2025 (UTC)[reply]

February 5

[edit]

Changing default file opening

[edit]

Haven't phrased this very well, but say you open pdf/doc and it always opens in the topo left corner of the screen: is there any way of forcing the default to say, half screen with on the right, or anything else? Cheers, Serial (speculates here) 12:44, 5 February 2025 (UTC)[reply]

Hi! What Operating system are you running? Mgjertson (talk) 18:15, 5 February 2025 (UTC)[reply]
Hi Mgjertson, W11 64 bit. Serial (speculates here) 09:45, 6 February 2025 (UTC)[reply]
Ah, sorry, I don't have much experience with windows so I'm not sure how. I do know there's window snapping, but I'm not aware of any way to force a window to open in a specific location Mgjertson (talk) 13:55, 6 February 2025 (UTC)[reply]
You can set a program to open in a spcific location if you open it from a shortcut by adding the window location to the shortcut's command string. Windows does not have a way to tell a specifici program to always open in a specific location. It is possible, but complicated, to make a shortcut to a program that opens in a specific location and then make the shortcut the program handler for the file type. 12.116.29.106 (talk) 14:14, 6 February 2025 (UTC)[reply]
A Web search for "windows auto position window" turns up some promising suggestions, including PowerToys FancyZones and AutoHotkey for automatically resizing/positioning windows. Pointing out, we've stubbed our toe on a slight XY problem here: Windows doesn't have a built-in way to my knowledge, to automatically set the window position of a certain specific program when it launches. But you don't actually care about doing that precisely—you just want the PDF reader or whatever to be "half-screened", and there are numerous tools to easily do just that with a click or keypress, with a little configuring. --Slowking Man (talk) 03:53, 7 February 2025 (UTC)[reply]
Thanks Slowking Man, and also the anon contributor (even if they did speak in tongues 😉 ) Serial (speculates here) 13:04, 7 February 2025 (UTC)[reply]

February 6

[edit]

de-mojibake

[edit]

Is there a tool to which I can feed mojibake and get back a list of what might have been intended?

My immediate motivation is an old comment on my blog, about golf, mentioning "a platinum π-iron".

—Tamfang (talk) 20:50, 6 February 2025 (UTC)[reply]

A little searching turned up the Python package ftfy which sounds like it does what you're asking for.
In this one-off case just doing it "by hand" might be more efficient. Does the page itself have any charset declaration anywhere? View the HTML page source (if you need instructions Web search "view source <name of browser you are using>"). That tells you what the page is instructing your browser to interpret it as. Then you can lookup the raw byte values of those characters and see what they correspond to in other charsets. Slightly wild guess: maybe it's one of the Unicode Enclosed Alphanumerics symbols that got mangled into Latin-1 text? --Slowking Man (talk) 02:42, 7 February 2025 (UTC)[reply]
Pasting text with non-vanilla ASCII characters from an MS Windows document into a browser text input field has unpredictable results. Some years ago I tried to construct a dictionary of MS mojibake to extended ASCII to be used for de-mojibake-ing. This proved a futile exercise, as it was a many-to-many mapping. For the golf iron, the most likely is that Ï€ represents a single character, but no candidate that makes sense comes to mind.  ‑‑Lambiam 21:57, 7 February 2025 (UTC)[reply]
After storing line and code in so-called ANSI ( under Windows) substracting 128 to "Ï" you get an "O".. which makes a nice idea of a comment, but in genuine ASCII "€" is out of bounds, as 127 stands for DEL not 🏌🏼‍♀️
In short the character string you've pasted is a subset basically compatible with ISO 8859-1, "O" or "P" ( if substracting 127) in a Dingbat table such as Webdings would translate to a flag on this table if the "€" was decreted valued to an offset of 1. It's rather improbable but sometimes it can come to even more. The only certitude we can have at this point is that the 5 bytes string to which "Ï€" translates if stored in UTF-8 for example is an absolutely dead-end. Well maybe not as at one point we've been using some copy-pasting. -- Askedonty (talk) 21:36, 8 February 2025 (UTC)[reply]


February 10

[edit]

"Passive" spamdexing?

[edit]

By "passive", I meant getting more irrelevant results to some queries without making low-quality sites nor abusing fanon wikis. Like repeating the particular search queries like "relevant stuff" OR "irrelevant stuff" and repeated or multiple OR statements between relevant and irrelevant ones would lead to irrelevant results popping up on that particular query (especially on Google image search and YouTube search) over time (e.g. Audiosurf appearing in image search results about foo_enhanced_spectrum_analyzer). While these new irrelevant results are usually not ranked as high, I think this thing is interesting though obscure. 2001:448A:3070:E573:5D44:3301:1481:FE0F (talk) 11:18, 10 February 2025 (UTC)[reply]

It appears that you are suggesting that if you go to a search engine and you search for nonsense and see certain web pages show up in your list of results that somehow those web pages will be indexed higher with the search engine. Is that correct? If so, that is now how spamdexing works. Spamdexing is performed by altering the code of the web page so the headers and content of the web page are filled with phrases and keywords that trick the search engine into falsely assuming that the web page provides information that it does not provide. Adam Savage recently posted a complaint about this on Youtube. He wanted to purchase a laser printer. His searches kept leading him to inkjet printers. Why? The inkjet printer web pages had header fields that tricked the search engine into thinking that they contained information about laser printers when they didn't have that information in any way. But, back to your question, if you were to hire a team to constantly search for "laser printers or inkjet printers," those searches would not alter the indexing of the results that appear. In some search engines, clicking on a result may increase the index position, but simply having it appear on your computer screen as a search result doesn't fit into the algorithm. 68.187.174.155 (talk) 11:48, 10 February 2025 (UTC)[reply]
That explains what's going on in Google Images search but how about YouTube search? Like seeing this irrelevant video on top of the search result about another topic. 2001:448A:3070:E573:E819:DAF3:2E41:E036 (talk) 12:21, 10 February 2025 (UTC)[reply]
I noticed that only one of those videos in the result list appear to be close to the query. So, Youtube appears to be supplying "this is kind of like that" results. I've seen situations like this. My son watched a lot of Minecraft videos and Youtube would respond to queries about Minecraft with videos that are made by the people who make many Minecraft videos, but actually have nothing to do with Minecraft. So, it is possible that the authors of the Death Stranding videos also make a lot of popular Titanfall videos. Further, Youtube is heavily confused by foreign languages. So, it may not be translating effectively and things that the videos include NPC pilot information. Why it contains a plax mix of baby songs is a mystery. I feel that expresses how poor Youtube search is. 68.187.174.155 (talk) 13:33, 10 February 2025 (UTC)[reply]
But obviously, the author of this video haven't made any Titanfall-related videos on YouTube last checked, but it still shows up in search results like this and this even with personalization things (both search history and especially watch history) turned off. 2001:448A:3070:E573:E819:DAF3:2E41:E036 (talk) 16:12, 10 February 2025 (UTC)[reply]

February 11

[edit]