Jump to content

Wikipedia:Reference desk/Computing: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
Jdphenix (talk | contribs)
Line 164: Line 164:
:What Internet archives are you thinking of, other than that maintained by the [[Internet Archive]]?  --[[User talk:Lambiam|Lambiam]] 17:14, 26 January 2021 (UTC)
:What Internet archives are you thinking of, other than that maintained by the [[Internet Archive]]?  --[[User talk:Lambiam|Lambiam]] 17:14, 26 January 2021 (UTC)
::{{re|Lambiam}} Thank you. The website link through [[Internet Archive]] you provided does accept keywords. The way I was accessing did not. [[User:Charles Juvon|Charles Juvon]] ([[User talk:Charles Juvon|talk]]) 17:27, 26 January 2021 (UTC)
::{{re|Lambiam}} Thank you. The website link through [[Internet Archive]] you provided does accept keywords. The way I was accessing did not. [[User:Charles Juvon|Charles Juvon]] ([[User talk:Charles Juvon|talk]]) 17:27, 26 January 2021 (UTC)

== Information about length of power cables on a power supply ==

Is there any accessible information online about the length of cables that are the output from a PSU? I am putting together a ATX build in a mid-tower and I encountered a problem I've never ran into before. The CPU power cable was not long enough to reach the port. [[User:Jdphenix|Jdphenix]] ([[User talk:Jdphenix|talk]]) 18:23, 26 January 2021 (UTC)

Revision as of 18:23, 26 January 2021

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 19

Run command when process dies (Linux)

Lets say I have a process running that's likely to take some time. I also have a second command that I want to run, but I know that command will require the same limited resources (network bandwidth, disk access, etc) that the already running process is already swamping. Is there a way to schedule that second command to run when the first, already running, process dies? 108.21.233.20 (talk) 02:01, 19 January 2021 (UTC)[reply]

