I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!
\
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import binascii | |
def CRC32_from_file(filename): | |
buf = open(filename,'rb').read() | |
buf = (binascii.crc32(buf) & 0xFFFFFFFF) | |
return "%08X" % buf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Inspired by http://www.dib0.nl/code/458-a-spinner-for-console-in-net | |
public class ConsoleSpinner | |
{ | |
/// <summary> | |
/// Displays a text spinner and ellipses until a task completes. | |
/// </summary> | |
/// <param name="task">Task to watch for completion</param> | |
/// <param name="description">Description of the work - single word</param> | |
public static void UntilTaskComplete(Task task, string description = "work") | |
{ |