Skip to content

Instantly share code, notes, and snippets.

def champ(n):
s = ""
for x in xrange(0,n+1):
s = s + str(x)
return int(s[n])
k = [1, 10, 100, 1000 ,10000, 100000, 1000000]
ans = 1
#either
@rainzoo
rainzoo / Alice_Vs_VirtualBox.md
Created October 20, 2016 06:53
Alice Vs VirtualBox

Bug

Alice asks VirtualBox to delete a snapshot. Not just any snapshot but one whose child snapshot has a snapshot. VirtualBox deletes the snapshot file, but when she launchs the VM, VirtualBox complains:

Failed to open a session for the virtual machine VMName V2.

Could not open the medium 'C:\Users\Alice\VirtualBox VMs\VMName V2\Snapshots/{snapshot_that_should_have_been_deleted}.vdi'.

VD: error VERR_FILE_NOT_FOUND opening image file 'C:\Users\Alice\VirtualBox VMs\VMName V2\Snapshots/{snapshot_that_should_have_been_deleted}.vdi' (VERR_FILE_NOT_FOUND).
@rainzoo
rainzoo / .emacs
Last active November 28, 2020 08:20
;;(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
;;'(ansi-color-names-vector ["#212526" "#ff4b4b" "#b4fa70" "#fce94f" "#729fcf" "#ad7fa8" "#8cc4ff" "#eeeeec"])
;;'(custom-enabled-themes (quote (wombat))))
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.