Jump to content

Wikipedia:Reference desk/Computing

From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by Sahil shrestha (talk | contribs) at 09:11, 27 September 2020 (→‎I want to remove the "Windows Setup" option that shows up everytime I boot.). 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:

September 20

JSON question

I am quite aware that JSON can be used to serialise objects containing string fields into single, scalar strings. Is it also possible to serialise non-text characters, such as line feeds and carriage returns, inside the string fields? How would such a serialised string look like? JIP | Talk 09:26, 20 September 2020 (UTC)[reply]

Yes. Unicode characters U+0000 <control-0000> (NUL), U+0009 <control-0009> tab key (HT), U+000A <control-000A> newline (LF), U+000D <control-000D> (CR), and U+0085 <control-0085> (NEL) may be used in JSON string data types. 84.209.119.241 (talk) 12:01, 20 September 2020 (UTC)[reply]
Thanks. It's important that whitespace is preserved in the actual string fields. Whitespace in the JSON syntax doesn't matter. Can I count on this? JIP | Talk 13:22, 20 September 2020 (UTC)[reply]
Yes, user 84.209.119.241 is correct, you can serialize control characters, such as line feeds and carriage returns and even U+0000 NUL characters, in a JSON string, preserving all of the original actual whitespace characters.
Because line feeds and carriage returns are considered "control characters", they must be escaped in JSON.
If your JSON is stored by itself in some file, it might look something like
{"chapter" : 4, "body" : "I'm some \n \"quoted\" text \r\n "}

or equivalently

{"chapter" : 4, "body" : "I'm some \u000A \u0022quoted\u0022 text \u000D\u0022 "}
Something that trips up many people is that if your JSON is stored in source code as a string in some programming language (such as a C++ string or, inexplicably, storing it as a string rather than a dictionary in JavaScript),
it must be escaped *again*, so that (after the compiler removes the first layer of escapes) the JSON decoder sees the escape codes (rather than actual newline characters), like this:
var json_data_string = '{"chapter" : 4, "body" : "I\' some \\n \\\"quoted\\\" text \\r\\n "}';

or equivalently

var json_data_string = '{"chapter" : 4, "body" : "I\'m some \\u000A \\u0022quoted\\u0022 text \\u000D\\u0022 "}'
(related: leaning toothpick syndrome and the discussion at "How do I handle newlines in JSON?" ).
--DavidCary (talk) 00:49, 21 September 2020 (UTC)[reply]

September 22

Typesetting Talmud

