Jump to content

Wikipedia:Reference desk/Computing

From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by 2601:648:8202:96b0::4fff (talk) at 06:42, 25 January 2020 (→‎What's wrong with this code?). 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:


January 18

Laptop Screen Flashes White

I have a Dell Insprion Windows 10 Laptop, It flashes white on the screen once every few hours, I am not using the OEM Windows it came with, could this be the cause of the white Flashing? --Thegooduser Life Begins With a Smile :) 🍁 03:45, 18 January 2020 (UTC)[reply]
Thegooduser, I would say that it sounds like a display driver issue of some kind. You may want to investigate the driver version and options; latest update and/or a previous stable version. Often, companies such as Dell have custom update software and/or support websites where you can find the correct hardware drivers, that would be the first place to consider. Elizium23 (talk) 03:50, 18 January 2020 (UTC)[reply]
Elizium23 All drivers and system firmware are up to date, but the screen still flashes white... --Thegooduser Life Begins With a Smile :) 🍁 21:23, 19 January 2020 (UTC)[reply]
Thegooduser, have you contacted Dell's customer support department, or at least consulted their online portal? They may have some discussion forums where this is a known bug. At least you could contact a CSR who might be aware of your issue. If it is a hardware issue, I hope you are under warranty! Elizium23 (talk) 21:30, 19 January 2020 (UTC)[reply]
Elizium23, haven't contacted dell yet, from what I've heard (not sure if it's true) people have said dell's customer service is not the best... --Thegooduser Life Begins With a Smile :) 🍁 22:15, 19 January 2020 (UTC)[reply]
It could be a hardware issue where the LCD screen intermittently loses connection with the lower half of the laptop, and you just see the back-light. I suggest you hook up to an external monitor as a test. If the problem goes away, that's a good indication that this is the issue. Unfortunately, if this is the problem, there's no quick fix. You might find keeping the laptop open at a certain angle makes this less likely to happen, but every time you close and reopen it you are likely to make the problem worse. Ultimately, you either have an expensive repair or replacement to consider, since the display could fail permanently at any time. NonmalignedNations (talk) 13:28, 20 January 2020 (UTC)[reply]

January 20

Trying to convert a PDF symbol of a document to a display of a picture

File:בירור מעבר מפידיאף לתמונה - צילום 1, 18.1.2020.jpg

as it shows in the above photograph, in What'sApp. Ignore the the Hebrew language text in it, since it doesn't matter. In the upper part of the photograph there's the PDF symbol of the document, in red, and in its lower part there's the actual photograph received from the symbol (done by someone else). I'm trying to figure out how the conversion is done. I know it's to do with a short & simple step, involving screensaving, but don't see how exactly. Thanks, בנצי (talk) 12:54, 20 January 2020 (UTC)[reply]

