JPAcontainer这里的教程:https://vaadin.com/download/jpacontainer-tutorial/
表示您需要一个H2数据库驱动程序JPAcontainer.我不明白为什么?- 你有什么功能没有H2那么好JPAcontainer?
def user_info(request, template_name='social/retrieve_user_data.html', username=None):
user = User.objects.get(username=username)
if request.method == 'POST':
form = UserInfoForm(request.POST, user)
print(form.is_valid())
if form.is_valid():
form.save()
else:
print('not post')
form = UserInfoForm(user)
return render_to_response(template_name, RequestContext(request, {
'form': form,
}))
class UserInfoForm(forms.Form):
def __init__(self,*args,**kwargs):
self.user = kwargs.pop('user')
super(UserInfoForm,self).__init__(*args,**kwargs)
Run Code Online (Sandbox Code Playgroud)
这会产生一个带有异常值 u'user' 的 KeyError。这里有什么问题?在这两种情况下,表单都使用有效值 user 进行初始化。为什么我收到一个keyerror>
sampleInput =
2.1053 -4.8512 4.6223 0.9665 1.0000
hiddenWeights =
-0.6342 -0.2089 0.4533 -0.6182 -0.3663
-0.9465 -1.0770 -0.2668 0.7077 -1.1656
0.0936 -0.2853 -0.1408 0.6193 -0.5481
1.4253 0.3770 -0.6710 0.1069 0.0310
Run Code Online (Sandbox Code Playgroud)
我希望结果是hiddenWeights,每列等于前一列*2.1053.所以hiddenTights的第一列将是:
2.1053 * -0.6342
2.1053 * -0.9464
etc.
Run Code Online (Sandbox Code Playgroud) 我正在尝试为结构的二维数组编写吸气剂。我尝试了各种解决方案,而我的 IDE 抱怨所有这些。
static history_t history[3][6];
history_t **get_history(){
return history;
};
Run Code Online (Sandbox Code Playgroud)
根据我的理解,这是正确的。数组数组是指向指针的指针。但是,我的 IDE 抱怨指针类型不兼容。我一直无法找到任何历史签名和访问器的组合,这使我能够返回任何有用的东西。
这在 C 中是可能的吗?
warning: returning 'history_t (*)[6]' {aka 'struct <anonymous> (*)[6]'} from a function with incompatible return type 'history_t **' {aka 'struct <anonymous> **'} [-Wincompatible-pointer-types]
return history;
Run Code Online (Sandbox Code Playgroud)
所以,我的函数不是返回history_t **,而是history_t *[6]。但是,重新定义要返回的签名history_t*[6]也不起作用。