问题列表 - 第49678页

迁移C++代码以使用标准标头.现在得到:引用'ostream'模棱两可

我一直在迁移一些代码来改变头文件的声明,因为它们不包含在我的Ubuntu环境中.我终于改变了所有文件,但是收到了以下错误:

Item.h:33: error: reference to ‘ostream’ is ambiguous
Item.h:16: error: candidates are: struct ostream
/usr/include/c++/4.4/iosfwd:130: error:                 typedef struct  
std::basic_ostream<char, std::char_traits<char> > std::ostream 
Item.h:33: error: ISO C++ forbids declaration of ‘ostream’ with no type
Item.h:33: error: ‘ostream’ is neither function nor member function; cannot be declared friend
Run Code Online (Sandbox Code Playgroud)

代码如下:

class Item
{
public:
    Item( //const Wrd* hd,
     const Term * _term, int _start, int _finish );
    ~Item();
    int         operator== (const Item& item) const;
    friend ostream& operator<< ( ostream& os, const Item& item …
Run Code Online (Sandbox Code Playgroud)

c++ std ostream

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

PHP中的MongoDB - 如何将项插入集合中的数组?

这一定很简单,但我似乎无法弄明白......假设我有一个集合users,这是该集合中的第一个项目:

{ 
    "_id" : ObjectId("4d8653c027d02a6437bc89ca"), 
    "name" : "Oscar Godson", 
    "email" : "oscargodson@xxx.com", 
    "password" : "xxxxxx", 
    "tasks" : [
    {
        "task" : "pick up stuff",
        "comment" : "the one stuff over there"
    },
    {
        "task" : "do more stuff",
        "comment" : "lots and lots of stuff"
    }
] }
Run Code Online (Sandbox Code Playgroud)

然后我将如何使用MongoDB的PHP驱动程序向集合中此项中的"tasks"数组添加另一个"任务"

php database json mongodb nosql

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

奇怪的Sql Update行为

我正在尝试使用以下更新语句更新PostgreSQL和MySQL上的供应商表:

UPDATE SUPPLIERS SET CURDEBT = CURDEBT + 10 WHERE ID = 5
Run Code Online (Sandbox Code Playgroud)

只要CURDEBT列不等于null,这就可以正常工作,如果它为null,则不会更新记录.有没有人能解决这个问题?

谢谢

mysql sql postgresql

0
推荐指数
3
解决办法
143
查看次数

iPhone appstore批准错误

我正准备将第一个应用程序发布到应用程序商店,我一直在阅读"iPhone人机界面指南"和相关文档,以检查我可能缺少的内容.

我想问一下,在提交应用程序以获得批准时,人们最常犯的错误是什么.

我正在考虑要求人们失踪等.

一个问题是是否需要设备旋转,如果需要,是否需要旋转所有四个方向.

iphone objective-c app-store

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

弱/强参考指针关系

我一直在尝试编写自己的弱/强指针,但我并不清楚这种关系.我似乎遇到的所有事情都没有明确表达,而且通常一个文档会对另一个文档所说的内容进行谴责.任何人都可以详细解释弱/强指针关系,可能还有一个图像或代码示例?

(请不要只是告诉我"使用提升"或"使用tr1"等.这不是功课,我想学习).

c++ pointers smart-pointers unsafe-pointers

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

如何创建链接服务器MySQL

是否有可能为SQL Server的链接服务器等功能创建/配置MySQL?

如果是的话,请你告诉我怎么样?我正在使用MySQL 5.5.

mysql linked-server

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

Clojure 1.3的稳定性如何?

我正在考虑从Clojure 1.2切换到Clojure 1.3 alpha/beta,我想知道其他人在切换之前对Clojure 1.3的稳定性有何看法.

在1.2我继续用尽"PermGen"空间,这显然是在1.3中修复的.这就是我想要移植的原因.

更新:Rich Hickey已经承认这是Clojure中的一个问题,并且perm gen和关键字的问题似乎是固定的,但在1.3中通过使关键字使用弱引用:

http://groups.google.com/group/clojure/browse_thread/thread/4308d846bf2ef129

clojure

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

无法找到JAX-WS的Spring Namespace

我想将JAX-WS集成到我的Spring项目中.找到此链接:http: //jax-ws-commons.java.net/spring/

我采用它并将其集成到我的applicationContext.xml:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" 
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
   xmlns:context="http://www.springframework.org/schema/context" 
   xmlns:task="http://www.springframework.org/schema/task"
   xmlns:ws="http://jax-ws.dev.java.net/spring/core" 
   xmlns:wss="http://jax-ws.dev.java.net/spring/servlet" 
   xsi:schemaLocation="http://www.springframework.org/schema/beans 
           http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
           http://www.springframework.org/schema/context
           http://www.springframework.org/schema/context/spring-context-3.0.xsd
           http://www.springframework.org/schema/task
           http://www.springframework.org/schema/task/spring-task-3.0.xsd
           http://jax-ws.dev.java.net/spring/core
           http://jax-ws.dev.java.net/spring/core.xsd
           http://jax-ws.dev.java.net/spring/servlet
           http://jax-ws.dev.java.net/spring/servlet.xsd">

    <context:annotation-config />
    <context:component-scan base-package="cloud" />
    <task:annotation-driven/>

    <wss:binding url="/notification" service="#notificationService"></wss:binding>  
    <ws:service id="notificationService" bean="#notificationImpl"></ws:service> 

    <bean id="notificationImpl" class="cloud.balancer.Notification" /> 
</beans> 
Run Code Online (Sandbox Code Playgroud)

但每次我启动Tomcat时,都会遇到以下异常:

SEVERE:将上下文初始化事件发送到类的侦听器实例的异常org.springframework.web.context.ContextLoaderListener org.springframework.beans.factory.parsing.BeanDefinitionParsingException:配置问题:无法找到XML架构命名空间的Spring NamespaceHandler [ http://jax-ws.dev.java.net/spring/servlet] Offending resource:ServletContext resource [ /WEB-INF/applicationContext.xml]

Eclipse不会报告有关命名空间的任何错误.我发现谷歌有一些类似的问题,但没有修复我的错误.

谢谢你的帮助!

java spring jax-ws

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

Wordpress插件开发 - 获取所有活动的小部件

我正在开发一个wordpress插件,它创建一个可以作用于另一个小部件的小部件.我已经搜索但似乎无法找到(如果它存在)一个钩子,它将提供所有活动的小部件实例的详细信息.如果您遇到这个问题,我们将不胜感激.谢谢

wordpress plugins

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

具有自定义控件属性值的WPF自定义控件的工具提示

在WPF应用程序中,我有一个自定义控件.

public class MyControl : Control
{
    static MyControl()
    {
        DefaultStyleKeyProperty.OverrideMetadata(typeof(MyControl), new FrameworkPropertyMetadata(typeof(MyControl)));
    }

    public static readonly DependencyProperty ControlStatusProperty = DependencyProperty.Register("ControlStatus", typeof(int), typeof(MyControl), new PropertyMetadata(16));

    public int ControlStatus
    {
        get
        {
            return (int)GetValue(ControlStatusProperty);
        }
        set
        {
            SetValue(ControlStatusProperty, value);
            ChangeVisualState(false);
        }
    }
 ...
    public override void OnApplyTemplate()
    {
        base.OnApplyTemplate();
       ...
        ToolTipService.SetToolTip(this, "Status: " + ControlStatus);          
    }

    private void ChangeVisualState(bool useTransitions)
    {
       ...
       ToolTipService.SetToolTip(this, "Status: " + ControlStatus);
    }
Run Code Online (Sandbox Code Playgroud)

问题是:ToolTip总是显示方法执行时的ControlStatus属性值OnApplyTemplate().自定义控件
ControlStatus属性在运行时已更改,但ToolTip仍始终显示初始值.

如何使自定义控件的工具提示始终显示自定义控件属性的当前值?

c# silverlight wpf custom-controls tooltip

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