Your question is unclear. Are you asking how to add a screenshot to a PDF document? Or are you asking how What'sApp displays PDF documents? Or something else? NonmalignedNations (talk) 13:31, 20 January 2020 (UTC)[reply]
Let's make it simpler: I've a PDF document > send it as an SMS on What'sApp > it appears as in the upper part of the attached photograph, namely as a red symbol. Now, my problem is getting it as a picture, the way it's shown in the lower part of the above mentioned photograph, but don't know how to do it. I hope it's clearer now. בנצי (talk) 13:55, 20 January 2020 (UTC)[reply]
I don't think you can. Basically, you're asking how to have the document show with a thumbnail or preview. I don't think PDFs provide for that. For example, on my Windows 10 machine, I can switch view in Windows Explorer to show thumbnails. For items such as images, videas, and PowerPoint presentations, tiny previews get generated. But for most other file types, including PDFs, that doesn't happen; you only see the generic symbol. Most PDFs are text heavy, so there is little demand for the ability to generate thumbnails since few people could read them anyway. Matt Deres (talk) 20:00, 20 January 2020 (UTC)[reply]
Added after 'edit conflict': I don't understand, though what you say is clear. You ignore what the photograph I uploaded here shows. Someone, who received my message (the one on the top of the photograph), somehow transformed it to the actual picture of the document, shown in his answer below my message. Since I don't have any contact with him, I'm left with the quiz. בנצי (talk) 21:02, 20 January 2020 (UTC)[reply]
Possibly if the PDF file consists of one image only (which can include an image of text) but no actual text, What'sApp might choose to display a thumbnail. Give it a try. NonmalignedNations (talk) 20:44, 20 January 2020 (UTC)[reply]
Maybe you're right if I understand what you say. It does consist one image only. Well. How do I get further ? How to give it a try ? בנצי (talk) 21:05, 20 January 2020 (UTC)[reply]
You would get whatever you want displayed on the screen, then use the Print Screen button on the keyboard (to the right of the function keys on a standard desktop keyboard). Then go into Microsoft Paint or equivalent, and click on the Paste menu option. The full image should display. From there you can trim the image and save it. Then, within the PDF editor, import the image. NonmalignedNations (talk) 21:48, 20 January 2020 (UTC)[reply]
Perhaps the second one is not a simple PDF but rather a webpage with a PDF in it? Matt Deres (talk) 16:06, 21 January 2020 (UTC)[reply]
I think we should start with the basics here. Does the 2nd one even seem like a PDF? In other words, if you click on it, does it actually open a PDF in a PDF viewer? It looks to me like it could just be an image. BTW, when you're done here, you probably should ask for that image to be deleted. I suggest in future you upload to image sharing sites like ImgUr. I see 2 comments in there that could be protected by copyright. Then there's the image of the PDF which I'm not sure is your own work. Nil Einne (talk) 07:54, 22 January 2020 (UTC)[reply]
Thanks. On the technical side: I'll check what you say later. On what looks private: they're mine, otherwise I wouldn't have uploaded them. I'm aware to that. The comments are technical in nature, and are mine, as well as the picture. The tip regarding ImgUr is a good idea for future necessity. בנצי (talk) 10:08, 22 January 2020 (UTC)[reply]
בנצי, open PDF document on the device, then screenshot your device (ios android). Save to your photos, in the whatsapp conversation send an image and pick it from wherever you saved it. —TheDJ (talkcontribs) 10:40, 22 January 2020 (UTC)[reply]
and that's not an 'good' / 'official' way to convert a pdf to an image, but it is super quick and works very well on most modern mobile devices. If you are looking for a desktop method to do it properly, or a technical method to do it for hundreds of them at the same time or something, then please indicate what it is that you are trying to achieve. —TheDJ (talkcontribs) 10:42, 22 January 2020 (UTC)[reply]

Reading parameter value in Angular

At work, I'm developing an ASP.NET Core web application that uses Angular on the front end, embedded in the HTML. The Angular code needs to read a parameter value in the ngOnInit() method when the page containing the Angular code is loaded. All works OK when I use an HTTP GET request, because then the parameter value is in the URL and Angular can get it from queryParams. But when I use HTTP POST, the parameter value is not in the URL at all. The ASP.NET Core controller knows the parameter value, but how can I pass it to Angular? Would it work to write it on the rendered HTML page as a hidden field and have Angular somehow access the page DOM in ngOnInit()? Can I use jQuery or just plain JavaScript to retrieve it? JIP | Talk 19:51, 20 January 2020 (UTC)[reply]

January 21

Further Angular question

This StackOverflow answer explained how to use jQuery from inside Angular. I tried it out at work and it worked straight out of the box.

The answer says to write declare var $: any;. Now I'm sort of a beginner in Angular so my question is, what does the declare part do? My guess it's the same thing as extern in C, meaning "this symbol exists, but we're not defining what it does here, it comes from some other place". Is this correct? JIP | Talk 18:28, 21 January 2020 (UTC)[reply]

Declare tells Angular that the variable is declared elsewhere. This is telling Angular that the variable $ is defined somewhere else. It goes a bit further. When compiled, nothing is added to the compiled code to handle the externally declared variable. It is just assumed to exist. Therefore, it is mainly just a hint for the compiler to ignore it and don't throw any warnings or errors if I use it. I wouldn't relate it to C's extern. That is more of a visibility issue, making a variable or function available elsewhere. So, to simplify to the point of being technically incorrect: Angular's define tells the computer to ignore it. C's extern expands scope. 135.84.167.41 (talk) 19:58, 21 January 2020 (UTC)[reply]
So I guess I was somewhat right, that declare in Angular means to the compiler "this symbol exists, you don't have to care where it comes from". As I said, I'm a beginner to this Angular thing, I'm more used to statically compiled languages such as C. JIP | Talk 21:50, 21 January 2020 (UTC)[reply]
Correct. It tells the compiler to ignore the symbol. 135.84.167.41 (talk) 13:01, 22 January 2020 (UTC)[reply]