Yes. The key is to use wait(2) which is accessible in the shell by the wait command. You do not say what language you are using, so it will be difficult for me to customize the instructions.
The concept is that a parent process (such as the shell or your program which did a fork and exec) is privileged to be notified of the status of child processes. Therefore the wait system call can be arranged to notify you of these exited processes. You can wait for 'anything' or you can wait for 'a specific process'.
Once wait returns then your process has exited, and you can do additional processing, such as start up the second command. Elizium23 (talk) 02:30, 19 January 2021 (UTC)[reply]
If you are going to execute the first command, grab its process id and give it to tail which will wait for the process to exit, and then execute your second command.
$ command1 &
$ pid=$!
$ tail --pid=$pid -f /dev/null
$ command2
If the first command has already started, find it's pid using pgrep
$ tail -f --pid=$(pgrep COMMAND1_NAME) /dev/null
$ command2
Hope this helps - manya (talk) 06:25, 20 January 2021 (UTC)[reply]
Or if you are starting both commands yourself (as opposed to the first one having already been started by someone/something else), just put the two commands in a shell script one after the other. Then run the script. 85.76.65.82 (talk) 07:13, 20 January 2021 (UTC)[reply]
It is ridiculous to use tail for this purpose. Just use wait.
#!/bin/bash
sleep 10 &
pid=$!
wait $pid
echo "Waiting done, run at will" Elizium23 (talk) 07:33, 20 January 2021 (UTC)[reply]
If your script is not the parent process, and wait does not work, then use kill -0 $pid and evaluate its exit status to see if the process still exists. You can put this in a spin loop. Elizium23 (talk) 07:36, 20 January 2021 (UTC)[reply]
Why is it better to do that than:
#!/bin/sh
sleep 10
echo "yup"
Are we overthinking this or what? 85.76.65.82 (talk) 20:53, 20 January 2021 (UTC)[reply]
...It's not "overthinking" the problem..., just making some (sort of reasonable, but not universally-true) assumptions about the system: the user is not necessarily spawning processes via the bash shell; the user may want to do other CPU work, instead of stalling; the user may wish to avoid expending power and emitting heat by making the CPU execute a busy wait; and so on. The method posted by 85.76.65.82 expressly differs from the method posted by Elizium23, because 85.76.65.82 relies on blocking bash REPL logic and expressly rules out asynchronous control or dispatch to subshell; while Elizium23's method does neither of those things. If you don't know or care what those are, "the methods are darned similar," at face value. At the same time, only one of these methods (the one proposed by Elizium23) is scalable to support multiple processes, or to take advantage of multiple CPUs, and so forth.
As a general rule, bash doesn't know anything about your CPU hardware; but the linux kernel does. So even if we're looking only at the two ways we might do this in the bash shell, using only a single-CPU system - we're still comparing two "superficially-functionally-identical" effects, implemented by two different under-the-hood behaviors: (1) scheduling a wait by depending on the shell's blocking REPL implementation; and (2) dispatching to the operating system (using the shell's builtin wait or the equivalent (wait(2)), which allows the linux kernel to schedule a wait, using the most efficient hardware-optimized scheduling logic.
Per the usual "GNU-is-not-Unix" adage, the actual way that your bash shell interprets and executes wait depends on how it builds against your kernel. The same is true of the way that its REPL logic gets scheduled. It's really easy to get lost in the weeds here, but the take-away message is that wait is almost surely always the more efficient implementation. In certain cases, the worst-case scenario, the difference in efficiency (and power expenditure) can be catastrophically huge. "We all hope" that your computer got installed with a version of linux and bash that were designed and tested and optimized by detail-oriented professionals - but ... we're talking about free software. Components like your linux kernel - and the shell that you use to communicate with it - are usually distributed under a term of service that expressly disavows any warranty of correct operation, fitness for any purpose, freeness from defects, and so forth.
So, use the wait method (or its variants). It will probably be more efficient. For most users on most computers, the efficiency difference is very small - perhaps too small to realistically characterize. For other users, the difference is huge.
Nimur (talk) 21:50, 20 January 2021 (UTC)[reply]
You just put them in a script and run the script.
#!/bin/sh
myprogram1
myprogram2
wait is a shell builtin that you use when running background jobs from your shell, using job control, and want to wait on them to terminate. If you don't start a command in the background using &, it runs in the foreground and the shell waits on it to complete. Note that this will run both commands regardless of whether the first aborts abnormally. We can add error handling if needed. For more on the general topic read this. Also, it's possible a different solution might be more useful. If the programs don't depend on each other, and you just want to avoid loading down your machine, try just running them at a high niceness. On Linux you can ionice them as well. --47.152.93.24 (talk) 04:10, 21 January 2021 (UTC)[reply]

Phone spoofing

I (in the UK) got (yet another) spam phone call today and I used the "who called me" option after the call to get a UK number. I tried phoning it to see what happened and it was answered by what sounded like a pleasant lady and not an automated robot. Is it possible to fake the "called from" number that you get using BT's 1471 "who called me" service? -- SGBailey (talk) 14:06, 19 January 2021 (UTC)[reply]

@SGBailey: Yes. See Caller_ID_spoofing. According to that article, there is a large fine for doing this in the UK, but I don't know how it is enforced. RudolfRed (talk) 15:51, 19 January 2021 (UTC)[reply]
Don't see how it could be considering many VoIP services allow you to modify your Caller ID and those accounts could easily be set up fraudulently or without any checks at all ✨ Ed talk!17:14, 19 January 2021 (UTC)[reply]
The PSTN is built on a web of trust that is, nowadays, sorely misplaced. Back in the heyday of phone communications, interchanges and switches could trust one another not to be playing tricks or being hacked or something, but the phone system was not built to have malicious players, providers, or whole countries attached.
See STIR/SHAKEN for a modern effort to combat the spoofing. Attempts are underway. Elizium23 (talk) 17:57, 19 January 2021 (UTC)[reply]

January 20

Wireless Mouse

  • If someone uses an wireless mouse, and uses the built in keyboard on a laptop, can the hacker hijack the keystrokes using the wireless mouse receiver? --つがる Talk to つがる:) 🍁 01:12, 20 January 2021 (UTC)[reply]
    It seems highly unlikely. I am not sure what you mean by "hijack the keystrokes"; there could be exfiltration of what keys I am typing, or spoofing of keys that I did not type, things like that, in theory, but it would depend completely on the kind of hardware in play. There are different types of laptops and different types of wireless mice and endless permutations of them together.
    Let me take a common case as an example. The user has an ordinary laptop and a Logitech wireless mouse with a unifying receiver. Now, the unifying receiver is a special case. It does not use PINs or security to sync devices. It is also a general-purpose input device controller which can have more than one slave. So if the attacker is close enough!!! and manages to sync to the unifying receiver as a keyboard, then the attacker could conceivably execute keystrokes onto the laptop while I'm using the wireless mouse. The attacker would not be able to see the things I am typing on the built-in keyboard, and should not be able to see the mouse movements or button presses.
    Now if we switch the scenario to Bluetooth, that should make it somewhat resistant. If the user is careful, then no unknown devices can pair, under normal circumstances, and so theoretically the wireless mouse could be used without fear of hijack. But Bluetooth has insecurities, so if the attacker were able to pair as an input device, the attacker could be a keyboard or a mouse or both or anything she wants. And it would not be necessary for me to be using a wireless mouse, just having Bluetooth enabled would be enough.
    But all this is highly unlikely in most cases because of two things, proximity and vigilance. Your attacker will need to sidle up very close to your laptop. Sitting next to you at Starbucks. And you would need to be unaware that your keyboard is going haywire. Most people would notice right away. But then the damage could be done? Elizium23 (talk) 05:06, 20 January 2021 (UTC)[reply]