Hello, I need to find a software that can typeset Talmud. A page of Talmud looks roughtly like this. There are three main areas. The middle is the main text, and the blocks surrounding it to the left and the right are different commentaries. Each commentary will quote one or two words of the main text and then give the comment. so the software needs to be able to do two things:

  1. Have two running sets of commentary so that each comment appears on the same page as what it's commenting on (in the same way that e.g. Microsoft Word keeps footnotes ont he same page as the text they link to).
  2. Fit the text into a Talmud-like shape as shown in the image (it isn't precise, there are plenty of different layouts eg File:V12p022a01 Talmud.jpg and File:Test baba kama Page 22.jpg , but it needs to appear in that sort of arrangement and not like ordinary footnoes.

Can anyone recommend?

First: Do you want to typeset the Hebrew (and, apparently, Babylonian Aramaic) text, or a translation with a more widely supported left-to-right script? The latter requirement might rule out quite some candidates. --Stephan Schulz (talk) 20:13, 22 September 2020 (UTC)[reply]
[1] finds a bunch of TeX-based possibilities. [2] looks immediately promising. 2601:648:8202:96B0:0:0:0:DDAF (talk) 22:06, 22 September 2020 (UTC)[reply]
Sorry, I can't help with the software, but you may have more success if you use the word "gloss" in your searching. Footnotes, by definition, run at the foot of the page while glosses are typically on the side(s). Matt Deres (talk) 16:21, 24 September 2020 (UTC)[reply]
By the way, if you are doing this for a commercial or otherwise funded project, there is a sizeable TeX community where you can find consultancy help including custom macro development and the like (see www.tug.org). At least in math and physics, TeX is still the premier academic typesetting system (no idea about areas like biblical studies). You can also get questions answered at the TeX stack exchange. I happen to know one unemployed TeX person who I can refer you to if you want more extensive help, and there are quite a few other experts out there. 2601:648:8202:96B0:0:0:0:DDAF (talk) 18:48, 24 September 2020 (UTC)[reply]

September 24

No root account in Fedora 32?

I recently upgraded from Fedora 26 to Fedora 32. As I have separate partitions for /, /boot, /boot/efi and /home, all I had to do was tell Fedora to reformat the first three and leave /home as it is. I have full access to all my old personal files.

But I found out that Fedora never asked me for a root password, only for a personal password. I tried su both with my personal password and my old root password, neither worked. However I am able to use sudo for administrative tasks.

What has happened here? Has Fedora abandoned the concept of a separate root account and forced users to use sudo? JIP | Talk 13:33, 24 September 2020 (UTC)[reply]

I run Fedora version 32 (Server Edition) as a VM under CentOS and there certainly is a root user. IIRC, you have to fiddle a bit to bring it under control, I think the idea is that if you don't know how then you shouldn't do it! Have you tried sudo passwd root to set the root password, or sudo bash to get a shell? Martin of Sheffield (talk) 14:21, 24 September 2020 (UTC)[reply]
There is still a root account but generally sudo is preferred. Modern sshd's are usually configured to not allow logging in as root using a password (you have to use an ssh private key instead). There is a config parameter that lets you enable password login but I'd advise against it for obvious security reasons. 2601:648:8202:96B0:0:0:0:DDAF (talk) 18:55, 24 September 2020 (UTC)[reply]
I don't know how Fedora 32 handles it, but for many distros, the root password is required when booting into rescue mode, and that will really trip you up if you've been using sudo with your user password up until that time. I have no idea what my root password is, but I think it is tucked away in a password manager database. You may want to test rescue mode to see how it behaves. Also, id root will tell you about the root account, which undoubtedly exists. Also, sudo -i is the best way to get an interactive shell as root. Elizium23 (talk) 19:02, 24 September 2020 (UTC)[reply]
You learn something new every day! Having been using and running *nix for 25 years you get used to doing things the "old school" way. Martin of Sheffield (talk) 07:58, 25 September 2020 (UTC)[reply]
root is just the user account with ID 0. As noted, sudo is fancier and makes it easier to do things in a more secure fashion, so it's generally the preferred way of doing things on modern systems, but the only way Fedora could "force" you to use sudo would be to go in and massively rewrite huge parts of the Linux kernel so it somehow forced you to use sudo. sudo runs things as root by default, same as su, so you could just go in and edit /etc/passwd by hand if you wanted, though you should use passwd and friends instead so you can't accidentally mess the file up and bork your system. sudo doesn't ask you for a password if your account is set to not require a password in the sudoers file; you can change that if you want (check sudo's docs). --47.146.63.87 (talk) 20:39, 24 September 2020 (UTC)[reply]
In other distros, for example, Ubuntu, the root account is locked by default, and so yes, you do have to use sudo rather than su or login. Elizium23 (talk) 20:48, 24 September 2020 (UTC)[reply]
The "lock" is just, I believe, generating a random password for root rather than prompting you to set one as part of the installation. I think Fedora does the same thing. This is mainly so people don't set a crappy root password and then get their system pwned by unknowingly running something malicious or exposing sshd with root password login enabled, allowing something to guess the root password and rootkit their system. In "standard Unix", there's just root (the superuser) and everyone else; there isn't a capability-based security model. All privileged files are owned by root, and "sysadmin" programs like sudo, passwd, etc. are setuid so they always run with effective uid 0 regardless of who runs them. The standard install for Fedora, etc. gives your account full root access in sudoers, and sudo doesn't ask for the root password, but your user password (or none at all if you have NOPASSWD set). This is how you can run anything as root despite not knowing the root password. I understand not everyone is a programmer so my point might be kind of unclear; there isn't really a way to "shut off" root in a standard Unix system. If you're uid 0, you're root. su is just the real old, blunt-instrument way of opening a root shell, going back to the original good old days of teletypes and long hair and bell-bottom jeans. sudo does everything su does and way more, including, as you note, opening a root shell with sudo -i. The difference is sudo access is controlled by the sudoers file, while su asks for the root password. --47.146.63.87 (talk) 21:46, 24 September 2020 (UTC)[reply]
No, there is actually a method in the /etc/shadow file that locks accounts, and the root account is locked by this method. I don't know what password is or is not assigned to it. Elizium23 (talk) 22:05, 24 September 2020 (UTC)[reply]
Oh, right, thanks for the reminder. See man 5 shadow; you can lock and unlock accounts with passwd. But yeah, that only affects trying to log in as that user. Just saying this because tone doesn't come across well in text: I didn't mean anything in a hostile manner. Just wanted to describe some things in more detail for anyone interested. --47.146.63.87 (talk) 00:26, 25 September 2020 (UTC)[reply]
I am not certain, but I think this is what Fedora has done. It has set the root password to some random thing I don't know or am even supposed to know, but it has also automatically made me a sudoer, so I can use sudo to do administrative tasks with my own password. This kind of makes sense. JIP | Talk 01:28, 25 September 2020 (UTC)[reply]
It's probably not set to a random password, but an impossible one. Remember that /etc/passwd doesn't store passwords but hashes, so it would be stored as something which is not a hash of any password (I think usually an asterisk "*" is stored instead of a hash). You could generate a real password hash and change /etc/passwd to reflect it and then possibly you'd be able to login as root, if you can remove other obstructions mentioned. You might have to boot from another system (such as a live CD) to access /etc/passwd w/o a root shell. 93.142.121.167 (talk) 23:01, 26 September 2020 (UTC)[reply]

