(Serial port or com port? - Serial ports are often refered as COM ports. It is the same to be short. You can read abut it in the Wiki article )
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
| # The source is https://en.wikipedia.org/wiki/ITU_prefix | |
| data = {\ | |
| "A[A-L]": "United States", | |
| "A[M-O]": "Spain", | |
| "A[P-S]": "Pakistan", | |
| "A[T-W]": "India", | |
| "AX": "Australia", | |
| "A[Y-Z]": "Argentina", | |
| "A2": "Botswana", | |
| "A3": "Tonga", |
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
| import datetime, calendar | |
| def get_month_days(date): | |
| counter = datetime.datetime(date.year, date.month, 1, tzinfo=date.tzinfo) | |
| date_list = [] | |
| while date.month == counter.month: | |
| date_list.append(counter) | |
| counter += datetime.timedelta(days=1) | |
| return date_list |
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
| # $FreeBSD$ | |
| # Basic .clang-format | |
| --- | |
| BasedOnStyle: WebKit | |
| AlignAfterOpenBracket: DontAlign | |
| AlignConsecutiveAssignments: false | |
| AlignConsecutiveDeclarations: false | |
| AlignEscapedNewlines: Left | |
| AlignOperands: false | |
| AlignTrailingComments: true |
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 <ctype.h> | |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <string.h> | |
| char *process_drive(char *s) | |
| { | |
| char *p; | |
| char *c; |
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
| data = ''' | |
| static const unsigned char array[3][5] = | |
| { | |
| { 0x00, 0x01, 0x02, 0x03, 0x04 }, // " " | |
| { 0x10, 0x11, 0x12, 0x13, 0x14 }, // X | |
| { 0x20, 0x21, 0x22, 0x23, 0x24 }, // ~ | |
| }; | |
| ''' | |
| import re |
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 <stdio.h> | |
| int main(int argc, char *argv[]) | |
| { | |
| int i; | |
| char *tv[] = { | |
| "no space", | |
| " one space", | |
| " more spaces", | |
| }; |
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
| # Thanks RYO for the hints | |
| class MyBase: | |
| name = 'Base' | |
| grazelist = [] | |
| def __init__(self, x=None): | |
| print 'Base:', x | |
| if x: | |
| self.x = x | |
| def graze(self, x): |
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 <stdint.h> | |
| #include <stdio.h> | |
| #include <string.h> | |
| int printTabNumber(int x) | |
| { | |
| uint32_t c = ((x<0?'-':' ') << 8) | 0x20UL; | |
| uint32_t s[3] = {0x20202020UL, 0x20202020UL, c}; | |
| int i; | |
| union |
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
| // reading an entire binary file | |
| #include <iostream> | |
| #include <fstream> | |
| using namespace std; | |
| int reading() | |
| { | |
| streampos size; | |
| char * memblock; |
NewerOlder