hibernate效率问题为什么我加了批处理1000多条数据还要1分钟才能插入完成,大家帮我看下代码看看有什么可以优化的 [问题点数:40分,结帖人u011168393]

结帖率 50%
Bbs9
本版专家分:50492
版主
Blank
GitHub 绑定GitHub第三方账户获取
Blank
优秀版主 优秀大版主
2015年8月优秀大版主
2015年9月优秀大版主
Blank
黄花 2015年2月 Java大版内专家分月排行榜第二
2014年3月 Java大版内专家分月排行榜第二
Blank
蓝花 2014年9月 Java大版内专家分月排行榜第三
2014年6月 Java大版内专家分月排行榜第三
2014年2月 Java大版内专家分月排行榜第三
2013年11月 Java大版内专家分月排行榜第三
2013年10月 Java大版内专家分月排行榜第三
Bbs7
本版专家分:18461
Blank
红花 2015年1月 Java大版内专家分月排行榜第一
Blank
黄花 2014年10月 Java大版内专家分月排行榜第二
2014年9月 Java大版内专家分月排行榜第二
2014年8月 Java大版内专家分月排行榜第二
Blank
蓝花 2016年1月 Java大版内专家分月排行榜第三
2014年12月 Java大版内专家分月排行榜第三
2014年11月 Java大版内专家分月排行榜第三
Bbs2
本版专家分:436
大家帮我看有什么问题??
rnrn输出的结果总是“空”<em>为<em>什么</em></em>?
大家看有什么代码错误??
rnrn rnrn
大家看有什么解法。
最近和同学在做一个数值计算软件,在非线性方程的数值解法模块中,我想往函数中 以字符串形式传入一个字符串方程表达式(姑且认为是一元的,比如“sin(x)+5*x*x+”),我想问下有<em>什么</em>好的方法,对字符串方程进行识别,并在函数里面进行变量(比如x)替换以及求值.记得之前我们学编译原理的时候是自己设计的编译器进行一些类似操作,但感觉任务量比较大。所以想问下<em>大家</em>有<em>什么</em>好的方法,还是已经有<em>什么</em>现成的库或者源码<em>可以</em>用。
大家看有什么错,
我想控制图片的大小,如果超出300,则在300,否则正常显示 rn
大家看有什么错误
rnrnrn rn 字符串对象的属性 rn rnrnrnrn rn显示填写的内容rnrn rn显示myfunc函数 rnrnrnrnrn<em>大家</em>看看我这个写的有<em>什么</em>错误啊,能帮助解释一下function format(x)函数的详细调用过程的更加感谢啊
大家帮我看有关于JApplet的问题
[code=Java]rnimport java.awt.*;rnimport java.awt.event.*;rnimport javax.swing.*;rnimport javax.swing.border.TitledBorder;rnimport javax.swing.JApplet;rnpublic class LoanApplet extends JAppletrn private JTextField jftAnnualInterestRate=new JTextField();rn private JTextField jftNumberofYears=new JTextField();rn private JTextField jftLoanAmount=new JTextField();rn private JTextField jftMonthlyPayment=new JTextField();rn private JTextField jftTotalPayment=new JTextField();rn private JButton jbtComputeLoan=new JButton("Compute Payment");rn public void Init()rn jftMonthlyPayment.setEditable(false);rn jftTotalPayment.setEditable(false);rn jftAnnualInterestRate.setHorizontalAlignment(JTextField.RIGHT);rn jftNumberofYears.setHorizontalAlignment(JTextField.RIGHT);rn jftLoanAmount.setHorizontalAlignment(JTextField.RIGHT);rn JPanel p1=new JPanel(new GridLayout(5,2));rn p1.add(new JLabel("Annual Interest Rate"));rn p1.add(jftAnnualInterestRate);rn p1.add(new JLabel("Number of Years"));rn p1.add(jftNumberofYears);rn p1.add(new JLabel("Loan Amount"));rn p1.add(jftLoanAmount);rn p1.add(new JLabel("Monthly Payment"));rn p1.add(jftMonthlyPayment);rn p1.add(new JLabel("Total Payment"));rn p1.add(jftTotalPayment);rn p1.setBorder(new TitledBorder("Enter interest rate,year and loan amount"));rn JPanel p2=new JPanel(new FlowLayout(FlowLayout.RIGHT));rn p2.add(jbtComputeLoan);rn jbtComputeLoan.addActionListener(new ButtonListener());rn rn private class ButtonListener implements ActionListenerrn public void actionPerformed(ActionEvent e)rn double interest=Double.parseDouble(jftAnnualInterestRate.getText());rn int year=Integer.parseInt(jftNumberofYears.getText());rn double loanAmount=Double.parseDouble(jftLoanAmount.getText());rn Loan loan=new Loan(interest,year,loanAmount);rn jftMonthlyPayment.setText(String.format("%.2f",loan.getMonthlyPayment()));rn jftTotalPayment.setText(String.format("%.2f",loan.getTotalPayment()));rn rn rnrn[/code]rn利用浏览器和appletViewer查看后均是显示一个灰色的矩形,大侠们<em>帮我</em>看看怎么回事?
大家帮我看下面的代码
rn rnrnrn( )rn这个<em>代码</em>好像删掉也没关系,<em>大家</em><em>帮我</em>解释一下.rn
好简单的问题大家帮我看有什么错误
rn rn rn rn rn rn rnrnrn上面的<em>代码</em>我是用来判断表单select的值 如果是dsk的话,就运行下面的查询语句,但不知道出了<em>什么</em><em>问题</em>,就是会报错,请<em>大家</em>帮忙指正指正。
大家帮我看下面的代码,急
父对话框时CCtrlPage1rn子对话框是CInformationDlgrnvoid CCtrlPage1::OnNMDblclkList2(NMHDR *pNMHDR, LRESULT *pResult)rnrn CInformationDlg* dlg=new CInformationDlg();rn //dlg->m_database.Open(_T("access"));rn dlg->Create(IDD_INFORMATION,this);rn dlg->ShowWindow(SW_SHOW);rn dlg->UpdateWindow();rnrnrn两个对话框都有一个列表资源,双击父列表弹出子对话框rn选择子对话框列表中的某一列,点击确定,将选中列的内容填入父对话框的双击的那一列rnrnvoid CInformationDlg::OnBnClickedOk()rnrn // TODO: 在此添加控件rn for(int j=1;jm_infolist.GetItemText(this->index,j);//index是获取的列表的行号rnrn CCtrlPage1 *p=(CCtrlPage1*)GetParent();rn int row=p->row;rn (p->m_list).SetItemText(row,j,str);rn rn rnrnrnrnrn 编译没有错误,但运行到最后一句是出现断言:BOOL CListCtrl::SetItemText(int nItem, int nSubItem, LPCTSTR lpszText)rnrn ASSERT(::IsWindow(m_hWnd));
大家帮我看下面的代码
下面的<em>代码</em>是获取安装软件清单,运行是出现错误,请<em>大家</em>帮忙看看应该怎么写。rnrnrnImports SystemrnImports System.ManagementrnImports System.Windows.FormsrnrnNamespace WMISamplernrn Public Class CallWMIMethodrnrn Public Overloads Shared Function Main() As Integerrnrn Tryrn[color=#FF0000]'下面一行运行出错:[/color]rn Dim classInstance As New ManagementObject( _rn "root\DEFAULT", _rn [color=#FF0000]"StdRegProv"[/color], Nothing)rnrn ' Obtain [in] parameters for the methodrn Dim inParams As ManagementBaseObject = _rn classInstance.GetMethodParameters("GetStringValue")rnrn ' Add the input parameters.rn inParams("hDefKey") = &H80000002rn inParams("sSubKeyName") = "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\"rn inParams("sValueName") = "DisplayName"rnrn ' Execute the method and obtain the return values.rn Dim outParams As ManagementBaseObject = _rn classInstance.InvokeMethod("GetStringValue", inParams, Nothing)rnrn ' List outParamsrn Console.WriteLine("Out parameters:")rn Console.WriteLine("ReturnValue: 0", outParams("ReturnValue"))rn Console.WriteLine("sValue: 0", outParams("sValue"))rnrn Catch err As ManagementExceptionrnrn MessageBox.Show("An error occurred while trying to execute the WMI method: " & err.Message)rn End Tryrn End Functionrn End ClassrnEnd Namespace
mysql 插入更新多条数据效率问题
http://topic.csdn.net/u/20110310/13/3279054f-5022-4fac-baa7-d194f5335ba0.html http://www.rosoo.net/a/201103/11043.html http://topic.csdn.net/u/20080921/18/718f167e-e030-439d-a206-b2dc3dc99a3f.ht
数据库连接代码大家看有问题吗?
rs.open "select top 10 turename from [bout_shop] where month([color=#FF0000]overtime[/color])=month(date()) and day([color=#FF0000]overtime[/color])=day(date()) order by [color=#FF0000]sales_total [/color]desc",conn,1,3 [color=#FF0000] //第 11 行[/color] rn我这错误提示:rn错误类型:rnMicrosoft JET Database Engine (0x80040E10)rn至少一个参数没有被指定值。rn/tea/paihang_1.asp, 第 11 行rn
帮我看有什么问题
-
帮我看有什么问题
use mydatarnalter table db2 modify (db2 varchar(20))rn怎么总说'('附近有语法错误
大家帮我看下面的代码什么无法实现?
文件名是index.php,没有编译错误,但是无法实现发邮件的功能,请各位帮帮忙,谢谢!rn".nl2br($message)." back to the send page "; rn exit(); rn rn?> rn rn rn mail rn rn rn rn rn rn email systemrn rnrnrnrn rn rn header:rn rn rn rn rn rn rn rn rn your name:rn rn rn rn rn rn rn rn rn address:rn rn rn rn rn rn rn rn rn friend's name:rn rn rn rn rn rn rn rn rn address:rn rn rn rn rn rn rn rn rn content:rn rn rn rn rn rn rn rn rn rn rn rn rn rnrnrnrn rn rn
hibernate插入批处理问题
下面的<em>代码</em>会出来内存溢出。但是这个是书上面的<em>代码</em>。<em>问题</em>出现在哪。二级缓存已经关闭了rnprivate void testUser()throws Exceptionrn rn //打开Sessionrn Session session = HibernateUtil.currentSession();rn //开始事务rn Transaction tx = session.beginTransaction();rn //循环<em>1000</em>00次,<em>插入</em><em>1000</em>00条记录rn for (int i = 0 ; i < <em>1000</em>00 ; i++ )rn rn //创建User实例rn UserInsert u1 = new UserInsert();rn u1.setName("xxxxx" + i);rn u1.setAge(i);rn u1.setNationality("china");rn //在Session级别缓存User实例rn session.save(u1);rn //每当累加器是20的倍数时,将Session中<em>数据</em>刷入<em>数据</em>库,rn //并清空Session缓存。rn if (i % 20 == 0)rn rn session.flush();rn session.clear();rn rn rn //提交事务rn tx.commit();rn //关闭事务rn HibernateUtil.closeSession();rn
帮我看有什么问题
#includern#includernusing namespace std;rnint main()rnrn string st;rn vector vec;rn cout<<>st)rn vec.push_back(st);rn for(vector::size_type ix=0;ix!=st.size();ix++)rn cout<
帮我看下面的代码!
这是一个日历的程序,在想实现以下功能,鼠标右键所指的日期上点击右键rn出现一个菜单,在菜单上点击"显示日期"按钮 显示鼠标所指的日期rn怎么修改啊rn rn rnrnrn
帮我看下面的代码
SelectA_Condition:=' Where '+ memo1.Text ;rn SelectA_sql:='exec '+Title+' ''*'','' '+ SelectA_Condition + ''' ' ;rn edit1.text:=SelectA_sql;rn F_Query.Close ;rn Seach.Show;rnrn[color=#FF0000] DM.CDS_SelectA.Close ;rn DM.CDS_SelectA.CommandText :=SelectA_sql;rn DM.CDS_SelectA.Open;rnrn IF DM.CDS_SelectA.RecordCount >0 thenrn Seach.Closern elsern beginrn Application.MessageBox('无记录,请检查条件重新查询','查询',MB_ICONError);rn Seach.close;rn end;[/color]rn这个执行后,F_Query不会close,seach这个窗体<em>可以</em>显示,结果也能查出来,但是查出来后seach也不close,rn如果不要后面经色<em>代码</em>部份,F_Query就会close,Seach窗体也会显示出来rn
帮我看下面的代码
<em>为<em>什么</em></em>类的实例不能访问其实例字段?:rnTypern TNj = recordrn njh: integer; rn ydns: integer; rn Njlx: integer; rn njmc: string; rn end;rnrn TKs = recordrn ksmc: string;rn ksh: integer;rn kch: string;rn end;rnrn TNodeInf = classrn privatern fNj: TNj;rn fKs: Tksary;rn rn Private declarations rn publicrn // constructor Create(xqh,xqmc: string);rn procedure SetNj(njmc: string; njh,ydns,Njlx: integer); rn procedure SetKs(ksmc,kch: array of string; ksh: array of integer );rn rn end;rnrnimplementationrnrnprocedure TNodeInf.SetNj(njmc: string; njh,ydns,Njlx: integer);rnbeginrnrn fNj.njmc := njmc;rn fnj.njh := njh;rn fnj.ydns := ydns;rn fnj.Njlx := Njlx;rnend;rn....rnrn<em>为<em>什么</em></em>我在建立该对象的实例后,通过其实例调用时:rnNodeInfo.SetNj('dd',9,7,5) ;rn总是Access violation at address 004862af in ...错误?rn
帮我看有什么毛病!谢谢各位朋友!
-
帮我看有什么错误。谢谢
rntitle 和 name 都是文本,time是时间 我的系统是win2000 和 IIS 5.0rn提示的错误是错误类型:rnMicrosoft OLE DB Provider for ODBC Drivers (0x80040E14)rn/myweb2/writmsg.asp, 第 21 行rn即 conn.excute sqlrn 我的<em>数据</em>库没有只读属性,目录也是可写入的,但是就是不能修改<em>数据</em>库中的记录。这是<em>为<em>什么</em></em>。rn不会是系统的<em>问题</em>吧rn
帮我看有什么错误?在线等
Response.Write(" ");rnrn这是我在后台的<em>代码</em>,新开一个窗口,编译能通过,不过当运行到这里就会说网页有错误
帮我看下面的代码!!
varrnreg: TRegistry;rnbeginrnreg := TRegistry.Create;rnreg.RootKey:=HKEY_CLASSES_ROOT;rnreg.OpenKey('*\shell\xxxx\command', true);rnreg.WriteString('', '"' + application.ExeName + '" "%1"');rnreg.CloseKey;rnreg.OpenKey('*\shell\diary', false);rnreg.WriteString('', '操作(&C)');rnreg.CloseKey;rnreg.Free;rnshowmessage('DONE!');rnend;rnrn运行时说:failed to set data for "rn是 reg.WriteString('', '"' + application.ExeName + '" "%1"');rn的<em>问题</em>,但我看不出那儿错了rn
帮我看下面的代码
rn rn 质检查询1rn rnrn rn rnrn<em>问题</em>出在那个TD的超连接 " 怎么没有用啊?
帮我看下面的代码
<em>为<em>什么</em></em>对象里面的方法不能访问其字段?rnTypern TNj = recordrn njh: integer; rn ydns: integer; rn Njlx: integer; rn njmc: string; rn end;rnrn TKs = recordrn ksmc: string;rn ksh: integer;rn kch: string;rn end;rnrn TNodeInf = classrn privatern fNj: TNj;rn fKs: Tksary;rn rn Private declarations rn publicrn // constructor Create(xqh,xqmc: string);rn procedure SetNj(njmc: string; njh,ydns,Njlx: integer); rn procedure SetKs(ksmc,kch: array of string; ksh: array of integer );rn rn end;rnrnimplementationrnrnprocedure TNodeInf.SetNj(njmc: string; njh,ydns,Njlx: integer);rnbeginrnrn fNj.njmc := njmc;rn fnj.njh := njh;rn fnj.ydns := ydns;rn fnj.Njlx := Njlx;rnend;rn....rnrn<em>为<em>什么</em></em>我在建立该对象的实例后,通过其实例调用时:rnNodeInfo.SetNj('dd',9,7,5) ;rn总是Access violation at address 004862af in ...错误?rn
大家帮我看下面的问题
void Test_Adc(void)rnrn  /*int a0=0,a1=0,a2=0,a3=0,a4=0,a5=0,a6=0,a7=0; */ rn int a0=0,a1=0,a2=0,a3=0,a4=0,a5=0,a6=0,a7=0;rnrn  while(1)rn  rn    a0=ReadAdc(0); /* 进行0通道ADC */rn    a1=ReadAdc(1);rn    a2=ReadAdc(2);rn    a3=ReadAdc(3);rn    a4=ReadAdc(4);rn    a5=ReadAdc(5);rn    a6=ReadAdc(6);rn    a7=ReadAdc(7);rn    Uart_Printf("0:%04d 1:%04d 2:%04d 3:%04d 4:%04d 5:%04d 6:%04d 7:%04d\n",a0,a1,a2,a3,a4,a5,a6,a7);rn    Delay(50000); //5srn  rnrnrn在ARM developer suite里面编译的时候,程序在第2行出现如下错误:rnillegal character (hex code 0Xal) in source。rn不知道是怎么回事啊?
各位大哥帮我看有什么错??
dm.addQdoctor.Close;rn dm.addQdoctor.SQL.Clear;rn dm.addQdoctor.SQL.Add('insert into doctor');rn dm.addQdoctor.SQL.Add('values (:trim(edit1.Text),:trim(edit2.Text),:strbirthday,:trim(combobox1.Text),:edit3.Text,:edit4.Text,:inhousecode,:dtcosttypecode)');rn dm.addQdoctor.Params[0].AsString:=trim(edit1.Text);rn dm.addQdoctor.Params[1].AsString:=trim(edit2.Text);rn dm.addQdoctor.Params[2].AsDate:=strbirthday;rn dm.addQdoctor.Params[3].AsString:=trim(combobox1.Text);rn dm.addQdoctor.Params[4].AsString:=trim(edit3.Text);rn dm.addQdoctor.Params[5].AsString:=trim(edit4.Text);rn dm.addQdoctor.Params[6].AsString:=inhousecode;rn dm.addQdoctor.Params[7].AsString:=dtcosttypecode;rn dm.addQdoctor.ExecSQL;
简单查询语句,帮我看有什么
我在DELPHI里这么写的,连的是ACCESS<em>数据</em>库,运行报FROM子句出错。rn Dateform.ADOQuery1.Close;rn Dateform.ADOQuery1.SQL.Clear;rn Dateform.ADOQuery1.SQL.Add('select * from User where User_Name = '''+name+''' and User_Password = '''+password+'''');rn Dateform.ADOQuery1.open;rnrn能<em>帮我</em>看看<em>什么</em>地方出错了吗?rn
帮我看有什么错????????
if ClientQ[TEdit(Components[i]).Name].DataType = ftInteger thenrn TEdit(Components[i]).Text := IntToStr(ClientQ[TEdit(Components[i]).Name])rnrn编译时没错,但一执行到这句话时就出错,错误提示为:rnVariant does not reference an automation object
数据库连接,帮我看有什么
[code=C#]rnusing System;rnusing System.Collections;rnusing System.Data;rnusing System.Data.SqlClient;rnusing System.Configuration;rnusing System.Diagnostics;rnusing System.ComponentModel;rnusing System.Collections;rnrnrnnamespace WebSite1.DataAcessLayerrnrn public class Database : IDisposablern rn protected SqlConnection Connection;rnrn protected String ConnectionString;rnrn public Database()rn rn ConnectionString = ConfigurationSettings.AppSettings["DBConnectionString"];rn rnrn ~Database()rn rn tryrn rn if (Connection != null)rn rn Connection.Close();rn rn catch rn tryrn rn Dispose();rnrn rn catch rn rn protected void open() rn rn if(Connection == null)rn rn Connection = new SqlConnection(ConnectionString);rn rn if(Connection.State.Equals(ConnectionState.Closed))rn rn Connection.Open();rn rn rn public void Close() rn rn if (Connection != null)rn rn Connection.Close();rn rn rn public void Dispose() //释放连接<em>数据</em>库所占用的资源rn rn if(Connection !=null)rn rn Connection.Dispose();rn Connection = null;rn rn rn public int ExecuteSQL(String SqlString)rn rn int count = -1;rn open();rn tryrn rn SqlCommand cmd = new SqlCommand(SqlString, Connection);rn count = cmd.ExecuteNonQuery();rnrn rn catchrn rn count = -1;rnrn rn finallyrn rn Close();rn rn return count;rn rn public DataSet GetDataSet(String SqlString) rn rn open();rn SqlDataAdapter adapter = new SqlDataAdapter(SqlString, Connection);rn DataSet dataset = new DataSet();rn adapter.Fill(dataset);rn Close();rn return dataset;rn rn rn public DataRow GetDAtaRow(String SqlString) rn rn DataSet dataset = GetDataSet(SqlString);rn dataset.CaseSensitive = false;rn if(dataset.Tables[0].Rows.Count>0)rn rn return dataset.Tables[0].Rows[0];rn rn elsern rn return null;rn rn rnrn rnrn[/code]
帮我看有什么错误啊
using System;rnusing System.Collections;rnusing System.ComponentModel;rnusing System.Data;rnusing System.Data.OleDb;rnusing System.Drawing;rnusing System.Web;rnusing System.Web.SessionState;rnusing System.Web.UI;rnusing System.Web.UI.WebControls;rnusing System.Web.UI.HtmlControls;rnrnnamespace GuestBookrnrn /// rn /// View 的摘要说明。rn /// rn public class View : System.Web.UI.Pagern rn protected System.Web.UI.WebControls.Repeater Message;rn int pageSize,recordCount,pageCount,currentPage;rn protected System.Web.UI.WebControls.Label lbRecordCount;rn protected System.Web.UI.WebControls.Label lbCurrentPage;rn protected System.Web.UI.WebControls.Label lbPageCount;rn protected System.Web.UI.WebControls.LinkButton butPrev;rn protected System.Web.UI.WebControls.LinkButton butNext;rn protected System.Web.UI.WebControls.DropDownList dlsPageIndex;rn rn OleDbConnection conn;rn rn private void Page_Load(object sender, System.EventArgs e)rn rn OleDbConnection conn;rn OleDbCommand comd; rn string sql; rn DataSet ds;rn OleDbDataAdapter da; rn rn string conStr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Server.MapPath(".") + "..\\Data\\data.mdb";rn conn = new OleDbConnection(conStr);rn rn sql = "Select * from GuestBook order by date DESC";rn da = new OleDbDataAdapter(sql,conn);rn rn ds = new DataSet();rn rn da.Fill(ds,1,5,"Message");rn Message.DataSource = ds;rn Message.DataMember = "Message";rn Message.DataBind();rn rn conn.Close();rn rn rnrnrnrnrnrnrnrnrn rn rnrn rnrn rnrn rnrn rn rn rn Titlern rn rn Title IDrn rn rn Typern rn rn Publisher IDrn rn rn Pricern rn rnrn rnrn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rnrn rnrn rnrn rnrn rnrn rnrnrnrnrnrn改了。rn不过运行 没有信息啊出现啊rn
帮我看有什么错?谢谢
int cout(char *string)rnrn int j=0;rn char *i;rn for(i=string;*i!='\0';i++)rn j++;rn rn return j;rnrnrnint add(char *string)rnrn int addNumber,addedNumber,total;rn int i=0,j=1,b=0;rn char *anotherString;rn char *a;rn addNumber=atoi(string);rn a=string;rn while((*a)!='+')rn j++;rn a++;rn rn for(i=j;i<=cout(string);i++)rn *(anotherString+b) = *(anotherString+i); //调试到这里总是不能继续进行rn b++;rn rn addedNumber=atoi(anotherString);rn total=addNumber+addedNumber;rn return total;rnrn请各位大哥指教
大家帮我看有什么问题!!!!!!!!!!!
我想实现的功能是用一个程序给另外一个程序加个尾巴,,这个程序在启动的时候自己读这个新加的尾巴。rn这是我的载入程序:rnint filehandle;rnint filelong;rnint b=128127126125;rnchar *pszBuffer;rn//AnsiString a=Edit1->Text;rn//b=StrToInt(a);rnfilehandle=FileOpen("d:\\save\\a.exe",fmOpenReadWrite);rnfilelong=FileSeek(filehandle,0,2);rnpszBuffer = new char[20];rnFileWrite(filelong,pszBuffer,b);rnFileClose(filehandle);rndelete [] pszBuffer ;rn这是我的读出程序:rnchar *p;rnint filehandle,a;rnfilehandle=FileOpen("d:\\save\\a.exe",0);rna=FileSeek(filehandle,16,2);rnp=new char[20];rnFileRead(filehandle,p,19);rnLabel1->Caption=p;rnEdit1->Text=IntToStr(a);rnFileClose(filehandle);rndelete [] p;rn
麻烦大家帮我的看看有什么问题
到底是哪出了<em>问题</em>呢,是一个死循环rn#include rn#pragma hdrstoprnrn#include "Unit1.h"rn//---------------------------------------------------------------------------rn#pragma package(smart_init)rn#pragma resource "*.dfm"rnTForm1 *Form1;rn//---------------------------------------------------------------------------rn__fastcall TForm1::TForm1(TComponent* Owner)rn : TForm(Owner)rnrnrn//---------------------------------------------------------------------------rnbool __fastcall TForm1::DoCopyDir(String sDirName,String sToDirName)rnrnHANDLE hFindFile;rnString tfile,t;rnAnsiString sCurDir;rnWIN32_FIND_DATA FindFileData ;rn//先保存当前目录rnsCurDir=GetCurrentDir();rnChDir(sDirName);rn//sDirName=GetCurrentDir()+'\\';rnrnhFindFile=FindFirstFile("*",&FindFileData);rnif(hFindFile!=INVALID_HANDLE_VALUE)rnrnrnif(!DirectoryExists(sToDirName)) ForceDirectories(sToDirName);rnrndornrntfile=FindFileData.cFileName;rnif(tfile=="."||tfile=="..") continue;rnif(FindFileData.dwFileAttributes==FILE_ATTRIBUTE_DIRECTORY)rnrnt=sToDirName+"\\"+tfile;rnif(!DirectoryExists(t)) ForceDirectories(t);rnif(sDirName[sDirName.Length()-1]!='\\') DoCopyDir(sDirName+'\\'+tfile,t);rnelse DoCopyDir(sDirName+tfile,sToDirName+tfile);rnrnelsernrnt=sToDirName+'\\'+tfile; CopyFile( tfile.c_str(),t.c_str(),True);rn//BOOL CopyFile( LPCTSTR lpExistingFileName, // 源文件的路径rn// LPCTSTR lpNewFileName, // 目标文件的路径rn// BOOL bFailIfExists // 这是一个标志,如果目标文件已经存在,是否强制覆盖);rnrnrnwhile(FindNextFile(hFindFile,&FindFileData));rnFindClose(hFindFile);rnrnelsernrnChDir(sCurDir);rnreturn false;rnexit;rnrn//回到原来的目录下rnChDir(sCurDir);rnreturn true;rnrnrn//--------------------------------------------------------------------rn//---- 1.2拷贝目录的函数:CopyDirrnrnvoid __fastcall TForm1::Button1Click(TObject *Sender)rnrnif(OpenDialog1->Execute())rnEdit1->Text =OpenDialog1->FileName.c_str() ;rn Edit2->Text="d:\\aaa";rnrnrn//---------------------------------------------------------------------------rnrnvoid __fastcall TForm1::Button2Click(TObject *Sender)rnrnif(DoCopyDir(OpenDialog1->FileName,Edit2->Text)==true)rnShowMessage("OK");rnelsernShowMessage("error");rnrn
大家帮我看有什么地方不对吗?
#include rn#include rn#include rn#include rn#include rn#include rnrnusing namespace std;rnrnint main()rnrn vector v;rn string temp;rn cout << "enter the fileName:";rn cin >> temp;rn ifstream file(temp.c_str());rnrn if (!file)rn MessageBox(NULL,"file can not open!","autoEdit",MB_OK|MB_ICONWARNING|MB_DEFAULT_DESKTOP_ONLY);rn return 0;rn rn v.push_back("CREATE TABLE [dbo].[***] (");rn rn while(getline(file,temp))rn string myType=temp.substr(temp.find(':')); rn rn temp.erase(temp.find(':')); rn string::iterator i;rn for(i=temp.begin();i!=temp.end();++i)rn if (*i==' ')rn temp.erase(i); rn rn temp.insert(0,"["); rn temp.append("]");rn rn for(i=myType.begin();i!=myType.end();++i)rn if (*i==':' || *i==' ' || *i==';')rn myType.erase(i); rn rn rn int flag=0;rn rn if (myType.compare(string("Tedit"))==0)rn temp.append(" [varchar] (16) COLLATE Chinese_PRC_CI_AS NULL ,");rn flag=1;rn rn else if (myType.compare(string("TRadioGroup"))==0)rn temp.append(" [int] NULL ,");rn flag=1; rn rn else if (myType.compare(string("TComboBox"))==0) rn temp.append(" [varchar] (16) COLLATE Chinese_PRC_CI_AS NULL ,");rn flag=1;rn rn else if (myType.compare(string("TCheckBox"))==0)rn temp.append(" [char] (1) COLLATE Chinese_PRC_CI_AS NULL ,");rn flag=1; rn rn else if (myType.compare(string("TMemo"))==0)rn temp.append(" [varchar] (300) COLLATE Chinese_PRC_CI_AS NULL ,");rn flag=1;rn rn else if (myType.compare(string("TChart"))==0) rn temp.append(" [image] NULL ,"); rn flag=1; rn rn else if (myType.compare(string("TLabeledEdit"))==0) rn temp.append(" [varchar] (16) COLLATE Chinese_PRC_CI_AS NULL ,");rn flag=1; rn rn rn if (flag) rn v.push_back(temp);rn elsern myType.append(" is a unknown type!");rn MessageBox(NULL,myType.c_str(),"autoEdit",MB_OK|MB_ICONWARNING|MB_DEFAULT_DESKTOP_ONLY); rn return 0;rn rn rn//这里还需删除最后一个逗号 rn rn v.push_back(") ON [PRIMARY]");rn v.push_back("GO");rn file.clear();rn file.close();rn rn ofstream resultFile("sql.temp",ios::out|ios::trunc);rn for (vector::iterator i=v.begin();i!=v.end();++i)rn resultFile << *i << endl;rn rn rn resultFile.clear();rn resultFile.close(); rn MessageBox(NULL,"convert compleate!","autoEdit",MB_OK|MB_DEFAULT_DESKTOP_ONLY); rn return 0;rnrnrn能编译,但是运行时就出错了,不知道<em>为<em>什么</em></em>,大概是程序有<em>什么</em>地方写错了。rnrn
大家帮我看有什么问题
就这么一点<em>代码</em>,不知怎么回事,只要用上,程序就喜欢自动退出,或者因为出现叫做<em>什么</em> 内存访问无效(英文,我自己瞎翻的)<em>什么</em>的错误而退出!rn我实在没有看出错在哪儿,谁给点意见?rnrnrnint ClassName::Send(LPSTR QQNumber, LPSTR msgin,LPSTR msgout)rnrn CString m_download,cmsgin(msgin);rn char * m_location;rn CInternetSession mySession;rn CInternetFile * myFile=NULL;rn m_location="http://localhost/?";rn strcat(m_location,msgin);rn tryrn rn myFile=(CInternetFile*)mySession.OpenURL(m_location,1,INTERNET_FLAG_RELOAD,0);rn rn catch(CInternetException * pEx)rn rn myFile=NULL;rn pEx->Delete();rn return 0;rn rn if(myFile)rn rn CString line;rn for(int i=0;iReadString(line);i++)rn m_download+=line+"\r\n";rn myFile->Close();rn delete myFile;rn rn if(m_download=="")rn rn m_download+="Error!";rn rn wsprintf(msgout,"%s",m_download);rn msgin="";rn return 1;rn
可以帮我看有什么问题吗?
import java.awt.*;rnimport java.awt.event.*;rnimport javax.swing.*;rnpublic class Event1 extends JFrame rnrnJButton but1,but2;rnJTextField txt;rnpublic Event1()rnsuper("阶乘计算的窗口");rnaddWindowListener(new WindowAdapter()rnpublic void windowClosing(WindowEvent e)rnSystem.exit(0););rninitialize();rnrnpublic void initialize()rnrnsetside(300,200);rn(new handle()).setLayout(null);rnbut1=new JButton("确定");rnbut1.setBounds(10,40,70,25);rnbut1.addActionListener(new handle());rnadd(but1);rnbut2=new JButton("重置");rnbut2.setBounds(105,40,70,25);rnbut2.addActionListener(new handle());rnadd(but2);rntxt=new JTextField();rntxt.setBounds(75,70,70,25);rnadd(txt);rnshow();rnrnpublic class handle implements ActionListenerrnpublic void actionPerformed(ActionEvent e)rnint dialogtype=JOptionpane.PLAIN_MESSAGE;//对话框的类型;rnif(e.getSource()==but1)rnrnint i, m,sum=1;rnfloat s=txt.getText();rnm=(s%1==0&&s>0)?1:2;rnswitch(m)rnrncase 1:for(i=1;i,dialogtype);break;rnrnrnelse rnnew Event1();rnrnrnrnpublic static void main(String args[])rnnew Event1();rnrnrnrnrnrnrn
大家帮我看有问题,好怕
我这次考得还<em>可以</em>,上下午都应该有50多。但是下午题第3题我只填了序号,还有后面3题选一题,我做了C++,但是我没在题号上打钩,会不会有事的????好担心哦,如果因为这个挂了,就~~~~~~~~
hibernate 插入大量数据效率
<em>数据</em>库是oracle,主键来自sequence。当<em>插入</em>一颗树到多个表里时,(e.g. Scholl -> Grade -> Class -> Student),取得sequence.nextval,的过程相当慢,导致整个<em>插入</em>过程长的无法接受,<em>大家</em>有<em>什么</em>办法处理这种情况吗?
组件不能立刻更新,大家帮我看有什么办法.
rnjLabelStep1.setForeground(new Color ( 255,255,255 ));rntimeDelay (2);rnjLabelArrow1.setForeground(new Color ( 255,255,255 ));rnrnrn<em>代码</em>前后都省略了,原意是先更改jLabelStep1的前景,2秒后更改jLabelArrow1的前景。这段程序是在一个按钮事件里写的。但是我所做的更改不能立刻实现,一定等到程序走出了按钮事件后才实现了setForeground .我曾经尝试了在jLabelStep1.setForeground(new Color ( 255,255,255 )); 后面<em>插入</em>jContentPaneProceed.validate (这两个组件在这个容器里)。也没有效果。但是在后面<em>插入</em>JOptionPane.showMessageDialog便会有效。不知有没有其他办法。另注延时没<em>问题</em>。
插入多条数据问题~~~
--<em>插入</em><em>多条</em><em>数据</em>rninsert into CCC(C_Id,C_Name)(newid(),select A_Name from AAA where A_Id not inrn(select A_Id from BBB where B_DateTime='2009-09-03'))rnrn我想C_Id <em>插入</em>的是全球唯一, 这样<em>多条</em><em>插入</em>~ 老是报错。。 rnrn谁能指导我下~ 谢谢。rn
多条数据插入问题
A表结构 (ID,OTHERID,NAME,DESC,INFORMATION),其中ID为序列(主键,非自增)是有专门的序列表B来记录。rnB表结构(TABLENAME,SEQ,STEP),SEQ是当前对应的TABLENAME的序列值,STEP是步长(固定值为1)。rnrn现在要向A批量<em>插入</em>很<em>多条</em>信息(例如100条),OTHERID 是已经知道的,例如:1,2,3,4,5....100,NAME是固定值A,DESC是固定值B,INFORMATION是固定值C。rnrn求如何写这样的SQL,要<em>插入</em>OTHERID的值是已知无规律的信息。
多条数据插入问题
当天时间是 NewDaternrn iNSERT INTO UserSalary_Days(UserName,zz, createdate)rnrn selecct username ,zz from sys_userrn rnrnrn怎么把NewDate 也同时<em>插入</em>进去
【看看有什么错】
Sample Inputrn2rnTom 5.77rnJack 21.4rnrnSample OutputrnTom 7.69rnJack 67.76rnrn分段计算水费的。rnrn为每个用户单独输出一行:姓名以及其该月的水费,两者之间用一个空格分隔。水费保留小数点后2位。rnrnrnrn#includernint main()rnrn int i,n;rn double x,y;rn char name[11];rnrn scanf("%f",&n);rn for(i=1;i10&&x20)rn y=x*3.4-5;rn printf("%s %.2f\n",&name,&y);rn rn return 0;rnrnrnrnrn
大家看有什么区别
if((*((skill_list_1.shen_fu)->state))==0)rnrn和rnrnif(*skill_list_1.shen_fu->state==0)rnrn<em>为<em>什么</em></em>第2个判断出来的总是真?rn
看有什么错误?
using System;rnusing System.Net;rnrnrnclass CreateIPrnrn public static void Main(string[] args)rn rn tryrn rn //将用户输入的IP地址通过InetAddr method产生一个IPAddress对象rn IPHostEntry HostInfo=Dns.Resolve(args[0]);//?rn //获取IP地址例表rn IPAddress[] AddrList=HostInfo.AddressList;rn for(int i=0;i
大家看有什么问题
我的<em>代码</em>!rnString id = request.getParameter("articleid");rn int vid=Integer.parseInt(id);rn Connsyata syata=new Connsyata();rn Connection conn=syata.getConnection();rn PreparedStatement pstmt=conn.prepareStatement("select * from news where news_id=?");rn pstmt.setInt(0,vid);rn ResultSet prs=pstmt.executeQuery();rn<em>为<em>什么</em></em>老出现这样的<em>问题</em>呀!rnjava.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Invalidrnparameter binding(s).rn at com.microsoft.jdbc.base.BaseExceptions.createException(Unknown Source)rn at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source)rn at com.microsoft.jdbc.base.BasePreparedStatement.validateParameterIndex(Unknown Source)rn at com.microsoft.jdbc.base.BasePreparedStatement.setObjectInternal(Unknown Source)rn at com.microsoft.jdbc.base.BasePreparedStatement.setInt(Unknown Source)rn at _jsp._admin._article._editarticle__jsp._jspService(_editarticle__jsp.java:45)rn at com.caucho.jsp.JavaPage.service(JavaPage.java:61)rn at com.caucho.jsp.Page.pageservice(Page.java:569)rn at com.caucho.server.dispatch.PageFilterChain.doFilter(PageFilterChain.java:149)rn at com.caucho.server.webapp.WebAppFilterChain.doFilter(WebAppFilterChain.java:163)rn at com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:208)rn at com.caucho.server.hmux.HmuxRequest.handleRequest(HmuxRequest.java:386)rn at com.caucho.server.port.TcpConnection.run(TcpConnection.java:332)rn at com.caucho.util.ThreadPool.runTasks(ThreadPool.java:457)rn at com.caucho.util.ThreadPool.run(ThreadPool.java:398)rn at java.lang.Thread.run(Thread.java:595)rnrn
一个对数据库的操作,大家帮我看有什么好的做法
我的程序要轮询一个表里是否有<em>数据</em>,一有<em>数据</em>,马上处理,如果用rn定时器,太浪费资源,因为<em>数据</em>有的情况很少,但实时性要求高,一有rn必须马上得到这个消息,用触发器?能立即通知我的程序吗?
大家帮我看有什么错误,是关于EJB的
package chooseclass;rnrnimport chooseclass.*;rnimport javax.ejb.*;rnimport javax.naming.*;rnimport javax.naming.NamingException;rnimport java.util.*;rnimport java.rmi.RemoteException;rnimport javax.rmi.PortableRemoteObject;rnimport java.sql.*;rnimport java.sql.*;rnpublic class choosecBean implements SessionBean rnSessionContext sessionContext;rnprivate CourseHome cHome;rn public void ejbCreate() throws CreateException rn tryrn Context initial=new InitialContext();rn cHome=(CourseHome)initial.lookup("Course");rn catch(javax.naming.NamingException ex)rn rn rn rn public void ejbRemove() rn /**@todo Complete this method*/rn rn public void ejbActivate() rn /**@todo Complete this method*/rn rn public void ejbPassivate() rn /**@todo Complete this method*/rn rn public void setSessionContext(SessionContext sessionContext) rn this.sessionContext = sessionContext;rn rn public void setcname(String course_id, String cname) rn tryrn Course course=cHome.findByPrimaryKey(course_id);rn course.setCname(cname);rn catch(FinderException ex)rn rn /**@todo Complete this method*/rn rn public String getcname(String course_id) rn /**@todo Complete this method*/rn tryrn Course course=cHome.findByPrimaryKey(course_id);rn return course.getCname();rn catch(FinderException fex)rn rn rn return null;rn rn public void setcourse(String course_id, String cname) rn /**@todo Complete this method*/rn tryrn rn Course course=cHome.create(course_id);rn course.setCname(cname);rn catch(DuplicateKeyException dupkeyex)rn rn throw new SQLException("have");rn catch(CreateException ex)rn throw new SQLException("s");//rn catch(Exception ex)rn rn rnrn其中Course是CMP,<em>大家</em><em>帮我</em>检查一下,谢谢。
大家帮我看下这是什么
["FieldName":"项目简称","Caption":"项目简称","width":"3","TableName":"","KeyName":"","KeyValue":"","KeyType":"combox","orderBy":""rn这到底是<em>什么</em>意思? 文件名 OA人工成本<em>数据</em>管理,mod
看有什么效果
看<em>看有</em><em>什么</em>效果
大家看有什么问题!!!!
$db = mysql_connect("localhost","dbuser_shanxi","dbuser_shanxi")rn or die("无法连接<em>数据</em>库!");rn mysql_select_db("yymy", $db)rn or die("无法选择<em>数据</em>库!");rn$result=mysql_query("select * from user where company='$company'");rn $arr=mysql_fetch_array($result);rn $nums=mysql_num_rows($result);rn if($nums!=1)rn echo " ";rn echo " ";rn exit(); rnrnelsernrn if($pwd !=$arr["password"])rn echo " ";rn echo " ";rn exit();rn rnrn怎么提示我有时能进去但有时提示密码错误啊!!!!rn$company $pwd 是由登陆页面用表单提交过来的rn请高手指点
jdbc批处理进行多条数据插入
package cn.linjun.demo; import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; import java.sql.Statement; public class DemoBrach { private static Co...
笔试题,大家看有什么好方法.
1. 有双向循环链表结点定义为: rnstruct node rn int data; rnstruct node *front,*next; rn; rn有两个双向循环链表A,B,知道其头指针为:pHeadA,pHeadB,请写一函数将两链表中data值相同的结点删除 rnrn2. 编程实现:找出两个字符串中最大公共子字符串,如"abccade","dgcadde"的最大子串为"cad" rnrn3. 编程实现:把十进制数(long型)分别以二进制和十六进制形式输出,不能使用printf系列库函数 rn
大家看有什么解决办法
我有这样一个表: rn DeptName Note rn AAA UU rn AAA VV rn BBB XX rn BBB YY rn BBB MM rn CCC OO rn我现在想要得到的结果是: rn AAA 1.UU2.VV rn BBB 1.XX 2.YY 3.MM rn CCC 1.OO
大家帮我看下面的代码问题么?
where[]是一个数组,里面的值一部分存的是“”,一部分存的是具体值。我要过滤出“”,把存有具体值的存到value[]中。rn<em>代码</em>如下:rnfor(int k=0;k
大家帮我看下面的代码问题出在哪?
function detection()rnrn if(document.getElementById('pwuser').value=="")rn rn alert('用户名不能为空!');rn document.getElementById('pwuser').select();rn return false;rn rn rn if(document.getElementById('pwpwd').value=="")rn rn alert('密码不能为空!');rn document.getElementById('pwpwd').select();rn return false;rn rn rn if(document.getElementById('gdcode').value=="")rn rn alert('验证码不能为空!');rn document.getElementById('gdcode').select();rn return false;rn rn rn var str='';rn var pwuser=document.getElementById('pwuser').value;rn var pwpwd =document.getElementById('pwpwd').value;rn var gdcode=document.getElementById('gdcode').value;rn rn edk("detection.php?pwuser="+pwuser+"&pwpwd="+pwpwd+"&gdcode="+gdcode);rnrnrn<em>为<em>什么</em></em>最后一句edk这句不能运行,点击没有反应,在<em>什么</em>情况下,哪种可能性下它才不能运行?rndetection.php文件的内容:rnquery($sql);rnrn if($rd=$db->fetch_array($date))rnrn rnrn $err='ok';rnrn elsernrn $err='err001';rnrn rnrn //print '123456789';rnrn $sid = GetCookie('sid');rnrn //@extract($db->get_one("SELECT nmsg FROM pw_cknum WHERE sid='$sid'"));rnrn $sqls="SELECT nmsg FROM pw_cknum WHERE sid='$sid'";rnrn $row=$db->query($sqls);rnrn if($rs=$db->fetch_array($row))rnrn rnrn $nmsg=$rs['nmsg'];rnrn rnrn rnrn if(!$code or $nmsg!=$code)rnrn //if(!$code)rnrn //验证失败rnrn if($err=='ok')rnrn rnrn $err='err002';rnrn rnrn //Showmsg('check_error',1);rnrn else //验证成功rnrn if($err=='ok')rnrn rnrn $err='ok';rnrn rnrn rnrn rnrn return $err;rnrnrnrn?>
初学者,大家帮忙看看有什么错误
程序1:rnset Record = Server.CreateObject("ADODB.Recordset")rnsql="Insert INTO user(username) VALUES('"&username&"')"rnRecord.Open sql,Connrn---------------rnError Type:rnMicrosoft JET Database Engine (0x80040E14)rnSyntax error in INSERT INTO statement.rn----------------rn程序2:rnset Record = Server.CreateObject("ADODB.Recordset")rnRecord.Open "[user]",conn,1,3rnRecord.addnewrn----------------rnError Type:rnMicrosoft JET Database Engine (0x80040E09)rnCannot update. Database or object is read-only.rn----------------rnrniis已经设了相应目录可写了
大家帮忙看看有什么错~谢谢
rnrn他总是报错:指定的转换无效
三道面试题,大家看有什么思路。
3题两小时,2条编程,一条逻辑题rnrn 1、给一个字符串、例如 “ababc”要求返回“ab”rn 因为“ab”连续重复出现且最长。rnrn 用C/C++语言写一函数<em>完成</em>该算法,给出复杂度rnrn 2、对序列1、1、2、3、5、8、13。。。。 是Fab..数列rn 2、3、5、13...是Fab..质数数列,因为他们与自己前面的Fab...数列都互质rnrn 给出k,返回第k小的Fab..质数rnrn 3、101个硬币100真、1假,真假区别在于重量。请用无砝码天平称两次给出rn 真币重还是假币重的结论。rn
hibernate插入百万级数据效率问题
有百万级的<em>数据</em>需要通过<em>hibernate</em><em>插入</em>,而且还有需要级联<em>插入</em>的<em>数据</em>。我用多线程<em>插入</em>,现在只能达到平均每秒钟<em>插入</em>30条的样子,这个<em>效率</em>实在有点低。请熟悉<em>hibernate</em>的朋友讲讲关于<em>插入</em>大<em>数据</em>的心得,给小弟一些启发。rnrn 只有30分了不要嫌少
大家帮我看下面的代码有没有问题
// 是否为重复设备rn DWORD ip = pdfInfo->ip;rn int iItem = FindDeviceItem(ip); //判断设备信息的IP是否在列表控件中rn if(iItem!=-1) // 已存在于设备列表中rn rn // 替换并删除旧的记录rn m_lstDevice.DeleteItem(iItem);//m_lstDevice是个列表控件的关联变量rn rn // 从设备信息数组中删除rn //DevArray是一个CPtrArray,里面存储了DeviceFindInfo(一个结构体)型指针rn //我是这样存储的,DeviceFindInfo DevInfo;DevArray.Add(&DeInfo);rn for(int i=0;iip==ip)rn rn rn DevArray.RemoveAt(i);rn pdoldInfo=NULL;rn break; rn rn rn rn 老是出错,不知道有<em>什么</em>隐患,谢谢高手指点
大家看下面的代码
procedure TForm1.Button1Click(Sender: TObject);rnvarrn hCom:THandle;rn Timeout:TCommTimeouts;rn Dataout,Datain:pchar;rn Overlapped:POverlapped;rn BufferSize:DWORD;rnbeginrn hcom:=CreateFile('Com3',rn GENERIC_READ or GENERIC_WRITE,rn 0,rn nil,rn OPEN_EXISTING,rn FILE_ATTRIBUTE_NORMAL or FILE_FLAG_OVERLAPPED,rn 0);rn Timeout.ReadIntervalTimeout:=10;rn Timeout.ReadTotalTimeoutMultiplier:=20;rn Timeout.ReadTotalTimeoutConstant:=30;rn SetCommTimeouts(hCom,Timeout);rn SetEvent(hCom);rnrn Dataout:='S';rn GetMem(overlapped,sizeof(TOverlapped));rn BufferSize:=4096;rn GetMem(Datain,4096);rnrn if WriteFile(hCom,Dataout,1,BufferSize,Overlapped) thenrn showmessage('Write Right');rn if ReadFile(hCom,Datain,1,BufferSize,Overlapped) thenrn showmessage('Read Right');rnrn //showmessage(string(Datain));rnrn FreeMem(Datain);rn FreeMem(Overlapped);rn Closehandle(hCom);rnend;rnrn上面的<em>代码</em>应该是发送一字符,读取一个字符,上面的<em>代码</em>能否正确执行,得到想要的结果,这个<em>代码</em>我找来的。
大家看下面的代码
这是一位网友写的,我将成整理成项目,但调试不成功。rn.h Filern#ifndef MAINHrn#define MAINHrn#include rnusing namespace std;rnrnclass Animal //The class Animal is a abstract and virtual classrnrn public:rn virtual void WhoAmI()=0;rn;rnclass AnimalFactory:public Animalrnrn private:rnrn public:rn AnimalFactory();rn static Animal* CreateByName(const char *ClassName);rn virtual ~AnimalFactory();rnrn protected:rn virtual Animal* DoCreateObject()=0;rn virtual const char *GetClassName();rn virtual void RegFactory(const char *ClassName);rn virtual void UnRegFactory(const char *ClassName);rn;rnclass Dog:public Animalrnrn private:rnrnrnrn public:rn virtual void WhoAmI();rnrn;rnclass DogFactory:public AnimalFactoryrnrn private:rn public:rn DogFactory();rn protected:rn virtual const char* GetClassName();rn virtual Animal* DoCreateObject();rn;rnclass Cat:public Animalrnrn public:rn virtual void WhoAmI();rn;rnrnclass CatFactory:public AnimalFactoryrnrn private:rn public:rn CatFactory();rn protected:rn const char *GetClassName();rn virtual Animal *DoCreateObject();rn;rn#endifrn.cpp Filernrn//---------------------------------------------------------------------------rnrn#include rn#pragma hdrstoprn#include "Main.h"rn#include rn#include rn#include rnusing namespace std;rn#pragma argsusedrntypedef map TStrToFactory;rnTStrToFactory FactoryMap;rnAnimal *AnimalFactory::CreateByName(const char *ClassName)rnrn TStrToFactory::iterator theIterator=FactoryMap.find(String(ClassName));rn if(theIterator!=FactoryMap.end())rn rn return (*theIterator).second->DoCreateObject();rn rn elsern rn return NULL;rn rnrn//------------------------------------------------------rnvoid AnimalFactory::RegFactory(const char *ClassName)rnrn FactoryMap.insert(TStrToFactory::value_type(String(ClassName),this));rnrnvoid AnimalFactory::UnRegFactory(const char *ClassName)rnrn FactoryMap.erase(String(ClassName));rnrnvoid Dog::WhoAmI()rnrnrn cout<WhoAmI();rn delete X;rn delete Y;rn getch();rn return 0;rnrn//---------------------------------------------------------------------------rnrnrn
大家看有什么好的算法
一个表格table 可能有n行x列 n和x都是变化的,会根据不同的参数变化rn从<em>数据</em>库中取出n*x列,把每条记录包括主题,描述等信息写到每个单元格中rn<em>大家</em>有<em>什么</em>好的算法吗rn(没分了,以后一定补上)rn
大家看有什么好的意见。
本人现有一笔记用cardbus网卡,以前是有个驱动的,送修后硬盘被分区了,现在没有了驱动,包括windows XP、2003在内的所有操作系统都不认,上面的铭牌表示是KINGMAX的,但无型号,事实上KINGMAX也没也过这么一款网卡,不知道<em>大家</em>能不能提供这种网卡的通用驱动。
求解啊,大家看有什么错误
求解啊,<em>大家</em>看<em>看有</em><em>什么</em>错误,图书馆管理系统 ,只编写了两个功能,入库能没<em>问题</em> ,为啥输不出来呢?rnrn#includern#includernstruct Bookrnrn int BookID;rn char BName[10]; rn char Writer[10]; rn char Bclass[10];rn int AllNumber,NowNumber;rn rn Book *next;rn;rnrnBook*InBook(Book*bookh,Book*bookr);rnvoid BPrint(Book*bookh);rnrnint main()rnrn int n;rnrnBook*bookh=NULL;rnBook*bookr=NULL;rnwhile (true)rn rn printf("\n\n\n");rn printf("******************************************************************\n");rn printf("* 图书管理系统 *\n");rn printf("******************************************************************\n");rn printf("\n");rn printf("请选择:\n");rn printf("\t1.图书入库\n");rn printf("\t2.查看图书\n");rn printf("\t4.删除图书\n");rn printf("\t3.借阅图书\n");rn printf("\t4.查询借阅\n");rn printf("\t5.归还图书\n");rn printf("\t0.退出\n");rn printf("\n");rn rn printf("输入选择");rn scanf("%d",&n);rn switch(n)rn rn case 0 :/*退出*/rn rn return 0;rn break;rn rn case 1:/*图书入库*/rn rn InBook(bookh,bookr);rn break;rn rncase 2:rn rn BPrint(bookh);rn break;rn rn rnrn return 0;rn rnrnBook *InBook(Book*bookh,Book*bookr)rnrnBook*s=(Book*)(malloc(sizeof(Book)));rnprintf("id");rnscanf("%d",&s->BookID);rnprintf("all");rnscanf("%d",&s->AllNumber);rnprintf("now");rnscanf("%d",&s->NowNumber);rnprintf("class");rnscanf("%s",s->Bclass);rnprintf("name");rnscanf("%s",s->BName);rnprintf("writer");rnscanf("%s",s->Writer);rnif(bookh==NULL)rnbookh=s;rnelse bookr->next=s;rnbookr=s;rnif(bookr!=NULL) bookr->next=NULL;rnreturn bookh;rnrnrnvoid BPrint(Book*bookh)rnrn Book *p;rn p=bookh;rnwhile(p!=NULL)rn rn printf("%d",p->BookID);rn printf("%d",p->AllNumber);rn /*rn puts(p->BName);rn puts(p->Writer);rn puts(p->Bclass);rn printf("\n");*/rn p=p->next;rn rn rn rn
我是初学者,各位前辈帮我看有什么错误!
rnrnrn rn rn rn 您是第rn rn 个访问本站的客户rn rn
我用AJAX提交保存数据大家帮我看有什么问题
[code=PHP]rnadd.phprn rnrn rn id: rn bookname: rn issuDate: rn price: rn synopsis: rn Maker: rn publisher: rn rn rnrnsave.phprnrnrnrnrnrn按保存后没有反应,<em>大家</em><em>帮我</em>看<em>看有</em><em>什么</em><em>问题</em>。rn[/code]rnrn
批处理Batch 插入1000数据的测试
import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; public class Connect...
大家帮我看下这段代码...
[code=HTML] rn rn rn rn 说明一rn rn 说明二rn rn 说明三rn 说明四rn rn 说明五rn rn rn rn rn rn rn[/code]rnrn效果:[img=http://pb.images22.51img1.com/6000/wuxuezhouge/ba3b769f14e57db46dd5e91096f0fc74.jpg][/img]rnrn找了个<em>代码</em>··rn但发现图片和图片的距离很远,想搞近些,但就是不知道怎么修改·~rn看了下<em>代码</em>·好像要改DIV的CSS,但<em>代码</em>里的是id=www_qpsh_com 根本找不到它的CSS来修改·rn<em>大家</em>知道<em>为<em>什么</em></em>吗?有<em>什么</em>办法?rnrn
大家帮我看下这个代码
用红色画个矩形rn<em>代码</em>如下:rnNAME XITI7_1rnC_SEG SEGMENT PARArn ASSUME CS:C_SEGrnSTART: MOV AH,00Hrn MOV AL,10Hrn INT 10Hrn MOV AH,0CHrn MOV DX,50rn MOV CX,100rn MOV AL,04HrnAGAIN1: INT 10Hrn INC DXrn CMP DX,200rn JBE AGAIN1rn DEC DXrnAGAIN2: INT 10Hrn INC CXrn CMP CX,400rn JBE AGAIN2rn DEC CXrnAGAIN3: INT 10Hrn DEC CXrn CMP CX,100rn JAE AGAIN3rn INC CXrnAGAIN4: INT 10Hrn DEC DXrn CMP DX,50rn JAE AGAIN4rn MOV AH,4CHrn INT 21HrnC_SEG ENDSrn END STARTrn运行结果却是花屏,<em>为<em>什么</em></em>呢。。
大家帮我看下这个代码!
<em>代码</em>如下:rn01 function isint($str) rn02 $str = (string)$str; rn03rn04 $pos = 0; rn05 $len = strlen($str); rn06 for($i=0;$i) $pos++; rn08 else break; rn09 rn10 $str = substr($str,$pos); rn11rn12 $int = (int)$str; rn13 if($str==(string)$int) return true; rn14 else return false; rn15 rn rn<em>问题</em>:rn请问这是一个判断是否为整数的程序吗?rn第7行<em>为<em>什么</em></em>要判断是否为0,第10行<em>为<em>什么</em></em>又要使用substr函数?rn有<em>什么</em>用意?
大家帮我看下这段代码???
rn==============================rn rn rnrnrnrn点按钮没有反应是<em>什么</em>原因rn提交路径没有<em>问题</em>的rn
一条纪录对应多条纪录,复杂,大家帮我看有什么办法,先谢谢啦!!!!
有没有写过这样的SQL语句:表中的一条纪录,字段A=01时,显示一条纪录,同时字段A1赋为000001,B1取B字段的值;rn字段A=02时,显示两条纪录,字段A1分别赋为000002和000003,B1分别为B字段和C字段的值。rn原始纪录rnA B Crn01 11 00rn02 22 33rnrn之后rnA1 B1 rn000001 11 rn000002 22rn000003 33rnrnrnrn
帮我看下代码问题
用C++写了个时钟程序但无法运行 求组rn#include rn#include rn#include rn#include rnrn#define ID_TIMER 1rn#define TWOPI (2 * 3.14159)rnrnLRESULT CALLBACK WndProc (HWND, UINT, WPARAM, LPARAM) ;rnrnint WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance,rn PSTR szCmdLine, int iCmdShow)rn rn static char szAppName[] = "AnaClock" ;rn HWND hwnd;rn MSG msg;rn WNDCLASSEX wndclass ;rnrn wndclass.cbSize = sizeof (wndclass) ;rn wndclass.style = CS_HREDRAW | CS_VREDRAW ;rn wndclass.lpfnWndProc = WndProc ;rn wndclass.cbClsExtra = 0 ;rn wndclass.cbWndExtra = 0 ;rn wndclass.hInstance = hInstance ;rn wndclass.hIcon = NULL ;rn wndclass.hCursor = LoadCursor (NULL, IDC_ARROW) ;rn wndclass.hbrBackground = (HBRUSH) GetStockObject (WHITE_BRUSH) ;rn wndclass.lpszMenuName = NULL ;rn wndclass.lpszClassName = szAppName ;rn wndclass.hIconSm = NULL ;rnrn RegisterClassEx (&wndclass) ;rnrn hwnd = CreateWindow (szAppName, "Analog Clock",rn WS_OVERLAPPEDWINDOW,rn CW_USEDEFAULT, CW_USEDEFAULT,rn CW_USEDEFAULT, CW_USEDEFAULT,rn NULL, NULL, hInstance, NULL) ;rnrn if (!SetTimer (hwnd, ID_TIMER, <em>1000</em>, NULL))rn rn MessageBox (hwnd, "Too many clocks or timers!", szAppName,rn MB_ICONEXCLAMATION | MB_OK) ;rn return FALSE ;rn rnrn ShowWindow (hwnd, iCmdShow) ;rn UpdateWindow (hwnd) ;rnrn while (GetMessage (&msg, NULL, 0, 0))rn rn TranslateMessage (&msg) ;rn DispatchMessage (&msg) ;rn rn return msg.wParam ;rn rnrnvoid SetIsotropic (HDC hdc, int cxClient, int cyClient)rn rn SetMapMode (hdc, MM_ISOTROPIC) ;rn SetWindowExtEx (hdc, <em>1000</em>, <em>1000</em>, NULL) ;rn SetViewportExtEx (hdc, cxClient / 2, -cyClient / 2, NULL) ;rn SetViewportOrgEx (hdc, cxClient / 2, cyClient / 2, NULL) ;rn rnrnvoid RotatePoint (POINT pt[], int iNum, int iAngle)rn rn int i ;rn POINT ptTemp ;rnrn for (i = 0 ; i < iNum ; i++)rn rn ptTemp.x = (int) (pt[i].x * cos (TWOPI * iAngle / 360) +rn pt[i].y * sin (TWOPI * iAngle / 360)) ;rnrn ptTemp.y = (int) (pt[i].y * cos (TWOPI * iAngle / 360) -rn pt[i].x * sin (TWOPI * iAngle / 360)) ;rnrn pt[i] = ptTemp ;rn rn rnrnvoid DrawClock (HDC hdc)rn rn int iAngle ;rn POINT pt[3] ;rnrn for (iAngle = 0 ; iAngle < 360 ; iAngle += 6)rn rn pt[0].x = 0 ;rn pt[0].y = 900 ;rnrn RotatePoint (pt, 1, iAngle) ;rnrn pt[2].x = pt[2].y = iAngle % 5 ? 33 : 100 ;rnrn pt[0].x -= pt[2].x / 2 ;rn pt[0].y -= pt[2].y / 2 ;rnrn pt[1].x = pt[0].x + pt[2].x ;rn pt[1].y = pt[0].y + pt[2].y ;rnrn SelectObject (hdc, GetStockObject (BLACK_BRUSH)) ;rnrn Ellipse (hdc, pt[0].x, pt[0].y, pt[1].x, pt[1].y) ;rn rn rnrnvoid DrawHands (HDC hdc, struct tm *datetime, BOOL bChange)rn rn static POINT pt[3][5] = 0, -150, 100, 0, 0, 600, -100, 0, 0, -150,rn 0, -200, 50, 0, 0, 800, -50, 0, 0, -200,rn 0, 0, 0, 0, 0, 0, 0, 0, 0, 800 ;rn int i, iAngle[3] ;rn POINT ptTemp[3][5] ;rnrn iAngle[0] = (datetime->tm_hour * 30) % 360 + datetime->tm_min / 2 ;rn iAngle[1] = datetime->tm_min * 6 ;rn iAngle[2] = datetime->tm_sec * 6 ;rnrn memcpy (ptTemp, pt, sizeof (pt)) ;rnrn for (i = bChange ? 0 : 2 ; i < 3 ; i++)rn rn RotatePoint (ptTemp[i], 5, iAngle[i]) ;rnrn Polyline (hdc, ptTemp[i], 5) ;rn rn rnrnLRESULT CALLBACK WndProc (HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam)rn rn static int cxClient, cyClient ;rn static struct tm dtPrevious ;rn BOOL bChange ;rn HDC hdc ;rn PAINTSTRUCT ps ;rn time_t lTime ;rn struct tm *datetime ;rnrn switch (iMsg)rn rn case WM_CREATE :rn time (&lTime) ;rn datetime = localtime (&lTime) ;rnrn dtPrevious = * datetime ;rn return 0 ;rnrn case WM_SIZE :rn cxClient = LOWORD (lParam) ;rn cyClient = HIWORD (lParam) ;rn return 0 ;rnrn case WM_TIMER :rn time (&lTime) ;rn datetime = localtime (&lTime) ;rnrn bChange = datetime->tm_hour != dtPrevious.tm_hour ||rn datetime->tm_min != dtPrevious.tm_min ;rnrn hdc = GetDC (hwnd) ;rnrn SetIsotropic (hdc, cxClient, cyClient) ;rnrn SelectObject (hdc, GetStockObject (WHITE_PEN)) ;rn DrawHands (hdc, &dtPrevious, bChange) ;rnrn SelectObject (hdc, GetStockObject (BLACK_PEN)) ;rn DrawHands (hdc, datetime, TRUE) ;rnrn ReleaseDC (hwnd, hdc) ;rnrn dtPrevious = *datetime ;rn return 0 ;rnrn case WM_PAINT :rn hdc = BeginPaint (hwnd, &ps) ;rnrn SetIsotropic (hdc, cxClient, cyClient) ;rn DrawClock (hdc) ;rn DrawHands (hdc, &dtPrevious, TRUE) ;rnrn EndPaint (hwnd, &ps) ;rn return 0 ;rnrn case WM_DESTROY :rn KillTimer (hwnd, ID_TIMER) ;rn PostQuitMessage (0) ;rn return 0 ;rn rn return DefWindowProc (hwnd, iMsg, wParam, lParam) ;rn rnrn
高手帮我看有什么问题
显示一个字符串中某个指定字符出现的次数rnrn#includern#includern#includernrnvoid main()rnrn char letter[10],j;rn int abc,n,z,m,i;rn rn abc=abcd(letter[i],j);rn rn printf ("enter:");rn scanf ("%d",&m);rn printf ("enter:");rn for (i=0;i
帮我看有何错误?
从sqlserver向mysql倒入<em>数据</em>:rnrn执行显示:rnParse error: parse error, unexpected T_VARIABLE in D:\icbcoa\zhuanhuan.php on line 3
帮我看有什么问题,急
\n";rnecho "$query\n\n";rn$numcols = 0;rnwhile(ora_fetch($cursor)) rn $numcols = ora_numcols($cursor);rn for ($column=0; $column < $numcols; $column++) rn $data = trim(ora_getcolumn($cursor, $column));rn if($data == "") $data = "NULL";rn echo "$data\t";rn rn echo "\n";rnrn$numrows = ora_numrows($cursor);rnecho "\nROWS RETURNED: $numrows\n";rnecho "\n";rnrnora_close($cursor);rnrn?>
我做得界面大家看有什么问题.
http://www.djtz.net/get.asp?get=147798
大家帮我看以下我的代码!~~
#include rn#include rnmain()rnrn int x,y,a,b,c;rn char s;rn x=1,y=2;rn clrscr();rn gotoxy(x,y);printf("______________________________________________");rn gotoxy(x,y+2);printf("| C LANGUAGE SYSTEM MUNE |");rn gotoxy(x,y+3);printf("|--------------------------------------------|");rn gotoxy(x,y+4);printf("|1.restart system |");rn gotoxy(x,y+5);printf("|2.close your PC |");rn gotoxy(x,y+6);printf("|3.media software |");rn gotoxy(x,y+7);printf("|4.go to internet |");rn gotoxy(x,y+8);printf("|5.online help |");rn gotoxy(x,y+9);printf("|6.count |");rn gotoxy(x,y+10);printf("|--------------------------------------------|");rn gotoxy(x,y+11);printf("| |ver:1.0(2004.4) |");rn gotoxy(x,y+12);printf("|____________________________________________|");rn dorn rn gotoxy(3,y+11);rn scanf("%d",&a);rn switch(a)rn rn case1:system("shutdown -t o -r");break;rn case2:system("shutdown -t o -s");break;rn case3:system("c:\\programfiles\\windowsmediaplayer\\wnplayer.exe");break;rn case4:printf("sorry!! please your call server ");break;rn case5:printf("this is software made by SKYHEROCN i hope to you help!");break;rn case6:system("JISUANQI.exe");break;rn default:gotoxy(3,y+11);printf("please enter!");rn rn fflush(stdin);rn gotoxy(3,y+12);printf("GO ON(y/n)?");rn gotoxy(14,y+12);scanf("%c", &s);rn rn while (s=='y'||s=='Y');rn Zrn无法执行是啥回事啊~?
金山界面库代码_BKUIlib下载
金山界面库的开源代码,使用C++,采用DUI方式自绘界面 相关下载链接:[url=//download.csdn.net/download/nighsen/4628001?utm_source=bbsseo]//download.csdn.net/download/nighsen/4628001?utm_source=bbsseo[/url]
ha_MemTest下载
很好用的内存检测工具,已经经过本人亲自测试过 相关下载链接:[url=//download.csdn.net/download/dsryuguo/2642503?utm_source=bbsseo]//download.csdn.net/download/dsryuguo/2642503?utm_source=bbsseo[/url]
myeclipse中Axis2插件下载
myeclipse中Axis2插件axis2-eclipse-codegen-wizard和Axis2_Service_Archiver! 相关下载链接:[url=//download.csdn.net/download/ww1030028989/3719900?utm_source=bbsseo]//download.csdn.net/download/ww1030028989/3719900?utm_source=bbsseo[/url]
我们是很有底线的