Forbidden

If I go to this URL, I get the message: "403 Forbidden" above a line across the top of a white page and "nginx/1.10.3 (Ubuntu)" below. If I go to this URL and click on "View all articles", it goes to the same URL but there is content.— Vchimpanzee • talk • contributions • 21:11, 21 January 2020 (UTC)[reply]

Vchimpanzee, The site may be configured to not allow external links to enter some portions of the site, using HTTP Referer headers. moonythedwarf (Braden N.) 21:18, 21 January 2020 (UTC)[reply]
This is a new development. Is there a way for me to put the section on a list so I don't have to search for that link to "all articles"?— Vchimpanzee • talk • contributions • 21:31, 21 January 2020 (UTC)[reply]
I got a 403 the first time I tried it, but it worked every time after that, including after clearing cookies, closing and re-opening the browser, retrieving with cURL instead of a browser, etc. I haven't tried retrieving through a different IP address. One of my attempts to retrieve with cURL hung in the middle but other attempts worked. It sounds like the site is just a bit flaky. 2601:648:8202:96B0:0:0:0:4FFF (talk) 18:52, 23 January 2020 (UTC)[reply]
That site seems to be doing some pretty horrible things, like depending on a periodic XHR from shopify.com that in turn loads all kinds of tracking beacons into your browser. I would stay away from it in general. I did see the 403 behaviour again after trying a while later though. 2601:648:8202:96B0:0:0:0:4FFF (talk) 20:12, 23 January 2020 (UTC)[reply]

January 22

PC Video Fault

The PC gives a low-contrast, streaky display on a VGA monitor.

Which component is likely causing the faulty display shown on a monitor connected to the VGA output? How would a serviceman test this?

Pictures of video board, etc.
Edge of video card showing VGA output socket
The PC gives a low-contrast, streaky display on a VGA monitor.
Video board component side. Click to enlarge.
Video board underside. Click to enlarge.

Notes:

  • The VGA monitor and VGA cable have been tested ok.
  • The PC digital functions are ok.
  • The specs of the PC are HP Pavilion 9910 desktop 1.4 GHz, 128 MB, 40 GB disk, 32 MB display memory, nVidia GeForce 2 GTS. Windows ME.

DroneB (talk) 16:00, 22 January 2020 (UTC)[reply]

That card is from 2000 or so, so it is getting on in years. The image of the cooler shows a lot of junk in it, so it might have insufficient cooling.Try cleaning that and see if it helps.
Otherwise, the driver may have gone bad, you could try reinstalling it (if you can find a source for it).
I've found the manual on https://ideafix.name/old/video/BREND/asus/agp/v7700/v7700-101.pdf but it does not list your problem.
If the chip itself is damaged due to age or temperature, fixing it is nearly impossible, but you can still find the card being sold on amazon and e-bay. Rmvandijk (talk) —Preceding undated comment added 07:24, 23 January 2020 (UTC)[reply]

January 24

Computer and Internet Security

I am at a stage of my life when I decided to create an iron clad security system for my computers. I do program in C#, C++ and I have some experience in applications. Now I am looking for a book that might help me to cover all the topics I still do not understand. I found this on Amazon: "Computer & Internet Security: A Hands-on Approach 2nd Edition." The author is Wenliand Du. [1] There are no user comments of any kind on the book.

I wonder if anybody held this book in their hands and could make a comment? Perhaps there are other books on the subject people are familiar with?

Thanks AboutFace 22 (talk) 14:18, 24 January 2020 (UTC)[reply]

You need to ensure the book is aligned to your OS, preferably to the distro/version you use. A Win7 book would be poor for Win10 and useless for Linux. Conversely an Linux guide would be meaningless mumbo-jumbo to Windows users. Martin of Sheffield (talk) 14:36, 24 January 2020 (UTC)[reply]

I do both Windows 10 and Linux Ubuntu. My understanding is that Linux has a much higher security because fewer consumers use it, so the potential malware developers express little interest in Linux. AboutFace 22 (talk) 17:09, 24 January 2020 (UTC)[reply]

