小编Kaj*_*zer的帖子

向WP8应用添加服务引用时出现问题

我尝试向http://www.webservicex.com/globalweather.asmx?WSDLWeb服务添加服务引用.我去添加服务参考,它发现它很好,但当我尝试点击确定,我得到错误:

无法检出当前文件.该文件可能是只读的或锁定的,或者您可能需要手动检查文件.

我还尝试在"高级"选项卡下添加Web引用,但没有任何选项可以这样做.

我尝试在7.1目标应用程序中这样做,同样的错误.我的朋友在Visual Studio 2010上这样做,他没有得到这样的错误.

visual-studio-2012 windows-phone-8

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

BufferedImage - 获取灰度颜色模型图片中像素的值

BufferedImage使用此代码转换为灰度.我通常得到像素值BufferedImage.getRGB(i,j)和g,R,G和B的每个值.但是如何获得灰度图像中像素的值?

编辑:抱歉,忘了转换.

static BufferedImage toGray(BufferedImage origPic) {
    BufferedImage pic = new BufferedImage(origPic.getWidth(), origPic.getHeight(), BufferedImage.TYPE_BYTE_GRAY);
    Graphics g = pic.getGraphics();
    g.drawImage(origPic, 0, 0, null);
    g.dispose();
    return pic;
}
Run Code Online (Sandbox Code Playgroud)

java pixel grayscale

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

Linux内核中的调度算法

在linux内核中实现了多少种不同的算法?是否只有FIFO和Round Robin,或者还有其他吗?

我在哪里可以找到关于这个主题的好文档?

让我们说如果我想实现这些算法myslef,我应该从哪里开始?

linux kernel scheduling process

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

ListView绑定中的SelectedItem

我是WPF的新手.在我的示例应用程序中,我使用ListView来显示属性的内容.我不知道如何将ListView中的SelectedItem绑定到属性,然后绑定到TextBlock.

Window.xaml

<Window x:Class="Exec.App"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="Main window" Height="446" Width="475" >

    <Grid>
        <ListView Name="ListViewPersonDetails" Margin="15,12,29,196" ItemsSource="{Binding Persons}" SelectedItem="{Binding CurrentSelectedPerson}">
            <ListView.View>
                <GridView>
                    <GridViewColumn Header="First name" DisplayMemberBinding="{Binding FirstName}"/>
                    <GridViewColumn Header="Last name" DisplayMemberBinding="{Binding LastName}"/>
                    <GridViewColumn Header="Address" DisplayMemberBinding="{Binding Address}"/>
                </GridView>
            </ListView.View>
        </ListView>

        <TextBlock Height="23" Name="textFirstNameBlock" FontSize="12" Margin="97,240,155,144">
                <Run Text="Name: " />
                <Run Text="{Binding CurrentSelectedPerson.FirstName}" FontWeight="Bold" />
        </TextBlock>

        <TextBlock Height="23" Name="textLastNameBlock" FontSize="12" Margin="97,263,155,121">
                <Run Text="Branch: " />
                <Run Text="{Binding CurrentSelectedPerson.LastName}" FontWeight="Bold" />
        </TextBlock>

        <TextBlock Height="23" Name="textAddressBlock" FontSize="12" Margin="0,281,155,103" HorizontalAlignment="Right" Width="138">
                <Run Text="City: " />
                <Run …
Run Code Online (Sandbox Code Playgroud)

c# data-binding wpf xaml

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

Windows Phone 8 - 将列表保存到IsolatedStorage

我正在尝试保存一个类我的类对象的集合.我收到一个错误说明:

收集数据协定类型'System.Collections.Generic.List无法反序列化,因为它没有公共无参数构造函数.添加公共无参数构造函数将修复此错误.

这是我的班级:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace MojProjekt
{
    class Lekarna
    {
        public string Ime { get; set; }

        public Lekarna()
        {
        }
    }
}
Run Code Online (Sandbox Code Playgroud)

以下是我如何保存到IsolatedStorage:

List<Lekarna> lekarneList = new List<Lekarna>();  
// here I then fill the list ...  
IsolatedStorageSettings localStorage = IsolatedStorageSettings.ApplicationSettings;
localStorage.Add("lekarneList", lekarneList;
localStorage.Save();
Run Code Online (Sandbox Code Playgroud)

c# silverlight windows-phone windows-phone-8

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

尝试从列表中删除元素时"列出迭代器不兼容"

list<employee> remove_employees(const string& name,
                                const string& lastname) 
{
    list<employee> listOfRemoved; 
    list<employee>::iterator it; 

    for(it=employees.begin(); it != employees.end(); )
    {
        if(it->get_name() == name && it->get_lastname() ==lastname) 
        {
            listOfRemoved.push_back(*it); 
            employees.erase(it); 
        }
        else
            it++;
    }

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

我试图从类实例变量员工中删除一些员工,然后返回一个新列表,只有已删除的emeployees.当我尝试运行程序时,它会从标题中给出错误.我知道它与擦除和push_back有关,但我无法弄明白.

c++ iterator list

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

无法从字符串转换为LPCTSTR

我试图在静态文本小部件中放入一些文本,如下所示:

m_StartupTime.SetWindowText(someStringVariable);
Run Code Online (Sandbox Code Playgroud)

并得到一个错误:

'CWnd :: SetWindowTextA':无法将参数1从'std :: string'转换为'LPCTSTR'

我尝试过使用该c.str()方法,但是当我这样做时,程序编译得很好,但在运行时崩溃,抛出一个错误:

错误

所以我正在弄清楚问题是否与转换有关,还是除此之外的其他问题?

使用CString并没有解决问题,我尝试从Unicode字符集切换到Multi-Byte,但没有成功.哦,我在MFC开发.

编辑:找到解决方案!我使用了CString类.

string a = "smth";
CString str(a.c_str());
Run Code Online (Sandbox Code Playgroud)

c++ string mfc

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