小编Nic*_*ick的帖子

如何输出Fluent NHibernate创建的HBM?

我正在尝试调试我的流畅应用程序,并希望看到生成的文件是什么样的.

有什么方法可以查看它们?

有没有办法出口它们?

mapping nhibernate hbm fluent-nhibernate

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

如何将2个参数传递给Nant脚本?

我必须编写一个Nant脚本,它将在命令行上接受2个参数.第一个只是一个选项,具有以下格式:-myOption.第二个需要用引号括起来:"有些空间值".

例如-myOption"this value"

我是Nant的新手,所以到目前为止我还没有成功,也不知道如何输出命令进行调试.

这是我到目前为止:

<target name="Build" depends="SetupConfig">
<exec workingdir="${refactory.basedir}" program="${exe.name.mfg.factory}" basedir="${refactory.basedir}" commandline="-myOption:">  
 <arg>${refactory.clientconfig}</arg>   
</exec>
Run Code Online (Sandbox Code Playgroud)

我试图使用"命令行"属性和args嵌套元素创建命令.args元素应该提供qoutes.

有人可以告诉我这看起来应该怎样?谢谢.

.net ant nant build-automation

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

如何在WinForm中使用自定义构造函数?

我需要在另一个项目中实例化一个Winform.这是怎么做到的?我目前正在尝试链接默认构造函数.似乎我的自定义构造函数没有被调用.

此外..此应用程序的入口点将不在拥有此表单的项目中.意味着以下内容不会运行:

 Application.EnableVisualStyles();
 Application.SetCompatibleTextRenderingDefault(false);
 Application.Run(new HtmlTestForm());
Run Code Online (Sandbox Code Playgroud)

我不完全确定这段代码是做什么的.表格还能起作用吗?

private HtmlTestForm()
        {
            InitializeComponent();
            OpenBrowser(new Uri(TestURL));
        }

 public HtmlTestForm(Uri uri)
            :this()
        {
            TestURL = uri;
        }
Run Code Online (Sandbox Code Playgroud)

//在另一个项目中新建表单

HtmlTestForm form = new HtmlTestForm(new Uri("http://SomeUri.html"));
Run Code Online (Sandbox Code Playgroud)

c# winforms

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

如何使用HttpWebRequest将数据发布到MVC Controller?

我试图将数据发布到MVC控制器操作但到目前为止一直没有成功.

以下是帖子数据的结构:

private string makeHttpPostString(XmlDocument interchangeFile)
    {
        string postDataString = "uid={0}&localization={1}&label={2}&interchangeDocument={3}";

        InterchangeDocument interchangeDocument =  new InterchangeDocument(interchangeFile);
        using (var stringWriter = new StringWriter())
        using (var xmlTextWriter = XmlWriter.Create(stringWriter))
        {
            interchangeFile.WriteTo(xmlTextWriter);
            string interchangeXml = HttpUtility.UrlEncode(stringWriter.GetStringBuilder().ToString());
            string hwid = interchangeDocument.DocumentKey.Hwid;
            string localization = interchangeDocument.DocumentKey.Localization.ToString();
            string label = ConfigurationManager.AppSettings["PreviewLabel"];

            return (string.Format(postDataString, hwid, localization, label, interchangeXml));
        }

    }
Run Code Online (Sandbox Code Playgroud)

