Lecture 05: Basic Python Programming

Size: px
Start display at page:

Download "Lecture 05: Basic Python Programming"

Transcription

1 BI296: Linux and Shell Programming Lecture 05: Basic Python Programming Maoying,Wu Dept. of Bioinformatics & Biostatistics Shanghai Jiao Tong University Spring, 2017 Maoying Wu (CBB) BI296-Lec05 Spring, / 44

2 Lecture Outline Python: Introduction ( 简介 ) Installing Python (Python 安装 ) Run Python( 运行 Python 的方式 ) Data Types ( 数据类型 ) Basic types( 基本类型 ):number( 数值, 包含 int( 整型 ), long( 长整型 ), float( 浮点数 ), complex( 复数 )) str( 字符串 ) bool( 布尔 ) Container( 容器类型 ): list ( 列表 ), tuple ( 元组 ), dict ( 字典 ), set ( 集合 ) Operators( 操作符 ) Arithmetic operators ( 数学操作符 ):+, -, *, /, %, ** Logical operators ( 逻辑操作符 ):and, or, not Comparison operators ( 比较操作符 ): <, <=, >, >=, ==,!=, is Assignment operators ( 赋值操作符 ): = Membership operators ( 成员操作符 ):in Conditional Expression and Flow Control( 条件表达式和流程控制 ) Functions ( 函数的定义 ) General( 一般函数 )and lambda function ( 单行匿名函数 ) Moules ( 模块 ) Maoying Wu (CBB) BI296-Lec05 Spring, / 44

3 Next we will talk about... 1 Introduction 2 Data types 3 flow control 4 functions Maoying Wu (CBB) BI296-Lec05 Spring, / 44

4 Come and Join Python Maoying Wu (CBB) BI296-Lec05 Spring, / 44

5 What is Python? Interpreted language ( 解释性编程语言 ). Relatively easy to learn. Fast to write code. Intuitive. Very versatile (vs. Matlab/R). Less control, worse performance (vs. C). Less safety handles, responsibility for user. Extremely popular in the field of data science. Matrix computing Statistics, machine learning Visualization Maoying Wu (CBB) BI296-Lec05 Spring, / 44

6 Install Python ( 安装 ) I recommend installing the Pre-package Python - Anaconda 1-Linux-x86_64.sh Use Python 2.7 Run bash Anaconda Linux-x86_64.sh. Add to the environment variable PATH. Maoying Wu (CBB) BI296-Lec05 Spring, / 44

7 Run Python interactively ( 交互式运行 ) Invoke the command python Python Anaconda custom (64-bit) (default, Jul , 17:42:40) [GCC (Red Hat )] on linux2 Type "help", "copyright", "credits" or "license" for more information. Anaconda is brought to you by Continuum Analytics. Please check out: and >>> Invoke the command ipython Python Anaconda custom (64-bit) (default, Jul , 17:42:40) Type "copyright", "credits" or "license" for more information. IPython An enhanced Interactive Python.? -> Introduction and overview of IPython s features. %quickref -> Quick reference. help -> Python s own help system. object? -> Details about object, use object?? for extra details. In [1]: Maoying Wu (CBB) BI296-Lec05 Spring, / 44

8 Run under Jupyter Notebook Run jupyter notebook Maoying Wu (CBB) BI296-Lec05 Spring, / 44

9 Run Python Non-interactively ( 非交互式 ) Write script file hello.py #!/usr/bin/env python """ hello.py """ name = input("what is your name? ") print "Hello, {}!".format(name) Approach 1 chmod u+x hello.py./hello.py Approach 2 python hello.py Maoying Wu (CBB) BI296-Lec05 Spring, / 44

10 Next we will talk about... 1 Introduction 2 Data types 3 flow control 4 functions Maoying Wu (CBB) BI296-Lec05 Spring, / 44

11 Basic types ( 基本数据类型 ) Basic object types in Python: bool( 布尔型 ) The class of the two boolean constants True, False. int( 整型 ) Integer numbers: 1, -2,... long( 长整型 ) Integer numbers of arbitrary size float( 浮点型 ) Double precision floating-point numbers, e.g.: , -1e-3. str( 字符串型 ) Text (strings of byte-size characters). list( 列表 ) Mutable list of Python objects dict( 字典 ) Key/value mapping,also named hash or associative array. The list and dict types are essential data structures, so we are covering them extensively afterwards. Maoying Wu (CBB) BI296-Lec05 Spring, / 44

12 Use type() to find out the type 字符串 :str >>> type("hello, world!") <type str > 列表 :list >>> type([1,2,3]) <type list > 整数 :int 或 long >>> type(123) <type int > 浮点数 :float >>> type(12.3) <type float > 复数 :complex >>> type( j) <type complex > 元组 :tuple >>> type((1,2,3)) <type tuple > 字典 :dict >>> type({ a :1, b :2}) <type dict > 集合 :set >>> type({1,2,3}) <type set > Maoying Wu (CBB) BI296-Lec05 Spring, / 44

13 String literals ( 字符串文本 ) Single and double quotes can be used interchangeably ( 单双引号等效 ): >>> "a string" == a string True You can use the single quotes inside double-quoted strings, and vice versa ( 单双引号相互包裹 ): >>> a = "Isn t it ok?" >>> b = "Yes", he said. Multi-line strings are enclosed by three single/duoble quotes ( 多行字串 ). >>> a = """This is a string,... that extends over more... than one line.... """ Maoying Wu (CBB) BI296-Lec05 Spring, / 44

14 Statements ( 语句 ), expressions ( 表达式 ) and operators ( 操作符 ) A statement is an instruction that Python can execute, such as x = 3 Operators are special symbols that represent computations, like addition, the values they operate on are called operands An expression is a combination of values, variable and operators x + 3 Maoying Wu (CBB) BI296-Lec05 Spring, / 44

15 Operators ( 操作符 ) I All the usual unary ( 一元 ) and binary ( 二元 ) arithmetic operators ( 数学操作符 ) are defined in Python: +, -, *, /, ** (exponentiation), <<, >>, etc. Logical operators ( 逻辑操作符 ) are expressed using plain English words: and, or, not. Numerical and string comparison ( 数值 / 字符串比较操作符 ) also follows the usual notation: <, >, <=, ==,!=,... References: boolean-operations-and-or-not comparisons Maoying Wu (CBB) BI296-Lec05 Spring, / 44

16 Operators ( 操作符 ) II Some operators are defined for non-numeric types: >>> "S" + JTU SJTU Some supports operands of mixed type >>> "a" * 2 aa >>> 2 * "a" aa Some do not >>> "aaa" / 3 Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: unsupported operand type(s) for /: str and Maoying Wu (CBB) BI296-Lec05 Spring, / 44

17 Type casting ( 类型强制转换 ) >>> >>> "a" + 10 Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: cannot concatenate str and int objects >>> int( a ) + 10 Traceback (most recent call last): File "<stdin>", line 1, in <module> ValueError: invalid literal for int() with base 10: a >>> int( a, 16) >>> "a" + str(10) a10 >>> float(12) / Maoying Wu (CBB) BI296-Lec05 Spring, / 44

