´´´sh sudo apt-get install cifs-utils ´´´
This file contains hidden or 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
| from datetime import datetime,deltatime | |
| s = str(1447564962575) | |
| date = datetime.fromtimestamp(float(s[0:-3])) | |
| milli = int(s[-3:]) |
This file contains hidden or 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
| #include <sys/types.h> | |
| #include "crc32.h" | |
| // CRC32 lookup table for polynomial 0x04c11db7 | |
| static u_long crc_table[256] = { | |
| 0x00000000, 0x04c11db7, 0x09823b6e, 0x0d4326d9, 0x130476dc, 0x17c56b6b, | |
| 0x1a864db2, 0x1e475005, 0x2608edb8, 0x22c9f00f, 0x2f8ad6d6, 0x2b4bcb61, | |
| 0x350c9b64, 0x31cd86d3, 0x3c8ea00a, 0x384fbdbd, 0x4c11db70, 0x48d0c6c7, | |
| 0x4593e01e, 0x4152fda9, 0x5f15adac, 0x5bd4b01b, 0x569796c2, 0x52568b75, | |
| 0x6a1936c8, 0x6ed82b7f, 0x639b0da6, 0x675a1011, 0x791d4014, 0x7ddc5da3, |
This file contains hidden or 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
| adb shell netcfg | head -n 1 |
This file contains hidden or 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
| // http://gynvael.coldwind.pl/n/c_cpp_number_to_binary_string_01011010 | |
| void to_bin(unsigned char c, char *out) { | |
| *(unsigned long long*)out = 3472328296227680304ULL + | |
| (((c * 9241421688590303745ULL) / 128) & 72340172838076673ULL); | |
| } |
This file contains hidden or 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
| # source: https://blog.tinned-software.net/create-bootable-usb-stick-from-iso-in-mac-os-x/ | |
| $ hdiutil convert -format UDRW -o livecd.img LiveCD.iso | |
| $ diskutil list | |
| $ diskutil partitionDisk /dev/disk<n> 1 "Free Space" "unused" "100%" | |
| $ diskutil unmount disk<n>s1 | |
| $ sudo dd if=antivirus_livecd.img.dmg of=/dev/disk<n> bs=1m | |
| $ diskutil eject /dev/disk<n> |
This file contains hidden or 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
| alias msbuild="/c/Program\ Files\ \(x86\)/MSBuild/14.0/Bin/MSBuild.exe" | |
| function ms() { | |
| local count_sln=`ls -1 *.sln 2>/dev/null | wc -l` | |
| if [[ $count_sln -eq 0 ]]; then | |
| echo "error: no solution in directory" | |
| return 1; | |
| fi | |
| local alias_is_set=`alias | grep msbuild | cut -d '=' -f 2 | tr -d "'"` |
This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.
###Array ####Definition:
- Stores data elements based on an sequential, most commonly 0 based, index.
- Based on tuples from set theory.
This file contains hidden or 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
| std::ostream& operator<<(std::ostream& os, REFGUID guid) | |
| { | |
| char buffer[37]; | |
| snprintf(buffer, sizeof(buffer), | |
| "%08lX-%04hX-%04hX-%02hhX%02hhX-%02hhX%02hhX%02hhX%02hhX%02hhX%02hhX", | |
| guid.Data1, guid.Data2, guid.Data3, | |
| guid.Data4[0], guid.Data4[1], guid.Data4[2], guid.Data4[3], | |
| guid.Data4[4], guid.Data4[5], guid.Data4[6], guid.Data4[7]); | |
| return os << buffer; |
This file contains hidden or 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
| /* | |
| * topn_lite.cpp | |
| * Copyright (C) 2015 Emiliano Firmino <emiliano.firmino@gmail.com> | |
| * | |
| * Distributed under terms of the MIT license. | |
| */ | |
| #include <algorithm> | |
| #include <iostream> | |
| #include <fstream> |