Jump to content

Wikipedia:Reference desk/Archives/Computing/2017 September 19

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


September 19

[edit]

OOP prototypes

[edit]

Is it true to define a prototype in OOP programming as the "first inheritor of a class"?

Or else, the prototype is a structure similar to class in languages that some consider to be "without classes" like JavaScript?

Ben-Yeudith (talk)

Prototype-based programming is an alternative to class-based programming. With prototypes, an object has a prototype object which it inherits from, forming a prototype chain. With classes, an object is an instance of a class, and classes inherit from each other to form a class hierarchy. C0617470r (talk) 04:04, 19 September 2017 (UTC)[reply]
Thank you so much. Ben-Yeudith (talk) 09:14, 19 September 2017 (UTC)[reply]

Windows Task Manager

[edit]

How do I delete stuff that appears automatically in the "Processes" tab? 103.67.157.85 (talk) 06:58, 19 September 2017 (UTC)[reply]

Are you asking how to stop a particular process (that facility is built in to Task manager), or how to prevent certain processes from starting up? Many processes are needed for other applications or for the operating system, so it might be useful to mention which processes you want to kill. Dbfirs 07:02, 19 September 2017 (UTC)[reply]
I suggest a procedure like this to test which processes you can kill:
1) First, save anything critical, as you may lose it.
2) Start up the Task Manager, write down the name of a process you want to kill, then click on it and pick End Process. It may end with no apparent problem (sometimes slowly), it may not end at all, it may end and then restart, it may end and take other processes with it, or it may end and cause problems, up to killing Windows.
Repeat this process many times and then you will know which processes are safe to kill. StuRat (talk) 20:51, 19 September 2017 (UTC)[reply]
To stop things from starting automatically, I recommend using the Autoruns program from SysInternals. As mentioned above, you ideally should have some idea of what you're disabling, because some things are necessary for various parts of Windows to function properly. With that said, there's little harm in experimenting. If you disabled something and it causes undesired effects, you can just re-enable it and restart. --47.138.161.183 (talk) 01:34, 21 September 2017 (UTC)[reply]

Reversing lines → senil gnisreveR

[edit]

I thought I remembered that one of the more obscure among the GNU Core Utilities took a text file, kept the order of lines within it intact, but reversed the order of characters within each line. Thus unleashing this on a file reading in part:

     Who
     What
     How
     Where

would result in a file reading in part:

     ohW
     tahW
     woH
     erehW

However, I don't notice any such tool within the List of GNU Core Utilities commands. Am I overlooking something? ("Double-byte aware" would be particularly welcome, but even single-byte-only would be useful.) -- Hoary (talk) 09:32, 19 September 2017 (UTC)[reply]

On the UNIX and Linux systems I have access to, that command is rev, which doesn't have a Wikipedia article listed in the disambiguation page rev. On my Fedora Linux machine, it's not in the coreutils package, but is in the util-linux package. --69.159.60.147 (talk) 10:31, 19 September 2017 (UTC)[reply]
(EDIT CONFLICT)
I couldn't find it on the list either, but that would be the rev utility. Anyway, if you've got a standard GNU installation then it should be available. Just type something like
rev SomeLines.txt > SomeLinesReversed.txt
Not sure if it handles unicode properly though... Arundel (talk) 10:35, 19 September 2017 (UTC)[reply]
Excellent. Thank you, 69.159.60.147 and Arundel. -- Hoary (talk) 11:27, 19 September 2017 (UTC)[reply]
Note that the util-linux package has nothing to do with the GNU project. It's just a grab bag of utilities that most Linux distros include. (If you're immersed in the FLOSS world you can tell just from the name, because GNU/FSF is very insistent on only using "Linux" to refer to the kernel.) A more portable POSIX awk implementation: awk '{s=""; for(i=length();i>0;--i){s=s substr($0,i,1);} print s;}' myfile. If your awk supports Unicode, this, of course, will. --47.138.161.183 (talk) 06:43, 20 September 2017 (UTC)[reply]
See http://man7.org/linux/man-pages/man1/rev.1.html --CiaPan (talk) 11:34, 19 September 2017 (UTC)[reply]