18 Operators ( 操作符 ) III The mod operator % computes the remainder of integer division. >>> 9 % 2 1 >>> 9 % -2-1 Maoying Wu (CBB) BI296-Lec05 Spring, / 44

19 Exercise Have a look at the following scripts, try to infer the rules: >>> 9 / 2 >>> 9 % 2 >>> -9 / 2 >>> -9 % 2 >>> 9 / -2 >>> 9 % -2 >>> -9 / -2 >>> -9 % -2 Maoying Wu (CBB) BI296-Lec05 Spring, / 44

20 Operators ( 操作符 ) IV The % operator is also used for string formatting: >>> "This is slide %d of %d" % (11, 32) This is slide 11 of 32. >>> "We are %.1f %% done." % (100.0 * 11/32) We are 34.4% done. >>> "Today is %s %d, %d" % ( September, 11, 2012) Today is September 11, 2016 Maoying Wu (CBB) BI296-Lec05 Spring, / 44

21 Operators ( 操作符 ) IV The % operator is also used for string formatting: >>> "This is slide %d of %d" % (11, 32) This is slide 11 of 32. >>> "We are %.1f %% done." % (100.0 * 11/32) We are 34.4% done. >>> "Today is %s %d, %d" % ( September, 11, 2012) Today is September 11, 2016 The %d in the left string is substituted with the base-10 representation of the integer number on the right side. Maoying Wu (CBB) BI296-Lec05 Spring, / 44

22 Operators ( 操作符 ) IV The % operator is also used for string formatting: >>> "This is slide %d of %d" % (11, 32) This is slide 11 of 32. >>> "We are %.1f %% done." % (100.0 * 11/32) We are 34.4% done. >>> "Today is %s %d, %d" % ( September, 11, 2012) Today is September 11, 2016 The %f in the left string is substituted with the floating-point number on the right side; the number of digits to put after the comma is written before the f Maoying Wu (CBB) BI296-Lec05 Spring, / 44

23 Operators ( 操作符 ) IV The % operator is also used for string formatting: >>> "This is slide %d of %d" % (11, 32) This is slide 11 of 32. >>> "We are %.1f %% done." % (100.0 * 11/32) We are 34.4% done. >>> "Today is %s %d, %d" % ( September, 11, 2012) Today is September 11, 2016 The %s in the left string is substituted with the string on the right side. Maoying Wu (CBB) BI296-Lec05 Spring, / 44

24 Integers ( 整数 ) 1, 2, -32, 45, Operators for integers + - * / % ** Note: / uses integer division: 5 / 2 yields 2 But, if one of the operands is a float, the return value is a float: 5 / 2.0 yields 2.5 Note: Python automatically uses long integers for very large integers. Maoying Wu (CBB) BI296-Lec05 Spring, / 44

25 Floats ( 浮点数 ) 1.23, 6.43, 1.0E-20 A floating point number approximates a real number. Note: only finite precision, and finite range (overflow)! Operators for floats + addition - subtraction * multiplication / division ** power Maoying Wu (CBB) BI296-Lec05 Spring, / 44

26 Booleans ( 布尔类型 ) True, False Boolean expressions: == equals: 5 == 5 yields True! = not equal: 5!= 5 yields False > greater than: 5 > 4 yields True >= greater than or equal: 5 >= 5 yields True is is the same object: 5 is 5 yields True Similarly, we have < and <=. Maoying Wu (CBB) BI296-Lec05 Spring, / 44

27 Booleans ( 布尔类型 ) True, False Boolean expressions: == equals: 5 == 5 yields True! = not equal: 5!= 5 yields False > greater than: 5 > 4 yields True >= greater than or equal: 5 >= 5 yields True is is the same object: 5 is 5 yields True Similarly, we have < and <=. Logical operators: True and False yields False True or False yields True not True yields False Maoying Wu (CBB) BI296-Lec05 Spring, / 44

28 == vs. is We can use is compare two objects, to check whether they are pointing to the same stuff. >>> a = 100; b = 100 >>> a == b True >>> a is b True >>> id(a) == id(b) # memory address True >>> a = 257; b = 257 >>> a == b True >>> a is b False >>> id(a) == id(b) # memory address False Maoying Wu (CBB) BI296-Lec05 Spring, / 44

29 Next we will talk about... 1 Introduction 2 Data types 3 flow control 4 functions Maoying Wu (CBB) BI296-Lec05 Spring, / 44

30 Flow Control More control over your program Flow control statements allow you to do more complicated tasks. if for while Maoying Wu (CBB) BI296-Lec05 Spring, / 44

31 if statements Using if, we can execute part of a program conditional on some condition being true. if traffic_light == blue : drive() elif traffic_light == yellow : accellerate() else: freeze() Maoying Wu (CBB) BI296-Lec05 Spring, / 44

32 for loops 遍历 Very often, one wants to repeat some action. This can be achieved by a for loop for i in range(5): print i**2 Here, range(n) gives us a list with integers 0,..., n 1 Maoying Wu (CBB) BI296-Lec05 Spring, / 44

33 while loops 条件成立则重复 When we not know how many iterations are needed, we can use while. i = 1 while i < 100: print i**2, i += i**2 # a += b is short for a = a + b # Maoying Wu (CBB) BI296-Lec05 Spring, / 44

34 continue 进入下一循环 continue continues with the next iteration of the smallest enclosing loop. Maoying Wu (CBB) BI296-Lec05 Spring, / 44

35 continue 进入下一循环 continue continues with the next iteration of the smallest enclosing loop. for num in range(2, 10): if num % 2 == 0: print "Found an even number", num continue print "Found an odd number", num Maoying Wu (CBB) BI296-Lec05 Spring, / 44

36 break 跳出循环 The break statement allows us to jump out of the smallest enclosing for or while loop. Maoying Wu (CBB) BI296-Lec05 Spring, / 44

37 break 跳出循环 The break statement allows us to jump out of the smallest enclosing for or while loop. Finding prime numbers: max_n = 10 for n in range(2, max_n): for x in range(2, n): if n % x == 0: # n divisible by x print n, equals, x, *, n/x break else: # executed if no break in for loop # loop fell through without finding a factor print n, is a prime number Maoying Wu (CBB) BI296-Lec05 Spring, / 44

38 pass 什么都不做 The pass statement does nothing, which can come in handy when you are working on something and want to implement some part of your code later. if traffic_light == green : pass # to implement else: freeze() Maoying Wu (CBB) BI296-Lec05 Spring, / 44

39 Next we will talk about... 1 Introduction 2 Data types 3 flow control 4 functions Maoying Wu (CBB) BI296-Lec05 Spring, / 44

40 How to define new functions The def statement starts a function def greet(name): definition. """ A friendly function. """ print ("Hello, " + name + "!") # the customized greeting greet("world") Maoying Wu (CBB) BI296-Lec05 Spring, / 44

41 Indentation is significant in def greet(name): Python: it is used to delimit blocks """ of code, like { and } in Java and A friendly function. C. """ print ("Hello, " + name + "!") # the customary greeting greet("world") Maoying Wu (CBB) BI296-Lec05 Spring, / 44

