2013年2月5日 星期二

電磁學(1)


Volume charge density ρv=∆v->無限大lim∆q/∆v  (C/m^3)
surface charge density  ρs=∆s->無限大lim∆q/∆s (C/m^2)
line charge density  ρl=∆l->無限大lim∆q/∆l (C/m)

電流 I=dq/dt (C/s or A)
D=∈E
H=1/u*B

u0=4pi*10^-7
∈0=1/36pi * 10^-9
C^2=1/(∈0u0)

Qt使用glut

在pro檔
Qt += opengl
libs += -L/usr/include/lib -lglut -lGLU

2013年2月3日 星期日

github上傳檔案

1)new repo 在首頁右上角
2)git add *(加入所選檔案)
3)git commit -m 'commit 訊息'
4)git push

2013年2月2日 星期六

作業系統(3)


第三章 Process Concept

Current-day computer systems allow multiple programs to be loaded into memory and executed concurrently. This evolution required firmer control amd more compartmentalization of various programs;and these needs resulted in the notion of a process, which is a program in execution. A process is the unit of work in modern time-sharing system.

A process is more than the program code, which is sometimes known as the text section. It also includes the current activity, as represented by the value of the program counter and the contents of processor's registers. A process generally also includes the process stack and a data section, which contains global variables. A process may also include a heap, which is memory that is dynamically allocated during process run time.

As a process executes, it changes state: The state of a process is defined in part by the current activity of that process.

1.New – The process is being created.
2.Running – Instructions are being  executed.
3.Waiting – The process is waiting for some event to occur.
4.Ready – The process is waiting to be assigned to a processor.
5.Terminated – The process has finished execution.

Each process is represented in the operating system by a process control block(PCB) – also called a task control block.
1. Process state
2. Program counter
3. CPU registers
4. CPU-scheduling information
5. Memory-management information
6. Accounting information  – the amount of CPU and real time used, time limits, account numbers, job or process numbers, and so on.
7. I/O status information.


The operating system must select, for scheduling purposes, processes from these queues in some fashion. The selection process is carried out by the appropriate scheduler.


A socket is defined as an endpoint for communication. A pair of processes communicating over a network employ a pair of sockets.
The RPC(Remote Procedure Calls) was designed as a way to abstract the procedure-call mechanism for use between systems with network connections.

離散數學(2)-1


Show that for primitive statements p,q

p V q(p xor q) ↔ (p^~q)V(~p^q) ↔ ~(p ↔ q)

p
q
p V q
p^~q
~p^q
(p^~q)V(~p^q)
p → q
q → p
p↔q
~ p↔ q
0
0
0
0
0
0
1
1
1
0
0
1
1
0
1
1
1
0
0
1
1
0
1
1
0
1
0
1
0
1
1
1
0
0
0
0
1
1
1
0

離散數學(8)


第八章 The Principle of Inclusion and Exclusion

The Principle of Inclusion and Exclusion. Cosider a set S, with |S|=N, and coditions ci, 1<=i<=t, each of which way be satisfied by some of the elements of s of S. The number of elements of S that satisfy none of the conditions ci, 1<=i<=t, is denoted by N'=N(c1'c2'c3'...ct') where

N'=N-[N(c1)+N(c2)+...+N(ct)]+[N(c1c2)+n(c1c3)+...+N(c1ct)+N(c2c3)+...+N(ct-1ct)]-[N(c1c2c3)+N(c1c2c4)+...+N(c1c2ct)_N(c1c3c4)+...+N(c1c3ct)+...+N(ct-2ct-1ct)]+...+
(-1)^tN(c1c2c3...ct)

N'=N-1<=i<=t∑N(ci)+1<=i<j<=t∑N(cicj)-1<=i<j<k<=t∑N(cicjck)+...+
     (-1)^tN(c1c2c3...ct)