September 25

Further WebSocket question

As I mentioned before, at work I am developing a system which consists of two separate applications, a Windows .NET C# desktop application and a web application, of which the front end is written in HTML and JavaScript, the back end in .NET C#. The web application's front end and the desktop application communicated with each other via WebSockets.

There is a web page which opens a WebSocket connection to the desktop application on load, and then listens on messages sent by the desktop application. This part was easy enough.

But the problem is, the web application should close the WebSocket connection when the user navigates away from the page, explicitly letting the desktop application know about this, so it can set its state properly. I have tried various ways to do this, but whatever way I try, the desktop application either ignores this entirely or fails to read the close request because the connection is closed as soon as the request is sent. The best I can imagine would be that the desktop application catches failure to read the connection and then sets its state properly. But I'd rather handle this more gracefully. Is this possible? JIP | Talk 01:25, 25 September 2020 (UTC)[reply]

Have you tried a web search? A lot of stuff like this is already answered on other websites... Did you send "Connection: keep-alive"? Otherwise the client or server will automatically close the connection Wubbalubbadubdub42 (talk) 00:11, 26 September 2020 (UTC)[reply]
JIP, all browsers automatically close the socket connections when a user navigates away. There should be an "on close" event for the connection which you should handle in your server code, then you can dispose of the socket correctly from there. You handle the connection close, sending a close message is practically impossible. Ed talk! 13:23, 26 September 2020 (UTC)[reply]

what is sticky black stuff on computer casing

what is sticky black stuff on computer casing — Preceding unsigned comment added by 220.255.238.193 (talk) 02:44, 25 September 2020 (UTC)[reply]

Unless you think the sticky stuff is software, this is not a question about computing, information technology, electronics, software, or hardware. Without more information it is impossible to answer the question. Normally, there is no sticky stuff on computer casings, nor should there be. Perhaps the case was stored under a roof sealed with tar paper, and it got so hot that the tar melted and some of it dripped on the casing. Or someone was careless when shining their shoes and left a dollop of black shoe creme on the casing. Or there was black isolation tape pasted over it and the sticky stuff remained when the tape was pulled off. Or the casing is made of an inferior-quality plastic and is weeping out the plasticizer. And so on.  --Lambiam 09:12, 25 September 2020 (UTC)[reply]

