Ⅰ Windows操作系統中的:內核, dll, AP,I都是做什麼的
內核是操作系統最基本的部分。它是為眾多應用程序提供對計算機硬體的安全訪問的一部分軟體,這種訪問是有限的,並且內核決定一個程序在什麼時候對某部分硬體操作多長時間。內核的分類可分為單內核和雙內核以及微內核。嚴格地說,內核並不是計算機系統中必要的組成部分。
動態鏈接庫英文為DLL,是Dynamic Link Library 的縮寫形式,DLL是一個包含可由多個程序同時使用的代碼和數據的庫,DLL不是可執行文件。動態鏈接提供了一種方法,使進程可以調用不屬於其可執行代碼的函數。函數的可執行代碼位於一個 DLL 中,該 DLL 包含一個或多個已被編譯、鏈接並與使用它們的進程分開存儲的函數。DLL 還有助於共享數據和資源。多個應用程序可同時訪問內存中單個DLL 副本的內容。DLL 是一個包含可由多個程序同時使用的代碼和數據的庫。
API(Application Programming Interface),應用程序編程介面。是一些預先定義的函數,目的是提供應用程序與開發人員基於某軟體或硬體的以訪問一組常式的能力,而又無需訪問源碼,或理解內部工作機制的細節。
Ⅱ 易語言怎麼用配置文件記錄密碼給完整源碼!比如目錄是「D:\AP\user.ini
配置文件保存密碼是非常危險的,我給你做了個簡單的加密...缺點:這個加密只能保存比較短的密碼信息.算是個思路吧,你可以自己寫個加密程序.代碼如下:
.版本 2
.支持庫 dp1
.程序集 窗口程序集1
.子程序 _按鈕寫入_被單擊
.如果真 (文件是否存在 (「D:\AP」) = 假)
創建目錄 (「D:\AP」)
.如果真結束
寫配置項 (「D:\AP」 + 「\user.ini」, 「User」, 「Name」, 編輯框1.內容)
寫配置項 (「D:\AP」 + 「\user.ini」, 「User」, 「Password」, 到文本 (加密數據 (到位元組集 (到文本 (編輯框2.內容)), 「我愛易語言」, #RC4演算法)))
.子程序 _按鈕讀取_被單擊
編輯框1.內容 = 讀配置項 (「D:\AP」 + 「\user.ini」, 「User」, 「Name」, )
編輯框2.內容 = 到文本 (解密數據 (到位元組集 (讀配置項 (「D:\AP」 + 「\user.ini」, 「User」, 「Password」, )), 「我愛易語言」, #RC4演算法))
Ⅲ aps 、php兩種程序的源碼 怎樣可以正確安裝到伺服器
首先肯定要搭建配置符合程勛的運行環境
sp的話安裝IIS php的話可以用iis 也可以用apache
Ⅳ DD-WRT 和 OpenWrt 能不能實現 AC+AP 的效果
可以到openwrt官網查詢支持openwrt的路由器,地址如下:
OpenWrt 可以被描述為一個嵌入式的 Linux 發行版,(主流路由器固件有 dd-wrt,tomato,openwrt三類)而不是試圖建立一個單一的、靜態的系統。
以TP-LINK WR703N 為例簡單介紹一下刷openwrt流程:
1、下載安裝
訪問WR703N在OpenWrt的Wiki頁,然後在Flashing一節中找到下載鏈接:squashfs-factory.bin。
進入路由器管理界面,出廠配置為,用戶名和密碼均為admin,然後進入固件更新,選擇下載的文件,然後更新。等待一段時間(~~2min),然後重啟路由。
2、初始配置
用一根網線將路由器的Lan口和你電腦相連,電腦上設置為DHCP模式。然後運行cmd.exe
輸入telent 192.168.1.1
成功後將出現OpenWrt的歡迎界面。
然後更改root密碼:
輸入passwd
更改root密碼後dropbear(SSH 服務)就運行了,輸入exit退出telent。
以後就可以通過ssh管理OpenWrt。
3、網路配置
OpenWrt官方的固件是不帶LuCl的,所以初始的網路設定需要在命令行下完成
下載ssh連接工具putty
輸入192.168.1.1
點擊open,如果彈出窗口點是即可。
輸入用戶名root回車 然後輸入你剛剛設定的密碼
然後用vi修改相關配置。
首先修改/etc/config/wireless文件
輸入vi /etc/config/wireless回車
注釋掉# option disabled 1
按i進入修改模式
改好後按esc,然後輸入:wq保存退出
然後修改/etc/config/network文件。
首先修改lan介面配置,注釋掉此行:
# option ifname 'eth0'
然後增加wan介面,如果你上級網路是DHCP的,則文件的末尾添加:
config interface 'wan'
option ifname 'eth0'
option proto 'dhcp'
如果你上級網路是靜態IP,則在文件的末尾添加:
config interface 'wan'
option ifname 'eth0'
option proto 'static'
option ipaddr '10.22.33.124'
option netmask '255.255.255.0'
option gateway '10.22.33.1'
option dns '202.113.16.10'
然後將路由器的Lan/Wan口接到上級網路中,重啟路由器。
這時便可以通過電腦尋找SSID為 OpenWrt的無線網路,加入後電腦便可以通過703N上網了。
接著ssh 到路由器
登陸後輸入opkg update
opkg install luci
/etc/init.d/uhttpd enable
/etc/init.d/uhttpd start
就有luci(WEB)界面了~
完後就可以通過瀏覽器訪問192.168.1.1來配置路由器了
/
Ⅳ nacos1.1.4源碼第五天 ap的實現
Nacos 集群默認支持的是CAP原則中的AP原則
nacos後面的版本可以切換cp和ap
cp ap狀態切換命令:curl -X PUT '$NACOS_SERVER:8848/nacos/v1/ns/operator/switches?entry=serverMode&value=CP'
目前1.1.4裡面 如果是臨時節點就是ap 持久化節點就是cp
前面client注冊服務的時候啟動的心跳線程 如果是臨時節點的話,隨機選擇一個服務端進行發送, 發送心跳請求
DistroConsistencyServiceImpl
發送請求 nacos/v1/ns/distro/datum
向所有服務輪詢查詢並存放節點信息Map<String, Datum>dataMap =new ConcurrentHashMap<>(1024);
Distro協議是阿里的私有協議,但是對外開源框架只有Nacos。所有我們只能從Nacos中一窺Distro協議。Distro協議是一個比較簡單的最終一致性協議。整體由節點定址、數據全量同步、非同步增量同步、定時上報client所有信息、心跳探活其他節點等組成
Ⅵ 從源碼中淺析android中怎麼利用attrs和styles定義控制項
1.attrs.xml:
我們知道Android的源碼中有attrs.xml這個文件,這個文件實際上定義了所有的控制項的屬性,就是我們在布局文件中設置的各類屬性
你可以找到attrs.xml這個文件,打開它,全選,右鍵->Show In->OutLine。可以看到整個文件的解構
我們大概可以看出裡面是Android中的各種屬性的聲明,比如textStyle這個屬性是這樣定義的:
java代碼
<!-- Default text typeface style. -->
<attr name="textStyle">
<flag name="normal" value="0" />
<flag name="bold" value="1" />
<flag name="italic" value="2" />
</attr>
那麼現在你知道,我們在寫android:textStyle的時候為什麼會出現normal,bold和italic這3個東西了吧,就是定義在這個地方。
再看看textColor:
Java代碼
<!-- Color of text (usually same as colorForeground). -->
<attr name="textColor" format="reference|color" />
format的意思是說:這個textColor可以以兩種方式設置,要麼是關聯一個值,要麼是直接設置一個顏色的RGB值,這個不難理解,因為我們可以平時也這樣做過。
也就是說我們平時在布局文件中所使用的各類控制項的屬性都定義在這裡面,那麼這個文件,除了定義這些屬性外還定義了各種具體的組件,比如TextView,Button,SeekBar等所具有的各種特有的屬性
比如SeekBar:
Java代碼
<declare-styleable name="SeekBar">
<!-- Draws the thumb on a seekbar. -->
<attr name="thumb" format="reference" />
<!-- An offset for the thumb that allows it to extend out of the range of the track. -->
<attr name="thumbOffset" format="dimension" />
</declare-styleable>
也許你會問SeekBar的background,等屬性怎麼沒有看到?這是因為Android中幾乎所有的組件都是從View中繼承下來的,SeekBar自然也不例外,而background這個屬性幾乎每個控制項都有,因此被定義到了View中,你可以在declare-styleable:View中找到它。
總結下,也就是說attrs.xml這個文件定義了布局文件中的各種屬性attr:***,以及每種控制項特有的屬性declare-styleable:***
2.styles.xml:
剛才的attrs.xml定義的是組件的屬性,現在要說的style則是針對這些屬性所設置的值,一些默認的值。
這個是SeekBar的樣式,我們可以看到,這裡面設置了一個SeekBar的默認的樣式,即為attrs.xml文件中的各種屬性設置初始值
Java代碼
<style name="Widget.SeekBar">
<item name="android:indeterminateOnly">false</item>
<item name="android:progressDrawable">@android:drawable/progress_horizontal</item>
<item name="android:indeterminateDrawable">@android:drawable/progress_horizontal</item>
<item name="android:minHeight">20dip</item>
<item name="android:maxHeight">20dip</item>
<item name="android:thumb">@android:drawable/seek_thumb</item>
<item name="android:thumbOffset">8dip</item>
<item name="android:focusable">true</item>
</style>
這個是Button的樣式:
Java代碼
<style name="Widget.Button">
<item name="android:background">@android:drawable/btn_default</item>
<item name="android:focusable">true</item>
<item name="android:clickable">true</item>
<item name="android:textAppearance">?android:attr/textAppearanceSmallInverse</item>
<item name="android:textColor">@android:color/primary_text_light</item>
<item name="android:gravity">center_vertical|center_horizontal</item>
</style>
有了屬性和值,但是這些東西是如何關聯到一起的呢?它們如何被android的framework層所識別呢?
3.組件的源碼
我們看下TextView的源碼:
Java代碼
public TextView(Context context) {
this(context, null);
}//這個構造器用來給用戶調用,比如new TextView(this);
public TextView(Context context,
AttributeSet attrs) {
this(context, attrs, com.android.internal.R.attr.textViewStyle);
}
public TextView(Context context,
AttributeSet attrs,
int defStyle) {
super(context, attrs, defStyle);//為用戶自定義的TextView設置默認的style
mText = "";
//設置畫筆
mTextPaint = new TextPaint(Paint.ANTI_ALIAS_FLAG);
mTextPaint.density = getResources().getDisplayMetrics().density;
mTextPaint.setCompatibilityScaling(
getResources().getCompatibilityInfo().applicationScale);
mHighlightPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
mHighlightPaint.setCompatibilityScaling(
getResources().getCompatibilityInfo().applicationScale);
mMovement = getDefaultMovementMethod();
mTransformation = null;
//attrs中包含了這個TextView控制項在布局文件中定義的屬性,比如android:background,android:layout_width等
//com.android.internal.R.styleable.TextView中包含了TextView中的針對attrs中的屬性的默認的值
//也就是說這個地方能夠將布局文件中設置的屬性獲取出來,保存到一個TypeArray中,為這個控制項初始化各個屬性
TypedArray a =
context.obtainStyledAttributes(
attrs, com.android.internal.R.styleable.TextView, defStyle, 0);
int textColorHighlight = 0;
ColorStateList textColor = null;
ColorStateList textColorHint = null;
ColorStateList textColorLink = null;
int textSize = 15;
int typefaceIndex = -1;
int styleIndex = -1;
/*
* Look the appearance up without checking first if it exists because
* almost every TextView has one and it greatly simplifies the logic
* to be able to parse the appearance first and then let specific tags
* for this View override it.
*/
TypedArray appearance = null;
//TextView_textAppearance不太了解為什麼要這樣做?難道是為了設置TextView的一些默認的屬性?
int ap = a.getResourceId(com.android.internal.R.styleable.TextView_textAppearance, -1);
if (ap != -1) {
appearance = context.obtainStyledAttributes(ap,
com.android.internal.R.styleable.
TextAppearance);
}
if (appearance != null) {
int n = appearance.getIndexCount();
for (int i = 0; i < n; i++) {
int attr = appearance.getIndex(i);
switch (attr) {
case com.android.internal.R.styleable.TextAppearance_textColorHighlight:
textColorHighlight = appearance.getColor(attr, textColorHighlight);
break;
case com.android.internal.R.styleable.TextAppearance_textColor:
textColor = appearance.getColorStateList(attr);
break;
case com.android.internal.R.styleable.TextAppearance_textColorHint:
textColorHint = appearance.getColorStateList(attr);
break;
case com.android.internal.R.styleable.TextAppearance_textColorLink:
textColorLink = appearance.getColorStateList(attr);
break;
case com.android.internal.R.styleable.TextAppearance_textSize:
textSize = appearance.getDimensionPixelSize(attr, textSize);
break;
case com.android.internal.R.styleable.TextAppearance_typeface:
typefaceIndex = appearance.getInt(attr, -1);
break;
case com.android.internal.R.styleable.TextAppearance_textStyle:
styleIndex = appearance.getInt(attr, -1);
break;
}
}
appearance.recycle();
}
//各類屬性
boolean editable = getDefaultEditable();
CharSequence inputMethod = null;
int numeric = 0;
CharSequence digits = null;
boolean phone = false;
boolean autotext = false;
int autocap = -1;
int buffertype = 0;
boolean selectallonfocus = false;
Drawable drawableLeft = null, drawableTop = null, drawableRight = null,
drawableBottom = null;
int drawablePadding = 0;
int ellipsize = -1;
boolean singleLine = false;
int maxlength = -1;
CharSequence text = "";
CharSequence hint = null;
int shadowcolor = 0;
float dx = 0, dy = 0, r = 0;
boolean password = false;
int inputType = EditorInfo.TYPE_NULL;
int n = a.getIndexCount();
for (int i = 0; i < n; i++) {
int attr = a.getIndex(i);
//通過switch語句將用戶設置的,以及默認的屬性讀取出來並初始化
switch (attr) {
case com.android.internal.R.styleable.TextView_editable:
editable = a.getBoolean(attr, editable);
break;
case com.android.internal.R.styleable.TextView_inputMethod:
inputMethod = a.getText(attr);
break;
case com.android.internal.R.styleable.TextView_numeric:
numeric = a.getInt(attr, numeric);
break;
//更多的case語句...
case com.android.internal.R.styleable.TextView_textSize:
textSize = a.getDimensionPixelSize(attr, textSize);//設置當前用戶所設置的字體大小
break;
case com.android.internal.R.styleable.TextView_typeface:
typefaceIndex = a.getInt(attr, typefaceIndex);
break;
//更多的case語句...
}
通過上面的代碼大概可以知道,每個組件基本都有3個構造器,其中只傳遞一個Context上下文的那個構造器一般用來在java代碼中實例化使用。
比如你可以
Java代碼
TextView tv = new TextView(context);
來實例化一個組件。
最終調用的是第3個構造器
Java代碼
public TextView(Context context,
AttributeSet attrs,
int defStyle)
在這個構造器中為你設置了默認的屬性attrs和值styles。關鍵不在這里,而是後面通過使用下面的代碼
Java代碼
TypedArray a =
context.obtainStyledAttributes(
attrs, com.android.internal.R.styleable.TextView, defStyle, 0);
來將屬性和值獲取出來,放到一個TypeArray中,然後再利用一個switch語句將裡面的值取出來。再利用這些值來初始化各個屬性。這個View最終利用這些屬性將這個控制項繪制出來。
如果你在布局文件中定義的一個View的話,那麼你定義的值,會被傳遞給構造器中的attrs和styles。也是利用同樣的方式來獲取出你定義的值,並根據你定義的值來繪制你想要的控制項。
再比如其實Button和EditText都是繼承自TextView。看上去兩個控制項似乎差異很大,其實不然。Button的源碼其實相比TextView變化的只是style而已:
Ⅶ 誰wifi設置AP熱點的源代碼!!
你得上網找了,不過這方面內容不多,看來看去這就那幾篇.而且大多數是英文.
Ⅷ AP微積分和高數的區別
首先AP是美國開發出來的課程,AP微積分分有AB和BC兩種,AB基本知道普通微分和積分,沒有什麼難一點的題目(相對美國人),BC一直學到微分方程和級數等
國內的高等數學還有AP微積分的所有內容另外還有多元微分和積分,另外級數的難度大於AP。
所以從單純數學角度來說,國內高等數學比較難,對於很多定理等的運用都會有更高的要求
但是AP是完全用英語來考的,如果英語不好,或者專業的名詞沒有見過的話,那麼也是不容易的