问题列表 - 第41997页

如何在SQL Server 2008中查看事务日志

我需要在SQL Server 2008上查看数据库的事务日志,以便找到删除事务并希望将其回滚.

不幸的是,我不知道从哪里开始,我发现很难确定哪些是谷歌上的文章.

我该怎么办?

sql-server transaction-log

53
推荐指数
3
解决办法
14万
查看次数

ValueError:需要多于1个值才能解压缩

免责声明:我已阅读位于Python错误的线程:"ValueError:需要超过1个值才能解压缩",并且没有一个答案解释了如何实际运行代码.

我正在阅读艰难的学习Python,我正在练习13.

以下是我试图在IDLE中运行的代码(不知道它实际上是什么),用于Python 2.7:

from sys import argv

script, first, second, third = argv

print "The script is called:", script
print "Your first variable is:", first
print "Your second variable is:", second
print "Your third variable is:", third
Run Code Online (Sandbox Code Playgroud)

运行时,我收到错误:

"Traceback(最近一次调用最后一次):文件"C:\ Python\LPTHW\examples_LPTHW\ex13.py",第3行,在脚本中,第一,第二,第三= argv ValueError:需要多于1个值来解包"

我试过通过Windows命令提示符运行该程序,但无济于事.我也通过在IDLE和命令提示符下键入:"python ex13.py first 2nd 3rd"运行程序,也得到了同样的错误.

如何运行此代码,以及我做错了什么?

编辑:@John Machin,我制作的程序与您发布的程序完全一样,保存为.py,然后进入保存文件的正确目录,使用"python yourcode.py BC D"运行程序收到以下消息"python未被识别为内部或外部命令..."当我通过键入它的名称(除了这个之外的所有其他程序都可以运行)运行程序时,我收到错误消息"SyntaxError:invalid syntax第2行:print len(argv),repr(argv)".

编辑2(使用新代码):@ John Machin,我将你的程序逐字复制到gedit并像往常一样制作.py文件.我打开了终端(命令提示符)并键入:

python ex13c.py B C D
Run Code Online (Sandbox Code Playgroud)

并收到:

'python' is not recognized as an internal or external command, operable …
Run Code Online (Sandbox Code Playgroud)

python

10
推荐指数
1
解决办法
3万
查看次数

array_unique也可以用于对象数组吗?

有没有比使用array-walk和unserialize更好的方法?

我有两个包含对象的数组.对象可以相同也可以不同.我想合并两个数组并只保留唯一对象.

在我看来,这对于一些如此微不足道的事情来说是一个很长的解决方案.还有其他方法吗?

class Dummy
{
    private $name;
    public function __construct($theName) {$this->name=$theName;}
}

$arr = array();
$arr[] = new Dummy('Dummy 1');
$arr[] = new Dummy('Dummy 2');
$arr[] = new Dummy('Dummy 3');

$arr2 = array();
$arr2[] = new Dummy('Dummy 1');
$arr2[] = new Dummy('Dummy 2');
$arr2[] = new Dummy('Dummy 3');

function serializeArrayWalk(&$item)
{
    $item = serialize($item);
}

function unSerializeArrayWalk(&$item)
{
    $item = unserialize($item);
}

$finalArr = array_merge($arr, $arr2);
array_walk($finalArr, 'serializeArrayWalk');
$finalArr = array_unique($finalArr);
array_walk($finalArr, 'unSerializeArrayWalk');

var_dump($finalArr);
Run Code Online (Sandbox Code Playgroud)

php arrays duplicate-removal

6
推荐指数
0
解决办法
2381
查看次数

为什么Convert.ToInt32("10.0")失败

不仅在.NET中,即使在SQL Server 2005中这种转换也失败了......

谁能告诉我为什么?

即使在情况下,也不要谨慎地返回整数部分

    Convert.ToInt32("10.2")
Run Code Online (Sandbox Code Playgroud)

.net sql-server-2005

2
推荐指数
2
解决办法
945
查看次数

使用Recaptcha与EPiServer XForms

有没有人在EPiServer中使用Recaptcha和XForms?

我不知道在哪里放置Recaptcha控件以及如何使其工作.ASP.NET的示例代码是以下代码.我应该把它放在哪里.我猜是在FormControl_BeforeSubmitPostedData

 <%@ Page Language="VB" %>
 <%@ Register TagPrefix="recaptcha" Namespace="Recaptcha" Assembly="Recaptcha" %>  
 <script runat=server%gt;       
 Sub btnSubmit_Click(ByVal sender As Object, ByVal e As EventArgs)           
    If Page.IsValid Then               
        lblResult.Text = "You Got It!"               
        lblResult.ForeColor = Drawing.Color.Green           
    Else               
        lblResult.Text = "Incorrect"               
        lblResult.ForeColor = Drawing.Color.Red           
    End If       
 End Sub   
 </script>   
 <html>   
 <body>       
 <form runat="server">           
     <asp:Label Visible=false ID="lblResult" runat="server" />
     <recaptcha:RecaptchaControl ID="recaptcha" runat="server" Theme="red"
                                 PublicKey="your_public_key" PrivateKey="your_private_key" />
     <asp:Button ID="btnSubmit" runat="server" Text="Submit" OnClick="btnSubmit_Click" />
 </form>   
 </body>   
 </html>
