process class를 정의해서 사용하고 있는데, 생성자인 __init__ 부분을 확인해보니, subprocess.Popen()을 이용해서 프로세스를 생성하는 것을 확인할 수 있었다.
그런데 어떤 차이가 있길래 NULL Byte Argument를 넘겨주어도 잘 실행이 되는가 싶어서, Popen 실행하기 직전의 Argument 리스트를 찍어보니, "\x00"인 NULL Character included string을 ""인 Empty String으로 치환되어 Popen API 인자로 넘어가는 것을 확인할 수 있었다.
확인해보니 _validate 함수에서 해당 처리를 하는데, 각각인자의 rstrip("\x00")를 하는 과정에서 사라진 것이다.
뭐 다시 생각을 해 보면, C로 작성한 바이너리에서 main 함수의 argc, argv중 argv는 NULL terminated string들이고,
if (strcmp(argv['A'], "\x00")) return 0;
위 코드를 Pass하기에 단지 Empty string이기만 해도 strcmp 리턴값이 0이 될 것이긴 하다.
어쨋거나 이러한 삽질을 통해서 뭔가 잊고 있떤 사실을 하나 알게 되긴 하였다.
고로 subprocess.Popen과 같은 파이썬 API로 호출해서 pkr input 문제를 풀려면 'A' 번째 인자는 Empty string만 넣어도 된다는 것.
강의는 당신이 간단한 실제 iOS 앱을 만들기 위한 프로세스들을 차근차근 하나씩 알려줍니다.
당신이 강의를 따라서 앱을 만드는 동안, iOS 앱 개발의 개념들을 배우게 되고, 스위프트 언어에 대한 깊은 이해를 얻을 수 있으며, Apple의 IDE인 Xcode의 다양하고 유용한 기능들에 익숙해지게 될 것입니다.
강의 전에 알아야 할 사항들
이 강의에서는, 당신이 스위프트 언어에 익숙하다고 가정합니다. 강의를 잘 따라오기 위해서 스위프트의 마스터가 될 필요는 없지만 당신이 스위프트 언어를 쉽게 읽고 이해할 수 있다면, 이 강의에서 좀 더 많은 것을 가져갈 수 있을 것입니다.
당신이 만약 아직 스위프트언어가 익숙하지 않다면, 스위프트 운동장 앱에서 코드 연습(Code Exercise)들을 끝내고오세요. 또는 "The Swift Programming Language (Swift 3)"를 통해서 스위프트를 경험하고 오는것도 괜찮습니다. 위 두 방법들은 스위프트 언어의 기본기를 잘 다져줄 것입니다.
강의에 대해서
이 강의에서, 당신은 간단한 FoodTracker라고 불리는 식단 기록 앱을 만들것입니다. 이 앱은 음식의 이름, 점수, 사진을 포함한 음식 리스트를 보여줍니다. 사용자는 음식들에 대해서 추가, 삭제, 수정을 할 수 있습니다. 새로 추가를 하거나, 존재하는 앱을 수정하기위해서 사용자는 다른 화면으로 이동하여 특정 음식의 이름과 점수, 사진을 설정할 수 있습니다.
강의들은 Xcode 프로젝트로 진행되며, 강의가 끝날 때 완성물은 위와 같이 생길 예정입니다.
강의가 진행 된 뒤, 당신은 프로젝트를 다운받아서 직접 만든 코드와 비교할 수 있습니다.
당신이 강의를 진행하는 동안 배웠던 개념들을 다시 확인해야 하는 경우, 용어사전(Glossary)을 이용하세요.
용어사전에 있는 용어들은 강의들에 링크되어 있습니다.
개발 도구 구하기
iOS 앱을 개발하기 위해서, 이 강의에서는 최신버전의 기술을 사용할 것입니다. 일단 Mac 컴퓨터(macOS 10.11.5 또는 그 이후 버전)가 필요하고, 최신버전의 Xcode가 구동되어야 합니다. Xcode는 당신이 설계, 개발, 디버그 하는데 필요한 모든 기능들을 가지고 있습니다. Xcode는 또한 iOS SDK를 포함하며, 이 SDK는 Xcode가 iOS 개발을 위해 필요한 도구들과 컴파일러 및 프레임워크들을 확장해줍니다.
당신의 Mac 컴퓨터의 App Store에서 최신 버전의 Xcode를 무료로 다운받으세요.
최신 버전의 Xcode를 다운로드 받기 위해서
당신의 Mac 컴퓨터에서 App Store를 여세요(Dock에 기본적으로 있습니다.)
오른쪽 위에 있는 검색 필드에, Xcode라고 입력한 뒤 리턴 키(엔터 키)를 누르세요.
Xcode 앱이 검색 결과 첫번째 창에 나타날 것입니다.
Install App을 눌러서 Xcode를 다운받으세요.
Apple ID와 패스워드를 입력하세요. Xcode는 /Applications 디렉토리에 다운받아질 것입니다.
Start Developing iOS Apps (Swift) is the perfect starting
point for learning to create apps that run on iPhone and iPad. View this
set of incremental lessons as a guided introduction to building your
first app—including the tools, major concepts, and best practices that
will ease your path.
Each lesson contains a tutorial and the conceptual information you
need to complete it. The lessons build on each other, walking you
through a step-by-step process of creating a simple, real-world iOS app.
As you make your way through the lessons and build the app, you’ll
learn about concepts in iOS app development, gain a deeper understanding
of the Swift programming language, and familiarize yourself with the
many valuable features of Xcode, Apple’s integrated development
environment (IDE).
Prerequisites
In these lessons, it is assumed that you are familiar with the Swift
programming language. You do not need to be a Swift master to complete
the lessons, but you will get more out of the lessons if you can
comfortably read and understand Swift code.
If you are not yet comfortable with Swift, complete the Learn to Code exercises in the Swift Playgrounds app. Alternatively, you can work through A Swift Tour from The Swift Programming Language (Swift 3). Both give you a solid foundation in the Swift programming language.
About the Lessons
In these lessons, you’ll be building a simple meal-tracking app called
FoodTracker. This app shows a list of meals, including a meal name,
rating, and photo. A user can add, remove, or edit a meal. To add a new
meal or edit an existing one, users navigate to a different screen where
they can specify a name, rating, and photo for a particular meal.
The lessons are each accompanied by an Xcode project file that shows
an example of how your code and interface should look at the end of the
lesson. After you go through a lesson, you can download the project and
check your work against it.
If you need to refer to the concepts you’ve learned throughout the
lessons, use the glossary to refresh your memory. Glossary terms are
linked throughout the lessons.
Get the Tools
To develop iOS apps using the latest technologies described in these
lessons, you need a Mac computer (macOS 10.11.5 or later) running the
latest version of Xcode. Xcode includes all the features you need to
design, develop, and debug an app. Xcode also contains the iOS SDK,
which extends Xcode to include the tools, compilers, and frameworks you
need specifically for iOS development.
Download the latest version of Xcode on your Mac free from the App Store.
To download the latest version of Xcode
Open the App Store app on your Mac (by default it’s in the Dock).
In the search field in the top-right corner, type Xcode and press the Return key.
The Xcode app shows up as the first search result.
Click Get and then click Install App.
Enter your Apple ID and password when prompted.
Xcode is downloaded into your /Applications directory.
윈도우 2000버전과 그 이후버전의 프린터 스풀러는 마이크로 소프트가 제공한 것과, 밴저가 제공한 컴포넌트들로 이루어져 있습니다.
이 스풀러들은 다음 역할들을 수행합니다.
- 프린트 업무가 로컬로 처리되어야 하는지, 네트워크를 넘어서 처리되어야 하는지
- 프린터 드라이버와 함께 GDI로 부터 생성된 데이터 스트림을 받아들여서, 특정 타입의 프린터에서 출력하도록 한다.
- 스풀링이 활성화 되어 있다면, 데이터를 파일로 스풀링한다.
- 논리 프린터 큐에서 첫번째로 가용한 물리적 프린터를 고른다.
- 스풀된 포맷(EMF 와 같은)의 데이터 스트림을 프린터 하드웨어로 보낼 수 있는 데이터 형식(PCL와 같은) 형식으로 변환한다.
- 데이터 스트림을 프린터 하드웨어로 보낸다.
- 스풀러 컴포넌트와 프린터 폼을 위한 레지스트리 기반 데이터베이스를 관리한다.
- (윈도우 비스타의 경우) 프린터 서버에서 하는 것 대신, 클라이언트 컴퓨터에서 프린팅 작업을 한다. 클라이언트 사이드 랜더링은 프린터 서버의 업무 량을 줄여주고,
윈도우 비스타에서는 이 기능이 기본값으로 활성화 되어 있다.
- 윈도우 7에서 프린터 드라이버는 스풀러가 구동되는 프로세스와 다른 프로세스에서 별개로 구동 될 수 있다. 이 기능은 Printer Driver Isolation(프린터 드라이버 고립)이라고 불린다.
[원문]
Print Spooler Architecture
읽는 데 2분
참가자
The Microsoft Windows 2000 and later print spooler is made up of a set of Microsoft-supplied and optional vendor-supplied components, with responsibilities that include:
Determining whether a print job should be handled locally or across a network.
Accepting a data stream created by GDI, in conjunction with a printer driver, for output on a particular type of printer.
Spooling the data to a file (if spooling is enabled).
Selecting the first available physical printer in a logical printer queue.
(Windows Vista) Rendering print jobs on the client computer instead of on the print server. Client-side rendering eases the print server workload, is transparent to the print driver, and is enabled by default in Windows Vista.
For Windows 7, print drivers can run in a separate process from the spooler. This feature is called Printer Driver Isolation.