Free reminder software

I'm looking for a program where I can make a note that I need to do something on X date, and the program reminds me when I log into my PC on that date. Suggestions? Clarityfiend (talk) 08:29, 20 January 2021 (UTC)[reply]

Cannot Windows calendar application do this? Ruslik_Zero 10:55, 20 January 2021 (UTC)[reply]
Mozilla Thunderbird and its forks have calendar functionality. Alternatively if what you need to do is on the PC, you can skip the reminder phase and set it to automatically start/open on that date via Windows Task Scheduler. 93.136.149.88 (talk) 23:27, 21 January 2021 (UTC)[reply]
So, like, what OS? Elizium23 (talk) 06:23, 22 January 2021 (UTC)[reply]
Windows 10. Clarityfiend (talk) 07:34, 23 January 2021 (UTC)[reply]

Machine Learning Algorithm Tutorial

Could anyone point me toward a written or maybe video tutorial on how to construct a machine learning algorithm from scratch. Specifically I'm interested in decision tree and neural network. I watched a great tutorial on YouTube that really did cover a lot, but it basically just explained how to implement existing python libraries. I don't want to reinvent the wheel, but I do want to have as comprehensive understanding of how these algorithms actually work. TheRiseOfSkittlez (talk) 21:31, 20 January 2021 (UTC)[reply]

Personally, I'd start by reading an implementation of least squares regression in the language of your choice.
If you can't see the connection to a higher parameter-space, re-read our article on regression analysis: almost every machine learning problem is representable as a regression problem over a generalized set of variables. In the case of a neural network, the parameters you are fitting are the numbers - the numerical coefficients - that describe the connectivity of the "neural" nodes. In the case of a decision tree, the parameters you are fitting are the branch probabilities.
If you follow LSQR, you can probably conceptualize the generalization to other fitting methods; actually implementing those methods is pretty painful, but here's a zero-cost full-length textbook that guides the reader through the underpinning math.
Nimur (talk) 22:34, 20 January 2021 (UTC)[reply]

The video course at https://fast.ai is very good. 2601:648:8202:96B0:0:0:0:313A (talk) 06:21, 22 January 2021 (UTC)[reply]

January 22

Is any detailed information about Aaron Swartz's The Info Network available?

Thanks. Apokrif (talk) 03:35, 22 January 2021 (UTC)[reply]

The ArsDigita link from our Aaron Swartz article leads here, which is fairly detailed.--Shantavira|feed me 09:16, 22 January 2021 (UTC)[reply]

Would it be useful to express -why- static variables are useful?

This page is pretty clear in describing what a static variable is, but while I am trying to learn about this, it might be useful to understand -why- they exist; the rationale for them and what benefits they offer - to the compiler, speed of resulting programme etc?

Just a suggestions, I am thankful for the record that exists!

https://en.wikipedia.org/wiki/Static_variable — Preceding unsigned comment added by 92.41.228.205 (talk) 17:06, 22 January 2021 (UTC)[reply]