42 (This is a comment. It is ignored by def greet(name): Python, just like blank lines.) """ A friendly function. """ print ("Hello, " + name + "!") # the customary greeting greet("world") Maoying Wu (CBB) BI296-Lec05 Spring, / 44

43 def greet(name): """ A friendly function. """ print ("Hello, " + name + "!") # the customary greeting greet("world") This calls the function just defined. Maoying Wu (CBB) BI296-Lec05 Spring, / 44

44 def greet(name): """ A friendly function. """ print ("Hello, " + name + "!") # the customary greeting greet("world") What is this? The answer in the next exercise! Maoying Wu (CBB) BI296-Lec05 Spring, / 44

45 Modules ( 模块 ) Not all functionality avaible comes automatically when starting python, and with good reasons. We can add extra functionality by importing modules ( 加载模块 ): >>> import math >>> math.pi >>> from math import pow >>> pow(3,4) 81.0 Useful modules ( 常用模块列表 ): math, string, random, and as we will see later numpy, scipy, matplotlib, pandas, scikit-learn. Maoying Wu (CBB) BI296-Lec05 Spring, / 44

46 Important functions for module >>> import sys >>> dir(sys) [ displayhook, doc, excepthook, name package, stderr, stdin, stdout, _clear_type_cache, _current_frames, _getframe, _mercurial, api_version, argv, builtin_module_names byteorder, call_tracing, callstats, copyright, displayhook, dont_write_bytecode, exc_clear, exc_info, exc_type, excepthook, exec_prefix, executable, exit, flags, float_info, float_repr_style, getcheckinterval, getdefaultencoding, getdlopenflags, getfilesystemencoding, getprofile, getrecursionlimit, getrefcount, getsizeof, gettrace, hexversion, long_info, maxint, maxsize, maxunicode, meta_path, modules, path, path_hooks, path_importer_cache, platform, prefix, ps1, ps2, py3kwarning, setcheckinterval, setdlopenflags, setprofile, setrecursionlimit, settrace, Maoying Wu (CBB) stderr, stdin, BI296-Lec05 stdout, subversion, Spring, / 44

47 Exercise A: Type and run the code on the previous page at the interactive prompt. (Type indentation spaces, too!) What does help(greet) print? What s the result of evaluating the function greet("world")? Exercise B: Type the same code in a file named hello.py, then type import hello at the interactive prompt. What happens? Type import hello again; what happens? Exercise C: At the terminal, type python hello.py. What happens? Type it again; what happens? Maoying Wu (CBB) BI296-Lec05 Spring, / 44

48 Modules, I The import statement reads a.py file, executes it, and makes its contents available to the current program. >>> import hello Hello, world! Modules are only read once, no matter how many times an import statement is issued. >>> import hello Hello, world! >>> import hello >>> import hello Maoying Wu (CBB) BI296-Lec05 Spring, / 44

49 Modules, II Modules are namespaces: functions and variables defined in a module must be prefixed with the module name when used in other modules: >>> hello.greet("bob") Hello, Bob! To import definitions into the current namespace, use the from x import y form: >>> from hello import greet >>> greet("bob") Hello, Bob! Maoying Wu (CBB) BI296-Lec05 Spring, / 44

50 The return statement def double(x): return x+x double(3) == 6 def double(x): return x+x # the following line # is never exec d print( Hello ) The result of a function evaluation is set by the return statement. If no return is present, the function returns the special value None. After executing return the control flow leaves the function. Maoying Wu (CBB) BI296-Lec05 Spring, / 44

51 Exercise Generate two random variables between 1 and 100 using the module random Prompt the users to compute the product of the above two integers. Check whether the result is correct. Repeat the above process 10 times. Compute the final score, with each question scoring 10. Maoying Wu (CBB) BI296-Lec05 Spring, / 44

Lecture 06: Compound Data Types in Python

Lecture 06: Compound Data Types in Python BI296: Linux and Shell Programming Lecture 06: Compound Data Types in Python Maoying,Wu ricket.woo@gmail.com Dept. of Bioinformatics & Biostatistics Shanghai Jiao Tong University Spring, 2017 Maoying Wu

More information

CME 193: Introduction to Scientific Python Lecture 1: Introduction

CME 193: Introduction to Scientific Python Lecture 1: Introduction CME 193: Introduction to Scientific Python Lecture 1: Introduction Nolan Skochdopole stanford.edu/class/cme193 1: Introduction 1-1 Contents Administration Introduction Basics Variables Control statements

More information

Introduction to Scientific Python, CME 193 Jan. 9, web.stanford.edu/~ermartin/teaching/cme193-winter15

Introduction to Scientific Python, CME 193 Jan. 9, web.stanford.edu/~ermartin/teaching/cme193-winter15 1 LECTURE 1: INTRO Introduction to Scientific Python, CME 193 Jan. 9, 2014 web.stanford.edu/~ermartin/teaching/cme193-winter15 Eileen Martin Some slides are from Sven Schmit s Fall 14 slides 2 Course Details

More information

Fundamentals of Programming (Python) Getting Started with Programming

Fundamentals of Programming (Python) Getting Started with Programming Fundamentals of Programming (Python) Getting Started with Programming Ali Taheri Sharif University of Technology Some slides have been adapted from Python Programming: An Introduction to Computer Science

More information

Getting Started with Python

Getting Started with Python Fundamentals of Programming (Python) Getting Started with Python Sina Sajadmanesh Sharif University of Technology Some slides have been adapted from Python Programming: An Introduction to Computer Science

More information

\n is used in a string to indicate the newline character. An expression produces data. The simplest expression

\n is used in a string to indicate the newline character. An expression produces data. The simplest expression Chapter 1 Summary Comments are indicated by a hash sign # (also known as the pound or number sign). Text to the right of the hash sign is ignored. (But, hash loses its special meaning if it is part of

More information

Multiprotocol Label Switching The future of IP Backbone Technology

Multiprotocol Label Switching The future of IP Backbone Technology Multiprotocol Label Switching The future of IP Backbone Technology Computer Network Architecture For Postgraduates Chen Zhenxiang School of Information Science and Technology. University of Jinan (c) Chen

More information

Control Structures 1 / 17

Control Structures 1 / 17 Control Structures 1 / 17 Structured Programming Any algorithm can be expressed by: Sequence - one statement after another Selection - conditional execution (not conditional jumping) Repetition - loops

More information

Chapter 1 Summary. Chapter 2 Summary. end of a string, in which case the string can span multiple lines.

Chapter 1 Summary. Chapter 2 Summary. end of a string, in which case the string can span multiple lines. Chapter 1 Summary Comments are indicated by a hash sign # (also known as the pound or number sign). Text to the right of the hash sign is ignored. (But, hash loses its special meaning if it is part of

More information

Lecture 07: Python Generators, Iterators, and Decorators

Lecture 07: Python Generators, Iterators, and Decorators BI296: Linux and Shell Programming Lecture 07: Python Generators, Iterators, and Decorators Maoying,Wu ricket.woo@gmail.com Dept. of Bioinformatics & Biostatistics Shanghai Jiao Tong University Spring,

More information

Interactive use. $ python. >>> print 'Hello, world!' Hello, world! >>> 3 $ Ctrl-D

Interactive use. $ python. >>> print 'Hello, world!' Hello, world! >>> 3 $ Ctrl-D 1/60 Interactive use $ python Python 2.7.5 (default, Mar 9 2014, 22:15:05) [GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.0.68)] on darwin Type "help", "copyright", "credits" or "license" for more information.

