Saturday, August 3, 2019

ubuntu - Installing Windows 10 on SSD - asking about options



Recently my hard drive, with a dual-boot of Windows 10 and Ubuntu 15.10, crashed on me. I could boot into Ubuntu, not Windows, and I saw in GParted that Windows 10 was practically gone.



I managed to reinstall Windows 10 from a repair USB, I had created earlier, but had to wipe out the entire disk, both systems and all data, as a consequence. Luckily I had backed up all data - I believe.




These troubles led me to finally pulling the trigger on an SSD. Now the old disk is working fine with the restored Windows 10, so I know I can simply clone it to the SSD.



The question is, if a clean install of Windows 10 would be a better option for me. I will probably mostly use the HDD as a data drive, but I would like to be able to keep it as an extra Windows disk, just as a Windows 10 system backup



I will restore the ( >= ) dual-boot, with Ubuntu, and possibly other distros I want to test out. As the need for speed is practically non-existent for my Linux setup(s), I want to use the SSD only for Windows. Actually I only need the greater speed for a few applications.



So it would be good to be able to have the extra Windows on the hard disk - mostly thinking about saving the SSD from wear and tear.



If I am thinking this out in a wrong way, please tell me how. Opinions on the endurance of SSDs seem to vary. Some say most SSDs today will outlive the other parts of the system they reside in, even with a huge load of read and write, all the day long.




Others say the number of read/write cycles are limited, and the number of "dead" areas on the SSD will increase with time, affecting the speed and lifetime of the drive.



So how should I go about in this?


Answer



It looks like you have been doing your research. You probably know most of what I wrote here, but I'll be thorough for people who come looking for similar answers.



If you want a few applications on Windows to run quickly, I'd recommend installing fresh Windows onto the SSD so you can set up partitioning appropriate to the new disk (usually SSDs are different sizes from HDDs). The OS and its applications will only run as fast as your hard drive and RAM allow, so I'd make sure all of Windows is on the one SSD.



A clean install is always a good idea, but certainly isn't critical, since you just did a reinstall. I have had SSDs in my family's laptops for the last couple of years and we are very happy with them. Wear and tear occurs much faster on spinning hard disks, because they have moving (fragile) parts carefully balanced between powerful magnets. SSDs don't have moving parts, so they use less power, should stay cooler, and are less likely to have motion-related failures. Even SSDs are not immune to failure, however, so it is a good idea to have external backups, like you are thinking.




If you are using a desktop that can hold both hard drives, I would probably wipe the old drive after installing or cloning to the new one. Then, you can set up space-efficient backups, recovery machine images, or partitions for the various Linux distros you want to use. If you are using the disk for an OS that you use regularly, however, don't plan on it for backups. It will probably die before your SSD. If you have a need for an instant second Windows machine, then stash the drive powered off it in its currently functioning state and use your new SSD for your Linux distros. Spinning HDDs are relatively cheap, so you could just get another one for Linux if you have enough space in your case.



BTW, if your Linux distro is installed on a second hard drive, you should be able to install directly to the second hard drive and not have to jump through the normal hoops of setting up your Windows partitions to create space for Linux. Your BIOS should be able to detect two different bootable disks. Your bootloader (GRUB2, probably) should let you choose which one you want to boot, and set up a default to boot.


windows - Why this multiline for/in/do doesn't work in a batch?


To help my kid learn the most common colors, I made this batch (it's Windows 7 but I suppose it's the same on another Windows version):


@echo off
for %%a in (^
black ^
blue ^
green ^
gray ^
orange ^
pink ^
red ^
#82461F ^
#7E287E ^
white ^
yellow ^
) do ffplay -hide_banner -f lavfi -i color=%%a:160x90:d=3,format=rgb24 -fs

Pretty straightforward: the for loop runs every ffplay command one at a time, filling my 16:9 screen with a single color until the kid recognizes the color and names it well; then I press q to exit that instance of ffplay and the next color is displayed.


I break the command so I can have every color value in a line to easily mix the lines when I need it in order to avoid a specific order to be learned.


But it just doesn't work. If I get right from these two questions...


... since every ^ disappears from the final command, my batch is equivalent to the command line interpreter single line...


for %a in (black blue green gray orange pink red saddlebrown violet white yellow ) do ffplay -hide_banner -f lavfi -i color=%a:160x90:d=3,format=rgb24 -fs

... which, needless to say, works perfectly.


What it does work is beginning the last line with a space. But, in spite of finding a way to make the batch work, the question remains. Why is it necessary that space? Or, what am I missing from the answers to the listed questions?


