JavaʵÏÖÊý×éÐÎʽµÄ¶àÏîʽ¼Ó·¨¡¢¼õ·¨¡¢³Ë·¨¡¢Ïà³ýÔËËã
javaʵÏֵĶàÏîʽ¼Ó·¨£¬¼õ·¨£¬³Ë·¨£¬³ý·¨ÔËË㣬ÆäÖжàÏîʽµÄ±íʾÐÎʽΪ°´Ãݴӵ͵½¸ßµÄϵÊýÊý×飬Êý×éµÄ³¤¶È¼´ÊǶàÏîʽµÄÃÝ
¼´ Êý×é{1,2,3,4} ±íʾ¶àÏîʽ4x3+3x2+2x+1
ÔËËãÔÚ¹¤¾ßÀàPolynÖнøÐÐ ³õʼ»¯Polyn±ØÐëÒª´«Á½¸ö²ÎÊý ¼´±»³ýÊýºÍ³ýÊý
ÆäÖмӷ¨£¬¼õ·¨ºÍ³Ë·¨ÊǾ²Ì¬·½·¨ ²»ÐèʵÀý¼´¿ÉʹÓÃ
³ý·¨ÐèÒª²úÉúÉ̺ÍÓàÊý ËùÒÔ±ØÐëҪʵÀý»¯ºó²Å¿É½øÐÐÔËËã
³ý·¨µÄËã·¨´óÖÂÊÇ£º
1¡¢Óñ»³ýÊýµÄ×î´óÏî³ýÒÔ³ýÊý×î´óÏî,µÃ¶àÏîʽp1
2¡¢ÓÃp1³Ë³ýÊý£¬µÃ¶àÏîʽp2
3¡¢±»³ýÊý¼õp2,µÃp3
4¡¢Èç¹ûp3µÄÃÝСÓÚ³ýÊý£¬ÔòÊä³öÓàÊýΪp3£¬ÉÌΪËùÓÐp1Ö®ºÍ
·ñÔòÒÔp3×÷Ϊеı»³ýÊý£¬×ª1
³õ²½Ð´µÄ³ÌÐòÈçÏ£¬Ã»×ö´íÎó´¦ÀíºÍÈ«·½Î»²âÊÔ£¬ÁôÒÔºóÓÐʱ¼ä½øÐС£
/**
*
* @author knightzhuwei
*
*/
import java.util.Arrays;
class Polyn{
private double[] dividend;
private double[] divisor;
private double[] result;
private double[] remainder;
public Polyn(double[] dividend,double[] divisor){
this.dividend=dividend;
this.divisor=divisor;
}
//¼Ó·¨ ÖðÏîÏà¼Ó ûɶºÃ˵µÄ
public static double[] addPolyn(double[] a,double[] b){
double[] heigher=a.length>b.length?a:b;
double[] lower=a.length>b.length?b:a;
double[] res=new double[heigher.length];
for(int i=0;i<heigher.length;i++){
if(i<lower.length){
res[i]=heigher[i]+lower[i];
}
else{
res[i]=heigher[i];
}
}
return res;
}
//¼õ·¨ ÖðÏîÏë¼õ ÉÔÂ鷳һЩ ×îºóÈç¹û¸ßλÊÇ0»¹Òª´¦Àí
public static double[] subPolyn(double[] a,double[] b){
double[] heigher=a.length>=b.length?a:b;
double[] lower=a.length>=b.length?b:a;
double[] res=new double[heigher.length];
if(heigher==a){
for(int i=0;i<heigher.length;i++){
if(i<lower.length){
res[i]=heigher[i]-lower[i];
}
else{
res[i]=heigher[i];
}
}
}else{
for(int i=0;i<heigher.length;i++){
if(i<lower.length){
res[i]=lower[i]-heigher[i];
}
else{
res[i]=-heigher[i];
}
}
}
int k=res.length-1;
for(;res[k]==0.0&&k>0;k--);
Ïà¹ØÎĵµ£º
Socket´«Êäģʽ
SocketsÓÐÁ½ÖÖÖ÷ÒªµÄ²Ù×÷·½Ê½:ÃæÏòÁ¬½ÓµÄºÍÎÞÁ¬½ÓµÄ.ÃæÏòÁ¬½ÓµÄsockets²Ù×÷¾ÍÏñÒ»²¿µç»°,ËûÃDZØÐ뽨Á¢Ò»¸öÁ¬½ÓºÍÒ»È˺ô½Ð.ËùÓеÄÊÂÇéÔÚµ½´ïʱµÄ˳ÐòºÍËûÃdzö·¢Ê±µÄ˳ÐòʱÏàͬ.ÎÞÁ¬½ÓµÄsockets²Ù×÷¾ÍÏñÊǸöÓʼþͶµÝ,,ûÓÐʲôȷ±£,¶à¸öÓʼþ¿ÉÄÜÔÚµ½´ïʱµÄ˳ÐòºÍ³ö·¢Ê±µÄ˳Ðò²»Ïàͬ.
µ½µ×ÓÃÄÄÖÖģʽÊÇÓÊÓ¦ ......
ÔÚjavaÈç¹ûÒ»¸ö³ÉÔ±±»ÉùÃ÷Ϊstatic£¬Ëü¾ÍÄܹ»ÔÚËüµÄÀàµÄÈκζÔÏó´´½¨Ö®Ç°±»·ÃÎÊ£¬¶ø²»±ØÒýÓÃÈκζÔÏó¡£Äã¿ÉÒÔ½«·½·¨ºÍ±äÁ¿¶¼ÉùÃ÷Ϊstatic¡£static ³ÉÔ±µÄ×î³£¼ûµÄÀý×ÓÊÇmain( ) ¡£ÒòΪÔÚ³ÌÐò¿ªÊ¼Ö´ÐÐʱ±ØÐëµ÷ÓÃmain() £¬ËùÒÔËü±»ÉùÃ÷Ϊstatic¡£
ÓÐʱÄãÏ£Íû¶¨ÒåÒ»¸öÀà³ÉÔ±£¬Ê¹ËüµÄʹÓÃÍêÈ«¶ÀÁ¢ÓÚ¸ÃÀàµÄÈκζÔÏó¡£Í¨³ ......
//** **********´´½¨¹¤×÷²¾************ */
WritableWorkbook workbook = Workbook.createWorkbook(new File("d:/test.xls"));
/** *//** **********´´½¨¹¤ ......
NVelocityÊÇJavaÄ£°åÒýÇæVelocityµÄ.Net°æ±¾¡£NVelocityÄ¿Ç°¹Ù·½°æ±¾Îª0.42¡£¹Ù·½µØÖ·£ºhttp://nvelocity.sourceforge.net/£¬Ô×÷ÕßÒѾÉêÃ÷²»ÔÙ¶ÔNVelocity×ö¼¼ÊõÖ§³ÖÁË£¬ËùÒÔsourceforgeÉÏNVelocity°æ±¾Ò»Ö±ÊÇ0.42²»ÔÙÓиüÐÂÁË¡£²»¹ýÄ¿Ç°NVelocityÒѾÓÐ1.0µÄ°æ±¾ÁË£¬ÊÇÓÉcastleprojectÏîĿά»¤µÄ¡£NVelocity.dllÄÜÔÚcast ......
ÏîÄ¿ÖÐÐèÒªºÍµÚÈý·½Æ½Ì¨½Ó¿Ú£¬¼ÓÁËÀ´Ô´IP¼øȨ¹¦ÄÜ£¬²âÊÔʱ·¢ÏÖûÓÐÎÊÌ⣬µ«ÊDz¿ÊðÒÔºó·¢ÏÖ´æÔÚÎÊÌ⣬һֱ¼øȨ²»Í¨¹ý£¬Ò»ÈºÈËץϹ¡£
ÎÒÕÒµ½ÄÇ¿éµÄ´úÂ룬¸úÁËÒ»±éÁ÷³Ì·¢ÏÖÂ߼ûÓÐɶÎÊÌ⣬µ«ÊÇ×îÖյĽá¹ûÈ´»¹ÊǼøȨ²»Í¨¹ý£¬ÊµÔÚÓÐЩ¹îÒì¡£Æä»ù±¾Â߼ΪÏÈÈ¡µÃÅäÖõÄIPÁÐ±í£¬È»ºóͨ¹ýrequest.getRemoteAddr()È¡µÃ¿Í»§¶ËµÄIPµ ......