Websites that haven't changed since 1990s

Approximately how many currently working websites haven't changed their design since the 1990s and early 2000s? Throughout my entire browsing I encountered only a few, less than 10 possibly, but still was positively surprised in a flashback. 212.180.235.46 (talk) 16:55, 25 September 2020 (UTC)[reply]

There are (at least) 23 Ancient Web Sites That Are Still Alive. 2606:A000:1126:28D:ADC6:7A08:1D3C:354B (talk) 03:45, 27 September 2020 (UTC)[reply]

September 26

NES Palette Divisibility Standard?

I learned from someone that when trying to make palette values for Super Nintendo (SNES), the values must always be divisible by 8 and always rounded down to the next value of 8. But when I looked at some palette values for NES (Nintendo Entertainment System), this standard did not apply. So what then is the divisibility standard for NES Palette values? --Arima (talk) 06:11, 26 September 2020 (UTC)[reply]

I want to remove the "Windows Setup" option that shows up everytime I boot.

I don't want this 'Windows Setup' option while booting the computer. I had tried to install windows 10 from my USB(I didn't make it bootable; I tried to install directly by going to installation file which was in the USB) and it asked me to restart and after it got stuck on windows 10 logo without spinning dots and restating from there many times, I decided not to install it so I unplugged the USB and decided to use the same Windows 7 OS but even when I have already unplugged the USB, that same Windows Setup option is still appearing while booting with another option which is my Windows 7, if I don't become quick and don't select windows 7 option quickly, it will go to the same windows 10 logo without no dots and restart from there. Please help me. Also if you could please tell me why I am not being able to install Windows 10 on my desktop PC as all the requirements meet. sahil shrestha 12:06, 26 September 2020 (UTC) — Preceding unsigned comment added by Sahil shrestha (talkcontribs)

Open the start menu, type "msconfig" and select the program. You'll get a window called System Configuration. Go to the tab Boot. You'll probably have two entries, I'm guessing something like: "Windows Setup : Default OS" and "Windows 7 (C:\Windows) : Current OS". Click on Windows 7, click the Set as default button and click OK. It'll tell you it needs to restart the computer but you can click Cancel ifyou don't want to restart right now. If you can't figure out how to do this, there's also a "Timeout" box where you can type the number of seconds the screen should stay on. Can't help you with Windows 10 as I don't use it myself. 93.142.121.167 (talk) 23:08, 26 September 2020 (UTC)[reply]
It worked! Thank you so much! But i have a question, will the garbage installation files also be deleted after I did that?

September 27

Multiple issues on my desktop PC

  • I am running my desktop PC on windows 7(recently installed after hard disk change since previous was damaged) and every-time I boot the computer, after the windows 7 logo comes a black screen shows up with monitor still connected to CPU. So every-time I have to shut down the PC by pressing power button and on next boot when I select the 'system repair' option and when the repair menu loads, I cancel the thing without even running the repair and the system restarts and viola! all things goes back to normal. This is how I've compromised till now. Please help me with this issue.
  • Another issue is with mouse. Every-time I boot my system the mouse has to be unplugged and plugged to make it work again else the pointer shows but the pointer won't move.
  • So my last issue till now is with windows installation. Every-time I try to install Windows 10 by making it bootable or directly by going to the file, it doesn't go further than the windows logo with no spinning dots and it restarts from that point and the same thing happens on loop.

I also believe all the requirements for windows 10 meets on my PC. Here's my specifications:

Processor: Intel Pentium 4 2.80 Ghz

RAM: 2 GB(Here's another issue with it too, there are two slots for RAM and whenever I put two rams both 2GB then nothing shows up on screen when I boot, and when I insert any one of my RAMs on one slot then only it shows up, I think one slot is damaged. But if you know the issue please help.)

OS: Windows 7 Professional SP1 64-bit

Graphics: Nvidia Geforce 210 1233 MB — Preceding unsigned comment added by Sahil shrestha (talkcontribs) 08:25, 27 September 2020 (UTC)[reply]