问题列表 - 第17480页

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

Iphone无法识别reneweed ad hoc provising profile

我安装了我们正在开发的应用程序的新版本,还有一个新的临时配置文件(旧版本已过期).我从手机和iTunes中删除了应用和个人资料.添加了新的配置文件和应用程序到iTunes并同步.一切似乎都很好 - 新的配置文件也在电话和新的应用程序上.但是在尝试启动应用程序时,我收到一条警告:"由于配置文件已过期,无法打开应用程序".

我删除并重新安装.我重新启动了手机.什么都没有帮助.

有任何想法吗?

谢谢

iphone profile provisioning adhoc

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

逗号分隔千位NSString stringWithFormat

是否可以使用1000.99显示为1,000.99

[NSString stringWithFormat:@"£%0.2f", 1000.99]
Run Code Online (Sandbox Code Playgroud)

如果我没有在正确的轨道上实现这一点,请指导我?

iphone objective-c nsstring stringwithformat ios

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

追加 C 失败,只需覆盖

而不是附加“abc”(从而最终得到一个充满 abcabcabc 的文件......),无论我运行多少次,我的文件只包含“abc”......我怎样才能附加?

#include <stdio.h>
#include <string.h>

int main(){
    char strng[10];
    strcpy(strng,"abc");
    FILE *my_file;
    my_file = fopen("myfile","a+");
    if (my_file == NULL){ printf("problem\n");}
    fwrite(strng, sizeof(strng), 1, my_file);
    printf("appending %s\n",strng);
    fclose(my_file);
}
Run Code Online (Sandbox Code Playgroud)

c file-io

5
推荐指数
0
解决办法
8964
查看次数

如何将 RTF 文件转换为 pdf 文件?

如何将 RTF 文件转换为 PDF 文件?我有 Adob​​e PDF 打印机,我应该使用它吗?如果是这样,我如何以编程方式访问它?

.net c# pdf documentation-generation

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

10个字符ID,全局和本地唯一

我需要生成一个10个字符的唯一ID(SIP/VOIP人员需要知道它是P-Charging-Vector头中的param icid值).每个字符应为26个ASCII字母之一(区分大小写),10个ASCII数字之一或连字符减号.

它必须是"全局唯一的(在生成id的机器之外)"并且足够"本地唯一(在生成id的机器内)",并且所有需要打包成10个字符,p!

这是我的看法.我是第一个编码'必须'编码全局唯一本地IP地址到base-63(它是一个无符号长整数,编码后将占用1-6个字符)然后尽可能多的当前时间戳(其一个time_t/long long int,编码后将占用9-4个字符,具体取决于编码的ip地址占用的空间大小.

我还在时间戳中添加了循环计数'i',以便在一秒钟内多次调用该函数时保留唯一性.

这是否足以在全球和本地独特,还是有另一种更好的方法?

拉夫

#include <stdio.h>
#include <string.h>
#include <sys/time.h>

//base-63 character set
static char set[]="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-";

// b63() returns the next vacant location in char array x
int b63(long long longlong,char *x,int index){
    if(index > 9)
        return index+1;

    //printf("index=%d,longlong=%lld,longlong%63=%lld\n",index,longlong,longlong%63);
    if(longlong < 63){
        x[index] = set[longlong];
        return index+1;
    }  

    x[index] = set[longlong%63];
    return b63(longlong/63,x,index+1);
}

int main(){
    char x[11],y[11] = {0}; /* '\0' is taken care of here */

    //let's generate 10 million ids
    for(int i=0; …
Run Code Online (Sandbox Code Playgroud)

c c++ linux x86-64 sip

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

使用常规迭代器向后迭代,还是使用reverse_iterator?

我最近了解了在C++中使用反向迭代器的正确方法(特别是当你需要擦除它时).(见这个问题,并且这一个.)

这就是你应该这样做的方式:

typedef std::vector<int> IV;
for (IV::reverse_iterator rit = iv.rbegin(), rend = iv.rend();
     rit != rend; ++rit)
{
  // Use 'rit' if a reverse_iterator is good enough, e.g.,
  *rit += 10;
  // Use (rit + 1).base() if you need a regular iterator e.g.,
  iv.erase((rit + 1).base());
}
Run Code Online (Sandbox Code Playgroud)

但我认为这样做要好得多(不要这样做,不符合标准,正如MooingDuck指出的那样):

for (IV::iterator it = iv.end(), begin = iv.begin();
     it-- != begin; )
{
  // Use 'it' for anything you want
  *it += 10;
  iv.erase(it); …
Run Code Online (Sandbox Code Playgroud)

c++ iterator stl

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

使用RMagick正确地将CMYK图像转换为RGB

我一直在用下面的颜色进行转换

    if @image.colorspace == Magick::CMYKColorspace
      # @image.colorspace #=> CMYKColorspace=12
      @image.colorspace = Magick::RGBColorspace
      @image = @image.negate
    end
Run Code Online (Sandbox Code Playgroud)

它大约有效,但颜色亮度不对.我需要否定图像的事实留下了非常难闻的气味.

该文档提到了使用color_profiles,但除此之外我找不到多少.

我现在正在努力

@image = @image.quantize(16777216, Magick::RGBColorspace)
Run Code Online (Sandbox Code Playgroud)

颜色更好,但仍然关闭.

ruby rmagick imagemagick

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

签名整数的Endian转换

我通过UDP接收大端数据并将其转换为小端.消息来源说整数是有符号的,但是当我交换有符号整数的字节(特别是16位)时,我会得到不切实际的值.当我把它们换成无符号的整数时,我得到了我的期望.我想源文档可能不正确,实际上是发送无符号的16位整数.但为什么会这么重要?这些值都应该是正数,并且在16位INT_MAX下,因此溢出不应该是一个问题.我唯一能想到的是(1)文档错误和(2)当我执行有符号的字节序交换时,我没有正确处理符号位.

我真的有两个问题:

1)当溢出不成问题时,我是否读入有符号或无符号的整数是否重要.

2)有符号值和无符号值之间的字节序交换是否不同(即符号位是否需要以不同方式处理)?

我认为对于有符号和无符号值,endian转换看起来都是相同的,例如对于16位value = value&0xff00 >> 8 | value&0x00ff << 8.

谢谢

endianness

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

Java Stanford NLP:拼写检查

我正在尝试使用斯坦福NLP检查文本样本的拼写准确性.它只是文本的一个度量标准,而不是过滤器或任何东西,所以只要错误是一致的,如果它稍微关闭它就没问题了.

我的第一个想法是检查词典是否知道这个词:

private static LexicalizedParser lp = new LexicalizedParser("englishPCFG.ser.gz");

@Analyze(weight=25, name="Spelling")
    public double spelling() {
        int result = 0;

        for (List<? extends HasWord> list : sentences) {
            for (HasWord w : list) {
                if (! lp.getLexicon().isKnown(w.word())) {
                    System.out.format("misspelled: %s\n", w.word());
                    result++;
                }
            }
        }

        return result / sentences.size();
    }
Run Code Online (Sandbox Code Playgroud)

但是,这会产生很多误报:

misspelled: Sincerity
misspelled: Sisyphus
misspelled: Sisyphus
misspelled: fidelity
misspelled: negates
misspelled: gods
misspelled: henceforth
misspelled: atom
misspelled: flake
misspelled: Sisyphus
misspelled: Camus
misspelled: foandf
misspelled: foandf
misspelled: babby
misspelled: formd …
Run Code Online (Sandbox Code Playgroud)

java nlp spell-checking stanford-nlp

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