Before high-level programming languages were developed, the most common situation was that all memory was statically allocated. One way in which functions in a program can communicate with each other is by passing information through parameters. But suppose that in an application there is a centrally important store of information that can be consulted and updated by various functions. In that situation, passing it around through parameters is awkward. The alternative is to use a global variable, which in most languages means it is allocated statically. Depending on the instruction set of the processor, accessing static variables may be faster than accessing dynamic variables; the latter may involve some indirection and pointer arithmetic.  --Lambiam 21:15, 22 January 2021 (UTC)[reply]
Static variables will typically have storage reserved at compile-time. This means no memory needs to be allocated for them at run-time, which can be important in constricted environments such as embedded systems with strict memory limitations. This also means a given static variable has a fixed memory address, which can be necessary for low-level stuff like device drivers. --47.152.93.24 (talk) 03:56, 23 January 2021 (UTC)[reply]

Change in key's meaning

I use Google Chrome. Traditionally when I press F6 it takes me to the URL bar where I can edit the URL I'm at. But now when I press F6 it highlights my current tab. Any reason the F6 key's function changed?? Georgia guy (talk) 18:08, 22 January 2021 (UTC)[reply]

Oops, just after I saved my edit, F6's behavior was back to normal. Georgia guy (talk) 18:09, 22 January 2021 (UTC)[reply]
And now it changed again. Georgia guy (talk) 18:10, 22 January 2021 (UTC)[reply]
FWIW, you can also use Alt+D to access the URL bar. Elizium23 (talk) 21:36, 22 January 2021 (UTC)[reply]

January 23

Archiving a page?

Could someone help me archive this: https://tniad.mil.id/tni-ad-turut-berduka-cita-atas-meninggalnya-letjen/? This is for an article of mine. Tried five times on web.archive.org but the website keeps saying "Live page is not available". Regards, Jeromi Mikhael 03:34, 23 January 2021 (UTC)[reply]

Although the domain tniad.mil.id is registered, my DNS gives: "cannot resolve tniad.mil.id: Unknown host", so it is no wonder that the Internet Archive does not find a live page. Ping gives timeout on both of the name servers ns1.mabesad.mil.id and ns2.mabesad.mil.id. This nay be a temoporary problem.  --Lambiam 09:38, 23 January 2021 (UTC)[reply]

Does this motherboard support booting from pcie (GA-H81M-S1)?

I am thinking of buying this ssd CT1000P1SSD8 (a gen 3 x4 pcie) and then using a pcie adaptor to plug into this motherboard GA-H81M-S1 (pcie 2.0 x1), would the motherboard allow it to boot or it would be able to just be used from ram. The idea of not buying a sata ssd is that this faster pc can be used when I change this 4 years old pc for a better one and it will work (without some speed loss from pcie 3.0 x4 to pcie 2.0 x1).2804:7F2:598:BE0F:3D8D:9C65:28ED:3B91 (talk) 19:56, 23 January 2021 (UTC)[reply]

I do not think so. You need at least series 9 Intel chipset. Ruslik_Zero 20:55, 23 January 2021 (UTC)[reply]
Thanks for the information2804:7F2:598:BE0F:3D8D:9C65:28ED:3B91 (talk) 21:00, 23 January 2021 (UTC)[reply]
Assuming your computer has an unused USB port and can boot from USB (nearly all can), and you're willing to spend $10 or something for a small USB key, or alternatively don't mind a large one permanently sticking out and have one available, you have options. Even if there is no motherboard support for NVMe booting and you're not willing to add NVMe support to tbe EFI yourself, it is fairly trivial to enable NVMe booting by using Clover or similar especially if your motherboard supports EFI booting. The motherboard boots the USB, then the USB boots the NVMe drive. I'm doing it myself on one system, indeed I just changed from an older Clover to Refind with NVMe driver added then to a new Clover then back to Refind with ease although I did have another system available to easily modify the USB when I screwed up. (The reason for changing was unrelated to the NVMe device.) However it's worth considering whether you're actually likely to gain anything from this set-up especially given you're restricting the maximums of the drive and that this sounds like a fairly old system and the benefits of NVMe are often small in a lot of non synthetic workloads. Nil Einne (talk) 15:33, 24 January 2021 (UTC)[reply]

January 24

Taskbar Stops Working

