怎么修改703N源码,使AR9331 openwrt 增加四LAN口支持

怎么修改703N源码,使AR9331 openwrt 增加四LAN口支持,第1张

你是两个口运营商不一样还是同一个运营商要做Load Balancing(负载均衡)。 比如说你要是一个电信一个联通,然后访问电信的网络时候走电信,访问联通的时候走联通,那要做静态路由,不是负载均衡。如果两个wan都是电信或者都是联通那就要用里面

1、首先用手机找到并打开微信,点击右上角点击扫一扫。

2、其次用手机扫描卡片的二维码,连接AR后,通过AR技术,可以捕捉到不同的精灵。

3、最后在捕捉的精灵背后有礼包兑换码。

我不知道C#语言你能不能看得懂,这里是我用C#语言实现的代码,其实数据结构哪种语言都可以实现,主要的是看它的算法思想

namespace JiSuanQi

{

class JiSuan

{

public char[] a;

public string[] aa;

public char a1;

public char a2;

public int top = -1;

public string s = "";

public string s1 = "";

public int totalnum = 0;

public JiSuan(string s)

{

thiss = s;

}

public void JiSuanQi()

{

aa = new string[20];

a=new char[20];

}

public void ZhongChuo() /对输入的中缀表达式的判断/

{

for(int i=0;i<sLength;i++)

{

char cha=s[i];

switch(cha)

{

case '+':

YuanSu(cha,1);

break;

case '-':

YuanSu(cha, 1);

break;

case '':

YuanSu(cha, 2);

break;

case '/':

YuanSu(cha, 2);

break;

case '(':

Push(cha);

break;

case ')':

YuanSu1();

break;

default:

s1 += cha;

break;

}

}

for (int i = 0; i < aLength;i++ )

{

if(i==0)

{

a2 = a[i];

char cha2 = a2;

char cha1 = a1;

int num;

if (PanDuan(cha2) == 2)

{

for (int j = 0; j < s1Length; j++)

{

char ss = s1[j];

if (ss == cha1)

{

s1 = s1Remove(j,1);

num = 1;

break;

}

}

YuanSu(cha1, 1);

YuanSu1();

break;

}

else

{

YuanSu1();

break;

}

}

}

}

public void Jisuan()

{

for (int i = 0; i < s1Length; i++)

{

char cha = s1[i];

int num1;

int num2;

if (cha != '+' && cha != '-' && cha != '' && cha != '/')

{

Push1(chaToString());

}

switch (cha)

{

case '+':

num1 = intParse(Pop1()ToString());

num2 = intParse(Pop1()ToString());

int total0 = num2 + num1;

totalnum = total0;

Push1(total0ToString());

break;

case '-':

num1 = intParse(Pop1()ToString());

num2 = intParse(Pop1()ToString());

int total = num2 - num1;

totalnum = total;

Push1(totalToString());

break;

case '':

num1 = intParse(Pop1()ToString());

num2 = intParse(Pop1()ToString());

int total1=num2 num1;

totalnum = total1;

Push1(total1ToString());

break;

case '/':

num1 = intParse(Pop1()ToString());

num2 = intParse(Pop1()ToString());

int total2 = num2 / num1;

totalnum = total2;

Push1(total2ToString());

break;

default:

break;

}

}

}

public int PanDuan(char cha)

{

int num2;

if (a[0] == '+' || a[0] == '-')

{

num2 = 1;

}

else

{

num2 = 2;

}

return num2;

}

public void YuanSu(char car,int num) /判断运算符的优先级/

{

while(top!=-1)

{

char ar=Pop();

if (ar == '(')

{

Push(ar);

break;

}

else

{

int num2;

if (ar == '+' || ar == '-')

{

num2 = 1;

}

else

{

num2 = 2;

}

if (num > num2)

{

Push(ar);

break;

}

else

{

s1+=ar;

}

}

}

Push(car);

}

public void YuanSu1() /读出寨中剩余的运算符并拼接到字符串/

{

while(top!=-1)

{

char cha = Pop();

if(cha!='(')

{

s1 = s1 + cha;

}

}

}

public void Push(char shuzi) /用数组模拟实现寨的进入/

{

if(top==0)

{

a1 = a[top];

}

top += 1;

a[top] = shuzi;

// return a[top]ToString();

}

public char Pop() /用数组模拟实现寨的输出/

{

char cha = a[top];

top -= 1;

return cha;

}

public void Push1(string shuzi)

{

top += 1;

aa[top] = shuzi;

}

public string Pop1()

{

string number=aa[top];

top -= 1;

return number;

}

public string ZiFu(string zifu)

{

return zifu;

}

}

class Program

{

static void Main(string[] args)

{

JiSuan js = new JiSuan(ConsoleReadLine());

jsJiSuanQi();

jsZhongChuo();

jsJisuan();

ConsoleWriteLine("计算结果:"+jstotalnum+" 后辍表达式:"+jss1);

}

}

}