这是请求:

 HttpWebRequest webRequest = (HttpWebRequest) WebRequest.Create(controllerUrl);

        webRequest.Method = "POST";
      //  webRequest.ContentType = "application/x-www-form-urlencoded";

        string postData = makeHttpPostString(interchangeFile);
        byte[] byteArray = Encoding.UTF8.GetBytes(postData);
        webRequest.ContentLength = byteArray.Length;

        using (Stream dataStream …
Run Code Online (Sandbox Code Playgroud)

c# asp.net-mvc

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

如何将自定义对象列表绑定到ComboBox?

如何将自定义对象列表绑定到组合框?这就是我目前所拥有的:

            this.classCmbo.DataSource = _viewModel.Coarses;
            this.classCmbo.DisplayMember = "Name";
            this.classCmbo.ValueMember = "Id";
Run Code Online (Sandbox Code Playgroud)

我要显示什么"名称",但我希望"Id"是与选择相关联的值.你怎么在winforms中做到这一点?

这是Coarse obj:

 public class Coarse
    {
        public virtual int Id { get; private set; }
        public virtual string Name { get;  set; }
    }
Run Code Online (Sandbox Code Playgroud)

谢谢...

c# winforms

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

如何使用LibGit2Sharp从Git存储库中获取文件二进制数据?

我决定尝试将我的项目从使用GitSharp迁移到LibGit2Sharp,因为不再主动维护GitSharp.使用GitSharp,我能够在给定分支的情况下访问检查到我的仓库中的任何文件的原始字节.我无法使用LibGit2Sharp找到任何文档或示例代码.

有人能给我以及如何做到这一点的例子吗?

c# git gitsharp libgit2sharp

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

如何更正"架构i386的未定义符号:"_main"链接问题?

我正在尝试使用apple提供的KeyChainitemwrapper.我的项目正在使用ARC,但我已经在KeyChainitemwrapper.m上关闭了ARC.我将'security.framework'框架链接到我的项目.

我收到了这个链接问题:

架构i386的未定义符号:"_ main",引用自:在crt1.10.6.o中启动ld:找不到架构i386的符号clang:错误:链接器命令失败,退出代码为1(使用-v查看调用)

我是ios开发的新手但我的猜测是问题与模拟器试图编译我的源i386而不是手臂的事实有关?我接近了吗?

无论如何..似乎这个包装器相当受欢迎,所以我想知道是否有人可能熟悉这个问题可以伸出援助之手.

谢谢

objective-c keychain ios ios5 automatic-ref-counting

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

使用Passport和ExpressJS进行Facebook身份验证 - 为什么不调用验证回调?

我是Passport,用于在ExpressJS应用程序中验证用户身份.我试图将所有Facebook路由放在他们自己的模块中,因为我打算支持其他OAuth提供商.在我的启动脚本中,我已经定义了所需的FB端点:

var express = require('express');
var routes = require('./routes');
var user = require('./routes/user');
var facebook = require('./routes/facebook');
var login = require('./routes/login');
var http = require('http');
var path = require('path');

var app = express();

/* Configuration stuff here*/

// development only
if ('development' == app.get('env')) {
  app.use(express.errorHandler());
}

app.get('/login', login.index);
app.get('/auth/facebook', facebook.fb_auth);
app.get('/auth/facebook/callback', facebook.fb_callback);
Run Code Online (Sandbox Code Playgroud)

如你所见,我需要我的'facebook'模块,其中包含实际路线和Facebook验证回调.它看起来像这样:

var passport = require('passport')
, FacebookStrategy = require('passport-facebook').Strategy
, User = require('../services/user');

passport.use(new FacebookStrategy({
  clientID: 'myclientid',
  clientSecret: 'mysecretkey',
  callbackURL: "http://localhost:3000/auth/facebook/callback" //localhost:3000 domain is registered domain in …
Run Code Online (Sandbox Code Playgroud)

node.js oauth-2.0 passport-facebook passport.js

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

iPhone-为什么在为ARM体系结构构建时编译器找不到某些包含项?

我正在尝试在iPhone项目中使用C库。我对iPhone开发非常满意。 我的图书馆

我已经奋斗了几天,试图将这个库构建到一个可以用于模拟器(i386)和ARM7的静态库中。

使用库的include配置和makefile,我可以毫无问题地构建库。但是,如果我编辑makefile尝试构建相同的库,但以armv7体系结构为目标,则会遇到很多错误。该错误似乎报告无法找到某些头文件。

那么,编译器是否会根据目标体系结构尝试在不同位置查找头文件?

这是我已编辑以尝试为armv7生成的Make文件:

 # $Id: Makefile.in 62 2005-03-09 21:11:53Z gyunaev $
CC = /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/arm-apple-darwin10-gcc-4.2.1 
CFLAGS = -Wall -DIN_BUILDING_LIBIRC -O3 -DENABLE_THREADS -D_REENTRANT
AR=ar cr
RANLIB=ranlib
INCLUDES=-I../include


OBJS = libircclient.o

all:    lib

lib:    libircclient.a

install: lib
    -mkdir /usr/local/include
    -mkdir /usr/local/lib
    cp ../include/libircclient.h /usr/local/include/libircclient.h
    cp ../include/libirc_errors.h /usr/local/include/libirc_errors.h
    cp ../include/libirc_events.h  /usr/local/include/libirc_events.h 
    cp libircclient.a /usr/local/include/lib/libircclient.a

$(OBJS): utils.c dcc.c errors.c portable.c sockets.c colors.c

libircclient.a: $(OBJS)
    $(AR) libircclient.a $(OBJS)
    $(RANLIB) libircclient.a

clean:
    rm -f libircclient.a $(OBJS)

distclean: clean
    -rm -f Makefile

.c.o:
    @echo "Compiling …
Run Code Online (Sandbox Code Playgroud)

c iphone cocoa-touch gcc ios4

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

AngularJS&ui.bootstrap.modal service templateUrl - 我可以使用Angular路由吗?

我对Angular很新,但很喜欢它!我正在尝试创建一个模态对话框来显示局部视图.ui.bootstap.modal有一个选项,用于显示要显示的局部视图的URL.我在我的应用程序模块上配置了一个如下所示的路由:

angular.module('buggy').config(['$routeProvider',
    function($routeProvider) {
        $routeProvider.
        when('/lists', {
            templateUrl: 'views/lists/list.html'
        }).
        when('/lists/create', {
            templateUrl: 'views/lists/create.html'
        }).
        when('/lists/:listId', {
            templateUrl: 'views/lists/partials/view.html'
        }). //more stuff
Run Code Online (Sandbox Code Playgroud)

我想展示when(/lists/:listId)从上面的路线定义的部分模板.所以在我的控制器中我试图打开模态对话框,如下所示:

 $scope.showList = function (list) {
            $modal.open({
            templateUrl:'lists/' + list._id,
            scope:$scope
        });
    }
Run Code Online (Sandbox Code Playgroud)

模态对话框打开但内容正好[object].我是否需要在服务器端定义路由,还是可以使用Angular路由返回部分路由?

谢谢!

angularjs angular-routing angular-ui-bootstrap

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