I don't want to start a flame war, but within the industry *nix generally is assumed to be more secure than WinX if both are configured correctly. It's not a numbers game, structurally *nix has developed from a mainframe environment whereas Win has evolved from a PC. Martin of Sheffield (talk) 17:19, 24 January 2020 (UTC)[reply]
That is why Macs are considered secure. Few people use them, so there is no point in attacking them. For Linux, it is secure because it is open source. Many eyeballs make errors easier to find. Both of those arguments are fallacies. 135.84.167.41 (talk) 17:20, 24 January 2020 (UTC)[reply]
Martin of Sheffield, 135.84.167.41 (talk · contribs · WHOIS): Both you and the IP editor are correct. Linux has things like the SELinux patches to make a properly configured linux system much more secure than a windows system, but simple things like being open source are not the key. Did you know the MacOS kernel, Darwin, is also open source? Surely the "open source == security" thing would apply to Darwin, then. moonythedwarf (Braden N.) 17:24, 24 January 2020 (UTC)[reply]
Since Darwin is a BSD derivative, it falls firmly in the *nix camp. It's not just open source (though that can be a big help) but the underlying structures. As for "worth attacking", serious attackers are more likely to be interested in a server than a desktop - always depending upon what the server is used for and whose desktop. Martin of Sheffield (talk) 19:31, 24 January 2020 (UTC)[reply]

I recommend Security Engineering by Ross J. Anderson. You can download it as pdf's from his website if you don't want to buy a dead tree copy. It is not so much about "how to secure a PC" as how to develop a security mindset, but it is great bedtime reading. 2601:648:8202:96B0:0:0:0:4FFF (talk) 06:40, 25 January 2020 (UTC)[reply]

There is a missing definition on the "List of computing and IT abbreviations" under the "B" section!

Under the "B" section there is missing a really old abbreviation or term. It is B.L.O.N.D. which stands for "Binary/ Local/ Online/ Network/ Device". I have been working with computers for 40+ year so when I checked for it it wasn't there. I just thought it should be added!!! Have a great day!!! — Preceding unsigned comment added by Murphy's Law Canada (talkcontribs) 19:55, 24 January 2020 (UTC)[reply]

January 25

Ubnutu 18.04.3 LTS

In Virtual Box, how can I expand the disc space? --Thegooduser Life Begins With a Smile :) 🍁 01:23, 25 January 2020 (UTC)[reply]

What's wrong with this code?

For the record, this code is for a rock-paper-scissors game:

inp = "Yes"

while inp == "Yes" or "yes":

   move1 = input("What move would you like to make?: ")
   move2 = input("What move would you like to make?: ")
   if move1 == "Rock" or "rock":
       if move2 == "Rock" or "rock":
           print("It's a draw!")
       elif move2 == "Paper" or "paper":
           print(move2,"beats",move1,"!")
       elif move2 == "Scissors" or "scissors":
           print(move1,"beats",move2,"!")
   elif move1 == "Paper" or "paper":
       if move2 == "Rock" or "rock":
           print(move1,"beats",move2,"!")
       elif move2 == "Paper" or "paper":
           print("It's a draw!")
       elif move2 == "Scissors" or "scissors":
           print(move2,"beats",move1,"!")
   elif move1 == "Scissors" or "scissors":
       if move2 == "Rock" or "rock":
           print(move2,"beats",move1,"!")
       elif move2 == "Paper" or "paper":
           print(move1,"beats",move2,"!")
       elif move2 == "Scissors" or "scissors":
           print("It's a draw!")
   inp = input("Would you like to play again? If so, type either 'Yes' or 'yes': ")

Futurist110 (talk) 01:34, 25 January 2020 (UTC)[reply]

I don't know whether this is actual code for a specific language. In most programming languages, indentation is ignored and the two "elif move1 == ..." will be interpreted as elif to the immediately preceding elif and not to something earlier with the same indentation. If your language is like that then it probably has an endif or similar to end the closest unterminated if. PrimeHunter (talk) 02:40, 25 January 2020 (UTC)[reply]
It's probably true that in most programming languages indentation is ignored -- but not in Python, which this code appears to be.
The obvious mistake I see is in the second line,
while inp == "Yes" or "yes":
which should be
while inp == "Yes" or inp == "yes":
Hope this helps! --Trovatore (talk) 05:01, 25 January 2020 (UTC)[reply]
You could alternatively say "while inp in ['yes','Yes']", but preferably: "while inp.lower() == 'yes'". 2601:648:8202:96B0:0:0:0:4FFF (talk) 06:42, 25 January 2020 (UTC)[reply]