我们来举个例子3+(45)

在这个程序里,我们是先把中辍表达式转换成后缀表达式的,转换的方法名是ZhongChuo() ,转换后的表达式为345+,那程序又是如何实现转换的呢?在ZhongChuo()中判断+,-,,/,(,)当遇到数字时,我们就把数字写入定义的寨中,而当遇到运算符时,由于运算符有优先级,所以我们就要对运算符进行相应的判断,这里,我们就需要主意寨的思想,当遇到运算级低的运算符时,就将它写入寨中,如果运算符高,就直接写入定义的字符串,具体代码实现看YuanSu()这个方法(C++里叫函数)

最后要记得把寨里的运算符全部写出并拼接到字符串里就可以得到后缀表达式了,希望我的回答你能看得懂

通达信选股公式

LC:=REF(CLOSE,1);

RSI1:=SMA(MAX(CLOSE-LC,0),6,1)/SMA(ABS(CLOSE-LC),6,1)100;

BT1:=CROSS(RSI1,25);

主力:=EMA( (CLOSE-MA(CLOSE,7))/MA(CLOSE,7)480,2)5;

散户:=EMA( (CLOSE-MA(CLOSE,11))/MA(CLOSE,11)480,7)5;

BT2:=CROSS(主力,散户) AND 主力<-10;

XG:FILTER(COUNT(BT1 OR BT2,3)>=2,3);

通达信的公式

LC:=REF(CLOSE,1);

RSI1:=SMA(MAX(CLOSE-LC,0),6,1)/SMA(ABS(CLOSE-LC),6,1)100;

AR:=SUM(HIGH-OPEN,26)/SUM(OPEN-LOW,26)100;

卖点雷达:=CROSS(85,RSI1)30,COLOR00FF00,LINETHICK2;

DRAWTEXT(CROSS(85,RSI1),20,'顶'),COLOR00FF00;

STICKLINE(卖点雷达,0,20,3,0),COLOR00FF00;

VARB:=SMA(MAX(CLOSE-LC,0),7,1)/SMA(ABS(CLOSE-LC),7,1)100;

VARC:=SMA(MAX(CLOSE-LC,0),13,1)/SMA(ABS(CLOSE-LC),13,1)100;

VARD:=BARSCOUNT(CLOSE);

买点雷达:(VARB< 20 AND VARC< 25 AND VARD> 50 AND AR<70)30,LINETHICK2,COLOR0078FF;

BT1:=CROSS(RSI1,25);

DRAWTEXT(BT1,-80,'底'),COLOR0000FF;

STICKLINE(BT1,-100,-80,3,0),COLOR0000FF;

主力:EMA( (CLOSE-MA(CLOSE,7))/MA(CLOSE,7)480,2)5,LINETHICK1,COLOR0000FF;

散户:EMA( (CLOSE-MA(CLOSE,11))/MA(CLOSE,11)480,7)5,LINETHICK2,COLORC87800;

