Wikipedia:Reference desk/Archives/Computing/2017 May 25

From Wikipedia, the free encyclopedia
Computing desk
< May 24 << Apr | May | Jun >> May 26 >
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.


May 25[edit]

Erratic scrolling[edit]

This problem occurs only with Chrome, not with Edge. One of my computers is a laptop with infrared mouse connected to a USB port. The mouse pointer behaves normally and can be moved around the screen very fast, but page scrolling is jerky when holding down the left button on the up/down boxes at the top and bottom of the scroll bar. Dragging the scroll bar itself is fine. The jerkiness is very bad. The scrolling sometimes stalls briefly, and believe it or not, the page sometimes reverses direction briefly, ie. it moves in the opposite direction to that of the box clicked, and then resumes in the correct direction. These symptoms also happen with the touchpad and buttons built into the keyboard. Laptop was originally XP, was upgraded to Win7, then 10. The mouse is Lexma brand and is identified in Device Manager as HID-compliant and drivers do not seem to be available. Anyone have a suggestion? Akld guy (talk) 10:54, 25 May 2017 (UTC)[reply]

Check for hardware issues first by removing the USB-mouse. However, the internal mouse pad will have other problems than the external mouse. Changing the direction might be causes by a dirty encoder disc in the mouse wheel, see rotary encoder. There are two photo transistors, one reading the clock signal when the wheel is moved, the other returns the direction. A failed solder dot can be detected by resoldering with adequate equipment most reliable and quick. The micro switches are also used to bypass crossing wires on the single layer printed circuit board (PCB).
Before assuming a hardware failure, Windows and Internet Explorer have settings in control panel about smooth scrolling. This checkboxes are made to choose a compromise between computer graphic performance and reading while scrolling. As the computer came with Windows XP, it might have a problem with memory size, causing a delay on user input. As we are used to stop scrolling when reaching the targeted part of the page, the computer might have buffered the mouse wheel input until performed. A wheelmouse should be working as a standard USB HID. Special buttons only might require a driver. Useful brand name mice are avail from €6 or $7. --Hans Haase (有问题吗) 11:40, 25 May 2017 (UTC)[reply]
I removed the mouse. Still the same problem with the integral touchpad and buttons. There is no scroll wheel on the mouse - I removed it some time ago to try to solve the problem and because my finger was continually moving it, making the scrolling even more difficult to control. I have an identical mouse, also with the wheel removed, which also exhibits the same symptom. Why is this happening only with Chrome and not Edge? Akld guy (talk) 12:45, 25 May 2017 (UTC)[reply]
  • It would be interesting to know, when you still had the mouse wheel, if clicking on it and then scrolling by moving the mouse up and down worked well. StuRat (talk) 13:54, 25 May 2017 (UTC)[reply]
  • Also, does this happen only when the page is busy loading ? (For some pages, they are always busy loading and reloading content and ads, with videos that auto-play being the worst culprits.) Try this text-only page (weather forecast) and let us know if it has a problem, too: [1]. StuRat (talk) 14:21, 25 May 2017 (UTC)[reply]
