问题列表 - 第23031页

使用ssh进行Git克隆 - 无法找到存储库

我正在尝试使用CopSsh,PuTTY和msysgit在Windows 7上设置Git服务器.我在使用ssh克隆存储库时遇到问题.

如果我使用常规目录路径,它的工作原理:

$ git clone ~/vc/git/depot/test.git/ /c/dev/es/app
Initialized empty Git repository in c:/dev/es/app/.git/
warning: You appear to have cloned an empty repository.
Run Code Online (Sandbox Code Playgroud)

Ssh,不起作用.我尝试了不同的路径而没有成功.

$ git clone ssh://steve@test:4837/~/vc/git/depot/test.git/ /c/dev/es/app
Initialized empty Git repository in c:/dev/es/app/.git/
fatal: '~/vc/git/depot/eastApp.git' does not appear to be a git repository
fatal: The remote end hung up unexpectedly
Run Code Online (Sandbox Code Playgroud)

我按照这里的说明进行操作:http://www.timdavis.com.au/git/setting-up-a-msysgit-server-with-copssh-on-windows/

有线索吗?

git ssh msysgit

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

如何使用DirectShow将音频流写入内存缓冲区而不是文件?

我制作了一个示例应用程序,它构建了一个过滤器图形,用于从麦克风中捕获音频并将其传输到文件中.是否有任何过滤器允许我流式传输到内存缓冲区?

我正在遵循msdn上的文章中概述的方法,并且正在使用该CLSID_FileWriter 对象将音频写入文件.这很好用,但我无法弄清楚如何写入内存缓冲区.

是否有这样的内存接收器过滤器或我是否必须自己创建它?(我更喜欢与Windows XP捆绑在一起的)

c++ directshow

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

在单个语句中将临时字符串流转换为c_str()

考虑以下功能:

void f(const char* str);
Run Code Online (Sandbox Code Playgroud)

假设我想使用stringstream生成一个字符串并将其传递给此函数.如果我想在一个声明中这样做,我可能会尝试:

f((std::ostringstream() << "Value: " << 5).str().c_str()); // error
Run Code Online (Sandbox Code Playgroud)

这给出了一个错误:'str()'不是'basic_ostream'的成员.好的,所以operator <<返回ostream而不是ostringstream - 如何将它转换回ostringstream?

1)这个演员安全吗?

f(static_cast<std::ostringstream&>(std::ostringstream() << "Value: " << 5).str().c_str()); // incorrect output
Run Code Online (Sandbox Code Playgroud)

现在有了这个,结果是运算符<<("Value:")调用,它实际上调用了ostream的运算符<<(void*)并打印了一个十六进制地址.这是错的,我想要的是文字.

2)为什么operator << on临时std :: ostringstream()会调用ostream运算符?当然临时有一种'ostringstream'而不是'ostream'?

我可以施放临时强制执行正确的操作员!

f(static_cast<std::ostringstream&>(static_cast<std::ostringstream&>(std::ostringstream()) << "Value: " << 5).str().c_str());
Run Code Online (Sandbox Code Playgroud)

这似乎有效并将"Value:5"传递给f().

3)我现在依赖于未定义的行为吗?演员看起来很不寻常.


我知道最好的选择是这样的:

std::ostringstream ss;
ss << "Value: " << 5;
f(ss.str().c_str());
Run Code Online (Sandbox Code Playgroud)

...但我对在一行中做这件事的行为很感兴趣.假设有人想制作一个(可疑的)宏:

#define make_temporary_cstr(x) (static_cast<std::ostringstream&>(static_cast<std::ostringstream&>(std::ostringstream()) << x).str().c_str())

// ...

f(make_temporary_cstr("Value: " << 5));
Run Code Online (Sandbox Code Playgroud)

这会按预期运作吗?

c++ string temporary stringstream

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

我没有选择母版页的选项

使用visual studio 2008.当我向项目添加新的aspx表单时,即使项目中有一个,我也无法选择母版页.如何启用该选项?它在过去自动出现.

asp.net master-pages visual-studio-2008 visual-studio

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

你能在解决方案中混合.NET框架版本吗?

我工作的代码库是.NET 2.0.对于我们的新程序集/ DLL/web应用程序,我很乐意利用3.5提供的功能.

可以在解决方案中混合使用.NET框架(每个程序集)吗?有没有与此相关的IIS相关警告?

我很想听到任何积极/消极/如何反馈.让我知道!

谢谢!

.net frameworks versions

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

Zend Framework url重定向

<?php
 class PI_Controller_Plugin_AssetGrabber extends Zend_Controller_Plugin_Abstract
{
public function dispatchLoopStartup(Zend_Controller_Request_Abstract $request)
{
    /*
        The module name
    */
    $moduleName = $request->getModuleName();
    /*
        This modules requires the user to be loggedin in order to see the web pages!
    */
    $loginRequiredModules = array('admin');

    if (in_array($moduleName,$loginRequiredModules)) {
        $adminLogin = new Zend_Session_Namespace('adminLogin');
        if (!isset($adminLogin->loggedin)) {
            /*--------------------------------------
               Here I want to redirect the user
            */
             $this->_redirect('/something');
        }
    }   
}
}
Run Code Online (Sandbox Code Playgroud)

我正在尝试重定向$this->_redirect('/something')但不起作用!你知道在这种情况下如何进行重定向?

最好的祝福,

php zend-framework

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

如何使用jQuery向价格添加尾随零

所以我有一个脚本可以返回产品的价格.但是价格可能包括也可能不包括尾随零,所以有时我可能会:

258.22

还有其他时候我可能会

258.2

在后一种情况下,我需要使用jQuery添加尾随零.我该怎么做呢?

jquery zero trailing

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

如何创建既粗体又斜体的NSFont?

这是关于Cocoa中字体处理的初学者问题.我有一个字体系列,例如Verdana,它有以下字体:Regular,Bold,ItalicBold Italic.我知道这些字体存在,因为它们在"字体"面板中可用.

这有效:

NSFont *regular = [NSFont fontWithName:@"Verdana" size:75];
NSFont *bold = [NSFont fontWithName:@"Verdana-Bold" size:75];
NSFont *italic = [NSFont fontWithName:@"Verdana-Italic" size:75];
Run Code Online (Sandbox Code Playgroud)

这不起作用:

NSFont *boldItalic = [NSFont fontWithName:@"Verdana-Bold Italic" size:75];
Run Code Online (Sandbox Code Playgroud)

获得给定字体系列的Bold Italic版本的最简单方法是什么?

fonts cocoa

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

构造函数和析构函数如何工作?

我正在尝试理解这段代码:

class Person:
    '''Represents a person '''
    population = 0

    def __init__(self,name):
          //some statements and population += 1
    def __del__(self):
          //some statements and population -= 1 
    def sayHi(self):
        '''grettings from person'''
        print 'Hi My name is %s' % self.name

    def howMany(self):
        '''Prints the current population'''
        if Person.population == 1:
            print 'i am the only one here'
        else:
            print 'There are still %d guyz left ' % Person.population
rohan = Person('Rohan')
rohan.sayHi()
rohan.howMany()


sanju = Person('Sanjivi')
sanju.howMany()

del rohan # am …
Run Code Online (Sandbox Code Playgroud)

python destructor class

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

如何在MySQL Workbench中获取表创建脚本?

我回滚到MySQL GUI Tools的MySQL查询浏览器,因为我找不到在MySQL Workbench中获取表创建脚本的快捷方式.

mysql mysql-workbench

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