我有一个表"Bestelling"有4列:"Id"(PK),"KlantId","Datum","BestellingsTypeId",现在我想让列Id auto_increment,但是,当我尝试这样做时,我得到这个错误:
ERROR 1062: ALTER TABLE causes auto_increment resequencing, resulting in duplicate entry '1' for key 'PRIMARY'
SQL Statement:
ALTER TABLE `aafest`.`aafest_bestelling` CHANGE COLUMN `Id` `Id` INT(11) NOT NULL AUTO_INCREMENT
ERROR: Error when running failback script. Details follow.
ERROR 1046: No database selected
SQL Statement:
CREATE TABLE `aafest_bestelling` (
`Id` int(11) NOT NULL,
`KlantId` int(11) DEFAULT NULL,
`Datum` date DEFAULT NULL,
`BestellingstypeId` int(11) DEFAULT NULL,
PRIMARY KEY (`Id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
Run Code Online (Sandbox Code Playgroud)
有人有个主意吗?
我正在制作一个应用程序,我有一个具有相当多属性的类,我想知道是否可以给它们一个默认值.因为如果我创建一个init方法,输入所有东西需要做很多工作,那么拼写错误的可能性很大,而且编码也不错......
这就是我班级的样子:
// Goalkeeping attributes
@property (nonatomic) int aerialAbility;
@property (nonatomic) int commandOfArea;
@property (nonatomic) int communication;
@property (nonatomic) int eccentricity;
@property (nonatomic) int handling;
@property (nonatomic) int kicking;
@property (nonatomic) int oneOnOnes;
@property (nonatomic) int reflexes;
@property (nonatomic) int rushingOut;
@property (nonatomic) int tendencyToPunch;
@property (nonatomic) int throwing;
// Technical attributes
@property (nonatomic) int corners;
@property (nonatomic) int crossing;
@property (nonatomic) int dribbling;
@property (nonatomic) int finishing;
@property (nonatomic) int firstTouch;
@property (nonatomic) int freeKickTaking;
@property (nonatomic) int heading; …Run Code Online (Sandbox Code Playgroud) 我正在制作一个C#WPF程序,我的程序必须能够打印发票,但我很难找到WPF中的打印方式...如果我记得winforms中的编程,那么你就是使用GDI +打印.但是,我认为WPF不是这种情况.
如果有人能指出我正确的方向,并提供有用的文件或示例的链接,我将非常高兴...
在 Visual Studio 2017 中调试新的 .net core 网站(文件 => 新项目)时,系统会提示我是否希望信任自签名 IIS Express 证书:
但是,单击“是”后,我没有收到添加证书的安全警告。相反,我直接重定向到浏览器,并收到安全警告:
我运行的是 Windows 10
有谁知道如何解决这个问题?
编辑:
根据本指南,单击“是”后我应该收到安全警告。但该窗口未显示。(我知道,该指南是关于 VS2013 的)。
我正在制作一个iPhone应用程序,我正在使用这个TableViewController,但是在测试时,我得到了这个错误,我真的不知道如何处理它:
2012-01-13 13:45:32.947 HandHistory Reviews[3422:707] ***
Terminating app due to uncaught exception 'NSUnknownKeyException',
reason: '[<SessionsTableViewController 0x191cb0> setValue:forUndefinedKey:]:
this class is not key value coding-compliant for the key dataSource.'
Run Code Online (Sandbox Code Playgroud)
有人有个主意吗?
这是我的SessionTableViewController.m文件:
#import "SessionsTableViewController.h"
#import "Session.h"
@interface SessionsTableViewController()
@property (nonatomic, copy) NSArray *sessions;
@end
@implementation SessionsTableViewController
@synthesize sessions = _sessions;
#pragma mark - View lifecycle
- (void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
NSMutableArray *sessions = [[NSMutableArray alloc] init];
// Looking for files
// Finding the Documents directory
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString …Run Code Online (Sandbox Code Playgroud) 我有一个应用程序需要显示价格,为此,我有以下代码:
<Label Content="{Binding Prijs}" ContentStringFormat="C"></Label>
Run Code Online (Sandbox Code Playgroud)
但是,这给出了一个字符串格式:$ 10.00,但我想显示欧元符号(€)而不是美元符号($).我怎么做?
我在解析器中使用正则表达式,但是,它似乎给出了一个结果,这是我的代码:正则表达式:
self.seatSelectRegex = [NSRegularExpression regularExpressionWithPattern:@"Seat ([0-9]{1,2}): (.*) \\([$£€]?([0-9.]+) in chips\\).*$" options:NSRegularExpressionAnchorsMatchLines error:&error];
Run Code Online (Sandbox Code Playgroud)
码:
NSMutableDictionary *players = [[NSMutableDictionary alloc] init];
[self.seatSelectRegex enumerateMatchesInString:input options:NSMatchingCompleted range:NSMakeRange(0, input.length) usingBlock:
^(NSTextCheckingResult *result, NSMatchingFlags flags, BOOL *stop)
{
NSLog(@"%lu", result.range.length);
Player *p = [[Player alloc] init];
p.name = [input substringWithRange:[result rangeAtIndex:2]];
p.seatNumber = [input substringWithRange:[result rangeAtIndex:1]].intValue;
p.stack = [input substringWithRange:[result rangeAtIndex:3]].doubleValue;
[players setValue:p forKey:p.name];
}];
Run Code Online (Sandbox Code Playgroud)
我期待输入3个结果,然而,我得到4,其中最后一个结果的位置= 0和长度= 0(前三个都是正确的).这是常见的行为吗?我应该检查范围的位置和长度,还是某处出现错误?
对于它的价值,这是我的意见:
PokerStars Hand #81669312371: Hold'em No Limit ($0.01/$0.02 USD) - 2012/06/08 16:57:33 CET [2012/06/08 10:57:33 ET]
Table 'Icarus …Run Code Online (Sandbox Code Playgroud) 我正在制作一个WPF应用程序,但在我的代码中我需要创建一个ContextMenu,它看起来很简单:
_menu = new ContextMenu();
_menu.Items.Add("My menu item");
Run Code Online (Sandbox Code Playgroud)
然后我用它,一切都像一个魅力.
但是,我需要知道何时单击"我的菜单项",但我似乎无法找到正确的事件,我正在搜索类似ItemClick事件的内容,但无法找到它...
我正在为学校制作一个骰子模拟器,我需要计算一定数量已经滚动的百分比,并且我给了它一个测试运行,但不知怎的,我得到了这个:
How many dice do you want to roll?
3
How many times do you want to roll the dice?
1000000
144414: 1000000 196039 %
Run Code Online (Sandbox Code Playgroud)
这是我的主类的代码:
#include <iostream>
#include "Dice.h"
#include "DiceSimulator.h"
using namespace std;
static int inputNumber(const string question);
int main(int argc, const char * argv[])
{
int numberOfDice = inputNumber("How many dice do you want to roll?");
const int times = inputNumber("How many times do you want to roll the dice?");
DiceSimulator sim(times, numberOfDice);
cout << sim.howManyTimesDidWeRollACertainNumber(11)
<< …Run Code Online (Sandbox Code Playgroud) 我正在尝试安装 popper(因为它是引导程序的对等依赖项)。但这样做时,我收到错误“错误:命令失败:git -c core.longpaths=true config --get remote.origin.url”。
我已经尝试过 'git config --system core.longpaths true' 命令,但我仍然遇到同样的错误。
完整的错误信息:
> npm ls
volvo-style@1.0.0 E:\Webapps\AspCore\Vcg.AspCore.Template\content\src\__VcgTemplateName__.Web
+-- bootstrap@4.0.0
+-- jquery@3.3.1
`-- UNMET PEER DEPENDENCY popper.js@^1.12.9
npm ERR! peer dep missing: popper.js@^1.12.9, required by bootstrap@4.0.0
SDECLE12@GNL10075NMJC2 E:\Webapps\AspCore\Vcg.AspCore.Template\content\src\__VcgTemplateName__.Web
> npm i --save popper
npm WARN addRemoteGit Error: Command failed: git -c core.longpaths=true config --get remote.origin.url
npm WARN addRemoteGit
npm WARN addRemoteGit at ChildProcess.exithandler (child_process.js:198:12)
npm WARN addRemoteGit at emitTwo (events.js:106:13)
npm WARN addRemoteGit at ChildProcess.emit (events.js:191:7)
npm WARN …Run Code Online (Sandbox Code Playgroud) c# ×4
wpf ×3
.net ×2
objective-c ×2
.net-core ×1
asp.net ×1
bootstrap-4 ×1
c++ ×1
collections ×1
git ×1
iis-express ×1
ios ×1
key-value ×1
mysql ×1
npm ×1
popper.js ×1
printing ×1
properties ×1
regex ×1
sql ×1
ssl ×1
uitableview ×1
xaml ×1