More information

Getting Started. Office Hours. CSE 231, Rich Enbody. After class By appointment send an . Michigan State University CSE 231, Fall 2013

Getting Started. Office Hours. CSE 231, Rich Enbody. After class By appointment send an  . Michigan State University CSE 231, Fall 2013 CSE 231, Rich Enbody Office Hours After class By appointment send an email 2 1 Project 1 Python arithmetic Do with pencil, paper and calculator first Idle Handin Help room 3 What is a Computer Program?

More information

Constants. Variables, Expressions, and Statements. Variables. x = 12.2 y = 14 x = 100. Chapter

Constants. Variables, Expressions, and Statements. Variables. x = 12.2 y = 14 x = 100. Chapter Variables, Expressions, and Statements Chapter 2 Unless otherwise noted, the content of this course material is licensed under a Creative Commons Attribution 3.0 License. http://creativecommons.org/licenses/by/3.0/.

More information

PYTHON FOR MEDICAL PHYSICISTS. Radiation Oncology Medical Physics Cancer Care Services, Royal Brisbane & Women s Hospital

PYTHON FOR MEDICAL PHYSICISTS. Radiation Oncology Medical Physics Cancer Care Services, Royal Brisbane & Women s Hospital PYTHON FOR MEDICAL PHYSICISTS Radiation Oncology Medical Physics Cancer Care Services, Royal Brisbane & Women s Hospital TUTORIAL 1: INTRODUCTION Thursday 1 st October, 2015 AGENDA 1. Reference list 2.

More information

Interactive use. $ python. >>> print 'Hello, world!' Hello, world! >>> 3 $ Ctrl-D

Interactive use. $ python. >>> print 'Hello, world!' Hello, world! >>> 3 $ Ctrl-D 1/58 Interactive use $ python Python 2.7.5 (default, Mar 9 2014, 22:15:05) [GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.0.68)] on darwin Type "help", "copyright", "credits" or "license" for more information.

More information

Variables, Expressions, and Statements

Variables, Expressions, and Statements Variables, Expressions, and Statements Chapter 2 Python for Informatics: Exploring Information www.pythonlearn.com Constants Fixed values such as numbers, letters, and strings are called constants because

More information

Command Dictionary CUSTOM

Command Dictionary CUSTOM 命令模式 CUSTOM [(filename)] [parameters] Executes a "custom-designed" command which has been provided by special programming using the GHS Programming Interface. 通过 GHS 程序接口, 执行一个 用户设计 的命令, 该命令由其他特殊程序提供 参数说明

More information

Understanding IO patterns of SSDs

Understanding IO patterns of SSDs 固态硬盘 I/O 特性测试 周大 众所周知, 固态硬盘是一种由闪存作为存储介质的数据库存储设备 由于闪存和磁盘之间物理特性的巨大差异, 现有的各种软件系统无法直接使用闪存芯片 为了提供对现有软件系统的支持, 往往在闪存之上添加一个闪存转换层来实现此目的 固态硬盘就是在闪存上附加了闪存转换层从而提供和磁盘相同的访问接口的存储设备 一方面, 闪存本身具有独特的访问特性 另外一方面, 闪存转换层内置大量的算法来实现闪存和磁盘访问接口之间的转换

More information

There are four numeric types: 1. Integers, represented as a 32 bit (or longer) quantity. Digits sequences (possibly) signed are integer literals:

There are four numeric types: 1. Integers, represented as a 32 bit (or longer) quantity. Digits sequences (possibly) signed are integer literals: Numeric Types There are four numeric types: 1. Integers, represented as a 32 bit (or longer) quantity. Digits sequences (possibly) signed are integer literals: 1-123 +456 2. Long integers, of unlimited

More information

Programming to Python

Programming to Python Programming to Python Sept., 5 th Slides by M. Stepp, M. Goldstein, M. DiRamio, and S. Shah Compiling and interpreting Many languages require you to compile (translate) your program into a form that the

More information

信息检索与搜索引擎 Introduction to Information Retrieval GESC1007

信息检索与搜索引擎 Introduction to Information Retrieval GESC1007 信息检索与搜索引擎 Introduction to Information Retrieval GESC1007 Philippe Fournier-Viger Full professor School of Natural Sciences and Humanities philfv8@yahoo.com Spring 2019 1 Introduction Philippe Fournier-Viger

More information

CS 115 Lecture 4. More Python; testing software. Neil Moore

CS 115 Lecture 4. More Python; testing software. Neil Moore CS 115 Lecture 4 More Python; testing software Neil Moore Department of Computer Science University of Kentucky Lexington, Kentucky 40506 neil@cs.uky.edu 8 September 2015 Syntax: Statements A statement

More information

Lecture 04: Bash Scripting

Lecture 04: Bash Scripting BI296: Linux and Shell Programming Lecture 04: Bash Scripting Maoying,Wu ricket.woo@gmail.com Dept. of Bioinformatics & Biostatistics Shanghai Jiao Tong University Spring, 2018 Maoying Wu (CBB) BI296-Lec04

More information

Introduction to Python

Introduction to Python Introduction to Python CB2-101 Introduction to Scientific Computing November 11 th, 2014 Emidio Capriotti http://biofold.org/emidio Division of Informatics Department of Pathology Python Python high-level

More information

Downloaded from Chapter 2. Functions

Downloaded from   Chapter 2. Functions Chapter 2 Functions After studying this lesson, students will be able to: Understand and apply the concept of module programming Write functions Identify and invoke appropriate predefined functions Create

More information

06/11/2014. Subjects. CS Applied Robotics Lab Gerardo Carmona :: makeroboticsprojects.com June / ) Beginning with Python

06/11/2014. Subjects. CS Applied Robotics Lab Gerardo Carmona :: makeroboticsprojects.com June / ) Beginning with Python CS95003 - Applied Robotics Lab Gerardo Carmona :: makeroboticsprojects.com June / 2014 Subjects 1) Beginning with Python 2) Variables 3) Strings 4) Basic arithmetic operators 5) Flow control 6) Comparison

More information

计算机组成原理第二讲 第二章 : 运算方法和运算器 数据与文字的表示方法 (1) 整数的表示方法. 授课老师 : 王浩宇

计算机组成原理第二讲 第二章 : 运算方法和运算器 数据与文字的表示方法 (1) 整数的表示方法. 授课老师 : 王浩宇 计算机组成原理第二讲 第二章 : 运算方法和运算器 数据与文字的表示方法 (1) 整数的表示方法 授课老师 : 王浩宇 haoyuwang@bupt.edu.cn 1 Today: Bits, Bytes, and Integers Representing information as bits Bit-level manipulations Integers Representation: unsigned

More information

Previous on Computer Networks Class 18. ICMP: Internet Control Message Protocol IP Protocol Actually a IP packet

