New answers tagged

0

Yes, a binary search will generally be faster. No, the standard library index function has no option for that. Another answer has code for a binary search: from bisect import bisect_left def binary_search(a, x, lo=0, hi=None): # can't use a to specify default for hi hi = hi if hi is not None else len(a) # hi defaults to len(a) pos = ...


0

I had to use the "-s" option for tlsdate, since catch-22 the "tls" ssl connection would not work with a wrong date on the host here, due to google's ssl cert's date looking like a date in the future to the wrongly-time-configured host here. sudo tlsdate -s -H mail.google.com


-1

It's not an unknown issue. There is a fix: http://www.webupd8.org/2014/09/dual-boot-fix-time-differences-between.html Worked for me ... the "issue" stems from the fact that Linux uses "UTC" [Grenwhich Mean Time or GMT, also referred to as Zulu] where as Windows uses your local time to set the system master time. Anyhow, hope the fix works for you too! ~J


0

Operating systems store and retrieve the time in the hardware clock located on your motherboard so that it can keep track of the time even when the system does not have power. Most operating systems (Linux/Unix/Mac) store the time on the hardware clock as UTC by default, though some systems (notably Microsoft Windows) store the time on the hardware ...


0

In 16.04, the following command will set the timezone to UTC: sudo timedatectl set-timezone Etc/UTC Found from here: https://www.server-world.info/en/note?os=Ubuntu_16.04&p=timezone


1

Probably the effective locale for the LC_TIME locale category is one which misses AM/PM specification. To fix it you can change the Regional Formats setting. If you change it to e.g. English (United States) or English (United Kingdom), AM/PM will show up next time you log in.


0

It is reasonably straightforward to toggle this setting from the clock settings. (Note: I realise that you have already followed this path but best to check.) Follow this path: Click on the clock > Time & date settings... > Clock And from here select 12 hour time as illustrated in this screenshot: If this is not enough and the clock is still ...


3

Unless you reboot your system, I believe the system is set to sync your time only once every 24 hours. You can run a cron job to query the ntp server to keep your time in sync more often. Run the following command to edit your cron jobs: sudo crontab -e If the system asks, choose nano as the editor. Then, scroll to the end of the file and enter the ...


0

Kernel load time isn't that much affected by using a SSD. It's a small file that gets decompressed to RAM and then runs from there. What is probably taking time is hardware initialization, not I/O. Check dmesg messages and see if you can find any hardware that is taking that long to init, 12 seconds is indeed slow for current hardware. What is your CPU? ...


10

Time settings, as as shown in the panel, are set with gsettings. You can set 12/24 hrs by the commands: 12-hour: gsettings set com.canonical.indicator.datetime time-format 12-hour 24-hour: gsettings set com.canonical.indicator.datetime time-format 24-hour options are: locale-default 12-hour 24-hour custom The same trick on Mate ...requires a ...


6

It is not clear to me what exactly do you want. If you want just display the hour in your terminal window, you can try: date +%R date +%r date +%H date +%I date +%H:%M date +%I:%M These are different time formats used to customize your time display. %R uses time with 24 hour and %r uses 12 hour format to display the whole time. If you want just hour with ...



Top 50 recent answers are included