求各位大神看一下哪里错了,怎么改。

错误:
ValueError: setting an array element with a sequence.

import tensorflow as tf
import scipy.io as sio
import numpy as np
import matplotlib.image as mpimg
import pickle as cp
import matplotlib.pyplot as plt
def get_batch(image, label, batch_size, now_batch, total_batch):
if now_batch < total_batch-1:
image_batch = image[now_batch*batch_size:(now_batch+1)*batch_size]
label_batch = label[now_batch*batch_size:(now_batch+1)*batch_size]
else:
image_batch = image[now_batch*batch_size:]
label_batch = label[now_batch*batch_size:]
return image_batch,label_batch

label_tain = list(sio.loadmat('dataset/corel5k_train_annot.mat')['annot1']) #加载文件

label_test = list(sio.loadmat('dataset/corel5k_test_annot.mat')['annot2'])

test_img = []
with open('dataset/corel5k_test_list.txt') as f:
for i in f.readlines():
test_img += [mpimg.imread('dataset/%s.jpeg'%i.strip())]
cp.dump(test_img,open("test.pkl","wb"))#一种保存列表的方式

train_img = []
with open('dataset/corel5k_train_list.txt') as f:
for i in f.readlines():
train_img += [mpimg.imread('dataset/%s.jpeg'%i.strip())]
cp.dump(train_img,open("train.pkl","wb"))

length=len(train_img)
for e in range(1,length+1):
train_img[e-1] = tf.image.resize_images(train_img[e-1], [128,192], method=0)
train_img[e-1] = tf.image.per_image_standardization(train_img[e-1])

def weight_variable(shape):
initial = tf.truncated_normal(shape, stddev=0.1)
return tf.Variable(initial)

def bias_variable(shape):
initial = tf.constant(0.1, shape=shape)
return tf.Variable(initial)

########卷积层、池化层接下来重复使用的,分别定义创建函数########

tf.nn.conv2d是TensorFlow中的2维卷积函数

def conv2d(x, W):
return tf.nn.conv2d(x, W, strides=[1, 1, 1, 1], padding='SAME')

使用2*2的最大池化

def max_pool_2x2(x):
return tf.nn.max_pool(x, ksize=[1, 2, 2, 1],strides=[1, 2, 2, 1], padding='SAME')
x = tf.placeholder(tf.float32,[None,128,192,3])
y_ = tf.placeholder(tf.float32,[None,260])

W_conv1 = weight_variable([3, 3, 3, 32])

用conv2d函数进行卷积操作,加上偏置

b_conv1 = bias_variable([32])

把x_image和权值向量进行卷积,加上偏置项,然后应用ReLU激活函数,

h_conv1 = tf.nn.relu(conv2d(x, W_conv1) + b_conv1)
#tf.global_variables_initializer().run()

对卷积的输出结果进行池化操作

h_pool1 = max_pool_2x2(h_conv1)
image_batch,label_batch = get_batch(train_img, label_train,5,0,9)

with tf.Session() as sess:
sess.run(tf.global_variables_initializer())
sess.run(h_pool1,feed_dict={x:image_batch,y_:label_batch})

0

1个回答