Edit:
#82461F==brown
#7E287E==violet
My wife wasn't convinced of how these two named colors looked on our display.


Edit:
For reference, the final working batch (thanks all), with colors alphabetically ordered and without unnecessary carets and spaces:


@echo off
for %%a in (
black
blue
#82461F %= brown %
gray
green
orange
pink
red
#7E287E %= violet %
white
yellow
) do ffplay -hide_banner -f lavfi -i color=%%a:160x90:d=3,format=rgb24 -fs

Answer



You can omit all the line continuation chars ^ they aren't neccessary,
but as the lines following start in the first column this is interpreted as escaping the first char of the following line - not what you itended I guess.


That doesn't harm for letters, but escaping the closing parentheses is a different thing.
The following batch echoes only the command for testing purposes:


@echo off
for %%a in (black
blue
green
gray
orange
pink
red
#82461F
#7E287E
white
yellow) do echo ffplay -hide_banner -f lavfi -i color=%%a:160x90:d=3,format=rgb24 -fs

Sample output:


ffplay -hide_banner -f lavfi -i color=black:160x90:d=3,format=rgb24 -fs
ffplay -hide_banner -f lavfi -i color=blue:160x90:d=3,format=rgb24 -fs
ffplay -hide_banner -f lavfi -i color=green:160x90:d=3,format=rgb24 -fs
ffplay -hide_banner -f lavfi -i color=gray:160x90:d=3,format=rgb24 -fs
ffplay -hide_banner -f lavfi -i color=orange:160x90:d=3,format=rgb24 -fs
ffplay -hide_banner -f lavfi -i color=pink:160x90:d=3,format=rgb24 -fs
ffplay -hide_banner -f lavfi -i color=red:160x90:d=3,format=rgb24 -fs
ffplay -hide_banner -f lavfi -i color=#82461F:160x90:d=3,format=rgb24 -fs
ffplay -hide_banner -f lavfi -i color=#7E287E:160x90:d=3,format=rgb24 -fs
ffplay -hide_banner -f lavfi -i color=white:160x90:d=3,format=rgb24 -fs
ffplay -hide_banner -f lavfi -i color=yellow:160x90:d=3,format=rgb24 -fs

Friday, August 2, 2019

Access to Windows explorer is super slow


I have Windows 10 Pro working for a few months but yesterday something strange started to happen to explorer.


I don't know how to describe it so I will give some examples.



  1. Windows File Explorer - when opening for the first time after system start i hangs for about one minute. After that it works fast with no problems. Doesn't matter if it's the Computer folder or any other. After closing and opening again the problem doesn't appear. Is happens again if I restart the explorer.exe process.

  2. LibreOffice Writer - Save As and Open shows the dialog and hangs for 30 seconds (happens every time).

  3. Notepad++ - well, this is one is really strange. Testing with open and save as dialogs. They always open but after confirming or canceling the main window hangs for 5 seconds. Also it doesn't always happen.

  4. My own application, using Qt with native dialogs. Even stranger - sometimes it hangs when I open an open/save file dialog, sometimes it opens and seems to be responsive until I click something and sometimes it hangs for 30 seconds after dismissing the dialog.


Everything else is working fine e.g. browsing internet, loading in games and the issue seems to be bound to accessing files via explorer and open/save dialogs.


I've done some googling and run sfc /scannow. It has found corrupted opencl.dll and repaired it but that didn't fix the issue.
Disabling or even uninstalling AVP also does nothing.


Answer



Thanks to @BenN suggestion I've managed to solve the problem.


I've used Process Monitor to check what the explorer.exe hangs on. It comes out it was a faulty shell extension. I didn't install it recently, so I guess it became corrupted somehow. After uninstalling the problem is gone.


Edit2: It was DAEMON Tools 5.2.0 shell extension. Wouldn't blame it though, as it was working fine for several months.


hard drive - Windows 7 PC becomes very slow on heavy copy




My PC configuration: Intel Core 2 Duo 2.4 MHz, 3 GB RAM, Hitachi 160 GB + Samsung 320 GB HDD, Asus P5B-VM Motherboard. I was using Windows XP Profession on Hitachi HDD for 2 years. Found no problem when copying gigabytes of data in Hitachi hard disk from one place to another. I've recently started using Windows 7 Ultimate in newly bought Samsung HDD (model: HD322HJ). Now my PC becomes almost unusable when heavy copying occured. Any idea why this could happen? Both of my HDD's are SATA 3.0, 3 Gb/s speed. The new Samsung HDD is 7200 RPM which is greater than Hitachi's.