BT2:=CROSS(主力,散户) AND 主力<-10;

DRAWICON(CROSS(RSI1,25),主力,26);

DRAWICON(CROSS(主力,散户) AND 主力<-10,主力,23);

BT:=FILTER(COUNT(BT1 OR BT2,3)>=2,3);

STICKLINE(BT,0,50,4,1),COLOR0000FF;

DRAWTEXT(BT,50,'金底'),COLOR0000FF;

STICKLINE(BT2,0,20,3,0),COLORFF00FF;

DRAWTEXT(BT2,20,'升'),COLORFF00FF;

基本上没有区别。如果非要说有区别的话,就是你要把另一个项目的代码扔到自己的项目中,没有经过/configure之类的步骤,一些开关(一般是configh里的宏)没有开启,然后导致编译出来不同。又或者说在别的机器上编译完的静态库搬到自己的机器上,别人的编译器版本比较新优化得比较好,又或者说别人的编译器架构和平台根本不同然后不能用。也就这些很显然的区别了。

为什么说没有区别的呢?我们来看看一般多文件编译的过程:

编译器将每一个源文件cpp都编译成一个目标文件o。目标文件里面有符号表,记录着函数和它所用到的符号、全局变量等等。

链接器将所有的o链接成系统可辨认的二进制文件,或者说“映像”。链接器将各个函数重新排列(Reallocation),然后将没有用到的函数舍弃。

即便是加入静态库仍然没有什么区别,因为:静态库本身就只不过是o文件的一个打包(Archive)。以GCC的ar为例,我们看看静态库a里面究竟是什么:

$ ar -t libfltka

Flo

Fl_Adjustero

Fl_Bitmapo

Fl_Browsero

Fl_Browser_o

Fl_Browser_loado

Fl_Boxo

Fl_Buttono

Fl_Charto

Fl_Check_Browsero

Fl_Check_Buttono

Fl_Choiceo

Fl_Clocko

Fl_Color_Choosero

Fl_Copy_Surfaceo

Fl_Countero

Fl_Dialo

Fl_Deviceo

Fl_Double_Windowo

Fl_File_Browsero

Fl_File_Choosero

Fl_File_Chooser2o

Fl_File_Icono

Fl_File_Inputo

Fl_Groupo

Fl_Help_Viewo

Fl_Imageo

Fl_Image_Surfaceo

真相就是,里面就是一大堆的o。从源代码编译(第一步)也是生成一大堆o,从静态库里解包也是生成一大堆相同的o,其余的步骤完全是没有区别的。换句话说,比如你有一个libexamplea,它里面有src1o和src2o两个目标文件。你在链接的时候用ld -lexample开关链接一个静态库,和你先用ar -x libexamplea解包,然后用ld src1o src2o链接是完全一样的。

没有用到的符号将会被自动削除,所以跟直接从源码编译相比,也不会对体积有影响。

MA01:=MA(CLOSE,5);

MA02:=MA(CLOSE,8);

P01:=IF(CROSS(MA01,MA02),1,0);

P02:=IF(CROSS(MA02,MA01),-1,0);

P0:=P01+P02;

MA11:=MA(CLOSE,8);

MA12:=MA(CLOSE,21);

P11:=IF(CROSS(MA11,MA12),1,0);

P12:=IF(CROSS(MA12,MA11),-1,0);

P1:=P11+P12;

RSV:=(CLOSE-LLV(LOW,6))/(HHV(HIGH,6)-LLV(LOW,6))100;

K:=SMA(RSV,12,1);

D:=SMA(K,24,1);

J:=3K-2D;

P21:=IF(CROSS(K,D)AND D<20,1,0);

P22:=IF(CROSS(D,K)AND K>80,-1,0);

P23:=IF(CROSS(J,0),05,0);

P24:=IF(CROSS(100,J),-05,0);

P2:=P21+P22+P23+P24;

DIFF:= EMA(CLOSE,12) - EMA(CLOSE,26);

