Ⅰ 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是完全用英语来考的,如果英语不好,或者专业的名词没有见过的话,那么也是不容易的