computer science
Studying ‘VBA’
Summary VBA is an abbreviation of Visual Basic for Application. Abbreviated as VBA, Visual Basic for Applications is a programming language that is similar to Visual Basic, only it is embedded in an individual Microsoft application such as Excel or Access. Using VBA you can create macros or small programs that perform tasks within the […]
Implementing the File System | Assignment 3 | Operating System
Brief Information Title: Implementing?the File System Hand-in date: 2016-05-17 Tue. Due date (1st): 2016-05-29 Sun. Due date (2nd):?2016-05-31 Tue. Due date (3rd): 2016-06-26 Sun. How to do the assignment: (pdf files) Homework 3 Homework 3: appendix 과제3 변경 및 중요사항(Homework 3: changes and important notices) Trace 2016-05-21 Sat. 23:13: Read the instructions. Try to implement […]
Implementing a Buffer Cache | Assignment 2 | Operating System
Brief Information Title: Implementing a Buffer Cache Hand-in date: 2016-04-14 Mon. Due date: 2016-05-13 Wed. How to do the assignment: (pdf files) Operating System) Assignment 2) Homework2-1(partially edited by SJ).pdf Operating System) Assignment 2) Homework2-2(partially edited by SJ).pdf Trace 2016-04-12 Tue.: Homework 2-1.pptx handed in. The file was explained on this day. 2016-04-14 Thu.: Homework […]
Interconnected One Hash Table and Two Doubly Linked Lists | Assignment 1 | Operating System
How to do the assignment: Operating System) Assignment 1) Instruction.pdf Trace 2016-03-19 Sat.: Developing environment has been set. I made a tutorial to set the environment. 2016-03-19 Sat.: Three functions are implemented: GetObjectFromObjFreeList,?InsertObjectIntoObjFreeList,?InsertObjectToTail, and?InsertObjectToHead 2016-03-20 Sun.: All implemented. I have matched the implemented code and the instruction one by one. 2016-03-28 Mon.: I got the […]
Operating System Concepts. 9th Ed. by A. Silberschatz and P. B. Galvin (2012) Wiley
Title: Operating System Concepts Authors:?A. Silberschatz, P. B. Galvin Publisher: Wiley Published Year: 2012 Contents Part 1:?Overview Chapter 1: Introduction Chapter 2: Operating-System Structures Part 2: Process Management Chapter 3: Processes Chapter 4: Threads Chapter 5: Process Synchronization Chapter 6: CPU Scheduling Chapter 7: Deadlocks Part 3: Memory Management Chapter 8: Main Memory Chapter 9: […]
Operating System | CS | Course
Brief Information Name : Operating System 운영체제 Lecturer : Ahn Woohyun 안우현 Semester : 2016 Spring Major?: BE,?Computer Science and Engineering Textbook Silberschatz, A., Galvin, P. B. & Gagne, G. (2008) Operating System Concepts. 8th Ed.?Wiley Syllabus 😕Syllabus_2016-5-1__Operating System.pdf In?short Assignments [Assignment 1] Interconnected One Hash Table and Two Doubly Linked Lists | Operating System […]
The Empty String, the Empty List, and Zero All Evaluate to False
The empty string, the empty list, the empty dictionary, the empty set, and zero all evaluate to False.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
bool('') # the empty string Out[1]: False bool('a non-empty string') # a non-emepty string Out[2]: True bool(list()) # the empty list Out[3]: False bool(['a non-empty list']) # a non-empty list Out[4]: True bool(dict()) # the empty dictionary Out[5]: False bool({'key':'value'}) # a non-empty dictionary Out[6]: True bool(set()) # the empty set Out[7]: False bool({'a non-empty set'}) # a non-empty set Out[8]: True bool(0) # zero Out[9]: False bool(1) # a non-zero Out[10]: True |
Conversion Between Str and Bytes
Diagram: Conversion Between Str and Bytes Conversion to String
1 2 3 4 5 6 7 8 |
def to_str(bytes_or_str): if isinstance(bytes_or_str, bytes): # bytes_or_str is bytes. value = bytes_or_str.decode('utf-8') else: # bytes_or_str is not bytes, but str. value = bytes_or_str return value |
1 2 3 4 5 6 |
>>> bytes_ex = b'This is a string.' >>> str_ex = 'This is a string' >>> to_str(bytes_ex) 'This is a string' >>> to_str(str_ex) 'This is a string' |
Conversion To Bytes
1 2 3 4 5 6 7 8 |
def to_bytes(bytes_or_str): if isinstance(bytes_or_str, str): # bytes_or_str is str. value = bytes_or_str.encode('utf-8') else: # bytes_or_str is not str, but bytes value = bytes_or_str return value |
1 2 3 4 5 6 |
>>> bytes_ex = b'This is a string.' >>> str_ex = 'This is a string' >>> to_bytes(bytes_ex) b'This is a string' >>> to_bytes(str_ex) b'This is a string' |
Write a?File in Write Binary Mode (‘wb’)
1 2 3 4 5 |
with open('binary.txt', 'wb') as f: f.write(to_bytes(str_ex)) with open('bytes.txt', 'wb') as f: f.write(to_bytes(bytes_ex)) |
Write a?File in Write Character?Mode (‘w’)
1 2 3 4 5 |
with open('str.txt', 'w') as f: f.write(to_str(str_ex)) with open('str.txt', 'w') as f: f.write(to_str(bytes_ex)) |
Studying ‘Artificial Intelligence’
Study Procedure Find and understand overall sub-fields of the artificial intelligence References Artificial intelligence – Wikipedia, the free encyclopedia Introduction to the artificial intelligence Sub-fields of the Artificial Intelligence The fields of the AI can be classified by goals, approaches, and tools. Goals Deduction, reasoning, problem solving Knowledge representation Default reasoning and the qualification problem […]