我有一个10位数的字符串传递给我,我想在进行更多处理和/或重定向之前验证它是否是有效的ASIN.
我知道非ISBN ASIN总是非数字的,长度为10个字符
我只是希望能够判断传递的项目是否是有效的ASIN,或者在我已经消除它可能是ISBN之后它只是一个搜索字符串.
例如,"SOUNDBOARD"是搜索词,而"B000J5XS3C"是ASIN,"1412775884"是ISBN.
是否有轻量级方式检查ASIN?
我想在一台非常弱的计算机上安装oracle 11g进行学习.什么是最轻量级的oracle版本?它是快递版吗?
提前致谢
我正在使用的应用程序无法在Visual Studio 2005的调试器中启动.
这是我做的:
该应用程序是一个非托管的C++项目,它使用大量的DLL文件作为插件.我正在使用"多线程调试"运行时,我确保所有依赖项都是针对相同的运行时编译的.
正是在这样做时,这个问题突然出现了.我试图扭转我的变化,但它没有帮助.重新启动计算机也无济于事.
我已经随机运行了一两次应用程序.如果我然后结束应用程序并再次启动它它没有启动.所以我不认为这是因为我的配置.
有任何想法吗?
还有一点需要注意:如果从Visual Studio外部启动应用程序,应用程序将启动并运行.
以下代码目前输出:
12.1
12.100
12.1000
12.00
12
12.0000
Run Code Online (Sandbox Code Playgroud)
如何更改它以便输出:
12.1
12.1
12.1
12
12
12
Run Code Online (Sandbox Code Playgroud)
Math.Round似乎是事情,但它让我定义了我想要的小数位数,但我希望它们如上所述变量.
如果没有数学方法可以做到这一点,我只会从字符串右侧删除零和小数点,但会认为有一种数学方法来处理它.
using System;
using System.Collections.Generic;
namespace Test8834234
{
public class Program
{
static void Main(string[] args)
{
List<string> decimalsAsStrings = new List<string>
{
"12.1",
"12.100",
"12.1000",
"12.00",
"12",
"12.0000"
};
foreach (var decimalAsString in decimalsAsStrings)
{
decimal dec = decimal.Parse(decimalAsString);
Console.WriteLine(dec);
}
Console.ReadLine();
}
}
}
Run Code Online (Sandbox Code Playgroud) 我想通过String.split(k)拆分一个字符串,其中k是一个任意字符串(从intput读取).问题是k可以是任何字符串,因此可以包括正则表达式运算符,例如:"*["
.
在这种情况下,split方法会触发异常,因为正则表达式格式不正确.
我正在寻找的是一种逃避任何给定k的方法,以便可以在split()上安全地传递结果字符串.
有什么想法吗?
按下按钮后,我想显示一个图像(使用图片框),等待几秒然后播放mp3声音,但我不能让它工作.我等了几秒钟System.Threading.Thread.Sleep(5000)
.问题是,图像总是出现在等待时间之后,但是我希望它首先显示,然后等待,然后播放mp3 ...我尝试使用WaitOnLoad = true
但是它不起作用,不应该首先加载图像并继续阅读下一个代码行?
这是我尝试过的代码(不起作用):
private void button1_Click(object sender, EventArgs e) {
pictureBox1.WaitOnLoad = true;
pictureBox1.Load("image.jpg");
System.Threading.Thread.Sleep(5000);
MessageBox.Show("test");//just to test, here should be the code to play the mp3
}
Run Code Online (Sandbox Code Playgroud)
我还尝试使用"LoadAsync"加载图像并将代码放在等待并在"LoadCompleted"事件中播放mp3,但这不起作用......
分析我的C#应用程序表明花费了大量时间List<T>.AddRange
.使用Reflector查看此方法中的代码表明它调用的List<T>.InsertRange
是这样实现的:
public void InsertRange(int index, IEnumerable<T> collection)
{
if (collection == null)
{
ThrowHelper.ThrowArgumentNullException(ExceptionArgument.collection);
}
if (index > this._size)
{
ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument.index, ExceptionResource.ArgumentOutOfRange_Index);
}
ICollection<T> is2 = collection as ICollection<T>;
if (is2 != null)
{
int count = is2.Count;
if (count > 0)
{
this.EnsureCapacity(this._size + count);
if (index < this._size)
{
Array.Copy(this._items, index, this._items, index + count, this._size - index);
}
if (this == is2)
{
Array.Copy(this._items, 0, this._items, index, index);
Array.Copy(this._items, (int) (index + count), …
Run Code Online (Sandbox Code Playgroud) 我正在尝试在我的项目中使用评论应用程序.
我尝试使用代码({%render_comment_form for event%}),在这里的文档中显示: Django评论
问题是如何在提交后将表单重定向到同一页面.
另外一个大问题是:目前如果我们在for中发现任何错误,那么我们将被重定向到预览模板.是否可以避免此行为并在同一表单上显示错误(在同一页面上)?
我正在尝试在Tomcat 6.0中部署新的Web应用程序,但每当我点击开始按钮时,我都会反复获取 FAIL - 应用程序在上下文路径/ Hello无法启动.其他部署的应用程序运行正常,每当我点击开始按钮.但为什么不申请这个?
网络的XML:
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
version="2.4">
<servlet>
<servlet-name>j_security_check</servlet-name>
<servlet-class>EmailHander</servlet-class>
</servlet>
<login-config>
<auth-method>FORM</auth-method>
<form-login-config>
<form-login-page>/login.jsp</form-login-page>
<form-error-page>/fail_login.html</form-error-page>
</form-login-config>
</login-config>
<web-app>
Run Code Online (Sandbox Code Playgroud)
这就是我在catalina日志文件中获得的异常:
Jan 23, 2010 6:49:31 PM org.apache.catalina.startup.ContextConfig applicationWebConfig
SEVERE: Parse error in application web.xml file at jndi:/localhost/Hello/WEB-INF/web.xml
org.xml.sax.SAXParseException: XML document structures must start and end within the same entity.
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1231)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1644)
at org.apache.catalina.startup.ContextConfig.applicationWebConfig(ContextConfig.java:365)
at org.apache.catalina.startup.ContextConfig.start(ContextConfig.java:1066)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:261)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4339)
at org.apache.catalina.manager.ManagerServlet.start(ManagerServlet.java:1249)
at org.apache.catalina.manager.HTMLManagerServlet.start(HTMLManagerServlet.java:612)
at org.apache.catalina.manager.HTMLManagerServlet.doGet(HTMLManagerServlet.java:136)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
at …
Run Code Online (Sandbox Code Playgroud) 我需要的是指示操作系统使用用于该文件类型的默认程序打开该文件.就好像在Windows下用户双击该文件一样.
目的是,"您的PDF文件已生成.点击此处打开它".
以平台无关的方式,如果可能的话......
我不知道我想要的确切术语,所以如果有人可以更新标签,我最欣赏的;)