Previous on Computer Networks Class 18. ICMP: Internet Control Message Protocol IP Protocol Actually a IP packet ICMP: Internet Control Message Protocol IP Protocol Actually a IP packet 前 4 个字节都是一样的 0 8 16 31 类型代码检验和 ( 这 4 个字节取决于 ICMP 报文的类型 ) ICMP 的数据部分 ( 长度取决于类型 ) ICMP 报文 首部 数据部分 IP 数据报 ICMP: Internet Control Message

More information

NyearBluetoothPrint SDK. Development Document--Android

NyearBluetoothPrint SDK. Development Document--Android NyearBluetoothPrint SDK Development Document--Android (v0.98) 2018/09/03 --Continuous update-- I Catalogue 1. Introduction:... 3 2. Relevant knowledge... 4 3. Direction for use... 4 3.1 SDK Import... 4

More information

Programming in Python 3

Programming in Python 3 Programming in Python 3 Programming transforms your computer from a home appliance to a power tool Al Sweigart, The invent with Python Blog Programming Introduction Write programs that solve a problem

More information

Lecture 4. Defining Functions

Lecture 4. Defining Functions Lecture 4 Defining Functions Academic Integrity Quiz Reading quiz about the course AI policy Go to http://www.cs.cornell.edu/courses/cs11110/ Click Academic Integrity in side bar Read and take quiz in

More information

1. Features. 2,Block diagram. 3. Outline dimension V power supply. 3. Assembled with 20 x 4 character displays

1. Features. 2,Block diagram. 3. Outline dimension V power supply. 3. Assembled with 20 x 4 character displays 1. Features 1. +5V power supply 2. Communicate over RS-232, 3. Assembled with 20 x 4 character displays 4. Built-in font with provision for up to 8 user defined 5. Easy Text Display Commands for printing

More information

2.8 Megapixel industrial camera for extreme environments

2.8 Megapixel industrial camera for extreme environments Prosilica GT 1920 Versatile temperature range for extreme environments PTP PoE P-Iris and DC-Iris lens control 2.8 Megapixel industrial camera for extreme environments Prosilica GT1920 is a 2.8 Megapixel

More information

CSCE 110 Programming I Basics of Python: Variables, Expressions, Input/Output

CSCE 110 Programming I Basics of Python: Variables, Expressions, Input/Output CSCE 110 Programming I Basics of Python: Variables, Expressions, Input/Output Dr. Tiffani L. Williams Department of Computer Science and Engineering Texas A&M University Spring 2011 Python Python was developed

More information

5.1 Megapixel machine vision camera with GigE interface

5.1 Megapixel machine vision camera with GigE interface Manta G-507 Latest Sony CMOS sensor PoE optional Angled-head and board level variants Video-iris lens control 5.1 Megapixel machine vision camera with GigE interface Manta G-507 is a 5.1 Megapixel machine

More information

<properties> <jdk.version>1.8</jdk.version> <project.build.sourceencoding>utf-8</project.build.sourceencoding> </properties>

<properties> <jdk.version>1.8</jdk.version> <project.build.sourceencoding>utf-8</project.build.sourceencoding> </properties> SpringBoot 的基本操作 一 基本概念在 spring 没有出现的时候, 我们更多的是使用的 Spring,SpringMVC,Mybatis 等开发框架, 但是要将这些框架整合到 web 项目中需要做大量的配置,applicationContext.xml 以及 servlet- MVC.xml 文件等等, 但是这些文件还还不够, 还需要配置 web.xml 文件进行一系列的配置 以上操作是比较麻烦的,

More information

STA141C: Big Data & High Performance Statistical Computing

STA141C: Big Data & High Performance Statistical Computing STA141C: Big Data & High Performance Statistical Computing Lecture 1: Python programming (1) Cho-Jui Hsieh UC Davis April 4, 2017 Python Python is a scripting language: Non-scripting language (C++. java):

More information

Beyond Blocks: Python Session #1

Beyond Blocks: Python Session #1 Beyond Blocks: Session #1 CS10 Spring 2013 Thursday, April 30, 2013 Michael Ball Beyond Blocks : : Session #1 by Michael Ball adapted from Glenn Sugden is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike

More information

CSCE 110 Programming I

CSCE 110 Programming I CSCE 110 Programming I Basics of Python (Part 1): Variables, Expressions, and Input/Output Dr. Tiffani L. Williams Department of Computer Science and Engineering Texas A&M University Spring 2013 Tiffani

More information

Chapter 2: Relational Model

Chapter 2: Relational Model Chapter 2: Relational Model Chapter 2: Relational Model Structure of Relational Databases Fundamental Relational-Algebra-Operations Additional Relational-Algebra-Operations Extended Relational-Algebra-Operations

More information

2. Introduction to Digital Media Format

2. Introduction to Digital Media Format Digital Asset Management 数字媒体资源管理 2. Introduction to Digital Media Format 任课 老师 : 张宏鑫 2014-09-30 Outline Image format and coding methods Audio format and coding methods Video format and coding methods

More information

The current topic: Python. Announcements. Python. Python

The current topic: Python. Announcements. Python. Python The current topic: Python Announcements! Introduction! reasons for studying languages! language classifications! simple syntax specification Object-oriented programming: Python Types and values Syntax

More information

Altera 器件高级特性与应用 内容安排 时钟管理 时钟管理 片内存储器 数字信号处理 高速差分接口 高速串行收发器. 时钟偏斜 (skew): 始终分配到系统中到达各个时钟末端 ( 器件内部触发器的时钟输入端 ) 的时钟相位不一致的现象 抖动 : 时钟边沿的输出位置和理想情况存在一定的误差

Altera 器件高级特性与应用 内容安排 时钟管理 时钟管理 片内存储器 数字信号处理 高速差分接口 高速串行收发器. 时钟偏斜 (skew): 始终分配到系统中到达各个时钟末端 ( 器件内部触发器的时钟输入端 ) 的时钟相位不一致的现象 抖动 : 时钟边沿的输出位置和理想情况存在一定的误差 4-E Altera 器件高级特性与应用 西安电子科技大学雷达信号处理重点实验室罗丰 luofeng@xidian.edu.cn 内容安排 时钟管理 片内存储器 数字信号处理 高速差分接口 高速串行收发器 2 时钟管理 时钟偏斜 (skew): 始终分配到系统中到达各个时钟末端 ( 器件内部触发器的时钟输入端 ) 的时钟相位不一致的现象 抖动 : 时钟边沿的输出位置和理想情况存在一定的误差 3 1

More information

CS 115 Data Types and Arithmetic; Testing. Taken from notes by Dr. Neil Moore

CS 115 Data Types and Arithmetic; Testing. Taken from notes by Dr. Neil Moore CS 115 Data Types and Arithmetic; Testing Taken from notes by Dr. Neil Moore Statements A statement is the smallest unit of code that can be executed on its own. So far we ve seen simple statements: Assignment:

More information

ENGR 101 Engineering Design Workshop

ENGR 101 Engineering Design Workshop ENGR 101 Engineering Design Workshop Lecture 2: Variables, Statements/Expressions, if-else Edgardo Molina City College of New York Literals, Variables, Data Types, Statements and Expressions Python as

More information

Get It Interpreter Scripts Arrays. Basic Python. K. Cooper 1. 1 Department of Mathematics. Washington State University. Basics