This has happened to me either twice or three times. I am using Windows 10, and Office 365, and Firefox, and Opera. (I know that someone will say that I can use one browser or another. I know. I have my reasons.) I normally switch between applications by mouse-clicking on the program icon in the task bar at the bottom of the screen. What has occasionally happened is that the task bar has stopped working. The mouse no longer will focus on the icons in the task bar. This means that the only way to switch between applications is to click on the window for an application, which of course is only possible if a portion of the window is visible. I may be able to shrink the window that I am in and expose part of another window to click. Also, when the task bar stops working, the clock in the lower right corner stops updating, perhaps because the clock is the extension of the frozen or vanished task bar.

So I have two questions. First, does anyone know what causes this? Is there a a post-mortem way that I can determine what caused this? Second, is there a way to recover from this, to make the task bar come back to life? Each time, I have restarted the computer; but to restart the computer when the task bar is frozen, it is necessary to bring up the security menu with Ctrl-Alt-Del.

What causes this (if it has a known cause)? What can be done to undo this, short of a restart? Robert McClenon (talk) 02:48, 24 January 2021 (UTC)[reply]

Robert McClenon, you know that you can switch by using Alt+Tab ↹ or ⊞ Win+Tab ↹? Elizium23 (talk) 02:56, 24 January 2021 (UTC)[reply]
Does this tutorial on restarting Windows Explorer help your situation? Elizium23 (talk) 02:58, 24 January 2021 (UTC)[reply]
Thank you, User:Elizium23 - You have given me at least two useful items of information. The first is that the problem is caused by the Windows Explorer thingy freezing. We don't need to know what causes that to be able to figure out what to do about it. The second is how to restart the Windows Explorer thingy from the Task Manager. Robert McClenon (talk) 04:10, 24 January 2021 (UTC)[reply]
You can also use Ctrl+⇧ Shift+Esc to start task manager. LongHairedFop (talk) 20:42, 24 January 2021 (UTC)[reply]

January 26

UK English in Word.

I'm in the UK and I'm using Microsoft Word. When I type a word like 'popularise' or 'specialise' it tries to tell me that the spelling is wrong and it suggests the American spelling of 'popularize' or 'specialize'. I've gone into settings and chosen the 'Language' option and then under 'Office Authoring Languages and Proofing' I've selected 'English (United Kingdom) preferred'... but it still keeps telling me that the US spelling is correct and my UK spelling is wrong. Am I missing something? — Preceding unsigned comment added by 95.150.37.129 (talk) 13:53, 26 January 2021 (UTC)[reply]

Select the text in your documetnt and look at the status bar, where it says: "Section 1 Page 1 of 1 ...". The fourth entry is the language. If it's "English (United States)", you need to click on it and select UK English in the dialog box. You can also change the language in the "Normal" style. When you modify a style, in the lower left corner of the Modify Style box select Format > Language. You might have to change the language of the Normal style in your Normal.dot template if you want every new document to start with UK English settings, altho you might also be able to change this in the Language tab under File > Options. 93.136.127.254 (talk) 14:41, 26 January 2021 (UTC)[reply]
The idea that the -ize suffix is an American spelling is a common misperception. See Oxford spelling. I work for a British publisher and we always use the -ize spellings.--Shantavira|feed me 15:28, 26 January 2021 (UTC)[reply]

Hi! I found an unpublished book online. I can read it as a pdf or on a web page. I want to know if I can print it legally. The link is here. Thank you! Dswitz10734 (talk) 15:23, 26 January 2021 (UTC)[reply]

Also asked at Wikipedia:Reference desk/Entertainment § Copyright question. Please do not crosspost.  --Lambiam 17:12, 26 January 2021 (UTC)[reply]

Internet Archive Search Engine

Is there a search engine that looks through internet archives? That would be equivalent to giving the WayBackMachine a good search engine. Charles Juvon (talk) 16:07, 26 January 2021 (UTC)[reply]

What Internet archives are you thinking of, other than that maintained by the Internet Archive?  --Lambiam 17:14, 26 January 2021 (UTC)[reply]
@Lambiam: Thank you. The website link through Internet Archive you provided does accept keywords. The way I was accessing did not. Charles Juvon (talk) 17:27, 26 January 2021 (UTC)[reply]

Information about length of power cables on a power supply

Is there any accessible information online about the length of cables that are the output from a PSU? I am putting together a ATX build in a mid-tower and I encountered a problem I've never ran into before. The CPU power cable was not long enough to reach the port. Jdphenix (talk) 18:23, 26 January 2021 (UTC)[reply]