DEA:=EMA(DIFF,9);

MACD:=2(DIFF-DEA);

P31:=IF(CROSS(DIFF,DEA)AND DEA<0,1,0);

P32:=IF(CROSS(DEA,DIFF)AND DIFF>0,-1,0);

P3:=P31+P32;

WR1:=100(HHV(HIGH,13)-CLOSE)/(HHV(HIGH,13)-LLV(LOW,113));

P41:=IF(WR1>80,1,0);

P42:=IF(WR1<20,-1,0);

P4:=P41+P42;

OB:=SUM(IF(CLOSE>REF(CLOSE,1),VOL,IF(CLOSE<REF(CLOSE,1),-VOL,0)),0);

P51:=IF(OBV>REF(EMA(OBV,24),1),15,0);

P52:=IF(OBV<REF(EMA(OBV,24),1),-15,0);

P5:=P51+P52;

BR:=SUM(MAX(0,HIGH-REF(CLOSE,1)),26)/SUM(MAX(0,REF(CLOSE,1)-LOW),26)100;

AR:=SUM(HIGH-OPEN,26)/SUM(OPEN-LOW,26)100;

P61:=IF(BR>350,3,0);

P62:=IF(BR<45,-3,0);

P63:=IF(AR>180,3,0);

P64:=IF(AR<45,-3,0);

P6:=P61+P62+P63+P64;

TH:=SUM(IF(CLOSE>REF(CLOSE,1),VOL,0),26);

TL:=SUM(IF(CLOSE<REF(CLOSE,1),VOL,0),26);

TQ:=SUM(IF(CLOSE=REF(CLOSE,1),VOL,0),26);

VR:=100(TH2+TQ)/(TL2+TQ);

P71:=IF(VR>350,3,0);

P72:=IF(VR<45,-3,0);

P7:=P71+P72;

MASS:=SUM(MA(HIGH-LOW,9)/MA(MA(HIGH-LOW,9),9),25);

MAMASS:=MA(MASS,6);

P81:=IF(MASS<27 AND CROSS(MASS,265),2,0);

P82:=IF(MASS>27 AND CROSS(MASS,265),-2,0);

P8:=P81+P82;

WVAD:=SUM((CLOSE-OPEN)/(HIGH-LOW)VOL,24)/10000;

MAWVAD:=MA(WVAD,6);

P91:=IF(WVAD>0,1,0);

P92:=IF(WVAD<0,-1,0);

P9:=P91+P92;

VOLUME:=MA(VOL,10)/VOL;

MID:=100(HIGH+LOW-REF(HIGH+LOW,1))/(HIGH+LOW);

EMV:=MA(MIDVOLUME(HIGH-LOW)/MA(HIGH-LOW,14),14);

Q11:=IF(EMV>0,15,0);

Q12:=IF(EMV<0,-15,0);

Q1:=Q11+Q12;

TR0:=EMA(EMA(EMA(CLOSE,13),13),13);

TRIX:=(TR0-REF(TR0,1))/REF(TR0,1)100;

Q21:=IF( CROSS(TRIX,TR0),15,0);

Q22:=IF( CROSS(TR0,TRIX),-15,0);

Q2:=Q21+Q22;

LC:=REF(CLOSE,1);

RSI:=SMA(MAX(CLOSE-LC,0),13,1)/SMA(ABS(CLOSE-LC),13,1)100;

Q31:=IF(RSI>80,1,0);

Q32:=IF(RSI<20,-1,0);

Q3:=Q31+Q32;

OSC:=100(CLOSE-MA(CLOSE,20));

MAOSC:=EXPMEMA(OSC,6);

Q41:=IF(CROSS(OSC,MAOSC),1,0);

Q42:=IF(CROSS(MAOSC,OSC),-1,0);

Q4:=Q41+Q42;

TYP:=(HIGH+LOW+CLOSE)/3;