Get It Interpreter Scripts Arrays. Basic Python. K. Cooper 1. 1 Department of Mathematics. Washington State University. Basics Basic Python K. 1 1 Department of Mathematics 2018 Python Guido van Rossum 1994 Original Python was developed to version 2.7 2010 2.7 continues to receive maintenance New Python 3.x 2008 The 3.x version

More information

Murrelektronik Connectivity Interface Part I Product range MSDD, cable entry panels MSDD 系列, 电缆穿线板

Murrelektronik Connectivity Interface Part I Product range MSDD, cable entry panels MSDD 系列, 电缆穿线板 Murrelektronik Connectivity Interface Part I Product range MSDD, cable entry panels MSDD 系列, 电缆穿线板 INTERFACE PORTFOLIO PG 03 Relays 继电器 Intelligent Interface Technology 智能转换技术 Passive Interface Technology

More information

Table of Contents EVALUATION COPY

Table of Contents EVALUATION COPY Table of Contents Introduction... 1-2 A Brief History of Python... 1-3 Python Versions... 1-4 Installing Python... 1-5 Environment Variables... 1-6 Executing Python from the Command Line... 1-7 IDLE...

More information

Python for Finance. Introduction and Basics of Python. Andras Niedermayer

Python for Finance. Introduction and Basics of Python. Andras Niedermayer Python for Finance Introduction and Basics of Python Andras Niedermayer Outline 1 Introduction 2 Why Python? 3 Python installation and environments 4 First Steps in Python 5 Variables 6 Basic Operations

More information

Technology: Anti-social Networking 科技 : 反社交网络

Technology: Anti-social Networking 科技 : 反社交网络 Technology: Anti-social Networking 科技 : 反社交网络 1 Technology: Anti-social Networking 科技 : 反社交网络 The Growth of Online Communities 社交网络使用的增长 Read the text below and do the activity that follows. 阅读下面的短文, 然后完成练习

More information

Lecture 1. Types, Expressions, & Variables

Lecture 1. Types, Expressions, & Variables Lecture 1 Types, Expressions, & Variables About Your Instructor Director: GDIAC Game Design Initiative at Cornell Teach game design (and CS 1110 in fall) 8/29/13 Overview, Types & Expressions 2 Helping

More information

STEAM Clown & Productions Copyright 2017 STEAM Clown. Page 1

STEAM Clown & Productions Copyright 2017 STEAM Clown. Page 1 What to add next time you are updating these slides Update slides to have more animation in the bullet lists Verify that each slide has stand alone speaker notes Page 1 Python 3 Running The Python Interpreter

More information

CS 115 Lecture 8. Selection: the if statement. Neil Moore

CS 115 Lecture 8. Selection: the if statement. Neil Moore CS 115 Lecture 8 Selection: the if statement Neil Moore Department of Computer Science University of Kentucky Lexington, Kentucky 40506 neil@cs.uky.edu 24 September 2015 Selection Sometime we want to execute

More information

Built-in Types of Data

Built-in Types of Data Built-in Types of Data Types A data type is set of values and a set of operations defined on those values Python supports several built-in data types: int (for integers), float (for floating-point numbers),

More information

Compile times - assert macros

