哪位大神指教一下 result *= i;什么意思

#include

//求阶乘
long factorial(int n)
{
int i;
long result=1;
for(i=1; i<=n; i++)
{
result *= i;
}
return result;
}
// 求累加的和
long sum(long n)
{
int i;
long result = 0;
for(i=1; i<=n; i++)
{
//嵌套调用
result += factorial(i);
}
return result;
}

int main()
{
printf("1!+2!+...+9!+10! = %ld\n", sum(10));
return 0;
}

c

11个回答

result *= i就是result = result * i
就是说result现在的值等于它之前的值乘以i
例如:假设resule现在的值是2,i的值是6
那么执行了result *= i之后result的值就会是12

就是 result=result*i;

就是 前边的乘以后边的简写

操作符 *= , +=

a*=b
a=a*b

a+=b
a=a+b

执行效率更高!

result = result * i;

result = result * i;

类似 + - * / 同理

result = result * i;

这是一种赋值运算=,+=,-=,*=,/=,&=,^=,\=,<<=,>>=
a = 2;<------->a = 2;
a *= 2<------->a = a * 2;
a <<= 2<---->a = a << 2;
.....

result = result * i

result=result*i

共11条数据 1 尾页
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
MyEclipse和Tomcat的问题 求哪位大神帮忙指教一下拜托拜托急急急
## 这是Action包里的 ## package com.bus.cnu.action; ## ## import com.carver.ptm.core.persistence.base.BaseDao; ## import java.util.List; ## import javax.servlet.http.HttpServletRequest; ## ## import org.apache.struts2.ServletActionContext; ## ## import com.bus.cnu.service.*; ## import com.bus.cnu.vo.BusRoundExceptionManage; ## public class DoorExceptionManageAction extends BaseAction { ## ## private static final long serialVersionUID=1L; ## private IBusRoundExceptionManageService busroundexceptionmanageservice; ## ## public String QuaryAll(){ ## HttpServletRequest request=ServletActionContext.getRequest(); ## List<BusRoundExceptionManage> brems=busroundexceptionmanageservice.queryAll(); ## request.setAttribute("BREMS", brems); ## return "success"; ## } ## ## public String GetBREM(){ ## HttpServletRequest request=ServletActionContext.getRequest(); ## Integer bremid=Integer.parseInt(request.getParameter("bremid")); ## BusRoundExceptionManage brem=busroundexceptionmanageservice.GetBusRoundExceptionById(bremid); ## request.setAttribute("BREM", brem); ## return "success"; ## } ## ## public String GetUpdateBREM(){ ## HttpServletRequest request=ServletActionContext.getRequest(); ## Integer bremid=Integer.parseInt(request.getParameter("bremid")); ## BusRoundExceptionManage brem=busroundexceptionmanageservice.GetBusRoundExceptionById(bremid); ## request.setAttribute("BREM", brem); ## return "success"; ## } ## ## public String Update(){ ## HttpServletRequest request=ServletActionContext.getRequest(); ## Integer bremid=Integer.parseInt(request.getParameter("bremid")); ## String reason=request.getParameter("manage"); ## BusRoundExceptionManage brem=busroundexceptionmanageservice.GetBusRoundExceptionById(bremid); ## brem.setReason(reason); ## if(busroundexceptionmanageservice.Update(brem)){ ## return "success"; ## } ## return "fail"; ## } ## ## public IBusRoundExceptionManageService getBusroundexceptionmanageservice() { ## return busroundexceptionmanageservice; ## } ## ## public void setBusroundexceptionmanageservice( ## IBusRoundExceptionManageService busroundexceptionmanageservice) { ## this.busroundexceptionmanageservice = busroundexceptionmanageservice; ## } ## ## public static long getSerialversionuid() { ## return serialVersionUID; ## } ## ## ## } 这是Struts里的 <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" "http://struts.apache.org/dtds/struts-2.0.dtd"> <struts> <include file="struts-ajax.xml" /> <package name="leo" extends="struts-default"> <action name="login" class="LoginAction"> <result name="input">/common/login.jsp</result> <result name="login.main">/common/main.jsp</result> </action> <action name="QueryAll" class="DoorExceptionManageAction" method="QuaryAll"> <result name="success">/dispatcher/door_abnormal.jsp</result> </action> <action name="GetBREM" class="DoorExceptionManageAction" method="GetBREM"> <result name="success">/dispatcher/door_abnormal_detail.jsp</result> </action> <action name="GetUpdateBREM" class="DoorExceptionManageAction" method="GetUpdateBREM"> <result name="success">/dispatcher/abnormal_handle.jsp</result> </action> <action name="Update" class="DoorExceptionManageAction"> <result name="success">/dispatcher/abnormal_handle_next.jsp</result> <result name="fail">/dispatcher/door_abnormal_detail.jsp</result> </action> </package> </struts> 这是报错截图 ![图片说明](https://img-ask.csdn.net/upload/201506/23/1435068126_529569.jpg)
Handler 如何跨方法 取值? handler 拿到 Message 后赋给全局变量,在其它方法中打印这个全局变量就是空 NULL,求大神指教!!!。
private String getStr; public void menthodA(String str){ String url = "http://10.0.0.12:8080/testa/test.do" Map<String, String> map = new HashMap<String, String>(); map.put("id", ""); OkHttpManager ok = new OkHttpManager(); ok.postComplexForm(url, map, new OkHttpManager.goBackJsonString() { @Override public void onResponse(String result) { Message msg = new Message(); msg.what = 2; msg.obj = result; handler.sendMessage(msg); } }); handler = new Handler(){ @Override public void handleMessage(@NonNull Message msg) { super.handleMessage(msg); if (msg.what == 2){ getStr = (String)msg.obj; Log.d("AAA","Print " + getStr);//字符串可以拿到msg } } }; Log.d("AAA","Print_1 " + getStr);//在这里字符串为空!! } // 我错在哪儿了?怎样才能将这个hanlder 拿到的msg交个主线程中的全局变量!感谢!
在线急等!!!关于String直接转byte[]
String s="18a1a2";(s是十六进制数组成的字符串) byte[] result = new byte[3] ; 怎么实现s每两位对应一个字节,即: result[0]=(0x)18; result[1]=(0x)a1; result[2]=(0x)a2; 请哪位大神指教一下,谢谢
C语言小白问题求大神指教
#include <stdio.h> #include <math.h> unsigned fun(int w) { int a; int i; i=1; a=w; while(a==0) { a=a/10; i++; } w=w%pow(10,i); return w; } unsigned main() { int w; printf("please enter a number:\n"); scanf("%d",&w); printf("the result is:%u\n",fun(w)); return 0; } 若w是n (n≥2)位的整数,函数求出w的后n-1位的数作为函数值返回。 自己写的算法,所以特别想实现,看过网上的答案,没太明白...... 求详细解释
关于linux获取硬盘序列号的一段代码?不太懂,求大神指教一下
#include <cctype> #include <cstdlib> #include <cstring> #include <fcntl.h> #include <unistd.h> #include <scsi/sg.h> #include <sys/ioctl.h> #include <linux/hdreg.h> #include <string> #include <fstream> static bool get_disk_name(std::string & disk_name) { disk_name.c_str(); std::ifstream ifs("/etc/mtab", std::ios::binary); if (!ifs.is_open()) { return(false); } char line[4096] = { 0 }; while (!ifs.eof()) { ifs.getline(line, sizeof(line)); if (!ifs.good()) { break; } const char * disk = line; while (isspace(disk[0])) { ++disk; } const char * space = strchr(disk, ' '); if (NULL == space) { continue; } const char * mount = space + 1; while (isspace(mount[0])) { ++mount; } if ('/' != mount[0] || ' ' != mount[1]) { continue; } while (space > disk && isdigit(space[-1])) { --space; } if (space > disk) { std::string(disk, space).swap(disk_name); break; } } ifs.close(); return(!disk_name.empty()); } static void trim_serial(const void * serial, size_t serial_len, std::string & serial_no) { const char * serial_s = static_cast<const char *>(serial); const char * serial_e = serial_s + serial_len; while (serial_s < serial_e) { if (isspace(serial_s[0])) { ++serial_s; } else if ('\0' == serial_e[-1] || isspace(serial_e[-1])) { --serial_e; } else { break; } } if (serial_s < serial_e) { std::string(serial_s, serial_e).swap(serial_no); } } static bool get_disk_serial_by_way_1(const std::string & disk_name, std::string & serial_no) { serial_no.clear(); int fd = open(disk_name.c_str(), O_RDONLY); if (-1 == fd) { return(false); } struct hd_driveid drive = { 0 }; if (0 == ioctl(fd, HDIO_GET_IDENTITY, &drive)) { trim_serial(drive.serial_no, sizeof(drive.serial_no), serial_no); } close(fd); return(!serial_no.empty()); } static bool scsi_io( int fd, unsigned char * cdb, unsigned char cdb_size, int xfer_dir, unsigned char * data, unsigned int data_size, unsigned char * sense, unsigned int sense_len ) { sg_io_hdr_t io_hdr = { 0 }; io_hdr.interface_id = 'S'; /* CDB */ io_hdr.cmdp = cdb; io_hdr.cmd_len = cdb_size; /* Where to store the sense_data, if there was an error */ io_hdr.sbp = sense; io_hdr.mx_sb_len = sense_len; /* Transfer direction, either in or out. Linux does not yet support bidirectional SCSI transfers ? */ io_hdr.dxfer_direction = xfer_dir; /* Where to store the DATA IN/OUT from the device and how big the buffer is */ io_hdr.dxferp = data; io_hdr.dxfer_len = data_size; /* SCSI timeout in ms */ io_hdr.timeout = 5000; if (ioctl(fd, SG_IO, &io_hdr) < 0) { return(false); } /* now for the error processing */ if (SG_INFO_OK != (io_hdr.info & SG_INFO_OK_MASK) && io_hdr.sb_len_wr > 0) { return(false); } if (io_hdr.masked_status || io_hdr.host_status || io_hdr.driver_status) { return(false); } return(true); } static bool get_disk_serial_by_way_2(const std::string & disk_name, std::string & serial_no) { serial_no.clear(); int fd = open(disk_name.c_str(), O_RDONLY); if (-1 == fd) { return(false); } int version = 0; if (ioctl(fd, SG_GET_VERSION_NUM, &version) < 0 || version < 30000) { close(fd); return(false); } const unsigned int data_size = 0x00ff; unsigned char data[data_size] = { 0 }; const unsigned int sense_len = 32; unsigned char sense[sense_len] = { 0 }; unsigned char cdb[] = { 0x12, 0x01, 0x80, 0x00, 0x00, 0x00 }; cdb[3] = (data_size >> 8) & 0xff; cdb[4] = (data_size & 0xff); if (scsi_io(fd, cdb, sizeof(cdb), SG_DXFER_FROM_DEV, data, data_size, sense, sense_len)) { /* Page Length */ int page_len = data[3]; /* Unit Serial Number */ trim_serial(data + 4, page_len, serial_no); } close(fd); return(!serial_no.empty()); } static bool parse_serial(const char * line, int line_size, const char * match_words, std::string & serial_no) { const char * serial_s = strstr(line, match_words); if (NULL == serial_s) { return(false); } serial_s += strlen(match_words); while (isspace(serial_s[0])) { ++serial_s; } const char * serial_e = line + line_size; const char * comma = strchr(serial_s, ','); if (NULL != comma) { serial_e = comma; } while (serial_e > serial_s && isspace(serial_e[-1])) { --serial_e; } if (serial_e <= serial_s) { return(false); } std::string(serial_s, serial_e).swap(serial_no); return(true); } static void get_serial(const char * file_name, const char * match_words, std::string & serial_no) { serial_no.c_str(); std::ifstream ifs(file_name, std::ios::binary); if (!ifs.is_open()) { return; } char line[4096] = { 0 }; while (!ifs.eof()) { ifs.getline(line, sizeof(line)); if (!ifs.good()) { break; } if (0 == ifs.gcount()) { continue; } if (parse_serial(line, ifs.gcount() - 1, match_words, serial_no)) { break; } } ifs.close(); } static bool get_disk_serial_by_way_3(const std::string & disk_name, std::string & serial_no) { serial_no.c_str(); const char * hdparm_result = ".hdparm_result.txt"; char command[512] = { 0 }; snprintf(command, sizeof(command), "sudo hdparm -i %s | grep SerialNo > %s", disk_name.c_str(), hdparm_result); if (0 == system(command)) { get_serial(hdparm_result, "SerialNo=", serial_no); } unlink(hdparm_result); return(!serial_no.empty()); } static bool get_disk_serial_by_way_4(std::string & serial_no) { serial_no.c_str(); const char * lshw_result = ".lshw_result.txt"; char command[512] = { 0 }; snprintf(command, sizeof(command), "sudo lshw -class disk | grep serial > %s", lshw_result); if (0 == system(command)) { get_serial(lshw_result, "serial:", serial_no); } unlink(lshw_result); return(!serial_no.empty()); } static bool get_disk_serial_number(std::string & serial_no) { if (0 != getuid()) { return(false); } std::string disk_name; if (get_disk_name(disk_name)) { if (get_disk_serial_by_way_1(disk_name, serial_no)) { return(true); } if (get_disk_serial_by_way_2(disk_name, serial_no)) { return(true); } if (get_disk_serial_by_way_3(disk_name, serial_no)) { return(true); } } if (get_disk_serial_by_way_4(serial_no)) { return(true); } return(false); } static void test_1() { std::string serial_no; if (get_disk_serial_number(serial_no)) { printf("serial_number: [%s]\n", serial_no.c_str()); } else { printf("get serial number failed\n"); } } static void test_2() { std::string disk_name; if (get_disk_name(disk_name)) { printf("disk_name:[%s]\n", disk_name.c_str()); { std::string serial_no; get_disk_serial_by_way_1(disk_name, serial_no); printf("get_serial_by_way_1:[%s]\n", serial_no.c_str()); } { std::string serial_no; get_disk_serial_by_way_2(disk_name, serial_no); printf("get_serial_by_way_2:[%s]\n", serial_no.c_str()); } { std::string serial_no; get_disk_serial_by_way_3(disk_name, serial_no); printf("get_serial_by_way_3:[%s]\n", serial_no.c_str()); } } { std::string serial_no; get_disk_serial_by_way_4(serial_no); printf("get_serial_by_way_4:[%s]\n", serial_no.c_str()); } } int main(int argc, char * argv[]) { printf("---------------\n"); test_1(); printf("---------------\n"); test_2(); printf("---------------\n"); return(0); } ``` ``` 主要是想问一下那个最终存储了硬盘序列号的变量是哪个?我对linux下的C不是很熟,求帮忙~谢谢~
vue中使用graphql,刚接触,不太明白,往各位大神指教
XXX.vue ``` import apollo from '../configuration/list.js' .... methods:{ handleList: function() { this.$apollo.query({ query: apollo, variables: { model: this.chooseModelCode || '', name: this.moduleInputName || '', pageSize: this.pageInfo.pageSize || 10, pageNum: this.pageInfo.pageNum || 1 } }).then(res => { console.log(res.data) this.Parse(res.data.result) console.log(res.data.result) }).catch(err => { console.log(err) }) }, } ``` list.js ``` import gql from 'graphql-tag' const apollo = gql `query result($model: String,$name: String,$pageSize: Int!,$pageNum: Int!){ result(model:$model,name:$name,pageSize:$pageSize,pageNum:$pageNum){ list{ name gmtCreate model } pageSize pageNum } }` export default apollo ``` 应该是哪里写的不对,老是报错 Network error: Server response was missing for query 'result'.
急,哪位大神能帮忙,一个莫名其妙的错误!
#include &lt;cstring&gt; using namespace std; template &lt;typename T&gt; class tree_node_t { public: string &to_string(string *result, int prefix = 0); void set_data(const T &data); protected: T m_data; }; 错误报告说:‘string’不是一个类型名 真的莫名其妙!string换成std::string也不行。 vs编译得好好的,不知道g++怎么的,老是这些莫名其妙的错误?哪位高手能指教一下啊?谢谢!
java 程序运行出现String index out of range: -1异常请各位大神指教
import java.awt.*; import javax.swing.*; import java.sql.*; import java.awt.event.*; import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; import java.sql.Statement; import java.util.regex.*; import java.util.Random; import static java.awt.BorderLayout.*; import java.io.File; import java.io.IOException; import javax.sound.sampled.AudioFormat; import javax.sound.sampled.AudioInputStream; import javax.sound.sampled.AudioSystem; import javax.sound.sampled.DataLine; import javax.sound.sampled.LineUnavailableException; import javax.sound.sampled.SourceDataLine; import javax.sound.sampled.UnsupportedAudioFileException; public class RobotDemo { final JTextField jtf=new JTextField(10); final JTextField jtf1=new JTextField(10); final JTextField jtf2=new JTextField(10); Link lk,lk1,lk2,lk3,lk4,lk5; ResultSet rs ,rs1,rs2,rs3,rs4,rs5; Statement sta; String answer,res; Random r=new Random(); public void init() { final JFrame jf=new JFrame(); final JPanel jp=new JPanel(); final JPanel jp1=new JPanel(); final JScrollPane jsp=new JScrollPane(jp); jsp.setPreferredSize(new Dimension(300,300)); jsp.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); JSplitPane js=new JSplitPane(JSplitPane.VERTICAL_SPLIT,jsp,jp1); final JPanel jp2=new JPanel(); JButton jb=new JButton("发送"); JButton jb1=new JButton("训练"); JButton jb2=new JButton("确定"); JButton jb3=new JButton("再加一条"); final JDialog jd=new JDialog(jf,"训练"); jf.add(js); jp1.add(jtf); jp1.add(jb); jp1.add(jb1); jd.add(jp2); jp2.add(jtf1); jp2.add(jtf2); jp2.add(jb3); jp2.add(jb2); jb.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { String result=""; String s=jtf.getText(); if(s.equals("")) { JOptionPane.showMessageDialog(null, "不能添加空白内容"); } else if(s.length()<4) { result=find(s); } else { result=find1(s); } StringBuffer str=new StringBuffer(s); int index; for(index=10;index<str.length();index+=11) { str.insert(index,"\n"); } StringBuffer str1=new StringBuffer(result); int index1; for(index1=5;index1<str1.length();index1+=6) { str1.insert(index1,"\n"); } JPanel jp3=new JPanel(); jp3.setPreferredSize(new Dimension(300,50)); JTextPane jta1=new JTextPane(); jta1.setBackground(Color.GREEN); jp3.setLayout(new FlowLayout(FlowLayout.LEFT)); JPanel jp4=new JPanel(); jp4.setPreferredSize(new Dimension(300,50)); JTextPane jta2=new JTextPane(); jta2.setBackground(Color.GREEN); jp4.setLayout(new FlowLayout(FlowLayout.RIGHT)); jp.setLayout(new BoxLayout(jp,BoxLayout.Y_AXIS)); jp.add(jp3); jp.add(jp4); jp3.add(jta1); jp4.add(jta2); jta1.setText(str.toString()); jta2.setText(str1.toString()); } }); jb2.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { String question =jtf1.getText(); String answer=jtf2.getText(); try { if(question.equals("")&&answer.equals("")) { JOptionPane.showMessageDialog(null, "不能添加空白内容"); } else { Statement sta = null; String sql="insert into chat1 values('" +question+ "','" +answer+"')"; lk=new Link(sql); lk.sta.executeUpdate(sql); JOptionPane.showMessageDialog(null, "添加成功"); } } catch(Exception a) { a.printStackTrace(); JOptionPane.showMessageDialog(null, "添加失败"); } finally { lk.closeConn(); } jtf1.setText(""); jtf2.setText(""); } }); jb3.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { String question =jtf1.getText(); String answer=jtf2.getText(); try { if(question.equals("")&&answer.equals("")) { JOptionPane.showMessageDialog(null, "不能添加空白内容"); } else { Statement sta = null; String sql="insert into chat1 values('" +question+ "','" +answer+"')"; lk=new Link(sql); lk.sta.executeUpdate(sql); JOptionPane.showMessageDialog(null, "可以再加一条"); } } catch(Exception a) { a.printStackTrace(); JOptionPane.showMessageDialog(null, "添加失败"); } finally { lk.closeConn(); } jtf2.setText(""); } }); jb1.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { jd.pack(); jd.setVisible(true); } }); jf.pack(); jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); jf.setVisible(true); } public String find(String s) { String result=""; try { String sql="select *from chat"; lk=new Link(sql); rs=lk.sta.executeQuery(sql); while(rs.next()) { String string =new String(rs.getString("question")); if(string.equals(s)||string.contains(s)||s.contains(string)) { try { String sql1="select * from chat where question='"+string+"'"; lk1=new Link(sql1); rs1=lk1.sta.executeQuery(sql1); while(rs1.next()) { result=new String (rs1.getString("answer")); } } catch(Exception e) { e.printStackTrace(); } finally { lk1.closeConn(); } } } } catch(Exception e) { e.printStackTrace(); } finally { lk.closeConn(); } if(result.equals("")) { int i=3; int k=r.nextInt(i); if(k==0) result="你知道穿山甲说了什么吗"; else if(k==1) result="呵呵"; else if(k==2) result="你能说人话吗"; } return result; } public String find1(String s){ Boolean flag=false; char c[]; int j=0,m=0,max=0; String result=null,ans=""; String string[]=new String[100]; String regex="[a-zA-Z0-9,。、;‘【】、=-《》?:的“{}——+|) _(*&……%¥#@!~·哦他她你我了吗嘛呢吧 ]"; Pattern p1=Pattern.compile(regex); Matcher m1=p1.matcher(s); result=m1.replaceAll("").trim(); c=new char[result.length()]; for(int i=0;i<result.length();i++){ c[i]=result.charAt(i); } for(j=0;j<c.length-1;j++){ if(j==0){ try{ String ml="drop table if exists possible"; lk=new Link(ml); lk.sta.executeUpdate(ml); String ml1="create table possible(question varchar(60))"; lk1=new Link(ml1); lk1.sta.executeUpdate(ml1); }catch(Exception e){ e.printStackTrace(); } finally{ lk1.closeConn(); lk.closeConn(); } } try{ String ml2="select *from chat1"; lk2=new Link(ml2); rs2=lk2.sta.executeQuery(ml2); while(rs2.next()){ int i=0; String str=new String (rs2.getString("question")); do{ flag=false; int k=i+1; int ij=i+j; if(ij<c.length){ char c1=str.charAt(i); if(c[ij]==c1&&str.length()==k){ String ml3="insert into possible values('"+str+"')"; lk3=new Link(ml3); lk3.sta.executeUpdate(ml3); } else if(c[ij]==c1&&str.length()!=k){ flag=true; i++; } } }while(flag); } }catch(Exception e2){ e2.printStackTrace(); } finally{ lk2.closeConn(); if(lk3!=null){ lk3.closeConn(); } } } try{ String ml4="select *from possible"; lk4=new Link(ml4); rs4=lk4.sta.executeQuery(ml4); while(rs4.next()){ string[m]=new String(rs4.getString("question")); m++; } if(m!=0){ max=string[0].length(); result=string[0]; for(int k=1;k<=m;k++){ if(max<string[k-1].length()){ result=string[k-1]; max=string[k-1].length(); } } String ml5="select *from chat1 where question='"+result+"'"; lk5=new Link(ml5); rs5=lk5.sta.executeQuery(ml5); while(rs5.next()){ ans=new String(rs5.getString("answer")); } } else{ int i=4; int k=r.nextInt(i); if(k==0){ ans="你要干嘛"; }else if(k==1){ ans="你是外星人吗"; }else if(k==2){ ans="你再这样我不理你了"; } } }catch(Exception ea){ ea.printStackTrace(); } finally{ lk4.closeConn(); if(lk5!=null){ lk5.closeConn(); } } if(ans.equals("")){ ans="你TM在逗我吗"; } return ans; } public static void main(String[] args) { new RobotDemo().init(); String MUSIC_FILE="相逢一笑.wav"; try { AudioInputStream audioInputStream= AudioSystem.getAudioInputStream(new File(MUSIC_FILE)); AudioFormat audioFormat=audioInputStream.getFormat(); DataLine.Info dataLineInfo=new DataLine.Info(SourceDataLine.class,audioFormat,AudioSystem.NOT_SPECIFIED); SourceDataLine sourceDataLine=(SourceDataLine)AudioSystem.getLine(dataLineInfo); sourceDataLine.open(audioFormat); sourceDataLine.start(); int count; byte tempBuffer[]=new byte[1024]; while ((count = audioInputStream.read(tempBuffer, 0, tempBuffer.length)) != -1) { if(count>0) { sourceDataLine.write(tempBuffer,0,count); } } sourceDataLine.drain(); sourceDataLine.close(); } catch(Exception a) { a.printStackTrace(); } } } 异常信息 java.lang.StringIndexOutOfBoundsException: String index out of range: -1 at java.lang.String.charAt(Unknown Source) at RobotDemo.find1(RobotDemo.java:294) at RobotDemo$1.actionPerformed(RobotDemo.java:73) at javax.swing.AbstractButton.fireActionPerformed(Unknown Source) at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source) at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source) at javax.swing.DefaultButtonModel.setPressed(Unknown Source) at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source at java.awt.Component.processMouseEvent(Unknown Source) at javax.swing.JComponent.processMouseEvent(Unknown Source) at java.awt.Component.processEvent(Unknown Source) at java.awt.Container.processEvent(Unknown Source) at java.awt.Component.dispatchEventImpl(Unknown Source) at java.awt.Container.dispatchEventImpl(Unknown Source) at java.awt.Component.dispatchEvent(Unknown Source) at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source) at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source) at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source) at java.awt.Container.dispatchEventImpl(Unknown Source) at java.awt.Window.dispatchEventImpl(Unknown Source) at java.awt.Component.dispatchEvent(Unknown Source) at java.awt.EventQueue.dispatchEventImpl(Unknown Source) at java.awt.EventQueue.access$200(Unknown Source) at java.awt.EventQueue$3.run(Unknown Source) at java.awt.EventQueue$3.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source at java.awt.EventQueue$4.run(Unknown Source) at java.awt.EventQueue$4.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source at java.awt.EventQueue.dispatchEvent(Unknown Source) at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.run(Unknown Source)
SSH框架报错找不到action,求大神指教
我是用 ``` <a class="more" href="/stage/charge/ordershow.action"> ``` 跳转,但是报There is no Action mapped for action name ordershow.错,新手求指教 错误: ``` 六月 06, 2016 11:32:02 上午 com.opensymphony.xwork2.util.logging.commons.CommonsLogger warn 警告: Could not find action or result There is no Action mapped for action name ordershow. - [unknown location] at com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:189) at org.apache.struts2.impl.StrutsActionProxy.prepare(StrutsActionProxy.java:61) at org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:39) at com.opensymphony.xwork2.DefaultActionProxyFactory.createActionProxy(DefaultActionProxyFactory.java:58) at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:475) at org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77) at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:91) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79) at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:521) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1096) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:674) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1500) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1456) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:745) ``` strust.xml配置: ``` <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.1//EN" "http://struts.apache.org/dtds/struts-2.1.dtd"> <struts> <constant name="struts.enable.DynamicMethodInvocation" value="false" /> <constant name="struts.devModel" value="true" /> <include file="json-default.xml" /> <include file="struts-default.xml" /> <package name="login" extends="json-default"> <action name="ordershow" class="orderAction" method="show"> <result name="show">/stage/order/order_info.jsp</result> </action> </package> <constant name="struts.i18n.encoding" value="UTF-8" /> <constant name="struts.locale" value="zh_CN" /> <constant name="struts.ui.theme" value="simple" /> <constant name="struts.ui.templateDir" value="template" /> <constant name="struts.ui.templateSuffix" value="ftl" /> </struts> ``` web.xml: ``` <?xml version="1.0" encoding="UTF-8" ?> <web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"> <display-name></display-name> <welcome-file-list> <welcome-file>index.jsp</welcome-file> </welcome-file-list> <filter> <filter-name>struts2</filter-name> <filter-class> org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter </filter-class> </filter> <filter-mapping> <filter-name>struts2</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> <filter-mapping> <filter-name>struts2</filter-name> <url-pattern>*.jsp</url-pattern> </filter-mapping> <filter-mapping> <filter-name>struts2</filter-name> <url-pattern>*.action</url-pattern> </filter-mapping> <listener> <listener-class> org.springframework.web.context.ContextLoaderListener </listener-class> </listener> <context-param> <param-name>contextConfigLocation</param-name> <param-value> classpath:/spring-*.xml </param-value> </context-param> </web-app> ``` jsp: ``` <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> <%@ taglib uri="/struts-tags" prefix="s"%> <% String path = request.getContextPath(); String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/"; %> <!DOCTYPE html> <!--[if IE 8]> <html lang="en" class="ie8"> <![endif]--> <!--[if IE 9]> <html lang="en" class="ie9"> <![endif]--> <!--[if !IE]><!--> <html lang="en"> <!--<![endif]--> <!-- BEGIN HEAD --> <head> <meta charset="utf-8" /> <title>Ttuo-Hotel | 酒店管理系统</title> <meta content="width=device-width, initial-scale=1.0" name="viewport" /> <meta content="" name="description" /> <meta content="" name="author" /> <link href="../assets/bootstrap/css/bootstrap.min.css" rel="stylesheet" /> <link href="../assets/css/metro.css" rel="stylesheet" /> <link href="../assets/bootstrap/css/bootstrap-responsive.min.css" rel="stylesheet" /> <link href="../assets/font-awesome/css/font-awesome.css" rel="stylesheet" /> <link href="../assets/fullcalendar/fullcalendar/bootstrap-fullcalendar.css" rel="stylesheet" /> <link href="../assets/css/main_style.css" rel="stylesheet" /> <link href="../assets/css/style_responsive.css" rel="stylesheet" /> <link href="../assets/css/style_default.css" rel="stylesheet" id="style_color" /> <link rel="stylesheet" type="text/css" href="../assets/chosen-bootstrap/chosen/chosen.css" /> <link rel="stylesheet" type="text/css" href="../assets/uniform/css/uniform.default.css" /> <link rel="shortcut icon" href="../favicon.ico" /> </head> <!-- END HEAD --> <!-- BEGIN BODY --> <body class="fixed-top"> <!-- BEGIN HEADER --> <div class="header navbar navbar-inverse navbar-fixed-top"> <!-- BEGIN TOP NAVIGATION BAR --> <div class="navbar-inner"> <div class="container-fluid"> <!-- BEGIN LOGO --> <a class="brand" href="index.html"> <img src="../assets/img/logo11.png" alt="logo" /> </a> <!-- END LOGO --> <!-- BEGIN RESPONSIVE MENU TOGGLER --> <a href="javascript:;" class="btn-navbar collapsed" data-toggle="collapse" data-target=".nav-collapse"> <img src="../assets/img/menu-toggler.png" alt="" /> </a> <!-- END RESPONSIVE MENU TOGGLER --> <!-- BEGIN TOP NAVIGATION MENU --> <ul class="nav pull-right"> <!-- BEGIN NOTIFICATION DROPDOWN --> <li class="dropdown" id="header_notification_bar"><a href="#" class="dropdown-toggle" data-toggle="dropdown"> <i class="icon-warning-sign"></i> <span class="badge">6</span> </a> <ul class="dropdown-menu extended notification"> <li> <p>You have 14 new notifications</p> </li> <li><a href="javascript:;" onclick=App.onNotificationClick(1);> <span class="label label-success"><i class="icon-plus"></i> </span> New user registered. <span class="time">Just now</span> </a> </li> <li><a href="#"> <span class="label label-important"><i class="icon-bolt"></i> </span> Server #12 overloaded. <span class="time">15 mins</span> </a> </li> <li><a href="#"> <span class="label label-warning"><i class="icon-bell"></i> </span> Server #2 not respoding. <span class="time">22 mins</span> </a> </li> <li><a href="#"> <span class="label label-info"><i class="icon-bullhorn"></i> </span> Application error. <span class="time">40 mins</span> </a> </li> <li><a href="#"> <span class="label label-important"><i class="icon-bolt"></i> </span> Database overloaded 68%. <span class="time">2 hrs</span> </a> </li> <li><a href="#"> <span class="label label-important"><i class="icon-bolt"></i> </span> 2 user IP blocked. <span class="time">5 hrs</span> </a> </li> <li class="external"><a href="#">See all notifications <i class="m-icon-swapright"></i> </a> </li> </ul> </li> <!-- END NOTIFICATION DROPDOWN --> <!-- BEGIN INBOX DROPDOWN --> <li class="dropdown" id="header_inbox_bar"><a href="#" class="dropdown-toggle" data-toggle="dropdown"> <i class="icon-envelope-alt"></i> <span class="badge">5</span> </a> <ul class="dropdown-menu extended inbox"> <li> <p>You have 12 new messages</p> </li> <li><a href="#"> <span class="photo"><img src="../assets/img/avatar2.jpg" alt="" /> </span> <span class="subject"> <span class="from">Lisa Wong</span> <span class="time">Just Now</span> </span> <span class="message"> Vivamus sed auctor nibh congue nibh. auctor nibh auctor nibh... </span> </a> </li> <li><a href="#"> <span class="photo"><img src="../assets/img/avatar3.jpg" alt="" /> </span> <span class="subject"> <span class="from">Richard Doe</span> <span class="time">16 mins</span> </span> <span class="message"> Vivamus sed congue nibh auctor nibh congue nibh. auctor nibh auctor nibh... </span> </a> </li> <li><a href="#"> <span class="photo"><img src="../assets/img/avatar1.jpg" alt="" /> </span> <span class="subject"> <span class="from"></span> <span class="time">2 hrs</span> </span> <span class="message"> Vivamus sed nibh auctor nibh congue nibh. auctor nibh auctor nibh... </span> </a> </li> <li class="external"><a href="#">See all messages <i class="m-icon-swapright"></i> </a> </li> </ul> </li> <!-- END INBOX DROPDOWN --> <!-- BEGIN TODO DROPDOWN --> <li class="dropdown" id="header_task_bar"><a href="#" class="dropdown-toggle" data-toggle="dropdown"> <i class="icon-tasks"></i> <span class="badge">5</span> </a> <ul class="dropdown-menu extended tasks"> <li> <p>You have 12 pending tasks</p> </li> <li><a href="#"> <span class="task"> <span class="desc">New release v1.2</span> <span class="percent">30%</span> </span> <span class="progress progress-success "> <span style="width: 30%;" class="bar"></span> </span> </a> </li> <li><a href="#"> <span class="task"> <span class="desc">Application deployment</span> <span class="percent">65%</span> </span> <span class="progress progress-danger progress-striped active"> <span style="width: 65%;" class="bar"></span> </span> </a> </li> <li><a href="#"> <span class="task"> <span class="desc">Mobile app release</span> <span class="percent">98%</span> </span> <span class="progress progress-success"> <span style="width: 98%;" class="bar"></span> </span> </a> </li> <li><a href="#"> <span class="task"> <span class="desc">Database migration</span> <span class="percent">10%</span> </span> <span class="progress progress-warning progress-striped"> <span style="width: 10%;" class="bar"></span> </span> </a> </li> <li><a href="#"> <span class="task"> <span class="desc">Web server upgrade</span> <span class="percent">58%</span> </span> <span class="progress progress-info"> <span style="width: 58%;" class="bar"></span> </span> </a> </li> <li><a href="#"> <span class="task"> <span class="desc">Mobile development</span> <span class="percent">85%</span> </span> <span class="progress progress-success"> <span style="width: 85%;" class="bar"></span> </span> </a> </li> <li class="external"><a href="#">See all tasks <i class="m-icon-swapright"></i> </a> </li> </ul> </li> <!-- END TODO DROPDOWN --> <!-- BEGIN USER LOGIN DROPDOWN --> <li class="dropdown user"><a href="#" class="dropdown-toggle" data-toggle="dropdown"> <img alt="" src="../assets/img/avatar1_small.jpg" /> <span class="username"></span> <i class="icon-angle-down"></i> </a> <ul class="dropdown-menu"> <li><a href="extra_profile.html"><i class="icon-user"></i> 我的信息</a> </li> <li><a href="calendar.html"><i class="icon-calendar"></i> 我的日历</a> </li> <li><a href="#"><i class="icon-tasks"></i> 我的任务</a> </li> <li class="divider"></li> <li><a href="hotel.jsp"><i class="icon-key"></i> 退出登录</a> </li> </ul> </li> <!-- END USER LOGIN DROPDOWN --> </ul> <!-- END TOP NAVIGATION MENU --> </div> </div> <!-- END TOP NAVIGATION BAR --> </div> <!-- END HEADER --> <!-- BEGIN CONTAINER --> <div class="page-container row-fluid"> <!-- BEGIN SIDEBAR --> <div class="page-sidebar nav-collapse collapse"> <!-- BEGIN SIDEBAR MENU --> <ul> <li> <!-- BEGIN SIDEBAR TOGGLER BUTTON --> <div class="sidebar-toggler hidden-phone"></div> <!-- BEGIN SIDEBAR TOGGLER BUTTON --> </li> <li> <!-- BEGIN RESPONSIVE QUICK SEARCH FORM --> <form class="sidebar-search"> <div class="input-box"> <a href="javascript:;" class="remove"></a> <input type="text" placeholder="查询. . ." /> <input type="button" class="submit" value=" " /> </div> </form> <!-- END RESPONSIVE QUICK SEARCH FORM --> </li> <li class="has-sub "> <a href="/hotel/index.jsp"> <i class="icon-home"></i> <span class="title">首页</span> <span class="selected"></span> </a> </li> <li class="start active"> <a href="/hotel/stage/stage.jsp"> <i class="icon-bookmark-empty"></i> <span class="title">前台</span> <span class="arrow "></span> </a> <ul class="sub"> <li><a href="/hotel/stage/charge/charge_info.jsp">入住开单</a></li> <li><a href="/hotel/jie">入住详情</a></li> <li><a href="ordershow.action">预定开单</a></li> <li><a href="/hotel/orderfood/food!food.action">订餐服务</a></li> <li><a href="Vip.action">会员管理</a></li> </ul> </li> <li class="has-sub "> <a href="/hotel/restaurant/catering.jsp"> <i class="icon-th-list"></i> <span class="title">餐饮部</span> <span class="arrow "></span> </a> <ul class="sub"> <li><a href="/hotel/restaurant/basic/basic.jsp">餐饮信息</a> </li> <li><a href="/hotel/restaurant/enter/enter!show.action">采购入库</a> </li> <li><a href="/hotel/restaurant/stock/stock.jsp">库存盘点</a> </li> <li><a href="/hotel/restaurant/purchase/purchase!show.action">取材出库</a> </li> </ul> </li> <li class="has-sub "> <a href="/hotel/room/room.jsp"> <i class="icon-star-empty"></i> <span class="title">客房部</span> <span class="arrow "></span> </a> <ul class="sub"> <li><a href="/hotel/room/basic/basic.jsp">基本设置</a> </li> <li><a href="/hotel/room/roommanage/roommanage.jsp">客房管理</a> </li> <li><a href="/hotel/room/damage/damage!show.action">损坏设备统计</a> </li> </ul> </li> <li class="has-sub "> <a href="javascript:;"> <i class="icon-table"></i> <span class="title">统计</span> <span class="arrow "></span> </a> <ul class="sub"> <li ><a href="statistic/room_pie.jsp">房间总体情况</a></li> <li ><a href="statistic/room_stack.jsp">各类型房间情况</a></li> </ul> </li> <li class="has-sub "> <a href="javascript:;"> <i class="icon-briefcase"></i> <span class="title">部门档案</span> <span class="arrow "></span> </a> <ul class="sub"> <li ><a href="department/deptc!show.action">部门分类</a></li> <li ><a href="department/dept!show.action">部门信息</a></li> <li ><a href="department/staff!show.action">人员档案</a></li> </ul> </li> <li class="has-sub "> <a href="javascript:;"> <i class="icon-map-marker"></i> <span class="title">地图</span> <span class="arrow "></span> </a> <ul class="sub"> <li><a></a></li> </ul> </li> <li class="has-sub "> <a href="javascript:;"> <i class="icon-map-marker"></i> <span class="title">公告</span> <span class="arrow "></span> </a> <ul class="sub"> <li><a></a></li> </ul> </li> <li class="has-sub "> <a href="javascript:;"> <i class="icon-briefcase"></i> <span class="title">其他</span> <span class="arrow "></span> </a> <ul class="sub"> <li><a href="profile/profile.jsp">我的信息</a></li> <li><a href="profile/calendar.jsp">我的日程</a></li> <li><a>我的任务</a></li> </ul> </li> <li class=""> <a href="hotel.jsp"> <i class="icon-user"></i> <span class="title">退出登陆</span> </a> </li> </ul> <!-- END SIDEBAR MENU --> </div> <!-- END SIDEBAR --> <div class="page-content"> <!-- BEGIN PAGE CONTAINER--> <div class="container-fluid"> <!-- BEGIN PAGE HEADER--> <div class="row-fluid"> <div class="span12"> <!-- BEGIN STYLE CUSTOMIZER --> <div class="color-panel hidden-phone"> <div class="color-mode-icons icon-color"></div> <div class="color-mode-icons icon-color-close"></div> <br> <div class="color-mode"> <p>主题 颜色</p> <ul class="inline"> <li class="color-black current color-default" data-style="default"></li> <li class="color-blue" data-style="blue"></li> <li class="color-brown" data-style="brown"></li> <li class="color-purple" data-style="purple"></li> <li class="color-white color-light" data-style="light"></li> </ul> <label class="hidden-phone"> <input type="checkbox" class="header" checked value="" /> <span class="color-mode-label">固定标题</span> </label> </div> </div> <!-- END BEGIN STYLE CUSTOMIZER --> <!-- BEGIN PAGE TITLE & BREADCRUMB--> <h3 class="page-title"> 前台<small>请选择内容进行操作:</small> </h3> <ul class="breadcrumb"> <li><i class="icon-home"></i> <a href="/hotel/index.jsp">首页</a> <i class="icon-angle-right"></i> </li> <li><a href="javascript:;">前台</a> </li> </ul> <!-- END PAGE TITLE & BREADCRUMB--> </div> </div> <!-- END PAGE HEADER--> <!-- BEGIN PAGE CONTENT--> <div class="row-fluid"> <div class="span12"> <div id="dashboard"> <!-- BEGIN DASHBOARD STATS --> <div class="row-fluid"> <div class="span2 responsive" data-tablet="span6" data-desktop="span2"> <div class="dashboard-stat yellow"> <div class="visual"> <img src="../assets/img/icon/resize_png_new4.png"> </div> <div class="details"> <div class="number">入住开单</div> <div class="desc"></div> </div> <a class="more" href="/hotel/stage/charge/charge_info.jsp"> 点击浏览更多 <i class="m-icon-swapright m-icon-white"></i> </a> </div> </div> <div class="span2 responsive" data-tablet="span6" data-desktop="span2"> <div class="dashboard-stat green"> <div class="visual"> <img src="../assets/img/icon/33216.png"> </div> <div class="details"> <div class="number">入住详情</div> <div class="desc"></div> </div> <a class="more" href="/hotel/jie"> 点击浏览更多 <i class="m-icon-swapright m-icon-white"></i> </a> </div> </div> <div class="span2 responsive" data-tablet="span6 fix-offset" data-desktop="span2"> <div class="dashboard-stat purple"> <div class="visual"> <img src="../assets/img/icon/resize_png_new7.png"> </div> <div class="details"> <div class="number">预定开单</div> <div class="desc"></div> </div> <a class="more" href="/stage/charge/ordershow.action"> 点击浏览更多 <i class="m-icon-swapright m-icon-white"></i> </a> </div> </div> <div class="span2 responsive" data-tablet="span6 fix-offset" data-desktop="span2"> <div class="dashboard-stat green"> <div class="visual"> <img src="../assets/img/icon/548346.png"> </div> <div class="details"> <div class="number">订餐服务</div> <div class="desc"></div> </div> <a class="more" href="/hotel/orderfood/food!food.action"> 点击浏览更多 <i class="m-icon-swapright m-icon-white"></i> </a> </div> </div> <div class="span2 responsive" data-tablet="span6 fix-offset" data-desktop="span2"> <div class="dashboard-stat yellow"> <div class="visual"> <img src="../assets/img/icon/resize_png_new6.png"> </div> <div class="details"> <div class="number">会员管理</div> <div class="desc"></div> </div> <a class="more" href="Vip.action"> 点击浏览更多 <i class="m-icon-swapright m-icon-white"></i> </a> </div> </div> </div> </div> <!-- END DASHBOARD STATS --> </div> </div> </div> <!-- END PAGE CONTENT--> </div> <!-- END PAGE CONTAINER--> </div> <!-- END PAGE --> <!-- BEGIN FOOTER --> <div class="footer"> 2014 &copy; Ttuo-Hotel | by ToTeam <div class="span pull-right"> <span class="go-top"><i class="icon-angle-up"></i> </span> </div> </div> <!-- END FOOTER --> <!-- BEGIN JAVASCRIPTS --> <!-- Load javascripts at bottom, this will reduce page load time --> <script src="../assets/js/jquery-1.8.3.min.js"></script> <script src="../assets/breakpoints/breakpoints.js"></script> <script src="../assets/jquery-slimscroll/jquery-ui-1.9.2.custom.min.js"></script> <script src="../assets/bootstrap/js/bootstrap.min.js"></script> <script src="../assets/js/jquery.blockui.js"></script> <script src="../assets/js/jquery.cookie.js"></script> <script src="../assets/fullcalendar/fullcalendar/fullcalendar.min.js"></script> <script type="text/javascript" src="../assets/uniform/jquery.uniform.min.js"></script> <script type="text/javascript" src="../assets/chosen-bootstrap/chosen/chosen.jquery.min.js"></script> <!-- ie8 fixes --> <!--[if lt IE 9]> <script src="assets/js/excanvas.js"></script> <script src="assets/js/respond.js"></script> <![endif]--> <script src="../assets/js/app.js"></script> <script> jQuery(document).ready(function() { // initiate layout and plugins App.setPage('calendar'); App.init(); }); </script> <!-- END JAVASCRIPTS --> </body> <!-- END BODY --> </html> ``` ``` ``` java文件: ``` package com.hotel.action.stage; import java.util.ArrayList; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.context.annotation.Scope; import org.springframework.stereotype.Controller; import com.hotel.entity.stage.Orderlist; import com.hotel.entity.stage.RoomAll; import com.hotel.service.stage.OrderService; import com.hotel.utils.Encode; import com.opensymphony.xwork2.ActionSupport; @Controller("orderAction") @Scope("prototype") public class OrderAction extends ActionSupport { @Autowired @Qualifier("orderService") private OrderService os; private Orderlist orderlist = new Orderlist(); private ArrayList<Orderlist> list1 = new ArrayList<Orderlist>(); ArrayList<RoomAll> list2 = new ArrayList<RoomAll>(); private String idds; private int id; private String number; public String save() { orderlist.setName(Encode.toutf8(orderlist.getName())); os.save(orderlist, idds); return "order1"; } public String show() { list1 = os.show(); return "show"; } public String getone() { list2 = os.getone(number); return "get1"; } public String getNumber() { return number; } public void setNumber(String number) { this.number = number; } public int getId() { return id; } public void setId(int id) { this.id = id; } public Orderlist getOrderlist() { return orderlist; } public ArrayList<Orderlist> getList1() { return list1; } public void setList1(ArrayList<Orderlist> list1) { this.list1 = list1; } public void setOrderlist(Orderlist orderlist) { this.orderlist = orderlist; } public String getIdds() { return idds; } public void setIdds(String idds) { this.idds = idds; } public ArrayList<RoomAll> getList2() { return list2; } public void setList2(ArrayList<RoomAll> list2) { this.list2 = list2; } } ``` 程序结构: ![图片说明](https://img-ask.csdn.net/upload/201606/06/1465185272_322367.png) jsp文件位置: ![图片说明](https://img-ask.csdn.net/upload/201606/06/1465185442_652255.png) jar包: ![图片说明](https://img-ask.csdn.net/upload/201606/06/1465185533_60648.png) ![图片说明](https://img-ask.csdn.net/upload/201606/06/1465185546_855720.png)
求助大神:c语言求最长公共子序列问题
我写的这个能正确求出最长序列元素个数但是输出的最长序列却是乱码,求大神指教。代码如下: #include<stdio.h> #include<stdlib.h> #include<string.h> #define MAX 101 int Long(char a[],char b[],char result[] ) { int m,n; m=strlen(a); n=strlen(b); int str[MAX][MAX]; int i,j,sum; for(i=0;i<=m;i++) { str[i][0]=0; } for(i=0;i<=n;i++) { str[0][i]=0; } for(i=1;i<=m;i++) { for(j=1;j<=n;j++) { if(a[i-1]==b[j-1]) { str[i][j]=str[i-1][j-1]+1; } else if(str[i-1][j]<str[i][j-1]) { str[i][j]=str[i][j-1]; } else { str[i][j]=str[i-1][j]; } } } sum=str[m][n]; return sum; result[sum]='\0'; while(sum>=1) { if(a[m-1]==b[n-1]) { result[--sum]=a[m-1]; m--; n--; } else if(str[m-1][n]<str[m][n-1]) { n--; } else { m--; } } } int main(void) { char a[MAX],b[MAX]; char result[MAX]; int i; printf("请输入数组a:\n"); gets(a); printf("请输入数组b:\n"); gets(b); Long(a,b,result); printf("%d\n",Long(a,b,result)); printf("%s",result); system("PAUSE"); return 0; }
使用接口的引用指向它实现类对象的好处是什么/
比如:一个Result接口,他的实现类是ResultImp 会有这样的操作:Result result = new ResultImp(); 请问上面这种操作的好处是啥?请各位大神指教~
程序莫名崩了,请大家指教
下面这段代码在跑的时候可以运行处结果,但是在结束的时候总是会出错,不知道是为什么,请各路大神指教 // 3_1.cpp: 定义控制台应用程序的入口点。 // #include "stdafx.h" #include<iostream> #include<string> using namespace std; int array_set(string a, int result[], int b) { int len_result; int len_a = 0; while (a[len_a] != '\0') len_a += 1; if (a == "*") { for (int i = 0; i < b; i++) { result[i] = i + 1; } len_result = b; } else { int num = 0; len_result = 0; for (int i = 0; i < len_a; i++) { if (a[i] == '-') { result[0] = num; result[1] = -1; len_result = 2; num = 0; continue; } if (a[i] == ',') { result[len_result] = num; len_result += 1; num = 0; continue; } num = num * 10 + int(a[i] - 48); } result[len_result] = num; len_result += 1; } if (result[1] == -1) { len_result = result[2] - result[0] + 1; for (int i = 0; i < len_result; i++) result[i] = i + result[0]; } for (int i = 0; i < len_result; i++) std::cout << result[i] << " "; std::cout << endl; return len_result; } int main() { int n; cin >> n; string times[6];//这些即为所要求的时间 int num = n; for (int i = 0; i < num; i++) { int len_mon; int len_d; int len_h; int len_min; //将要求的时间输入进来 for (int j = 0; j < 6; j++) { cin >> times[j]; } int month[12]; len_mon = array_set(times[3], month, 12); int day[31]; len_d = array_set(times[2], day, 31); int hour[10]; len_h = array_set(times[1], hour, 24); int minute[10]; len_min = array_set(times[0], minute, 60); } return 0; }
tradaboost以分类正确与否进行权重更新,想做成回归加权重分析,求大神指教
``` for l=1:M % 训练支持向量机 Wc=[Ws;Wt]; Wc=Wc/(sum(Wc))'; svm = svmTrain('svc_c',X,Y,ker,C,Wc); Ydt = svmSim(svm,xt); Yt=sign(Ydt); Result = ~~abs(Yt-yt) ; % 错误分类显示为1 p=Wt'.*Result; e(l) = sum(p); ```
httpclient 只能抽取第一页数据
HttpClient client = HttpClients.createDefault(); HttpGet get = new HttpGet("http://qichacha.com/search_hangye?industryCode=A&industryorder=0&p=1"); HttpResponse response = client.execute(get); HttpEntity entity = response.getEntity(); InputStream is=entity.getContent(); String result=EntityUtils.toString(entity,"utf-8"); // getHref(result); System.out.println(result); 网址1:http://qichacha.com/search_hangye?industryCode=A&industryorder=0&p=1 网址2:http://qichacha.com/search_hangye?industryCode=A&industryorder=0&p=2 为什么输入两个网址抓取的数据一样?求哪位大神指教,谢谢!
android静默安装问题,求大神们进来指点。
最新公司需求写一个静默安装的功能,本人在网上找了很多代码,也都在root过的手机里面实验过。但是没有用现在贴上代码 Process process = Runtime.getRuntime().exec("sh"); DataOutputStream dos = new DataOutputStream(process.getOutputStream()); cmd = String.valueOf(cmd); dos.writeBytes(cmd + "\n"); dos.flush(); dos.writeBytes("exit\n"); dos.flush(); dos.close(); process.waitFor(); int result = process.exitValue(); Log.i("result", "result:"+result); return (Integer) result; 这里result的返回值是137.不知道是什么原因。求大神指点。。。 另外还有上面Runtime.getRuntime().exec("sh");这里以前是写的su,但是代码会报一个java.io.ioException:write fail:peipe(broken pipe); 本人才学习android,所以请大家多多指教。
我如下遍历之后添加一级菜单没事,但是添加二级的时候菜单的值就是未定义,可以成功添加到数据库,求大神指教
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> <% String path = request.getContextPath(); String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/"; %> <link rel="stylesheet" type="text/css" href="css/shopbs/catalogDesign.css"> <div class="addDirectory-content"> <div class="addDirectory" id="addDirectoryNavigation"> <div class="addDirectoryLeft"> <label id="labels">添加菜单<img src="img/order/jia (2).png" /></label> </div> <div class=addDirectoryRight> <button type="button" onclick="addShopmenus()">保存</button> </div> </div> <div class="addMenu"> <c:forEach items="${shopmenulist }" var="navigations"> <div class="aNavigationBar aNavigationBar-list"> <ul class="clearfix navigationOne"> <li class="oneType">一级菜单</li> <li>名称&nbsp:&nbsp<span>${navigations.name }</span></li> <li>序号&nbsp:&nbsp<span>${navigations.sort }</span></li> <li>类型&nbsp:&nbsp<span>${navigations.type }</span></li> <li><form id="shopmenus_id" method="post"> <label for="select"> </label> <select name="select">操作 <option value="1">修改</option> </select> <input type="text" id="shopmenu_name" name="name" value="${navigations.name}"> <input type="text" id="shopmenu_sort" name="sort" value="${navigations.sort}"> <input type="text" id="shopmenu_type" name="type" value="${navigations.type}"> <input type="hidden" id="shopmenu_id" name="id" value="${navigations.id}"> <input type="button" value="保存" onclick="updatemenus_first()"> </form></li> <li class="addNavigation"><img src="img/order/jia (2).png" title="添加二级菜单" onclick="getId('${navigations.id}');" /></li> </ul> <div class="navigationTwo"> <c:forEach items="${navigations.submenus }" var="list"> <ul class="clearfix"> <li class="oneType">二级菜单</li> <li>名称&nbsp:&nbsp<span>${list.name }</span></li> <li>序号&nbsp:&nbsp<span>${list.sort }</span></li> <li>类型&nbsp:&nbsp<span>${list.type }</span></li> <li> <form id="secondsmenus" method="post"> <label for="select"> </label> <select name="select">操作 <option value="1">修改</option> </select> <input type="text" id="list_name" name="name" value="${list.name }"> <input type="text" id="list_sort" name="sort" value="${list.sort }"> <input type="text" id="list_type" name="type" value="${list.type }"> <input type="hidden" id="list_id" name="name" value="${list.id }"> <input type="button" value="保存" onclick="updatemenus_second()"> </form> </li> <li class="addNavigation"> <!-- <img src="img/order/jia (2).png" /> --> </li> </ul> </c:forEach> <ul class="clearfix addnavigationTwo"> <li class="oneType">二级菜单</li> <li>名称&nbsp:&nbsp<input id="shopname" name="name" /></li> <li>序号&nbsp:&nbsp<input id="${navigations.id }" name="sort" /></li> <li>类型&nbsp:&nbsp<input id="shoptype" name="type" value="0" /></li> <li> <form name="form1" method="post"> <label for="select"> </label> <select name="select"> <option value="1">操作</option> <option value="2">删除</option> <option value="3">修改</option> </select> </form> </li> <li class="addNavigation"> <!-- <img src="img/order/jia (2).png" /> --> </li> </ul> </div> </div> </c:forEach> </div> <div class="aNavigationBar" id="addAbusinessCategory"> <ul class="clearfix"> <li class="oneType">一级菜单</li> <li>名称&nbsp:&nbsp<input id="first_names" name="name" /></li> <li>序号&nbsp:&nbsp<input id="first_sorts" name="sort" /></li> <li>类型&nbsp:&nbsp<input id="first_types" name="type" value="0" /></li> <li> <form name="form1" method="post"> <label for="select"> </label> <select name="select"> <option value="1">操作</option> <option value="2">删除</option> <option value="3">修改</option> </select> </form> </li> <li class="addNavigation"><img src="img/order/jia (2).png" /></li> </ul> </div> <input type="hidden" id="shopmenu_shopId"> </div> <script type="text/javascript"> $("#addDirectoryNavigation").mouseover(function() { $("#addDirectoryLeft .addDirectoryLeft").show(); }).mouseleave(function() { $("#addDirectoryLeft .addDirectoryLeft").hide(); }) $("#addDirectoryNavigation .addDirectoryLeft label").click(function() { $(".aNavigationBar").show(); }); $(" .addNavigation img").click(function() { $("#twoTypesOfBusinesses").show(); }); $(function() { $(".aNavigationBar").on( "click", ".addNavigation", function() { $(this).parents(".aNavigationBar") .find(".addnavigationTwo").show(); }); }); function getId(id, index) { $("#shopmenu_shopId").val(id); } function addShopmenus() { var parinfo = $("#shopmenu_shopId").val(); $("#shopmenu_shopId").val(""); if (parinfo == "" || parinfo == null) { $.ajax({ type : "POST", url : "merchantcenter/addcatalogDesign", data : { name : $("#first_names").val(), sort : $("#first_sorts").val(), type : $("#first_types").val(), }, success : function(result) { if (result.status == 1) { alertMsg.correct("添加一级菜单成功"); $("#navigationDesign").click(); } else { alertMsg.error("非法操作"); } } }); } else { $.ajax({ type : "POST", url : "merchantcenter/addsubshopmenu", data : { name : $("#shopname").val(), sort : $("#" + parinfo + "").val(), parentId : parinfo, type : $("#shoptype").val(), }, success : function(result) { if (result.status == 1) { alertMsg.correct("添加二级菜单成功"); $("#navigationDesign").click(); } else { alertMsg.error("非法操作"); } } }); } } function updatemenus_first() { $.ajax({ type : "POST", url : "merchantcenter/updateShopmenus", data : { id : $("#shopmenu_id").val(), name : $("#shopmenu_name").val(), sort : $("#shopmenu_sort").val(), type : $("#shopmeun_type").val(), }, success : function(result) { if (result.status == 1) { alertMsg.correct("更新一级菜单成功"); $("#navigationDesign").click(); } else { alertMsg.error("更新失败"); } } }); } function updatemenus_second() { $.ajax({ type : "POST", url : "merchantcenter/updateShopmenus", data : { id : $("#list_id").val(), name : $("#list_name").val(), sort : $("#list_sort").val(), type : $("#list_type").val(), }, success : function(result) { if (result.status == 1) { alertMsg.correct("更新二级菜单成功"); $("#navigationDesign").click(); } else { alertMsg.error("更新失败"); } } }); } </script> 这是前台遍历与添加菜单的代码 /** * 跳转目录设计 */ @RequestMapping(value = "/tocatalogDesign") public ModelAndView tocatalogDesign(HttpServletRequest request) { Map<String, Object> result = new HashMap<String, Object>(); Shop shop = (Shop)request.getSession().getAttribute("shop"); List<Shopmenu>shopmenulist = shopmenuService.queryBySqlQuery("from Shopmenu sm where sm.parentId is null and sm.type=0 and sm.shop.id=?", new Object[]{shop.getId()}); result.put("shopmenulist", shopmenulist); return new ModelAndView("shopbs/order/catalogDesign",result); } /** * 目录设计 一级菜单 */ @RequestMapping(value="/addcatalogDesign",method = RequestMethod.POST) @ResponseBody public Map<String, Object> addcatalogDesign (HttpServletRequest request,Shopmenu shopmenu){ System.out.println("进入非法"); Map<String, Object>result = new HashMap<String,Object>(); Shop shop = (Shop)request.getSession().getAttribute("shop"); String warnInfo = ""; int status = 0; if(Common.isNull(shopmenu.getParentId())){ shopmenu.setShop(shop); shopmenu.setType(0); shopmenuService.save(shopmenu); warnInfo = "添加一级菜单成功"; status = 1; } result.put("warnInfo", warnInfo); result.put("status", status); return result; } /** * 目录设计 二级菜单 */ @RequestMapping(value="/addsubshopmenu",method = RequestMethod.POST) @ResponseBody public Map<String, Object> addsubshopmenu(HttpServletRequest request,Shopmenu shopmenu){ System.out.println("进入合法"); Map<String, Object>result = new HashMap<String,Object>(); Shop shop = (Shop)request.getSession().getAttribute("shop"); String warnInfo = ""; int status = 0; if(!Common.isNull(shopmenu.getParentId())){ shopmenu.setShop(shop); shopmenu.setType(0); shopmenuService.save(shopmenu); warnInfo = "添加二级菜单成功"; status = 1; }else{ warnInfo = "非法操作"; } result.put("warnInfo", warnInfo); result.put("status", status); return result; } 这是后台查询及添加菜单代码
在leetcode上提交zigzag后,一直爆出RE错误,感觉应该没有越界?
RT,原题在这:https://oj.leetcode.com/problems/zigzag-conversion/ 很简单的一个程序,就是横排字符串改成折线字符串,然后横排输出 我的程序在VS2012上 debug模式下自己测试没找到错误,但是提交上去之后, 就报Runtime-error,百思不得其解,求大神指教解救! ``` char *convert(char *s, int nRows) { long len=strlen(s); char *result=NULL; long i,j,k; i=1;j=0;k=0; result=(char *)malloc((len+1)); if(nRows<=1||len==0) {return s;} else { if(result!=NULL) { for(i=1,j=0,k=0;i<=nRows;i++)//这个是判断要求折成几行的,就循环几次 { for(k=i-1;k<len;k+=(nRows*2-2))//每行的循环,从最左侧元素开始往后计算 { result[j++]=s[k]; if(i>1 && i<nRows) { if((k+nRows*2-i*2)<len) { result[j++]=s[k+nRows*2-i*2];//每一行的折线元素的位置是之前的直线元 //素位置加上nRows*2-i*2,这个公式没错 } } } } result[j]='\0'; } return result; } } ``` 当前显示输入是 "A",1 没有给出输出,错误信息只有RE,别的都没有
项目中自定义的拦截器在没有接口请求的时候为什么一直在执行
在我看来,拦截器应该是接收到一个请求后才会执行,但是为什么我在项目中自定义的这个拦截器在没有任何接口去请求的时候也一直在执行啊?求大神指教呀~ 下面是我的代码和后台打印的日志 ``` package com.test.user.interceptor import com.test.common.ErrMsg import com.test.common.Result import com.test.common.Sessions import com.test.common.constant.IbErrMsg import org.slf4j.LoggerFactory import org.springframework.web.servlet.HandlerInterceptor import javax.servlet.http.HttpServletRequest import javax.servlet.http.HttpServletResponse import javax.validation.constraints.NotNull class LoginInterceptor : HandlerInterceptor { private val logger = LoggerFactory.getLogger(LoginInterceptor::class.java) override fun preHandle(@NotNull request: HttpServletRequest, @NotNull response: HttpServletResponse, @NotNull handler: Any): Boolean { val requestUri = request.requestURI if (requestUri == "/open/user/pwdLogin_v2") { return true } //登录鉴定 val session = request.session if (session == null) { logger.warn("session为空...") err(response, IbErrMsg.SESSION_ID_ERR) return false } val userDetails = Sessions.getUserDetails(session) if (userDetails == null) { logger.warn("session中用户信息为空!") err(response, IbErrMsg.NOT_LOGIN_IN) return false } return true } private fun err(response: HttpServletResponse, msg: ErrMsg) { response.contentType = "application/json;charset=UTF-8" val err: Result<Unit> = Result.error(msg) val writer = response.writer writer.println(err) } } ``` ![图片说明](https://img-ask.csdn.net/upload/201911/06/1573032903_10927.png)
大学四年自学走来,这些私藏的实用工具/学习网站我贡献出来了
大学四年,看课本是不可能一直看课本的了,对于学习,特别是自学,善于搜索网上的一些资源来辅助,还是非常有必要的,下面我就把这几年私藏的各种资源,网站贡献出来给你们。主要有:电子书搜索、实用工具、在线视频学习网站、非视频学习网站、软件下载、面试/求职必备网站。 注意:文中提到的所有资源,文末我都给你整理好了,你们只管拿去,如果觉得不错,转发、分享就是最大的支持了。 一、电子书搜索 对于大部分程序员...
在中国程序员是青春饭吗?
今年,我也32了 ,为了不给大家误导,咨询了猎头、圈内好友,以及年过35岁的几位老程序员……舍了老脸去揭人家伤疤……希望能给大家以帮助,记得帮我点赞哦。 目录: 你以为的人生 一次又一次的伤害 猎头界的真相 如何应对互联网行业的「中年危机」 一、你以为的人生 刚入行时,拿着傲人的工资,想着好好干,以为我们的人生是这样的: 等真到了那一天,你会发现,你的人生很可能是这样的: ...
《MySQL 性能优化》之理解 MySQL 体系结构
本文介绍 MySQL 的体系结构,包括物理结构、逻辑结构以及插件式存储引擎。
python自动下载图片
近日闲来无事,总有一种无形的力量萦绕在朕身边,让朕精神涣散,昏昏欲睡。 可是,像朕这么有职业操守的社畜怎么能在上班期间睡瞌睡呢,我不禁陷入了沉思。。。。 突然旁边的IOS同事问:‘嘿,兄弟,我发现一个网站的图片很有意思啊,能不能帮我保存下来提升我的开发灵感?’ 作为一个坚强的社畜怎么能说自己不行呢,当时朕就不假思索的答应:‘oh, It’s simple. Wait for me for a ...
一名大专同学的四个问题
【前言】   收到一封来信,赶上各种事情拖了几日,利用今天要放下工作的时机,做个回复。   2020年到了,就以这一封信,作为开年标志吧。 【正文】   您好,我是一名现在有很多困惑的大二学生。有一些问题想要向您请教。   先说一下我的基本情况,高考失利,不想复读,来到广州一所大专读计算机应用技术专业。学校是偏艺术类的,计算机专业没有实验室更不用说工作室了。而且学校的学风也不好。但我很想在计算机领...
复习一周,京东+百度一面,不小心都拿了Offer
京东和百度一面都问了啥,面试官百般刁难,可惜我全会。
达摩院十大科技趋势发布:2020 非同小可!
【CSDN编者按】1月2日,阿里巴巴发布《达摩院2020十大科技趋势》,十大科技趋势分别是:人工智能从感知智能向认知智能演进;计算存储一体化突破AI算力瓶颈;工业互联网的超融合;机器间大规模协作成为可能;模块化降低芯片设计门槛;规模化生产级区块链应用将走入大众;量子计算进入攻坚期;新材料推动半导体器件革新;保护数据隐私的AI技术将加速落地;云成为IT技术创新的中心 。 新的画卷,正在徐徐展开。...
轻松搭建基于 SpringBoot + Vue 的 Web 商城应用
首先介绍下在本文出现的几个比较重要的概念: 函数计算(Function Compute): 函数计算是一个事件驱动的服务,通过函数计算,用户无需管理服务器等运行情况,只需编写代码并上传。函数计算准备计算资源,并以弹性伸缩的方式运行用户代码,而用户只需根据实际代码运行所消耗的资源进行付费。Fun: Fun 是一个用于支持 Serverless 应用部署的工具,能帮助您便捷地管理函数计算、API ...
Python+OpenCV实时图像处理
目录 1、导入库文件 2、设计GUI 3、调用摄像头 4、实时图像处理 4.1、阈值二值化 4.2、边缘检测 4.3、轮廓检测 4.4、高斯滤波 4.5、色彩转换 4.6、调节对比度 5、退出系统 初学OpenCV图像处理的小伙伴肯定对什么高斯函数、滤波处理、阈值二值化等特性非常头疼,这里给各位分享一个小项目,可通过摄像头实时动态查看各类图像处理的特点,也可对各位调参、测试...
2020年一线城市程序员工资大调查
人才需求 一线城市共发布岗位38115个,招聘120827人。 其中 beijing 22805 guangzhou 25081 shanghai 39614 shenzhen 33327 工资分布 2020年中国一线城市程序员的平均工资为16285元,工资中位数为14583元,其中95%的人的工资位于5000到20000元之间。 和往年数据比较: yea...
为什么猝死的都是程序员,基本上不见产品经理猝死呢?
相信大家时不时听到程序员猝死的消息,但是基本上听不到产品经理猝死的消息,这是为什么呢? 我们先百度搜一下:程序员猝死,出现将近700多万条搜索结果: 搜索一下:产品经理猝死,只有400万条的搜索结果,从搜索结果数量上来看,程序员猝死的搜索结果就比产品经理猝死的搜索结果高了一倍,而且从下图可以看到,首页里面的五条搜索结果,其实只有两条才是符合条件。 所以程序员猝死的概率真的比产品经理大,并不是错...
害怕面试被问HashMap?这一篇就搞定了!
声明:本文以jdk1.8为主! 搞定HashMap 作为一个Java从业者,面试的时候肯定会被问到过HashMap,因为对于HashMap来说,可以说是Java集合中的精髓了,如果你觉得自己对它掌握的还不够好,我想今天这篇文章会非常适合你,至少,看了今天这篇文章,以后不怕面试被问HashMap了 其实在我学习HashMap的过程中,我个人觉得HashMap还是挺复杂的,如果真的想把它搞得明明白...
毕业5年,我问遍了身边的大佬,总结了他们的学习方法
我问了身边10个大佬,总结了他们的学习方法,原来成功都是有迹可循的。
python爬取百部电影数据,我分析出了一个残酷的真相
2019年就这么匆匆过去了,就在前几天国家电影局发布了2019年中国电影市场数据,数据显示去年总票房为642.66亿元,同比增长5.4%;国产电影总票房411.75亿元,同比增长8.65%,市场占比 64.07%;城市院线观影人次17.27亿,同比增长0.64%。 看上去似乎是一片大好对不对?不过作为一名严谨求实的数据分析师,我从官方数据中看出了一点端倪:国产票房增幅都已经高达8.65%了,为什...
推荐10个堪称神器的学习网站
每天都会收到很多读者的私信,问我:“二哥,有什么推荐的学习网站吗?最近很浮躁,手头的一些网站都看烦了,想看看二哥这里有什么新鲜货。” 今天一早做了个恶梦,梦到被老板辞退了。虽然说在我们公司,只有我辞退老板的份,没有老板辞退我这一说,但是还是被吓得 4 点多都起来了。(主要是因为我掌握着公司所有的核心源码,哈哈哈) 既然 4 点多起来,就得好好利用起来。于是我就挑选了 10 个堪称神器的学习网站,推...
这些软件太强了,Windows必装!尤其程序员!
Windows可谓是大多数人的生产力工具,集娱乐办公于一体,虽然在程序员这个群体中都说苹果是信仰,但是大部分不都是从Windows过来的,而且现在依然有很多的程序员用Windows。 所以,今天我就把我私藏的Windows必装的软件分享给大家,如果有一个你没有用过甚至没有听过,那你就赚了????,这可都是提升你幸福感的高效率生产力工具哦! 走起!???? NO、1 ScreenToGif 屏幕,摄像头和白板...
阿里面试,面试官没想到一个ArrayList,我都能跟他扯半小时
我是真的没想到,面试官会这样问我ArrayList。
曾经优秀的人,怎么就突然不优秀了。
职场上有很多辛酸事,很多合伙人出局的故事,很多技术骨干被裁员的故事。说来模板都类似,曾经是名校毕业,曾经是优秀员工,曾经被领导表扬,曾经业绩突出,然而突然有一天,因为种种原因,被裁员了,...
大学四年因为知道了这32个网站,我成了别人眼中的大神!
依稀记得,毕业那天,我们导员发给我毕业证的时候对我说“你可是咱们系的风云人物啊”,哎呀,别提当时多开心啦????,嗯,我们导员是所有导员中最帅的一个,真的???? 不过,导员说的是实话,很多人都叫我大神的,为啥,因为我知道这32个网站啊,你说强不强????,这次是绝对的干货,看好啦,走起来! PS:每个网站都是学计算机混互联网必须知道的,真的牛杯,我就不过多介绍了,大家自行探索,觉得没用的,尽管留言吐槽吧???? 社...
良心推荐,我珍藏的一些Chrome插件
上次搬家的时候,发了一个朋友圈,附带的照片中不小心暴露了自己的 Chrome 浏览器插件之多,于是就有小伙伴评论说分享一下我觉得还不错的浏览器插件。 我下面就把我日常工作和学习中经常用到的一些 Chrome 浏览器插件分享给大家,随便一个都能提高你的“生活品质”和工作效率。 Markdown Here Markdown Here 可以让你更愉快的写邮件,由于支持 Markdown 直接转电子邮...
看完这篇HTTP,跟面试官扯皮就没问题了
我是一名程序员,我的主要编程语言是 Java,我更是一名 Web 开发人员,所以我必须要了解 HTTP,所以本篇文章就来带你从 HTTP 入门到进阶,看完让你有一种恍然大悟、醍醐灌顶的感觉。 最初在有网络之前,我们的电脑都是单机的,单机系统是孤立的,我还记得 05 年前那会儿家里有个电脑,想打电脑游戏还得两个人在一个电脑上玩儿,及其不方便。我就想为什么家里人不让上网,我的同学 xxx 家里有网,每...
史上最全的IDEA快捷键总结
现在Idea成了主流开发工具,这篇博客对其使用的快捷键做了总结,希望对大家的开发工作有所帮助。
C++(数据结构与算法):62---搜索树(二叉搜索树、索引二叉搜索树)
一、搜索树的复杂度分析 本文考察二叉搜索树和索引二叉搜索树 二叉搜索树的渐进性能可以和跳表媲美: 查找、插入、删除操作所需的平均时间为Θ(logn) 查找、插入、删除操作的最坏情况的时间为Θ(n) 元素按升序输出时所需时间为Θ(n) 虽然在最坏情况下的查找、插入、删除操作,散列表和二叉搜索树的时间性能相同,但是散列表在最好的情况下具有超级性能Θ(1) 不过,对于一个指定的关键...
阿里程序员写了一个新手都写不出的低级bug,被骂惨了。
这种新手都不会范的错,居然被一个工作好几年的小伙子写出来,差点被当场开除了。
谁是华为扫地僧?
是的,华为也有扫地僧!2020年2月11-12日,“养在深闺人不知”的华为2012实验室扫地僧们,将在华为开发者大会2020(Cloud)上,和大家见面。到时,你可以和扫地僧们,吃一个洋...
AI 没让人类失业,搞 AI 的人先失业了
最近和几个 AI 领域的大佬闲聊 根据他们讲的消息和段子 改编出下面这个故事 如有雷同 都是巧合 1. 老王创业失败,被限制高消费 “这里写我跑路的消息实在太夸张了。” 王葱葱哼笑一下,把消息分享给群里。 阿杰也看了消息,笑了笑。在座几位也都笑了。 王葱葱是个有名的人物,21岁那年以全额奖学金进入 KMU 攻读人工智能博士,累计发表论文 40 余篇,个人技术博客更是成为深度学习领域内风向标。 ...
2020年,冯唐49岁:我给20、30岁IT职场年轻人的建议
点击“技术领导力”关注∆每天早上8:30推送 作者|Mr.K 编辑| Emma 来源|技术领导力(ID:jishulingdaoli) 前天的推文《冯唐:职场人35岁以后,方法论比经验重要》,收到了不少读者的反馈,觉得挺受启发。其实,冯唐写了不少关于职场方面的文章,都挺不错的。可惜大家只记住了“春风十里不如你”、“如何避免成为油腻腻的中年人”等不那么正经的文章。 本文整理了冯...
最全最强!世界大学计算机专业排名总结!
我正在参与CSDN200进20,希望得到您的支持,扫码续投票5次。感谢您! (为表示感谢,您投票后私信我,我把我总结的人工智能手推笔记和思维导图发送给您,感谢!) 目录 泰晤士高等教育世界大学排名 QS 世界大学排名 US News 世界大学排名 世界大学学术排名(Academic Ranking of World Universities) 泰晤士高等教育世界大学排名 中国共...
作为一名大学生,如何在B站上快乐的学习?
B站是个宝,谁用谁知道???? 作为一名大学生,你必须掌握的一项能力就是自学能力,很多看起来很牛X的人,你可以了解下,人家私底下一定是花大量的时间自学的,你可能会说,我也想学习啊,可是嘞,该学习啥嘞,不怕告诉你,互联网时代,最不缺的就是学习资源,最宝贵的是啥? 你可能会说是时间,不,不是时间,而是你的注意力,懂了吧! 那么,你说学习资源多,我咋不知道,那今天我就告诉你一个你必须知道的学习的地方,人称...
那些年,我们信了课本里的那些鬼话
教材永远都是有错误的,从小学到大学,我们不断的学习了很多错误知识。 斑羚飞渡 在我们学习的很多小学课文里,有很多是错误文章,或者说是假课文。像《斑羚飞渡》: 随着镰刀头羊的那声吼叫,整个斑羚群迅速分成两拨,老年斑羚为一拨,年轻斑羚为一拨。 就在这时,我看见,从那拨老斑羚里走出一只公斑羚来。公斑羚朝那拨年轻斑羚示意性地咩了一声,一只半大的斑羚应声走了出来。一老一少走到伤心崖,后退了几步,突...
一个程序在计算机中是如何运行的?超级干货!!!
强烈声明:本文很干,请自备茶水!???? 开门见山,咱不说废话! 你有没有想过,你写的程序,是如何在计算机中运行的吗?比如我们搞Java的,肯定写过这段代码 public class HelloWorld { public static void main(String[] args) { System.out.println("Hello World!"); } ...
立即提问