CCI:=(TYP-MA(TYP,13))/(0015AVEDEV(TYP,13));

Q51:=IF(CCI>180,2,0);

Q52:=IF(CCI<-180,-2,0);

Q5:=Q51+Q52;

TR1:=EXPMEMA(MAX(MAX(HIGH-LOW,ABS(HIGH-REF(CLOSE,1))),ABS(REF(CLOSE,1)-LOW)),14);

HD :=HIGH-REF(HIGH,1);

LD :=REF(LOW,1)-LOW;

DMP:=EXPMEMA(IF(HD>0&&HD>LD,HD,0),14);

DMM:=EXPMEMA(IF(LD>0&&LD>HD,LD,0),14);

PDI:=DMP100/TR1;

MDI:=DMM100/TR1;

ADX:=EXPMEMA(ABS(MDI-PDI)/(MDI+PDI)100,6);

ADXR:=EXPMEMA(ADX,6);

Q61:=IF(CROSS(PDI,MDI),2,0);

Q62:=IF(CROSS(DMI,PDI),-2,0);

Q6:=Q61+Q62;

DPO:=CLOSE-REF(MA(CLOSE,21),21/2+1);

MADPO:=MA(DPO,6);

Q71:=IF(DPO>0,1,0);

Q72:=IF(DPO<0,-1,0);

Q7:=Q71+Q72;

MTM:CLOSE-REF(CLOSE,12);

MAMTM:=MA(MTM,6);

Q81:=IF(CROSS(MTM,MAMTM),1,0);

Q82:=IF(CROSS(MAMTM,MTM),-1,0);

Q8:=Q81+Q82;

MID1:=SUM(VOL(2CLOSE-HIGH-LOW)/(HIGH+LOW),0);

CHO:=MA(MID,10)-MA(MID,20);

MACHO:=MA(CHO,6);

Q91:=IF((CLOSE>MA(CLOSE,90))AND CROSS(CLOSE,0), 15,0);

Q92:= IF((CLOSE<MA(CLOSE,90))AND CROSS(0,CLOSE), -15,0);

Q9:=Q91+Q92;

PSY:=COUNT(CLOSE>REF(CLOSE,1),12)/12100;

PSYMA:=MA(PSY,6);

R11:=IF(PSY>75,15,0);

R12:=IF(PSY<25,-15,0);

R1:=R11+R12;

MID2 := MA(CLOSE,20);

UPPER:= MID2+2STD(CLOSE,20);

LOWER:= MID2-2STD(CLOSE,20);

R21:=IF(CROSS(CLOSE,LOWER),2,0);

R22:=IF(CROSS(UPPER,CLOSE),-2,0);

R2:=R21+R22;

TYP1 := (HIGH + LOW + CLOSE)/3;

V1:=SUM(IF(TYP1>REF(TYP1,1),TYP1VOL,0),14)/SUM(IF(TYP1<REF(TYP1,1),

TYP1VOL,0),14);

MFI:=100-(100/(1+V1));

R31:=IF(MFI>80,1,0);

R32:=IF(MFI<20,-1,0);

R3:=R31+R32;

VARA:=R1+R2+R3+Q1+Q2+Q3+Q4+Q5+Q6+Q7+Q8+Q9+P0+P1+P2+P3+P4+P5+P6+P7+P8+P9;

决策曲线:VARA;

{未来函数,慎用}

全买: (ZIG(3,35)>REF(ZIG(3,35),1) AND REF(ZIG(3,35),1)<REF(ZIG(3,35),2))

90;

以上就是关于怎么修改703N源码,使AR9331 openwrt 增加四LAN口支持全部的内容,包括:怎么修改703N源码,使AR9331 openwrt 增加四LAN口支持、源码精灵礼包兑换码怎样获得、C++ 后缀表达式求值的源代码。要简单明了的 不要任何修饰等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zz/9878066.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-02
下一篇 2023-05-02

发表评论

登录后才能评论

评论列表(0条)

保存