小编Rya*_*n P的帖子

如何为32位和64位创建单个makefile?

我有一个makefile透明的Linux(x86_64)和OS X Intel(x86_64).这使用64位特定GCC选项.

有没有办法调整makefile,以便我可以构建32位和64位OS X PPC(ppc,ppc64),而无需维护单独的,特定于arch的makefile - 可能类似于预处理器指令,可以确定建筑前的建筑?

architecture gcc makefile powerpc

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

SafeFileHandle.Close抛出异常,但句柄有效且有效

我在WPF应用程序中遇到自定义游标的问题.我使用以下代码来创建Cursor对象:

[DllImport("user32.dll")]
private static extern IntPtr CreateIconIndirect(ref IconInfo icon);

[DllImport("user32.dll")]
[return: MarshalAs(UnmanagedType.Bool)]
private static extern bool GetIconInfo(IntPtr hIcon, ref IconInfo pIconInfo);

private static Cursor CreateCursor(string cursorName, System.Drawing.Bitmap bmp, 
    int xHotspot, int yHotspot, out SafeFileHandle handle)
{
    IconInfo tmp = new IconInfo();
    GetIconInfo(bmp.GetHicon(), ref tmp);
    tmp.xHotspot = xHotspot;
    tmp.yHotspot = yHotspot;
    tmp.fIcon = false;

    IntPtr ptr = CreateIconIndirect(ref tmp);
    handle = new SafeFileHandle(ptr, true);

    if (handle.IsClosed)
    {
        return null;
    }

    Cursor cur = CursorInteropHelper.Create(handle);

    return cur;
}
Run Code Online (Sandbox Code Playgroud)

当我关闭我的应用程序并且GC开始拾取垃圾时,它会引发异常:

System.Runtime.InteropServices.SEHException …
Run Code Online (Sandbox Code Playgroud)

c# wpf handle

7
推荐指数
1
解决办法
3677
查看次数

在列表中连接字符串

我在python中有一个列表:

A = ['5', 'C', '1.0', '2.0', '3.0', 'C', '2.1', '1.0', '2.4', 'C', '5.4', '2.4', '2.6', 'C', '2.3', '1.2', '5.2']
Run Code Online (Sandbox Code Playgroud)

我想加入一个A输出如下的方式:

5\n
C 1.0 2.0 3.0\n
C 2.1 1.0 2.4\n
C 5.4 2.4 2.6\n
C 2.3 1.2 5.2
Run Code Online (Sandbox Code Playgroud)

''.join(A)将每个字符串连接在一起,'\n'.join(A)从新行开始连接每个字符串.对此有何帮助?谢谢!

python list

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

MySQL | 您不能在FROM子句中为更新指定目标表'a'

DELETE FROM table_a WHERE id IN(
    SELECT table_a.id AS id FROM table_a, table_b 
    WHERE table_a.object_id = 1 AND table_a.code = 'code' 
        AND table_a.code = table_b.code 
        AND table_b.id = table_a.b_id 
        AND table_b.table = 'testTable')
Run Code Online (Sandbox Code Playgroud)

这是我希望MySQL执行的(稍微简化)查询.我在stackoverflow的其他页面上读到这是不受支持的,并且它可以通过使用JOINS来解决.如何使用JOINS将其"转录"为查询?我发现很难这样做,因为我从未尝试过使用多个表创建DELETE查询.

mysql mysql-error-1093

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

标签 统计

architecture ×1

c# ×1

gcc ×1

handle ×1

list ×1

makefile ×1

mysql ×1

mysql-error-1093 ×1

powerpc ×1

python ×1

wpf ×1