Compile times - assert macros Compile times - assert macros 53 doctest 1.0 - CHECK(a == b); do { Result res; bool threw = false; try { res = ExpressionDecomposer() success) {

More information

正则表达式 Frank from https://regex101.com/

正则表达式 Frank from https://regex101.com/ 符号 英文说明 中文说明 \n Matches a newline character 新行 \r Matches a carriage return character 回车 \t Matches a tab character Tab 键 \0 Matches a null character Matches either an a, b or c character [abc] [^abc]

More information

Computer Networks. Wenzhong Li. Nanjing University

Computer Networks. Wenzhong Li. Nanjing University Computer Networks Wenzhong Li Nanjing University 1 Chapter 3. Packet Switching Networks Network Layer Functions Virtual Circuit and Datagram Networks ATM and Cell Switching X.25 and Frame Relay Routing

More information

18.1. CS 102 Unit 18. Python. Mark Redekopp

18.1. CS 102 Unit 18. Python. Mark Redekopp 18.1 CS 102 Unit 18 Python Mark Redekopp 18.2 Credits Many of the examples below are taken from the online Python tutorial at: http://docs.python.org/tutorial/introduction.html 18.3 Python in Context Two

More information

Bi-monthly report. Tianyi Luo

Bi-monthly report. Tianyi Luo Bi-monthly report Tianyi Luo 1 Work done in this week Write a crawler plus based on keywords (Support Chinese and English) Modify a Sina weibo crawler (340M/day) Offline learning to rank module is completed

More information

Python Input, output and variables. Lecture 23 COMPSCI111/111G SS 2018

Python Input, output and variables. Lecture 23 COMPSCI111/111G SS 2018 Python Input, output and variables Lecture 23 COMPSCI111/111G SS 2018 1 Today s lecture What is Python? Displaying text on screen using print() Variables Numbers and basic arithmetic Getting input from

More information

CHAPTER 2: Introduction to Python COMPUTER PROGRAMMING SKILLS

CHAPTER 2: Introduction to Python COMPUTER PROGRAMMING SKILLS CHAPTER 2: Introduction to Python COMPUTER PROGRAMMING SKILLS 1439-1440 1 Outline 1. Introduction 2. Why Python? 3. Compiler and Interpreter 4. The first program 5. Comments and Docstrings 6. Python Indentations

More information

Lecture 0. Introduction to Python. Randall Romero Aguilar, PhD II Semestre 2018 Last updated: July 12, 2018

Lecture 0. Introduction to Python. Randall Romero Aguilar, PhD II Semestre 2018 Last updated: July 12, 2018 Lecture 0 Introduction to Python Randall Romero Aguilar, PhD II Semestre 2018 Last updated: July 12, 2018 Universidad de Costa Rica SP6534 - Economía Computacional Table of contents 1. Getting Python and

More information

Chapter 1 (Part 2) Introduction to Operating System

Chapter 1 (Part 2) Introduction to Operating System Chapter 1 (Part 2) Introduction to Operating System 张竞慧办公室 : 计算机楼 366 室电邮 :jhzhang@seu.edu.cn 主页 :http://cse.seu.edu.cn/personalpage/zjh/ 电话 :025-52091017 1.1 Computer System Components 1. Hardware provides

More information

Safe Memory-Leak Fixing for C Programs

Safe Memory-Leak Fixing for C Programs Safe Memory-Leak Fixing for C Programs Qing Gao, Yingfei Xiong, Yaqing Mi, Lu Zhang, Weikun Yang, Zhaoing Zhou, Bing Xie, Hong Mei Institute of Software, Peking Unversity 内存管理 安全攸关软件的开发必然涉及内存管理问题 软件工程经典问题,

More information

cs1114 REVIEW of details test closed laptop period

cs1114 REVIEW of details test closed laptop period python details DOES NOT COVER FUNCTIONS!!! This is a sample of some of the things that you are responsible for do not believe that if you know only the things on this test that they will get an A on any

More information

History Installing & Running Python Names & Assignment Sequences types: Lists, Tuples, and Strings Mutability

History Installing & Running Python Names & Assignment Sequences types: Lists, Tuples, and Strings Mutability History Installing & Running Python Names & Assignment Sequences types: Lists, Tuples, and Strings Mutability Some material adapted from Upenn cmpe391 slides and other sources Invented in the Netherlands,

More information

信息检索与搜索引擎 Introduction to Information Retrieval GESC1007

信息检索与搜索引擎 Introduction to Information Retrieval GESC1007 信息检索与搜索引擎 Introduction to Information Retrieval GESC1007 Philippe Fournier-Viger Full professor School of Natural Sciences and Humanities philfv8@yahoo.com Spring 2019 1 Last week We have discussed about:

More information

Variables, expressions and statements

Variables, expressions and statements Variables, expressions and statements 2.1. Values and data types A value is one of the fundamental things like a letter or a number that a program manipulates. The values we have seen so far are 2 (the

More information

The Three Rules. Program. What is a Computer Program? 5/30/2018. Interpreted. Your First Program QuickStart 1. Chapter 1

The Three Rules. Program. What is a Computer Program? 5/30/2018. Interpreted. Your First Program QuickStart 1. Chapter 1 The Three Rules Chapter 1 Beginnings Rule 1: Think before you program Rule 2: A program is a human-readable essay on problem solving that also executes on a computer Rule 3: The best way to improve your

More information

Lecture 3 for pipelining

Lecture 3 for pipelining Lecture 3 for pipelining The control hazard How to solve the control hazard Pipelining Hazards Taxonomy of Hazards Structural hazards These are conflicts over hardware resources. OK, maybe add extra hardware

More information

Python The way of a program. Srinidhi H Asst Professor Dept of CSE, MSRIT

Python The way of a program. Srinidhi H Asst Professor Dept of CSE, MSRIT Python The way of a program Srinidhi H Asst Professor Dept of CSE, MSRIT 1 Problem Solving Problem solving means the ability to formulate problems, think creatively about solutions, and express a solution

More information

Data Handing in Python

Data Handing in Python Data Handing in Python As per CBSE curriculum Class 11 Chapter- 3 By- Neha Tyagi PGT (CS) KV 5 Jaipur(II Shift) Jaipur Region Introduction In this chapter we will learn data types, variables, operators

More information

Basic Concepts. Computer Science. Programming history Algorithms Pseudo code. Computer - Science Andrew Case 2

Basic Concepts. Computer Science. Programming history Algorithms Pseudo code. Computer - Science Andrew Case 2 Basic Concepts Computer Science Computer - Science - Programming history Algorithms Pseudo code 2013 Andrew Case 2 Basic Concepts Computer Science Computer a machine for performing calculations Science

More information

Python Programming, bridging course 2011

Python Programming, bridging course 2011 Python Programming, bridging course 2011 About the course Few lectures Focus on programming practice Slides on the homepage No course book. Using online resources instead. Online Python resources http://www.python.org/

More information

Chapter2 Instruction Sets

Chapter2 Instruction Sets Coputer Architecture Chapter Instruction Sets Zheng Qinghua CS Departent of XJTU 05.3 Introduction to Instruction Set Architecture ISA is the structure of a coputer that a achine language prograer ust

More information

age = 23 age = age + 1 data types Integers Floating-point numbers Strings Booleans loosely typed age = In my 20s

age = 23 age = age + 1 data types Integers Floating-point numbers Strings Booleans loosely typed age = In my 20s Intro to Python Python Getting increasingly more common Designed to have intuitive and lightweight syntax In this class, we will be using Python 3.x Python 2.x is still very popular, and the differences

More information

ECE 122 Engineering Problem Solving with Java

ECE 122 Engineering Problem Solving with Java ECE 122 Engineering Problem Solving with Java Lecture 3 Expression Evaluation and Program Interaction Outline Problem: How do I input data and use it in complicated expressions Creating complicated expressions

More information

Introduction to Computer Science

Introduction to Computer Science Introduction to Computer Science 郝建业副教授 软件学院 http://www.escience.cn/people/jianye/index.html Lecturer Jianye HAO ( 郝建业 ) Email: jianye.hao@tju.edu.cn Tutor: Li Shuxin ( 李姝昕 ) Email: 957005030@qq.com Outline

More information

Announcements. Lab Friday, 1-2:30 and 3-4:30 in Boot your laptop and start Forte, if you brought your laptop

Announcements. Lab Friday, 1-2:30 and 3-4:30 in Boot your laptop and start Forte, if you brought your laptop Announcements Lab Friday, 1-2:30 and 3-4:30 in 26-152 Boot your laptop and start Forte, if you brought your laptop Create an empty file called Lecture4 and create an empty main() method in a class: 1.00

More information

New Media Data Analytics and Application. Lecture 7: Information Acquisition An Integration Ting Wang

New Media Data Analytics and Application. Lecture 7: Information Acquisition An Integration Ting Wang New Media Data Analytics and Application Lecture 7: Information Acquisition An Integration Ting Wang Outlines Product-Oriented Data Collection Make a Web Crawler System Integration You should know your

More information

PRG PROGRAMMING ESSENTIALS. Lecture 2 Program flow, Conditionals, Loops

PRG PROGRAMMING ESSENTIALS. Lecture 2 Program flow, Conditionals, Loops PRG PROGRAMMING ESSENTIALS 1 Lecture 2 Program flow, Conditionals, Loops https://cw.fel.cvut.cz/wiki/courses/be5b33prg/start Michal Reinštein Czech Technical University in Prague, Faculty of Electrical

More information

三 依赖注入 (dependency injection) 的学习

三 依赖注入 (dependency injection) 的学习 三 依赖注入 (dependency injection) 的学习 EJB 3.0, 提供了一个简单的和优雅的方法来解藕服务对象和资源 使用 @EJB 注释, 可以将 EJB 存根对象注入到任何 EJB 3.0 容器管理的 POJO 中 如果注释用在一个属性变量上, 容器将会在它被第一次访问之前赋值给它 在 Jboss 下一版本中 @EJB 注释从 javax.annotation 包移到了 javax.ejb

More information

Chapter 2: Operating-System Structures. Operating System Concepts 9 th Edition

Chapter 2: Operating-System Structures. Operating System Concepts 9 th Edition Chapter 2: Operating-System Structures Silberschatz, Galvin and Gagne 2013 Objectives To describe the services an operating system provides to users, processes, and other systems To discuss the various

More information

1. DWR 1.1 DWR 基础 概念 使用使用 DWR 的步骤. 1 什么是 DWR? Direct Web Remote, 直接 Web 远程 是一个 Ajax 的框架

1. DWR 1.1 DWR 基础 概念 使用使用 DWR 的步骤. 1 什么是 DWR? Direct Web Remote, 直接 Web 远程 是一个 Ajax 的框架 1. DWR 1.1 DWR 基础 1.1.1 概念 1 什么是 DWR? Direct Web Remote, 直接 Web 远程 是一个 Ajax 的框架 2 作用 使用 DWR, 可以直接在 html 网页中调用 Java 对象的方法 ( 通过 JS 和 Ajax) 3 基本原理主要技术基础是 :AJAX+ 反射 1) JS 通过 AJAX 发出请求, 目标地址为 /dwr/*, 被 DWRServlet(

More information

Advanced Algorithms and Computational Models (module A)

Advanced Algorithms and Computational Models (module A) Advanced Algorithms and Computational Models (module A) Giacomo Fiumara giacomo.fiumara@unime.it 2014-2015 1 / 34 Python's built-in classes A class is immutable if each object of that class has a xed value

More information

信息检索与搜索引擎 Introduction to Information Retrieval GESC1007

信息检索与搜索引擎 Introduction to Information Retrieval GESC1007 信息检索与搜索引擎 Introduction to Information Retrieval GESC1007 Philippe Fournier-Viger Full professor School of Natural Sciences and Humanities philfv8@yahoo.com Spring 2018 1 Last week What is Information Retrieval

More information

Not-So-Mini-Lecture 6. Modules & Scripts

Not-So-Mini-Lecture 6. Modules & Scripts Not-So-Mini-Lecture 6 Modules & Scripts Interactive Shell vs. Modules Launch in command line Type each line separately Python executes as you type Write in a code editor We use Atom Editor But anything

More information

Programming in C++ Prof. Partha Pratim Das Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur

Programming in C++ Prof. Partha Pratim Das Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur Programming in C++ Prof. Partha Pratim Das Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur Lecture 04 Programs with IO and Loop We will now discuss the module 2,

More information

And Parallelism. Parallelism in Prolog. OR Parallelism

And Parallelism. Parallelism in Prolog. OR Parallelism Parallelism in Prolog And Parallelism One reason that Prolog is of interest to computer scientists is that its search mechanism lends itself to parallel evaluation. In fact, it supports two different kinds

More information

上汽通用汽车供应商门户网站项目 (SGMSP) User Guide 用户手册 上汽通用汽车有限公司 2014 上汽通用汽车有限公司未经授权, 不得以任何形式使用本文档所包括的任何部分

上汽通用汽车供应商门户网站项目 (SGMSP) User Guide 用户手册 上汽通用汽车有限公司 2014 上汽通用汽车有限公司未经授权, 不得以任何形式使用本文档所包括的任何部分 上汽通用汽车供应商门户网站项目 (SGMSP) User Guide 用户手册 上汽通用汽车有限公司 2014 上汽通用汽车有限公司未经授权, 不得以任何形式使用本文档所包括的任何部分 SGM IT < 上汽通用汽车供应商门户网站项目 (SGMSP)> 工作产品名称 :< User Guide 用户手册 > Current Version: Owner: < 曹昌晔 > Date Created:

More information

Introduction to Python Part 1. Brian Gregor Research Computing Services Information Services & Technology

Introduction to Python Part 1. Brian Gregor Research Computing Services Information Services & Technology Introduction to Python Part 1 Brian Gregor Research Computing Services Information Services & Technology RCS Team and Expertise Our Team Scientific Programmers Systems Administrators Graphics/Visualization

More information

Spark Standalone 模式应用程序开发 Spark 大数据博客 -

Spark Standalone 模式应用程序开发 Spark 大数据博客 - 在本博客的 Spark 快速入门指南 (Quick Start Spark) 文章中简单地介绍了如何通过 Spark s hell 来快速地运用 API 本文将介绍如何快速地利用 Spark 提供的 API 开发 Standalone 模式的应用程序 Spark 支持三种程序语言的开发 :Scala ( 利用 SBT 进行编译 ), Java ( 利用 Maven 进行编译 ) 以及 Python

More information

ICP Enablon User Manual Factory ICP Enablon 用户手册 工厂 Version th Jul 2012 版本 年 7 月 16 日. Content 内容

ICP Enablon User Manual Factory ICP Enablon 用户手册 工厂 Version th Jul 2012 版本 年 7 月 16 日. Content 内容 Content 内容 A1 A2 A3 A4 A5 A6 A7 A8 A9 Login via ICTI CARE Website 通过 ICTI 关爱网站登录 Completing the Application Form 填写申请表 Application Form Created 创建的申请表 Receive Acknowledgement Email 接收确认电子邮件 Receive User

More information

Introduction to Computation for the Humanities and Social Sciences. CS 3 Chris Tanner

Introduction to Computation for the Humanities and Social Sciences. CS 3 Chris Tanner Introduction to Computation for the Humanities and Social Sciences CS 3 Chris Tanner Lecture 4 Python: Variables, Operators, and Casting Lecture 4 [People] need to learn code, man I m sick with the Python.

More information

CSc 10200! Introduction to Computing. Lecture 2-3 Edgardo Molina Fall 2013 City College of New York

CSc 10200! Introduction to Computing. Lecture 2-3 Edgardo Molina Fall 2013 City College of New York CSc 10200! Introduction to Computing Lecture 2-3 Edgardo Molina Fall 2013 City College of New York 1 C++ for Engineers and Scientists Third Edition Chapter 2 Problem Solving Using C++ 2 Objectives In this

More information

云计算入门 Introduction to Cloud Computing GESC1001

云计算入门 Introduction to Cloud Computing GESC1001 Lecture #3 云计算入门 Introduction to Cloud Computing GESC1001 Philippe Fournier-Viger Professor School of Humanities and Social Sciences philfv8@yahoo.com Fall 2018 1 Course schedule Part 1 Part 2 Part 3 Introduction

More information

学习沉淀成长分享 EIGRP. 红茶三杯 ( 朱 SIR) 微博 : Latest update:

学习沉淀成长分享 EIGRP. 红茶三杯 ( 朱 SIR) 微博 :  Latest update: 学习沉淀成长分享 EIGRP 红茶三杯 ( 朱 SIR) 微博 :http://t.sina.com/vinsoney Latest update: 2012-06-01 课程目标 EIGRP 协议基础 EIGRP 基础配置 EIGRP 协议基础 EIGRP 的协议特点 EIGRP 的三张表 EIGRP 数据包 初始路由发现 EIGRP metric DUAL 算法 EIGRP 的协议特点 CISCO

More information

There are two ways to use the python interpreter: interactive mode and script mode. (a) open a terminal shell (terminal emulator in Applications Menu)

There are two ways to use the python interpreter: interactive mode and script mode. (a) open a terminal shell (terminal emulator in Applications Menu) I. INTERACTIVE MODE VERSUS SCRIPT MODE There are two ways to use the python interpreter: interactive mode and script mode. 1. Interactive Mode (a) open a terminal shell (terminal emulator in Applications

More information

MEIN 50010: Python Introduction

MEIN 50010: Python Introduction : Python Fabian Sievers Higgins Lab, Conway Institute University College Dublin Wednesday, 2017-10-04 Outline Goals Teach basic programming concepts Apply these concepts using Python Use Python Packages

More information

: Operating System 计算机原理与设计

: Operating System 计算机原理与设计 .. 0117401: Operating System 计算机原理与设计 Chapter 11: File system interface( 文件系统接口 ) 陈香兰 xlanchen@ustc.edu.cn http://staff.ustc.edu.cn/~xlanchen Computer Application Laboratory, CS, USTC @ Hefei Embedded

More information