Thanks in advance.


Answer



Defrag both drives, star using alternative copy manager (ex. Total Commander, TeraCopy).



Scan both drives with HD Tune (check overall health), check transfers.


Thursday, August 1, 2019

microsoft excel - VBA Code for changing background text for any text within a cell




I'm trying to make a row change colour to yellow based on if any text is within the D column. I have already set up 5 different colours for another cell, however need this to over-ride those ones. I can make this work if I say ‘YES’ as it’s a pre-determined value. However, I need to input various text and numbers so that doesn’t surfice.



Below is what I have currently gathered but need to change the ‘YES’ so its any text within that cell.



Private Sub Worksheet_Change(ByVal Target As Range)



Set MyPlage = Range("T8:T1000") 
For Each Cell In MyPlage
Select Case Cell.Value

Case Is = "Cancelled"
Cell.EntireRow.Interior.ColorIndex = 8
Case Is = "Rejected"
Cell.EntireRow.Interior.ColorIndex = 3
Case Is = "Completed"
Cell.EntireRow.Interior.ColorIndex = 4
Case Is = "Pending"
Cell.EntireRow.Interior.ColorIndex = 15
Case Is = "Accepted"
Cell.EntireRow.Interior.ColorIndex = 39

Case Else
Cell.EntireRow.Interior.ColorIndex = xlNone

End Select

Next

Set MyPlage = Range("D8:D1000")
For Each Cell In MyPlage
Select Case Cell.Value

Case Is = "YES"
Cell.EntireRow.Interior.ColorIndex = 6

End Select
Next


End Sub



Thanks

James


Answer



Basically you don't want to do a select case just check if the cell is empty



Sub run()



 Set myplage = Range("D8:D1000")
For Each cell In myplage
If Not IsEmpty(cell.Value) Then
cell.EntireRow.Interior.ColorIndex = 6

End If
Next

Switching input language in Windows 10 is not always instant



I use CTRL+SHIFT on both Linux and Windows to switch between input languages.
Under Linux the switch is always instantaneous, meaning a quick and light touch of the CTRL+SHIFT combo suffices - I don't have to hold the key combo down or to press it several times until finally the switch successfully occurs. This is regardless of what applications I am running at the moment.



This is not the case in Windows. I often find myself having to press the CTRL+SHIFT combo several times or to hold it down until the input language is actually switched. While I cannot always reproduce the issue, I have noticed that for example it often happens when I am using a browser - maybe because I then switch the languages more frequently, for example due to chatting with different people in facebook or similar. Also, I am pretty sure that I don't have a stuck key on my keyboard.




I had this problem in Windows 7 as well but never looked into it. I believe I was able at some point to figure out how to fix this in Windows 10, but after some 'quality updates' (that probably reset some stuff in Windows 10 anyway) I cannot pinpoint the relevant settings. My guess is that it has something to do with how Windows treats sticky keys and key combos, which itself has probably changed since.



Personally, I find that latency unnecessary and even annoying.



Current OS: Windows 10 x64 (1803)



Does anyone know how to remove or reduce the delay of switching between input languages in Windows 10?



Feel free to add more relevant tags.




EDIT: Sticky keys and Filter keys are off in the Settings panel.


Answer



Go to Settings->Time&Language->Region&language->Advanced keyboard settings->Language bar options->Advanced Key Settings->Change Key Sequence.



Change the shortcut below Switch Input Language to see if this issue still occurs.



Nowadays,the default shortcut to switch input language of computers running Windows 10 is so strange. Some are left Alt+Shift, some are Ctrl+Space, and some are even Windows+Space. Then, some shortcut keys work fine, and some shortcut keys have a high delay. And I am not very clear about what caused this.



Also, switching the input language will have high latency when the memory is too high (of course you might have considered this).


hard drive - SSD vs. HDD reliability in a rack cabinet

I need to buy a pair of 2.5" disks for the root partition of a file server. These disks would essentially only contain the OS, so there will be practically no writing on them. Therefore, no SSD wear out should be an issue and the only thing I need is for the drive to keep responding to read requests.


In this setting, from what should I expect more reliability, an SSD or a HDD? I've heard of SSDs going bad because of the controller getting fried. Where should I put my money? Should I be looking at a pair of 2.5" HDDs or a pair of e.g. 60GB Intel SSDs?

hard drive - Leaving bad sectors in unformatted partition?

Laptop was acting really weird, and copy and seek times were really slow, so I decided to scan the hard drive surface. I have a couple hundr...