Oooh, that's a good page for troubleshooting. Nothing but text, links and a button. Kudos. ᛗᛁᛟᛚᚾᛁᚱPants Tell me all about it. 14:52, 25 May 2017 (UTC)[reply]
@MjolnirPants: AMD Sempron, 32 bit, 2.00 GHz, 2.00 GB. Don't tell me that's inadequate. It should be ample for simple text pages. Why does it work fine in Edge, but not in Chrome?
@StuRat: No, it never worked properly. It happens long after the page is static with no more data arriving (no LED indication on router). That weather forecast page is so short that there is hardly any scrolling from top to bottom, but it did seem like the problem was present. Akld guy (talk) 20:57, 25 May 2017 (UTC)[reply]
I can now say with near-complete assurance that the problem is Chrome. Chrome -while a good browser- is a resource hog. It uses a lot of memory, processor threads and virtual memory to run. Your system is rather low-end (at the current time), and the combination of these two factors is almost certainly responsible. I have observed the very same behavior on systems with very low specs, or on systems under a very high load. This also explains why Edge works well; it is less resource intensive than Chrome. My advice would be to use Edge in the future, or to switch to Firefox or possibly Safari for your browser if you do not want to use Edge. ᛗᛁᛟᛚᚾᛁᚱPants Tell me all about it. 21:03, 25 May 2017 (UTC)[reply]
@MjolnirPants: OK. I'm reluctant to abandon Chrome because it stores my Bookmarks in the cloud, so whenever a computer fails and gets replaced, all my bookmarks are still there. I know nothing about Firefox. Can it store bookmarks like that? I could google that but appreciate advice from someone who understands why I'm considering changing and may have relevant tips. Akld guy (talk) 21:17, 25 May 2017 (UTC)[reply]
Yes. Indeed, it can store not only bookmarks, but browser extensions, plug-ins and a great deal of other types of personalization. ᛗᛁᛟᛚᚾᛁᚱPants Tell me all about it. 21:25, 25 May 2017 (UTC)[reply]
I realise it can store bookmarks, but that wasn't my question. Can it store them independently in a cloud so that they're still there when the computer fails and gets replaced? Akld guy (talk) 21:51, 25 May 2017 (UTC)[reply]
The Firefox Sync article has some good info about how their synchronization works. I haven't used it myself but it seems pretty straightforward. Random character sequence (talk) 22:01, 25 May 2017 (UTC)[reply]
It is. It's pretty user friendly, with good default settings and one-button activation. ᛗᛁᛟᛚᚾᛁᚱPants Tell me all about it. 22:04, 25 May 2017 (UTC)[reply]
Sold. Gonna try FF for the first time ever. Thanks Random character sequence and MjolnirPants. Akld guy (talk) 22:36, 25 May 2017 (UTC)[reply]
Firefox is barely any better. Still jerky, but at least the page doesn't reverse direction. No doubt it will do that once it starts getting bloated. Sorry, but FF wasn't a solution. Looks like I'm stuck with the problem in Chrome or need to revert to Edge. Akld guy (talk) 00:03, 26 May 2017 (UTC)[reply]
Stick with Edge then. I know it's the "sequel" to Internet Exploder, but people online seem to think it's a pretty good browser. And, being made by MS, it's almost certainly more efficient in its use of resources than most others. According to the tech review sites, it does great on benchmarks, which is what you're looking for here. But it lacks most of the advanced features of browsers like FF or Chrome. Alternatively, you could also try Opera and Safari. As a last resort, it may be time to replace your machine, and turn your current one into a file server or something. ᛗᛁᛟᛚᚾᛁᚱPants Tell me all about it. 13:06, 26 May 2017 (UTC)[reply]
Note if you're just worried about cloud syncing for backups, I'm not sure you need to use Chrome or Firefox anyway. Edge supports cloud syncing [2] [3], as with nearly all other modern browsers. This will be to Microsoft servers and would require I'm pretty sure your Windows account is a Live account, not a local one. So if for some reason you're are unable or unwilling to use one then yes perhaps you're SOL (although it can't be that hard to make something which will backup your bookmarks somewhere). Although while I understand why some people dislike the either of their desktop or laptops being that way, it is interesting how many people are so opposed despite readily giving probably more info away to Google or Apple on their smartphone and other services they use. But otherwise I don't see why you would need Chrome or Firefox in this case. I'm not sure if there's any way to easily access the synced content other than by using another Windows device which is the key limitation for many people (if Microsoft brings Edge to Android and iOS people would have the option although I doubt many would take it up). But this doesn't seem to apply when you just want a backup and the replacement device is likely to be Windows. (If you do ever want to move away from Windows, you could easily sync then export.) Nil Einne (talk) 23:20, 26 May 2017 (UTC)[reply]
I've come up with a solution that suits me fine. I open Chrome and leave it running on my gmail account. This means that I get the normal gmail notifications that I was used to getting in Chrome. Then I open and use Edge for normal browsing. There is no problem with scrolling in Edge. The bookmarks that I want to keep are static and are in the Chrome cloud. If the computer fails and is replaced by another, I'll simply import those important ones from Chrome into the new device's Edge. I don't want to bother with a Win Live account, if that's the only way it can be done. Akld guy (talk) 01:16, 27 May 2017 (UTC)[reply]
Akld guy, is there a damaged key on the keyboard, causes holding a key pressed all time or cause the switch of the key bypassed by similar connection? If no, try this? It was found by googling for google chrome scrolling lag. Another recommendation was to reset the browsers settings.[4] Was this the problem? --Hans Haase (有问题吗) 16:25, 27 May 2017 (UTC)[reply]
@Hans Haase: There is no damaged key, but amazingly you have found the solution with that first link!! I disabled smooth scrolling and hey presto, the scrolling is now good. Still a trifle jerky but at least it doesn't stall and doesn't reverse the scrolling direction which it did every few sentences. Amazing. A solution. Thank you. Akld guy (talk) 23:09, 27 May 2017 (UTC)[reply]
That makes sense, as smooth scrolling requires more resources, because it attempts to scroll with smaller increments, meaning more steps to scroll the same distance. StuRat (talk) 21:23, 30 May 2017 (UTC)[reply]

Java finding values in a Map which match a String, and creating a Set of the results[edit]

I'd like to write a Java method that iterates over a Map of objects. I want it to look at one of the objects' attributes, match a String which I will provide, and add those matching objects to a new Set. Beyond a vague idea that I should use a while loop, I am lost. Can anyone help me get started? 129.67.116.232 (talk) 20:51, 25 May 2017 (UTC)[reply]

What do you need? You need a map of original objects. You need a map (initially empty) of matched objects. You need a string. Declare all of those. You need them. Now, iterate over the original map. For each iteration, check the attribute against the string and, if they match, copy the object to the matched objects map. You could make a clone of the object or copy the object itself - meaning that the object will be in both maps and if you change it in one, it changes in the other. When you are done iterating, the new map will have matching objects in it. So, what is the problem? Do you know how to define a map? Do you know how to iterate? Do you know how to compare strings? Do you know how to add an object to a map? 209.149.113.5 (talk) 12:24, 26 May 2017 (UTC)[reply]
Note that your initial container being a Map is irrelevant (unless the attribute in question is also the key for the map); its structure does not help the search. Therefore you're using the generic Collection interface. --Tardis (talk) 13:10, 26 May 2017 (UTC)[reply]
This is an ideal problem for streaming. Ruslik_Zero 14:12, 28 May 2017 (UTC)[reply]