python

摘要: Python的函数具有非常灵活的参数形态,既可以实现简单的调用,又可以传入非常复杂的参数。 默认参数一定要用不可变对象,如果是可变对象,运行会有逻辑错误! 要注意定义可变参数和关键字参数的语法: *args是可变参数,args接收的是一个tuple; **kw是关键字参数,kw接收的是一个dict。 以及调用函数时如何传入可变参数和关键字参数的语法: 可变参数既可以直接传入:func(... 阅读全文
posted @ 2014-12-13 21:12 sjtujoe 阅读(91) 评论(0) 推荐(0) 编辑

Python学习

摘要: 直接运行py文件 还有同学问,能不能像.exe文件那样直接运行.py文件呢?在Windows上是不行的,但是,在Mac和Linux上是可以的,方法是在.py文件的第一行加上: #!/usr/bin/env python 然后,通过命令: $ chmod a+x hello.py Python提供了ord()和chr()函数,可以把字母和对应的数字相互转换: >>> ord('A') ... 阅读全文
posted @ 2014-12-13 15:14 sjtujoe 阅读(126) 评论(0) 推荐(0) 编辑

b

摘要: 阅读全文
posted @ 2014-11-26 00:49 sjtujoe 阅读(81) 评论(0) 推荐(0) 编辑

a

摘要: 阅读全文
posted @ 2014-11-25 21:52 sjtujoe 阅读(61) 评论(0) 推荐(0) 编辑

[2014-11-24]高质量C++C编程指南 - 阅读笔记

摘要: C++ 语言可以用const来定义常量,也可以用 #define来定义常量。但是前者比后者有更多的优点: const常量有数据类型,而宏常量没有数据类型。编译器可以对前者进行类型安全检查。而对后者只进行字符替换,没有类型安全检查,并且在字符替换可能会产生意料不到的错误(边际效应)。 有些集成化的调试工具可以对const常量进行调试,但是不能对宏常量进行... 阅读全文
posted @ 2014-11-24 21:53 sjtujoe 阅读(160) 评论(0) 推荐(0) 编辑

【2014-11-24】Heterogeneous Parallel Programming – Section 2

摘要: Executing Thread Blocks Threads are assigned to Streaming Multiprocessors(SM) in block granularity Up to 8 blocks to each SM as resource allows Fermi SM can take up to 15... 阅读全文
posted @ 2014-11-24 11:23 sjtujoe 阅读(109) 评论(0) 推荐(0) 编辑

【2014-11-23】Heterogeneous Parallel Programming – Section 1

摘要: Latency devices(CPU cores) Throughput devices(GPU cores) Use the best match for the job (heterogeneity in mobile SOC CPU: Latency Oriented Design Powerful ALU R... 阅读全文
posted @ 2014-11-23 21:41 sjtujoe 阅读(243) 评论(0) 推荐(0) 编辑

【2014-11-23】《The Hardware/Software Interface》– Section 11

摘要: Data in Java Java has pointers – they are called ‘referenes’ Null is typically represented as 0 Characters and strings Two-byte Unicode instead of ASCII ... 阅读全文
posted @ 2014-11-23 16:48 sjtujoe 阅读(105) 评论(0) 推荐(0) 编辑

【2014-11-23】《The Hardware/Software Interface》– Section 10

摘要: The malloc package void* malloc(size_t size) void free (void *p) other functions calloc: Version of malloc that initializes allocated block to zero realloc: Ch... 阅读全文
posted @ 2014-11-23 15:54 sjtujoe 阅读(114) 评论(0) 推荐(0) 编辑

【2014-11-23】《The Hardware/Software Interface》– Section 8 (continue)

摘要: Exceptions: An exception is transfer of control to the operating system in response to some event. exception processing by exception handler Process(进程) Proce... 阅读全文
posted @ 2014-11-23 14:59 sjtujoe 阅读(202) 评论(0) 推荐(0) 编辑