Monday, 10 February 2020

What is the regex pattern for datetime (2008-09-01 12:35:45 )?

(\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}) 

from : https://stackoverflow.com/questions/37732/what-is-the-regex-pattern-for-datetime-2008-09-01-123545

Case insensitive replace

In a single line:
import re
re.sub("(?i)hello","bye", "hello HeLLo HELLO") #'bye bye bye'
re.sub("(?i)he\.llo","bye", "he.llo He.LLo HE.LLO") #'bye bye bye'
Or, use the optional "flags" argument:
import re
re.sub("hello", "bye", "hello HeLLo HELLO", flags=re.I) #'bye bye bye'
re.sub("he\.llo", "bye", "he.llo He.LLo HE.LLO", flags=re.I) #'bye bye bye'

from : https://stackoverflow.com/questions/919056/case-insensitive-replace/15831118#15831118

How to fix a : TypeError 'tuple' object does not support item assignment

Change this
badguy[0]-=7
into this
badguy = list(badguy)
badguy[0]-=7
badguy = tuple(badguy)

from : https://stackoverflow.com/questions/19338209/how-to-fix-a-typeerror-tuple-object-does-not-support-item-assignment

Sunday, 2 February 2020

Win10 - Require Password to Install Apps and Make OS Changes


[Solved] Windows cannot be installed to this disk the selected disk is of the GPT partition style


[How To] Disable Password Requirement After Sleep In Windows 10

WAY 2 – Using Registry

Registry Disclaimer: The further steps will involve registry manipulation. Making mistakes while manipulating registry could affect your system adversely. So be careful while editing registry entries and create a System Restore point first.
1. Press W8K + R and put regedit in Run dialog box to open Registry Editor (if you’re not familiar with Registry Editor, then click here). Click OK.
Windows 10 Registry Editor
2. In left pane of Registry Editor window, navigate to following registry key:
HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Power\PowerSettings\0e796bdb-100d-47d6-a2d5-f7d2daa51f51
How To Disable Password Requirement After Sleep In Windows 10
3. In the right pane of 0e796bdb-100d-47d6-a2d5-f7d2daa51f51 registry key, set the DCSettingsIndex named registry DWORD (REG_DWORD) to 0. If the DWORD or registry key doesn’t exists, you need to create them manually.
The above mentioned DCSettingsIndex DWORD prevents password requirement after sleep, when your system is on battery power. You need to similarly create ACSettingIndex DWORD under HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Power\PowerSettings\0e796bdb-100d-47d6-a2d5-f7d2daa51f51 and set it to 0 for preventing password requirement after sleep, when your system is connected to power source or plugged in.
Close Registry Editor and reboot the machine to make changes effective.
After reboot, your system would no longer ask to sign-in after sleep. Note that registry way always overrides the Settings app way. That is, you can’t follow WAY 1, if you’ve already followed WAY 2.
How To Disable Password Requirement After Sleep In Windows 10
Hope you find the article useful!

from : https://www.kapilarya.com/how-to-disable-password-requirement-after-sleep-in-windows-10

Thursday, 16 January 2020