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 | |
| # 2012-12-15 10:14:51.898000 | |
| print datetime.datetime.utcnow() | |
| # The now differs from utcnow as expected | |
| # otherwise they work the same way: | |
| # 2012-12-15 11:15:09.205000 | |
| print datetime.datetime.now() |
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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script> | |
| <link href="http://getbootstrap.com/2.3.2/assets/css/bootstrap.css" rel="stylesheet" type="text/css" /> | |
| <link href="http://getbootstrap.com/2.3.2/assets/css/bootstrap-responsive.css" rel="stylesheet" type="text/css" /> | |
| <script src="http://getbootstrap.com/2.3.2/assets/js/bootstrap-scrollspy.js"></script> | |
| <meta charset=utf-8 /> | |
| <title>JS Bin</title> | |
| <style type="text/css"> |
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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <script src="http://code.jquery.com/jquery.js"></script> | |
| <!-- Latest compiled and minified CSS --> | |
| <link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" media="screen"> | |
| <!-- Optional theme --> | |
| <link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap-theme.min.css"> | |
| <!-- Latest compiled and minified JavaScript --> |
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 <math.h> | |
| struct ComplexStruct { | |
| // 定义复数的结构体 | |
| double x, y; | |
| }; | |
| double real_part(struct ComplexStruct z){ | |
| // 返回复数的实部 | |
| return z.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 <stdio.h> | |
| void swap(int *a, int *b){ | |
| int temp = *a; | |
| *a = *b; | |
| *b = temp; | |
| } | |
| int main(int argc, char *argv[]){ | |
| int num1 = 5; |
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 <stdlib.h> | |
| #include <stdio.h> | |
| #include <time.h> /*用到了time函数,所以要有这个头文件*/ | |
| #define MAX 10 | |
| int main( void) | |
| { | |
| int number[MAX] = {0}; | |
| int i; | |
| srand((unsigned) time(NULL)); /*播种子*/ |
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> | |
| void print_day(int day){ | |
| char days[8][10] = { | |
| "", "Monday", "Tuesday", | |
| "Wednesday", "Thursday", "Friday", | |
| "Saturday", "Sunday" | |
| }; | |
| if (day < 1 || day > 7){ |
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(void){ | |
| char str[] = "hello world"; | |
| int num; | |
| float value; | |
| scanf("%s", str); | |
| scanf("%d", &num); | |
| scanf("%f", &value); |
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
| def insertion_sort(n): | |
| if len(n) == 1: | |
| return n | |
| b = insertion_sort(n[1:]) | |
| m = len(b) | |
| for i in range(m): | |
| if n[0] <= b[i]: | |
| return b[:i]+[n[0]]+b[i:] | |
| return b + [n[0]] |
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 <iostream> | |
| using namespace std; | |
| const int N = 6; //Define the size of the Matrix | |
| template<typename T> | |
| void Strassen(int n, T A[][N], T B[][N], T C[][N]); | |
| template<typename T> |