Regarding AWS certification requirements.

[edit]

Can I get an AWS certification by passing the exam or does it require experience in AWS too for the certification? https://aws.amazon.com/certification/certified-solutions-architect-associate/

Sadly it's usual that an exam pass can be achieved without experience. This is why such exam passes count for so little. It's also why I'm so careful when interviewing. Such a certification is not a substitute for experience. Andy Dingley (talk) 15:10, 19 September 2017 (UTC)[reply]
The exam is all that is required to get AWS certified. No experience is necessary. In my experience (40 years in IT in military, government, medical, and academic fields), only people who don't know what they are doing pay for certifications themselves. My stack of certifications only exist because someone I worked for made me get the certification. They paid for it. I took the exam. I don't put any certifications on my CV. I only list my degrees. 209.149.113.5 (talk) 17:24, 19 September 2017 (UTC)[reply]

Sleep number bed data stream

[edit]

First off, this is not a complaint; the Sleep Number bed seems to be an ok company. Many models of the Sleep Number Bed send data from the bed to your router to the company, which then can provide to the owner a summary of the sleep pattern. The owner has to opt in to having their sleep monitored. The legal disclaimer from the company says that for their SleepIQ® technology to work they will collect "Biometric and sleep-related data about how You, a Child, and any person that uses the Bed slept, such as that person’s movement, positions, respiration, and heart rate while sleeping. Audio in Your room to detect snoring and similar sleep conditions" and they will use the data for research, or provide it to other companies for research, and they use it to report back to the owner how well he is sleeping, so he might experiment with different sleep numbers, bedtimes, etc., but that "We may be required to share Personal Information under applicable law, including laws outside Your country of residence; or to comply with legal process or in response to a valid court order, government investigation, subpoena public and government authorities, including public and government authorities outside Your country of residence. We also reserve the right to report to law enforcement agencies any activities that We, in good faith, believe to be unlawful." My question is, is there any way for the owner to access the raw data as it passes, presumably by Bluetooth, from the mattress to the router, or from the router to the company, as opposed to just seeing a summary provided to them by the company the next day? (Possibly it uses iOS or Android and goes directly to the company rather than via your router. I don't know.) I am curious as to whether it transmits conversations, and from what distance, in addition to pulse rate, respiration and snoring. Would persons at the company or their associates who have access to the raw data be able to listen to all interesting bedroom audio, as well as getting a graphic display of the real time displays of any jiggity-jiggity activity on the mattress? If the owner chose not to have the microphone and pressure sensors send in data, is there a physical way to ensure privacy, in addition to trusting the company not to listen in when you have opted out, such as leaving the pressure control unit and pump plugged in but killing the power to the monitoring circuits by unplugging some power cable? Edison (talk) 15:30, 19 September 2017 (UTC)[reply]

My understanding is that you need to install an app called SleepIQ on your phone or tablet. It uses bluetooth to talk to the bed. The app sends data to the company, not the bed. So, you *could* disable data for the app if you want to. It isn't necessarily easy to do so. The connection is likely TLS, so you can't simply packet sniff it at the router. If you are talking about something other than the SleepIQ app, then ignore this all together. 209.149.113.5 (talk) 16:52, 19 September 2017 (UTC)[reply]
Yes, it is SleepIQ. But it only provides a summary chart with one hour resolution (from 1:10 am to 2:10 am there were 40 minutes of sound sleep and 15 minutes of restlessness, with the person out of bed 5 minutes." For the entire night it gives summaries of the three categories, and adds average heart rate and respiration rate. The "restlessness" doubtless includes: turning over, restless leg, scratching an itch, adjusting the covers, talking, snoring, radio/tv listening, shreiks of pleasure, whatever. When they do a sleep study at a lab, to check for sleep apnea, there is also a summary provided, but one can also download the second by second data as to movement, heart rate, respiration, and eye movement. The full data stream goes to the company, but only a summary comes back. It would seem possible to capture the datastream in the home, as it is uplinked, or to plug into a usb port on the machine and capture it. Edison (talk) 17:59, 19 September 2017 (UTC)[reply]
As mentioned, the data stream is likely encrypted with TLS. So, "grabbing" it isn't easy. It would be easier to communicate with the devices in the bed and do whatever you like. I haven't done anything with a bed. I used an ODB2 to Bluetooth device in my car (and other cars). I used a bluetooth arduino kit and monitored different aspects of the engine exactly how I wanted to. I was able to track down a "shiver" in the engine to moisture in the transmission. Only then did I discover that Mercedes transmissions made in the United States tend to be very vulnerable to moisture. Back to the point... You *could* communicate with the bed directly and, then, reverse engineer what the sensors do and make any kind of report that you like. It is simply a matter of how much effort you want to put into it. Most people just want someone else to do all the work. 209.149.113.5 (talk) 18:07, 19 September 2017 (UTC)[reply]
I find all this quite horrifying. Any computer analysis of your sleep patterns should occur right there in the room, not sent back to the company for analysis. The potential for abuses from this are endless. The only reason I would consent to having my sleep monitored is if I was suffering from a potentially life-threatening sleep disorder, like sleep apnea. StuRat (talk) 01:13, 20 September 2017 (UTC)[reply]
Sleep number optimization: [1]. :-) StuRat (talk) 01:09, 20 September 2017 (UTC) [reply]

Safely remove that USB thumb drive

[edit]

Before you remove a thumb drive or camera, you are supposed to click that "Safely remove..." thing. Is that needed? What if you don't? What can get harmed? Data? The USB? The computer? Anna Frodesiak (talk) 19:05, 19 September 2017 (UTC)[reply]

If it is writing a file to the USB stick then that file can become corrupted. (((The Quixotic Potato))) (talk) 19:15, 19 September 2017 (UTC)[reply]
Okay, so it won't hurt any hardware, right? Cheers. :) Anna Frodesiak (talk) 19:34, 19 September 2017 (UTC)[reply]
In theory the Master File Table and Master Boot Record (if it is a bootable usb drive) can become corrupted, but that is very unlikely, and usually easy to fix by running chkdsk. It may cause some data loss, but damaging hardware is unlikely unless you crush it in your mighty hands. (((The Quixotic Potato))) (talk) 19:42, 19 September 2017 (UTC)[reply]
Thank you, The Quixotic Potato. From now on, I'm going to just yank out that USB and not bother with the "Safely remove..." thing. Cheers. Anna Frodesiak (talk) 19:50, 19 September 2017 (UTC)[reply]
@Anna Frodesiak: For the record, I only store unimportant stuff on USB drives, and I do triple backups (locally, in the cloud and in another house). This article may be interesting to you. https://www.howtogeek.com/118546/htg-explains-do-you-really-need-to-safely-remove-usb-sticks/ (((The Quixotic Potato))) (talk) 20:45, 19 September 2017 (UTC)[reply]
Thank you, The Quixotic Potato. The howtogeek article convinced me. I will do the "Safely remove..." thing.
And why put only unimportant stuff on USB drives? Aren't they reliable? Won't data on them last for all eternity? (I do backups almost like you: Mirror HDD in the PC and an offsite HDD. No cloud. I don't trust companies to keep it safe.) Anna Frodesiak (talk) 21:08, 19 September 2017 (UTC)[reply]
Nothing will last for all eternity, not even potatoes. I have a little bit of important stuff (work and personal projects etc.) and a large amount of relatively unimportant stuff (e.g. music, videos). The important stuff is stored and backed up on heavily encrypted SSDs. Large SSDs are expensive, and I don't want to have to split for example my music collection over several drives. The relatively unimportant stuff doesn't require as much encryption (having to enter passwords is inconvenient and I am lazy), and there is so much of it that I use large but cheap external USB drives. A 2TB SSD which is able to store my music collection costs about 540 euro, and I would need to have 2 in order to back it up. That is 1080 euro just to store my music collection. Currently it is stored on a cheap 5TB drive which costs about 150 euro. Four 5TB drives cost me about 600 euro and that is enough to store my music and videos. I use those small 2.5 inch 2TB WD My Passport Ultra drives for other stuff. I store my backup drives in a Lampertz S13 Datasafe. I've lost important data in the past and that was a giant pain in the ass. (((The Quixotic Potato))) (talk) 22:25, 19 September 2017 (UTC)[reply]
It seems rather odd to conclude from this discussion that it's safe to yank the stick without safely unmounting it. As mentioned, data on the stick can be corrupted if you do that. I guess if you don't care about the integrity of the data on the stick then it's fine to do as you intend, but in that case why are you using a USB stick at all? It's hard for me to imagine a scenario where I copy data onto a stick but don't care whether the data is readable in the future. CodeTalker (talk) 21:07, 19 September 2017 (UTC)[reply]
Good point. I've changed my mind. But one scenario where I don't care is when I use a USB to transfer stuff from one PC to the one next to it. Anna Frodesiak (talk) 21:09, 19 September 2017 (UTC)[reply]
"Is it OK to remove the USB flash drive before it says it's safe ?" ... "Sure, that's just a silly disclaimer." ... "OK." ... Final scene is a rising mushroom cloud. :-) StuRat (talk) 20:03, 20 September 2017 (UTC) [reply]
I've been removing USB drives without going through the "safe" process for the past fifteen years, but only when I'm "sure" that they are not being written to. I've only been caught out once, and there were no bad consequences other than having to repeat the write. One of these days, I might regret the habit. With other people's data and drives, I always go through the "safely remove" process, of course. Dbfirs 08:14, 21 September 2017 (UTC)[reply]

Forgetting to unplug the computer before taking out a HDD

[edit]

I forgot once. Is that super serious? Anna Frodesiak (talk) 19:05, 19 September 2017 (UTC)[reply]

OH MY GOD RUN EVERYTHING WILL EXPLODE! No, not really. If it is writing a file while you unplug it the file may become corrupted. Usually Scandisk can fix that. It is theoretically possible that the Master File Table becomes corrupted, but that is unlikely, and if it happens then Scandisk may be able to fix that too. (((The Quixotic Potato))) (talk) 19:17, 19 September 2017 (UTC)[reply]
That only really applies if you don't shut down the operating system. If you don't unplug the computer then, depending on your computer, you might risk electrocution and death, which is a little more serious than having to run chkdsk. -- zzuuzz (talk) 19:31, 19 September 2017 (UTC)[reply]
Good point. Electricity is dangerous. (((The Quixotic Potato))) (talk) 19:36, 19 September 2017 (UTC)[reply]
Yikes! Anna Frodesiak (talk) 19:37, 19 September 2017 (UTC)[reply]
Is there evidence for this? All modern desktops are grounded at the power supply. As long as the wiring it's plugged into has a functioning ground, if there's a short in the power supply it should trip the fuse/breaker. Laptops all use external power supplies with a DC plug into the laptop itself; the low-voltage DC is unlikely to give you anything more than a bit of a jolt. (Of course, that still doesn't mean you should play with electricity.) --47.138.161.183 (talk) 06:23, 20 September 2017 (UTC)[reply]

Thank you folks. :) I'll be more careful next time. Anna Frodesiak (talk) 19:37, 19 September 2017 (UTC)[reply]

Anna Frodesiak, the HDD is not operating with hazardous voltage. Since the mid 1990s the ATX standard came into the computer market, indirectly specifying power supplies with no hazardous voltage outside power supply. Today, most HDDs use the SATA compatible connectors, designed for hot-plugging when supported by the computer hardware setup. So the only risks are: Electrostatic discharge, shortcut when not unplugging straightly or make the connectors touch other conducting parts, head crash damage when moving the drive with spinning platter, lost data and file system damage due incomplete writing access. --Hans Haase (有问题吗) 19:49, 20 September 2017 (UTC)[reply]
Thank you, Hans Haase. It seems a lot safer than I thought. :) Anna Frodesiak (talk) 23:58, 20 September 2017 (UTC)[reply]