Run Code Online (Sandbox Code Playgroud)

xforms episerver recaptcha

2
推荐指数
1
解决办法
1894
查看次数

测试设计和测试用例规范

嘿,有人能告诉我测试设计和测试用例规范之间有什么区别吗?我使用IEEE 829测试用例规范模板,我不知道我应该在哪里编写测试Thanx的步骤

testing

3
推荐指数
1
解决办法
1万
查看次数

拖放不适用于Mac

我试图将文件从Finder拖到我的SWT应用程序中.在Windows和Ubuntu上,以下代码可以工作:

public class DndTest {

    public static void main(final String[] args) {
        final Display display = new Display();
        final Shell shell = new Shell(display, SWT.DIALOG_TRIM);
        shell.setText("Drag & drop test");
        shell.setSize(200, 200);
        final FormLayout layout = new FormLayout();
        shell.setLayout(layout);
        final Label lbl = new Label(shell, SWT.NORMAL);
        lbl.setAlignment(SWT.CENTER);
        lbl.setText("Drop files here");
        final FormData layoutData = new FormData();
        layoutData.left = new FormAttachment(50, -100);
        layoutData.top = new FormAttachment(50, -15);
        layoutData.right = new FormAttachment(50, 100);
        layoutData.bottom = new FormAttachment(50, 15);
        lbl.setLayoutData(layoutData);

        final DropTarget dt = …
Run Code Online (Sandbox Code Playgroud)

java swt drag-and-drop

11
推荐指数
1
解决办法
1672
查看次数

通过ajax注入html,RE-RUN document.ready()jqueries,IS可能吗?

here is my case:

    <html>
    <body>
    <head>
    ...
    <script>
 $(function(){
        $('.do-tip').qtip({
            content: 'This is a tip of active hovered element',
            show: 'mouseover',
            hide: 'mouseout',
  })
 });
    </script>
    </head>
    <body>
    <a href="http://www.google.com" class="do-tip">google</a>

    <input type="button" value="load div by ajax" />
    <div> <!-- this div loaded by ajax -->
    <div>
    <a href="http://www.yahoo.com" class="do-tip">yahoo</a> <!-- HOW TO HERE, run the existing script only for this part, JQUERY UNCLE must have a solution-->
    </body>
    </html>

any ideas?
Run Code Online (Sandbox Code Playgroud)

ajax jquery document-ready

2
推荐指数
1
解决办法
4123
查看次数

Swing JTextArea多线程问题--InterruptedException

我有一个简单的控制台应用程序,在几个线程(其中10-20个)中运行计算.现在我正在尝试创建一个简单的GUI,允许我选择要处理的文件并打印来自所有线程的日志.

因此,我使用JTextArea为我的日志创建了一个swing GUI,并将信息记录到日志中:

public synchronized void log(String text) {
    logArea.append(text);
    logArea.append("\n");

    if (logArea.getDocument().getLength() > 50000) {
        try {
            logArea.getDocument().remove(0,5000);
        } catch (BadLocationException e) {
            log.error("Can't clean log", e);
        }
    }

    logArea.setCaretPosition(logArea.getDocument().getLength());
}
Run Code Online (Sandbox Code Playgroud)

但是,该setCaretPosition方法有时会在等待某些锁时死锁,append有时会抛出InterruptedException.

Exception in thread "Thread-401" java.lang.Error: Interrupted attempt to aquire write lock
at javax.swing.text.AbstractDocument.writeLock(AbstractDocument.java:1334)
at javax.swing.text.AbstractDocument.insertString(AbstractDocument.java:687)
at javax.swing.text.PlainDocument.insertString(PlainDocument.java:114)
at javax.swing.JTextArea.append(JTextArea.java:470)
at lt.quarko.aquila.scripts.ui.ScriptSessionFrame.log(ScriptSessionFrame.java:215)
Run Code Online (Sandbox Code Playgroud)

我是Swing的新手,所以我无法理解我在这里做错了什么?

提前致谢.

java swing multithreading

6
推荐指数
1
解决办法
5574
查看次数

Microsoft Detours如何工作以及如何使用它来获取堆栈跟踪?

我是微软Detours的新手.我已经安装它来跟踪进程所做的系统调用.我运行以下来自网络的命令

syelogd.exe /q C:\Users\xxx\Desktop\log.txt 
withdll.exe /d:traceapi.dll C:\Program Files\Google\Google Talk\googletalk.exe
Run Code Online (Sandbox Code Playgroud)

我得到了日志文件.问题是我不完全理解这里发生了什么.弯路如何运作?它如何跟踪系统调用?另外我不知道如何读取log.txt中的输出.这是log.txt中的一行

20101221060413329 2912 50.60: traceapi: 001 GetCurrentThreadId()
Run Code Online (Sandbox Code Playgroud)

最后,我想获得该过程的堆栈跟踪.我怎么能得到它?

windows detours

21
推荐指数
3
解决办法
2万
查看次数