0
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
TXT在线小说管理器
不知道哪里写错了,各位大神帮忙指点下,告诉怎么进行修改
基于SCOKET的CS聊天工具
做好了不能用 请各位指点,不知道哪里有错误。IP地址不会弄。我的QQ601940219 求大神帮助
各位大虾帮忙看一下,哪里错了?怎么改?
我的jsp程序:rnrn<%@ page language="java" import="tax.*" %>rnrnrn 产品信息rn rnrnrnrnrn rn rn rn rn 用Beans的方法修改:rn 修改前 rn rn 产品:<%= TaxRate.getProduct() %> rn 税率:<%= TaxRate.getRate() %>rn rn <% TaxRate.setProduct("A002"); %>rn <% TaxRate.setRate(17); %>修改后rn rn rn 产品:<%= TaxRate.getProduct() %> rn 税率:<%= TaxRate.getRate() %>rn <% TaxRate.setProduct("A003"); TaxRate.setRate(25); %>rn rn rn rn rn <% TaxRate.setProduct("A003");TaxRate.setRate(25); %>rn rn 用jsp:setProperty>修改:rn 修改前: rn rn 产品: rn 税率:rn rn rn rn rn 修改后: rn rn 产品: rn 税率:rn rn rn rnrn rn rn rnrnrn在执行时出现下面的错误:rnorg.apache.jasper.JasperException: Cannot find any information on property 'Product' in a bean of type 'tax.TaxRate'rn请问各位该怎么解决啊?rnBean程序没有错。rnBeans程序:rnpackage tax;rn//创建TaxRate类rnpublic class TaxRaternrn //指明变量Product和Rate的类型rn String Product;rn double Rate;rn //TaxRate类的构造器rn public TaxRate()rn this.Product="A001";rn this.Rate=5;rn rn //TaxRate类的setProduct方法rn public void setProduct(String ProductName)rn this.Product=ProductName;rn rn //TaxRate类的getProduct方法rn public String getProduct()rn return(this.Product);rn rn //TaxRate类的setRate方法rn public void setRate(double rateValue)rn this.Rate=rateValue;rn rn //TaxRate类的getRate方法rn public double getRate()rn return(this.Rate);rn rn
求大神看一下哪里错了,急急急急
nn nn nn nn nn nn nn nn n n nnnn```n package caifu.life.ZhSQ;nnimport android.app.TabActivity;nimport android.content.Intent;nimport android.os.Bundle;nimport android.view.KeyEvent;nimport android.view.Window;nimport android.widget.RadioButton;nimport android.widget.RadioGroup;nimport android.widget.TabHost;nimport android.widget.TabWidget;nimport android.widget.Toast;nnpublic class MainActivity extends TabActivity n // 退出程序的量n private long exitTime = 0;nn public static TabHost mTabHost;n public static TabHost getmTabHost() n return mTabHost; n n private RadioGroup gr_bottom; n private RadioButton tab_shouYe, tab_zuanTi, tab_fengCai,tab_mine; nn @Overriden protected void onCreate(Bundle savedInstanceState) n super.onCreate(savedInstanceState);n setContentView(R.layout.activity_main);n //不要窗口标题n requestWindowFeature(Window.FEATURE_NO_TITLE);n mTabHost = getTabHost();n final TabWidget tabWidget = mTabHost.getTabWidget(); n tabWidget.setStripEnabled(false);// 圆角边线不启用 n //添加n个tab选项卡,定义他们的tab名,指示名,目标屏对应的类 n mTabHost.addTab(mTabHost.newTabSpec("shouye").setIndicator("0")n .setContent(new Intent(this, ShouYeActivity.class))); n mTabHost.addTab(mTabHost.newTabSpec("zuanti").setIndicator("1")n .setContent(new Intent(this, ZhuanTiActivity.class))); n mTabHost.addTab(mTabHost.newTabSpec("fengcai").setIndicator("2")n .setContent(new Intent(this, FengCaiActivity.class))); n mTabHost.addTab(mTabHost.newTabSpec("mine").setIndicator("3")n .setContent(new Intent(this, MineActivity.class))); n n gr_bottom = (RadioGroup)findViewById(R.id.rg_bottom);n tab_shouYe = (RadioButton)findViewById(R.id.shouYe);n tab_zuanTi = (RadioButton)findViewById(R.id.sheQuZhuanTi);n tab_fengCai = (RadioButton)findViewById(R.id.sheQuFengCai);n tab_mine = (RadioButton)findViewById(R.id.woDeSheQu);n n gr_bottom.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() n public void onCheckedChanged(RadioGroup group, int id) n if (id == tab_shouYe.getId()) n mTabHost.setCurrentTab(0); n else if (id == tab_zuanTi.getId()) n mTabHost.setCurrentTab(1); n else if (id == tab_fengCai.getId()) n mTabHost.setCurrentTab(2); n else if (id == tab_mine.getId()) n mTabHost.setCurrentTab(3); n n n ); n //设置当前显示哪个标签n mTabHost.setCurrentTab(0);n n n nn n n n nn // 再按一次退出程序n @Overriden public boolean onKeyDown(int keyCode, KeyEvent event) n if (keyCode == KeyEvent.KEYCODE_BACKn && event.getAction() == KeyEvent.ACTION_DOWN) n if ((System.currentTimeMillis() - exitTime) > 2000) n Toast.makeText(getApplicationContext(), "再按一次退出程序",n Toast.LENGTH_SHORT).show();n exitTime = System.currentTimeMillis();n else n finish();n // 返回桌面操作n Intent home = new Intent(Intent.ACTION_MAIN);n home.addCategory(Intent.CATEGORY_HOME);n startActivity(home);n n return true;n n return super.onKeyDown(keyCode, event);n nn n nnn求大神看一下哪里错了n```nYour content must have a TabHost whose id attribute is 'android.R.id.tabhost'爆这个错n
求大神帮忙看一下哪里错了
部分代码如下rn#ifndef LIBRARY_Hrn#define LIBRARY_Hrn#includernusing namespace std;rnclass Libraryrnrnpublic:rn Library(int,int,Catalogue,Borrower*);rn ~Library();rn void displayMessage()const;rn void displayBorrower()const;rn void setmulu();rn void setborr();rnprivate:rn int totalBook;rn int borrower;rn //就是下面两行报错,把Library类里有关这两个的注释掉就可以运行rn Catalogue mulu;rn Borrower *totalBorrower;rn;rnclass Cataloguernrnpublic:rn Catalogue(BookRecord* = NULL,int=0);rn ~Catalogue();rnprivate:rn BookRecord *totalBookRecord;rn int total;rn;rnvoid enterborrower();rnvoid enterbookrecord();rn#endifrnrn.cpp部分代码rnrn#includern#includern#includern#include"Library.h"rnusing namespace std;rnrnLibrary::Library(int a,int b,Catalogue c,Borrower *d)rn :mulu(c)rnrn totalBook = a;rn borrower = b;rn totalBorrower = d;rnrnrn[img=https://img-bbs.csdn.net/upload/201603/13/1457859281_434264.png][/img]rn大神帮帮忙
改错,求大神看一下哪里错了
#includenint my_strcmp(char *,char *);nint main()nnint p;nchar a[100]="you know,i miss you very much ";nchar b[100]="but sorry,i don't love you any more";np=my_strcmp(a,b);nprintf("%d\n",p);nreturn 0;nnint my_srtcmp(char *s,char *t)nnint result;nfor(;*s&&*t&&*s==*t;s++,t++)nif(*s==*t)nresult=0;nif(*s<*t)nresult=-1;nif(*s>*t)nresult=1;nreturn result;n
初中数学课件打包下载 这是我做辅导老师时,自己收集加整理的课件,希望对大家有用!!
这是我做辅导老师时,自己收集加整理的课件,希望对大家有用!!
各位 不知道哪里错了 求大神看一下好吗
先贴一下报错:HTTP Status 404 - There is no Action mapped for namespace [/] and action name [userAction_login] associated with context path [/video].rn我是真的不知道哪里错 求各位大神帮帮忙。好吗rn另外 我Struts、hibernate、spring都是最新版本的 。而且我actionrn这是结构:struts.xml在src路径下rn[img=https://img-bbs.csdn.net/upload/201803/06/1520347303_648539.png][/img]rn这是struts.xmlrn[code=text]rnrnrn rn rn /success.jsprn /success.jsprn rn rn[/code]rn这是action类的:我save方法可以实现,login方法不行rn[code=java]package action;rnrnimport com.opensymphony.xwork2.ActionSupport;rnimport com.opensymphony.xwork2.ModelDriven;rnrnimport bean.User;rnimport service.UserService;rnrnpublic class UserAction extends ActionSupport implements ModelDrivenrn /**rn * rn */rn private static final long serialVersionUID = 1L;rn private User user = new User();rnrn @Overridern public User getModel() rn return user;rn rn rn private UserService userService;rn rnrn public void setUserService(UserService userService) rn this.userService = userService;rn rn rn public String save()rn this.userService.saveUser(user);rn System.out.println("action:save");rn return "userSave";rn rn rn rn //用户登入rn public String login()rn this.userService.findUser(user);rn System.out.println("action:login");rn return "login";rn rn rn[/code]rn这是index.jsp的rn[code=text]<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>rn<%rnString path = request.getContextPath();rnString basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";rn%>rnrnrnrn rn rn rn My JSP 'index.jsp' starting pagern rn rn rn rn rn rn rn rn rn rn 登入名: rn 密码: rn rn rn rnrn[/code]rn这是applicationContext.xml:rn[code=java]rnrn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn[/code]rn
哪里错了,求大神!!!!
#includennvoid input(char*s)nnscanf("%s",s);nnvoid output(char*s)nnprintf("%s",s);nnvoid add(char*s1,char*s2,char*s)nnint i,j,k,k1,t=0;nn for(i=0;s1[i];i++);nn for(j=0;s2[j];j++);nn i--,j--;nn k=i>j?i:j;nn k1=k+1;nn s[k1]='\0';nn for(;i>=0&&j>=0;k--)nn nns[k]=s1[i--]+s2[j--]-'0'+t;nnt=s[k]>'9';nnif(t)s[k]-=10;nn nn for(;i>=0;k--)nn nns[k]=s1[i--]+t;nnt=s[k]>'9';nnif(t)s[k]-=10;nn nn for(;j>=0;k--)nn nns[k]=s2[j--]+t;nnt=s[k]>'9';nnif(t)s[k]-=10;nn nn if(t)nn nnfor(;k1>=0;k1--)s[k1+1]=s[k1];nns[0]='1';nn nnnnnnnvoid sub(char*s1,char*s2,char*s)nnint i,j,k,k1,t=0;nn for(i=0;s1[i];i++);nn for(j=0;s2[j];j++);nn i--,j--;nn k=i>j?i:j;nn k1=k+1;nn s[k1]='\0';nn for(;j>=0;k--)nn nns[k]=s1[i--]-s2[j--]+'0'-t;nnt=s[k]<'0';nnif(t)s[k]+=10;nn nn for(;i>=0;k--)nn nns[k]=s1[i--]-t;nnt=s[k]<'0';nnif(t)s[k]+=10;nn nnnnint comp(char*s1,char*s2)nnint i,j;nn for(i=0;s1[i];i++);nn for(j=0;s2[j];j++);nn if(i>j)return 1;nn if(i=0&&s1[i]==s2[i];i++);nn if(s1[i]>s2[i])return 1;nn if(s1[i]
计算器小型应用
小型计算器功能不太完善 求各位大神指教
contact[1].html
各位大神,我这里需要3个积分,求大神赐分,在此跪谢。
请各位看一下哪里错了!
本人想写个能统计问卷调查结果的程序,不知哪里错了,请各位指点一下,谢谢!!rn#include"stdio.h"rnvoid main()rnrnint M,N,m,n,x,y;rnint i,j;rnfloat m1,n1,x1,y1;rnchar t[1000][50];rnprintf("欢迎使用\n");rnprintf("请输入问卷份数M和问卷题数N:\n");rnprintf("M= ,N= ");rnscanf("%d,%d",&M,&N);rnprintf("\n");rnfor(j=0;j
出现问题的自绘组合框
出现问题的自绘组合框,能不能帮看一下。代码出现崩溃问题,在函数DrawItem中,不知道是哪里错了。
各位大神看看哪里错了
#include n#include n#include ntypedef structn char *str;nSElemType;ntypedef structn SElemType *base;n SElemType *top;n int stacksize;nSqStack;nint main()n SqStack *S;char *sch="Hello";n S->base=(SElemType *)malloc(10*sizeof(SElemType));n if(!S->base) return 0;n S->top=S->base;n S->stacksize=10;n S->top->str=(char *)malloc(10*sizeof(char));n strcpy(S->top->str,sch);n printf("%s",S->top->str);n return 0;nn想往栈里存入一个字符串,老是报错,不知道哪里错了
请问各位大神下面代码哪里错了,应该怎么改?
请问各位大神下面代码哪里错了,应该怎么改?rn public bool IsFullrn rn get return Customers.Count >= _package.Number; rn
刚学spring的问题
求看看spring的问题刚刚学习spring,在网上下的demo,感觉也对,就是不知道哪里错了
求大神指点 哪里错了?
private void lblMode_MouseClick(object sender, MouseEventArgs e)rn rn if (e.Button != MouseButtons.Left)rn return;rn int xPos, yPos;rn xPos = e.X / 31;rn yPos = e.Y / 31;rn struArr[xPos, yPos] = !struArr[xPos, yPos];rn bool b = struArr[xPos, yPos];rn Graphics gp = lblMode.CreateGraphics();rn SolidBrush s = new SolidBrush(b ? blockColor : Color.Black);rn gp.FillRectangle(s, 31 * xPos + 1, 31 * yPos + 1, 30, 30);rn gp.Dispose;rn
求大神看看哪里错了
12-16 18:08:09.120 6564-6564/? E/AndroidRuntime: FATAL EXCEPTION: mainrn java.lang.IllegalStateException: ArrayAdapter requires the resource ID to be a TextViewrn at android.widget.ArrayAdapter.createViewFromResource(ArrayAdapter.java:386)rn at android.widget.ArrayAdapter.getView(ArrayAdapter.java:362)rn at android.widget.AbsListView.obtainView(AbsListView.java:2424)rn at android.widget.ListView.makeAndAddView(ListView.java:1781)rn at android.widget.ListView.fillDown(ListView.java:679)rn at android.widget.ListView.fillFromTop(ListView.java:739)rn at android.widget.ListView.layoutChildren(ListView.java:1632)rn at android.widget.AbsListView.onLayout(AbsListView.java:2254)rn at android.view.View.layout(View.java:11467)rn at android.view.ViewGroup.layout(ViewGroup.java:4238)rn at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1644)rn at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1502)rn at android.widget.LinearLayout.onLayout(LinearLayout.java:1415)rn at android.view.View.layout(View.java:11467)rn at android.view.ViewGroup.layout(ViewGroup.java:4238)rn at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1644)rn at android.widget.LinearLayout.layoutHorizontal(LinearLayout.java:1633)rn at android.widget.LinearLayout.onLayout(LinearLayout.java:1417)rn at android.view.View.layout(View.java:11467)rn at android.view.ViewGroup.layout(ViewGroup.java:4238)rn at android.widget.FrameLayout.onLayout(FrameLayout.java:431)rn at android.view.View.layout(View.java:11467)rn at android.view.ViewGroup.layout(ViewGroup.java:4238)rn at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1644)rn at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1502)rn at android.widget.LinearLayout.onLayout(LinearLayout.java:1415)rn at android.view.View.layout(View.java:11467)rn at android.view.ViewGroup.layout(ViewGroup.java:4238)rn at android.widget.FrameLayout.onLayout(FrameLayout.java:431)rn at android.view.View.layout(View.java:11467)rn at android.view.ViewGroup.layout(ViewGroup.java:4238)rn at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1721)rn at android.view.ViewRootImpl.handleMessage(ViewRootImpl.java:2678)rn at android.os.Handler.dispatchMessage(Handler.java:99)rn at android.os.Looper.loop(Looper.java:137)rn at android.app.ActivityThread.main(ActivityThread.java:4514)rn at java.lang.reflect.Method.invokeNative(Native Method)rn at java.lang.reflect.Method.invoke(Method.java:511)rn at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:993)rn at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:760)rn at dalvik.system.NativeStart.main(Native Method)rn Caused by: java.lang.ClassCastException: android.widget.LinearLayout cannot be cast to android.widget.TextViewrn at android.widget.ArrayAdapter.createViewFromResource(ArrayAdapter.java:379)rn at android.widget.ArrayAdapter.getView(ArrayAdapter.java:362) rn at android.widget.AbsListView.obtainView(AbsListView.java:2424) rn at android.widget.ListView.makeAndAddView(ListView.java:1781) rn at android.widget.ListView.fillDown(ListView.java:679) rn at android.widget.ListView.fillFromTop(ListView.java:739) rn at android.widget.ListView.layoutChildren(ListView.java:1632) rn at android.widget.AbsListView.onLayout(AbsListView.java:2254) rn at android.view.View.layout(View.java:11467) rn at android.view.ViewGroup.layout(ViewGroup.java:4238) rn at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1644) rn at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1502) rn at android.widget.LinearLayout.onLayout(LinearLayout.java:1415) rn at android.view.View.layout(View.java:11467) rn at android.view.ViewGroup.layout(ViewGroup.java:4238) rn at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1644) rn at android.widget.LinearLayout.layoutHorizontal(LinearLayout.java:1633) rn at android.widget.LinearLayout.onLayout(LinearLayout.java:1417) rn at android.view.View.layout(View.java:11467) rn at android.view.ViewGroup.layout(ViewGroup.java:4238) rn at android.widget.FrameLayout.onLayout(FrameLayout.java:431) rn at android.view.View.layout(View.java:11467) rn at android.view.ViewGroup.layout(ViewGroup.java:4238) rn at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1644) rn at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1502) rn at android.widget.LinearLayout.onLayout(LinearLayout.java:1415) rn at android.view.View.layout(View.java:11467) rn at android.view.ViewGroup.layout(ViewGroup.java:4238) rn at android.widget.FrameLayout.onLayout(FrameLayout.java:431) rn at android.view.View.layout(View.java:11467) rn at android.view.ViewGroup.layout(ViewGroup.java:4238) rn at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1721) rn at android.view.ViewRootImpl.handleMessage(ViewRootImpl.java:2678) rn at android.os.Handler.dispatchMessage(Handler.java:99) rn at android.os.Looper.loop(Looper.java:137) rn at android.app.ActivityThread.main(ActivityThread.java:4514) rn at java.lang.reflect.Method.invokeNative(Native Method) rn at java.lang.reflect.Method.invoke(Method.java:511) rn at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:993) rn at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:760) rn at dalvik.system.NativeStart.main(Native Method) 
求大神帮忙!!哪里错了???
#include rnusing namespace std;rnrnclass xunhuanchain;rnrnclass nodernrnpublic:rn friend xunhuanchain;rnprivate:rn int data;rn node *link;rnrn;rnrnclass xunhuanchainrnrnpublic:rn xunhuanchain()head=new node;head=head->link;rn ~xunhuanchain();rnrn int nodesearch(int k); //查找krn bool insertnode(int k,int x); //在k后插入xrn bool deletenode(int k); //删除k节点前面的节点rnrnprivate:rn node *head; //头结点rn node *current; //指针rn;rnrnrnint xunhuanchain::nodesearch(int k) rnrn int index=1;rn node *temp=head->link;rn temp->data=k;rn while (temp->data!=k)rn temp=temp->link;rn index++;rn rn current=temp; //另current指针指向指向k所在节点rn return (temp==head) ?0:index;rnrnrnbool xunhuanchain::insertnode(int k,int x)rnrn nodesearch(k);rn [color=#FF0000]node *t=new node;[/color] //编译时这里会报错rn rnrn if (head==0)rn rn system("pause");rn rn head->link=t;rn t->link=head;rn t->data=x;rn return true;rn rn t->data=x;rn t->link=current->link;rn current->link=t;rnrn return true;rnrnrnbool xunhuanchain::deletenode(int k)rnrnrn if (nodesearch(k)==0) cout<<"无k节点"<link;rn node *temp3=temp2->link;rn rn while(temp3->data!=k)rn temp3=temp3->link;rn temp2=temp2->link;rn temp1=temp1->link;rn rn temp1->link=temp3;rn return true;rnrnrnint main()rnrn int a;rn system("pause");rn xunhuanchain ch1;rn system("pause");rn cout<<"输入节点"<>a;rn ch1.deletenode(a);rn system("pause");rn return 0;rn
哪里错了?该怎么改?
#include rn#include rnrnint main() rn int i = 0, x, r, get = 0, lost = 0, number;rn int t1 = 0, t2 = 0;rn char option, go;rnrn do rn i++;rn srand(time(0));rn x = rand() % 12 + 1;rn printf("=======================================================\n");rn printf("Guesses Choice:\n");rn printf("O-Odd E-Even L-Low M-Medium H-High N-Number\n");rn printf("=======================================================\n");rn printf("Enter your choice: ");rn scanf("%c", &option);rn getchar();rn [color=#FF0000] printf("Point at risk: "); rn scanf("%d", &r);[/color]rn rn switch (option) rn rn case 'O':rn case 'o':rn printf("Odd number\n");rn if( (x % 2) == 1) get = r;rn else lost = r;rn break;rn case 'E':rn case 'e':rn printf("Even number\n");rn if( (x % 2) == 0) get = r;rn else lost = r;rn break;rn case 'L':rn case 'l':rn printf("Low number\n");rn if(x <= 4) get = 2 * r;rn else lost = r;rn break;rn case 'M':rn case 'm':rn printf("Medium number\n");rn if(x >= 5 && x <= 8) get = 2 * r;rn else lost = r;rn break;rn case 'H':rn case 'h':rn printf("High number\n");rn if(x >= 9) get = 2 * r;rn else lost = r;rn break;rn case 'N':rn case 'n':rn printf("A number\n");rn printf("Enter your number: \n");rn scanf("%d", &number);rn if(x == number) get = 12 * r;rn else lost = r;rn break;rn default:rn printf("Try again!\n");rn rnrn printf("The winning number is %d.\n", x);rn if(get > 0) printf("You won %d points.\n", get);rn else printf("You lost %d points.\n", lost);rn t1 += get;rn t2 += lost;rn printf("Continue (Y/N)? ");rn scanf("%c", &go);rn getchar();rn while (go == 'Y' || go == 'y');rn printf("Total number of guesses: %d\n", i);rn printf("Your current point: %d\n", t1 - t2);rn system("pause");rnrnrn为何不能循环?rn红色字体该放哪?
大神帮忙看一下 js 哪里错了
我想使用function函数判断是否是闰年,在DW8里写的代码,写完代码运行,在浏览器里没有任何现实,到底是哪里出错了,新人还望大神指点。rn代码如下rn
javascript 大神帮我看一下哪里出错了
rnrnrn rn 无标题文档rn rnrnrnrn rn 你喜欢喝哪一种咖啡呀rn 拿铁 rn蓝山咖啡 rn卡布奇洛 rn爱尔兰咖啡 rnrnrnrnrn
请问各位大佬,哪里错了怎么改,谢谢
#include rn#include rnstruct NODE *p,*pr;rn p=(NODE*)malloc(sizeof(NODE));rn p->next=NULL;rn printf("input p data\n");rn scanf("%d",&d);rn p->data=d;rn if(head==NULL)rn rn head=p;rn rn elsern rn pr=head;rn while(pr->next!=NULL)rn rn pr=pr->next;rn rn pr->next=p;rn rn return head;rnrnvoid output(NODE*head)rnrn NODE *p=head;rn while(p!=NULL)rn rn printf("%d\n",p->data);rn p=p->next;rn rnrnmain()rnrn char c;rn NODE *head=NULL;rnNODE * aaa(NODE *head)rnrn int d;rnrn printf("creat a lianbiao\n");rn dorn rn printf("if input data?y or n\n");rn if(c=='y')rn rn head=aaa(head);rn rn while(c=='y');rn printf("all data are following\n");rn output(head);rn
求大神帮忙看一下,要怎么改
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'accountDetailService': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.inspur.picp.customer.service.CustomerService com.inspur.picp.account.service.AccountDetailService.customerService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'customerService': Invocation of init method failed; nested exception is java.lang.NumberFormatExceptionrn at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:334)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1214)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:543)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)rn at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)rn at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)rn at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)rn at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)rn at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:772)rn at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:839)rn at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:538)rn at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:444)rn at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:326)rn at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:107)rn at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5118)rn at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5634)rn at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)rn at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1571)rn at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1561)rn at java.util.concurrent.FutureTask.run(FutureTask.java:266)rn at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)rn at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)rn at java.lang.Thread.run(Thread.java:748)rnCaused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.inspur.picp.customer.service.CustomerService com.inspur.picp.account.service.AccountDetailService.customerService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'customerService': Invocation of init method failed; nested exception is java.lang.NumberFormatExceptionrn at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:573)rn at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88)rn at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:331)rn ... 22 morernCaused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'customerService': Invocation of init method failed; nested exception is java.lang.NumberFormatExceptionrn at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:136)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:408)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1570)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:545)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)rn at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)rn at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)rn at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)rn at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)rn at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:1192)rn at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1116)rn at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1014)rn at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:545)rn ... 24 morernCaused by: java.lang.NumberFormatExceptionrn at java.math.BigDecimal.(BigDecimal.java:596)rn at java.math.BigDecimal.(BigDecimal.java:383)rn at java.math.BigDecimal.(BigDecimal.java:806)rn at com.inspur.picp.customer.service.CustomerService.initConfig(CustomerService.java:87)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)rn at java.lang.reflect.Method.invoke(Method.java:498)rn at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleElement.invoke(InitDestroyAnnotationBeanPostProcessor.java:354)rn at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleMetadata.invokeInitMethods(InitDestroyAnnotationBeanPostProcessor.java:305)rn at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:133)rn ... 36 more
一个用C++写的求最短路径的代码
一个一个用C++写的求最短路径的代码,可以直接使用,若有不足的地方,请各位大神指教
PADS安装介绍
pads安装方法介绍。求pads vx2.4完整版安装包,谢谢各位大神
初级代码 求大神帮我看一下哪里错了
import java.util.*;rnpublic class Test rnrn public static void main(String[] args) rn String[] str = "a","b","a","b","c","a","b","c","d";rn Set set = new TreeSet();rn for(int i = 0;i < str.length;i++)rnrn set.add(str[i]);rn rn System.out.println(set); /*这里可以打印*/rn String[] str1 = (String[])set.toArray();rn for(String str2 : str1)rn System.out.println(str2); /*rn这里报错:Exception in thread "main" java.lang.ClassCastException: [Ljava.lang.Object; canrnnot be cast to [Ljava.lang.String;rn*/rnrn rn rn rnrnrn就是想用Set集合去重复,然后再转化成数组,但是报错了,大神帮我看下,谢谢
发错了不好意思额,各位谅解
发错了不好意思额,各位谅解发错了不好意思额,各位谅解发错了不好意思额,各位谅解发错了不好意思额,各位谅解
SPIN控件的使用问题
我的程序哪里错了为什么不能调节,,不知道哪里出错了,请大家看看,要写20字真是烦人
11出错了不好意思不知道怎么删除只能换成这样的标题
出错了,不好意思。也不知道该怎么改,试着改这个看是个什么样子
帮忙看一下哪里错了
DROP TABLE bdcubasdoc,bdcumandoc,icgeneralh,icgeneralb,bdinvclrncreate table bdcubasdoc(bd_cubasdocpk_cubasdoc varchar(10),bd_cubasdoccustname varchar(10)) /*客商档案:客商档案主键/客商名称 */ rninsert into bdcubasdoc values('a1','广州好地')rninsert into bdcubasdoc values('a2','广州力百')rninsert into bdcubasdoc values('a3','浙江那爱司')rncreate table bdcumandoc(bd_cumandocpk_cubasdoc varchar(10),bd_cumandocpk_cumandoc varchar(10))/*客商管理档案:客商档案主键/客商管理档案主键*/rninsert into bdcumandoc values('a1','1')rninsert into bdcumandoc values('a2','2')rninsert into bdcumandoc values('a3','3')rnrncreate table icgeneralh(ic_general_hcgeneralhid int ,ic_general_hcproviderid varchar(3),ic_general_hccustomerid varchar(3),ic_general_hcdispatcherid varchar(5))rn /* 出入库单表头:出入库单表头id/供应商ID/客户ID/收发类型id*/ rninsert into icgeneralh values(101,'2','','s')rninsert into icgeneralh values(102,'2','','s')rninsert into icgeneralh values(103,'','3','s')rninsert into icgeneralh values(104,'','3','s')rninsert into icgeneralh values(105,'3','','s')rninsert into icgeneralh values(106,'','1','s')rnrncreate table icgeneralb(ic_general_bcgeneralhid int ,ic_general_bnoutnum int,ic_general_bninnum int,ic_general_bcinvbasid varchar(20))rn /*出入库单表体:出入库单表头id/实出数量/实入数量/存货基本id */rninsert into icgeneralb values(101,5,'','K1')rninsert into icgeneralb values(102,'',2,'K2')rninsert into icgeneralb values(103,4, '','K1')rninsert into icgeneralb values(104,'',3,'K1')rninsert into icgeneralb values(105,'',8,'K3')rninsert into icgeneralb values(106,3,'','K3')rncreate table bdinvcl(bd_invbasdocpk_invbasdoc varchar(20),bd_invbasdocinvname varchar(20))rn/*存货管理档案:存货档案主键/存货名称*/rninsert into bdinvcl values('k1','AES')rninsert into bdinvcl values('K2','包装桶')rninsert into bdinvcl values('K3','AE03')rnrnrnrngornrnselect bd_cubasdoccustname as g01,bd_invbasdocinvname as g02 ,sum(isnull(a.ic_general_bnoutnum,0) - isnull(a.ic_general_bninnum,0)) as g03rn from bdcubasdoc join bdcumandoc on bd_cubasdocpk_cubasdoc=bd_cumandocpk_cubasdocrnjoin rn(select ic_general_hcproviderid,ic_general_bnoutnum,ic_general_bninnum,ic_general_bcinvbasid rn from icgeneralh inner join icgeneralbrnon ic_general_hcgeneralhid=ic_general_bcgeneralhid rn where ic_general_hccustomerid=' 'rnunion all rnselect ic_general_hccustomerid,ic_general_bnoutnum,ic_general_bninnum ,ic_general_bcinvbasid rnfrom icgeneralh inner join icgeneralb on ic_general_hcgeneralhid=ic_general_bcgeneralhid rnwhere ic_general_hcproviderid=' ') arn rnon bd_cumandocpk_cumandoc=a.ic_general_hcproviderid left outer join bdinvcl on bd_invbasdocpk_invbasdoc=a.ic_general_bcinvbasidrngroup by bd_cubasdoccustname,bd_invbasdocinvnamernrnrnrn服务器: 消息 213,级别 16,状态 5,行 1rn插入错误: 列名或所提供值的数目与表定义不匹配。rn服务器: 消息 213,级别 16,状态 1,行 1rn插入错误: 列名或所提供值的数目与表定义不匹配。rn服务器: 消息 213,级别 16,状态 1,行 1rn插入错误: 列名或所提供值的数目与表定义不匹配。rn服务器: 消息 213,级别 16,状态 1,行 1rn插入错误: 列名或所提供值的数目与表定义不匹配。rn服务器: 消息 213,级别 16,状态 1,行 1rn插入错误: 列名或所提供值的数目与表定义不匹配。rn服务器: 消息 213,级别 16,状态 1,行 1rn插入错误: 列名或所提供值的数目与表定义不匹配。rnrn(所影响的行数为 5 行)rnrn
帮忙看一下,哪里错了~~
Sub updrn Dim u_bianhao, u_qidian, u_zhongdian, u_chexing, u_checi, u_facheshijian, u_fangxiang, u_notern u_bianhao = Trim(Request.Form("u_bianhao"))rn u_qidian = Trim(Request.Form("u_qidian"))rn u_zhongdian = Trim(Request.Form("u_zhongdian"))rn u_chexing = Trim(Request.Form("u_chexing"))rn u_checi = Trim(Request.Form("u_checi"))rn u_facheshijian = Trim(Request.Form("u_facheshijian"))rn u_fangxiang = Trim(Request.Form("u_fangxiang"))rn u_note = Trim(Request.Form("u_note"))rnrn MM_editQuery = "UPDATE [checi] SET " & _ rn "bianhao = " & to_sql(u_bianhao,"number") & ", " & _ rn "qidian = " & to_sql(u_qidian,"text") & ", " & _ rn "zhongdian = " & to_sql(u_zhongdian,"text") & ", " & _ rn "chexing = " & to_sql(u_chexing,"text") & ", " & _ rn "checi = " & to_sql(u_checi,"text") & ", " & _ rn "facheshijian = " & to_sql(u_facheshijian,"text") & ", " & _ rn "fangxiang = " & to_sql(u_fangxiang,"number") & ", " & _ rn "note = " & to_sql(u_note,"text") & " WHERE " & _ rn "bianhao = " & to_sql(u_bianhao,"number") & ""rnrn Set MM_editCmd = Server.CreateObject("ADODB.Command")rn MM_editCmd.ActiveConnection = MM_conn_STRINGrn MM_editCmd.CommandText = MM_editQueryrn MM_editCmd.Executern MM_editCmd.ActiveConnection.ClosernEnd sub
各位高手帮帮忙,看一下哪里错了,急!!
答复对象 错误 'ASP 0156 : 80004005' rnrn头错 rnrn/default1.asp,行10 rnrnHTTP 头已经写入到 客户浏览器。任何 HTTP 头的修改必须在写入页内容之前。 rnrnrn///////////////////////////////////////////////////////////rnrndefault1.asp的内容如下:rnrnrn<%@LANGUAGE="VBSCRIPT" CODEPAGE="CP_ACP"%>rnrnrn rn 无标题文档rnrnrnrn<%if session("txtClass")="普通会员" thenrn     session("grade")="2"rn else rn if session("txtClass")="vip会员" thenrn session("grade")="3"rn end if rn  session("grade")="1"rn rnend ifrn rn response.Redirect( "listproduct3.asp" ) rn %>rnrnrnrn
易语言钓鱼源码
求大神买走 求大神买走 易语言钓鱼源码
帮我看一下哪里错了?
下面这段程序是把:A quick brown fox jumps over the lazy dog 这句话反过来显示的。编译没错。运行的时候结果显示的是乱码。我不知道哪里错了。麻烦大哥大姐帮我一下。rndata segmentrnstr db 'A quick brown fox jumps over the lazy dog','$'rnlen=$-offset strrndata endsrnextr segmentrnstr1 db len dup('?'),'$'rnextr endsrncode segmentrnassume cs:code,ds:data,es:extrrnmain:rn mov ax,extrrn mov es,axrn mov ax,datarn mov ds,axrn mov si,offset strrn mov di,offset str1rn add di,len ;如果把这句去掉,并把下面的std改为cld则字符串按原样输出。rn mov cx,lenrn stdrn rep movsbrn mov ax,esrn mov ds,axrn mov dx,offset str1rn mov ah,09hrn int 21hrn mov ah,4chrn int 21hrncode endsrnend main
看一下,哪里有错了?
先声明rnrnt=array[1..7]of ttimer;rnrn然后在rnrnform1.create里负值rnrnt[1].interval:=1000;rnrnt[2].interval:=1000;rnrnt[3].interval:=1000;rnrnt[4].interval:=1000;rnrn为何执行时会报错rnrn应该怎么写?rn
帮忙看一下,哪里错了?
procedure TFrmserver.Button1Click(Sender: TObject);rnbeginrn myinifile.WriteString('setup','srv_name',edit1.Text);rn myinifile.WriteString('setup','srv_data',edit2.Text);rn myinifile.WriteString('setup','user_name',edit3.Text);rn myinifile.WriteString('setup','user_pwd',edit4.Text);rn myinifile.Destroy;rn button1.ModalResult := mrok;rnend;rnrn运行后老是出错!
看一下哪里错了,
rnrnrn 图片置换rnrnrn rnrnrnrn
求位数以及各位数字之和
输入一个整数 in,求它的位数以及各位数字之和。例如 123 的各位数字之和是 6,位数是 3。 输入: 4        (repeat=4) 0        (in=0) 23456    (in=23456) -100     (in=-100) -1       (in=-1) 输出: count = 1, sum = 0 (0的位数是1, 各位数字之和是0) coun...
用递归求各位数字之和 C++实现
输入一个数字,求其个十百千万...各数字之和 要求:编写递归函数实现