小编Nat*_*man的帖子

使用gdb在xv6上调试用户代码

我正在做一个基于xv6的操作系统类,我编写了一个需要在其上运行的程序.

我知道我可以调试内核代码,make qemu-gdb但我不确定如何调试我自己的用户程序.

可以说我想调试cat,我该怎么做呢?

谢谢

PS是不是有xv6标签?这个问题是否应该在这里?

gdb qemu xv6

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

实体框架4.3.1无法创建(/打开)数据库[​​线程异常?]

我曾经在一个MVC 3项目中使用过EF 4.1(Code First),这很好.

今天我尝试在WinForms项目中使用EF 4.3.1(Code First)并遇到一些真正的巫术:(我正在研究的原始项目是WinForms,但是对于附加的控制台应用程序代码也是如此.)

当尝试在数据库中输入一个简单的类时,我得到以下异常: 无法打开登录请求的数据库"Test".登录失败.用户'[ComputerName]\[Administrator]'登录失败.

我已经尝试检查SQL Server(2008 R2)配置,但我的用户确实拥有服务器上的所有权限.

注:数据库没有当我第一次运行该应用程序存在.

即使以下示例代码也不起作用:

class Program
{
    public static void Main()
    {
        var person = new Person { Name = "Nathan" };
        using (var db = new MyContext())
        { //#1
            db.Persons.Add(person);
            db.SaveChanges();
        }
        Console.Write("Person saved !");
        Console.ReadLine();
    }
}

public class Person
{
    public int PersonId { get; set; }
    public string Name { get; set; } …
Run Code Online (Sandbox Code Playgroud)

c# sql-server entity-framework sql-server-2008-r2 entity-framework-4.3

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

当密钥是由zip_iterator处理的元组时,CUDA Thrust sort_by_key具有自定义比较谓词

我在这里看了很多类似的问题并且有很多问题,尽管有一个小的改变.我正在尝试使用zip_iterator作为复合键对值进行排序.

具体来说,我有以下功能:

void thrustSort(
    unsigned int * primaryKey,
    float * secondaryKey,
    unsigned int * values,
    unsigned int numberOfPoints)
{
    thrust::device_ptr dev_ptr_pkey = thrust::device_pointer_cast(primaryKey);
    thrust::device_ptr dev_ptr_skey = thrust::device_pointer_cast(secondaryKey); 
    thrust::device_ptr dev_ptr_values = thrust::device_pointer_cast(values);

    thrust::tuple,thrust::device_ptr> keytup_begin =
        thrust::make_tuple,thrust::device_ptr>(dev_ptr_pkey, dev_ptr_skey);

    thrust::zip_iterator, thrust::device_ptr > > first =
        thrust::make_zip_iterator, thrust::device_ptr > >(keytup_begin);

    thrust::sort_by_key(first, first + numberOfPoints, dev_ptr_values, ZipComparator());    
}

和这个自定义谓词:

typedef thrust::device_ptr<unsigned int> tdp_uint ;
typedef thrust::device_ptr<float> tdp_float ;
typedef thrust::tuple<tdp_uint, tdp_float> tdp_uif_tuple ;

struct ZipComparator
{
    __host__ __device__
    inline bool operator() (const tdp_uif_tuple &a, const tdp_uif_tuple &b) …
Run Code Online (Sandbox Code Playgroud)

iterator cuda tuples operator-overloading thrust

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