小编WSk*_*ner的帖子

Phonegap在构建期间不会将插件文件复制到ios平台目录

rm -rf plugins/*
rm -rf platforms/*

phonegap build ios //this works

phonegap local plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-device.git

phonegap build ios
Run Code Online (Sandbox Code Playgroud)

添加插件后为ios构建失败.这是错误:

** BUILD FAILED **


The following build commands failed:
    CompileC build/PondMD.build/Debug-iphoneos/PondMD.build/Objects-normal/armv7/CDVDevice.o PondMD/Plugins/org.apache.cordova.device/CDVDevice.m normal armv7 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)
2014-01-16 10:32:15.055 xcodebuild[69605:1007] [MT] PluginLoading: Required plug-in compatibility UUID 37B30044-3B14-46BA-ABAA-F01000C27B63 for plug-in at path '~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/XCode4_beginning_of_line.xcplugin' not present in DVTPlugInCompatibilityUUIDs
2014-01-16 10:32:16.630 xcodebuild[69605:4203]  DVTAssertions: Warning in /SourceCache/IDEXcode3ProjectSupport/IDEXcode3ProjectSupport-3575/Xcode3Sources/XcodeIDE/Frameworks/DevToolsBase/pbxcore/SpecificationTypes/XCGccMakefileDependencies.m:78
Details:  Failed to load dependencies output contents from ``/Users/william/working/PhonegapPondMD/platforms/ios/build/PondMD.build/Debug-iphonesimulator/PondMD.build/Objects-normal/i386/CDVDevice.d''. Error: Error Domain=NSCocoaErrorDomain Code=260 "The file …
Run Code Online (Sandbox Code Playgroud)

ios cordova

8
推荐指数
2
解决办法
7457
查看次数

如何通过DateTimeField订购django-mptt树?

这是我使用的模型:

class Comment(MPTTModel):
    comment = models.CharField(max_length=1023)
    resource = models.ForeignKey('Resource')
    created_at = models.DateTimeField(auto_now_add=True)
    parent = TreeForeignKey('self', null=True, blank=True, related_name='children')
    author = models.ForeignKey(User)

    class MPTTMeta:
        order_insertion_by = ['created_at']
Run Code Online (Sandbox Code Playgroud)

但是,当我尝试从管理站点添加评论时,我得到:

ValueError at /admin/app/comment/add/
Cannot use None as a query value
Run Code Online (Sandbox Code Playgroud)

我的模特出了什么问题吗?我觉得django-mptt尝试获取DateTimeField,而它仍然是"None",之后它已在db级别设置.

python django django-mptt

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

OpenGL GLSL纹理(...)函数总是返回v4(0,0,0,1)

我有基本纹理映射的以下设置

void init(void) {
  glGenVertexArrays(NumVAOs, VAOs);
  glBindVertexArray(VAOs[Triangles]);

  GLfloat  vertices[6][2] = {
    { -0.90, -0.90 },  // Triangle 1
    {  0.85, -0.90 },
    { -0.90,  0.85 },

    {  0.1, 0.1 },  // UVs
    {  0.9,  0.1 },
    {  0.1,  0.9 }
  };

  glGenBuffers(NumBuffers, Buffers);

  glBindBuffer(GL_ARRAY_BUFFER, Buffers[ArrayBuffer]);

  glBufferData(GL_ARRAY_BUFFER, sizeof(vertices), vertices, GL_STATIC_DRAW);

    GLuint program = LoadShaders( "triangles.vert", "triangles.frag" );
  glUseProgram(program);

  glVertexAttribPointer(vPosition, 2, GL_FLOAT,
                        GL_FALSE, 0, BUFFER_OFFSET(0));

  glEnableVertexAttribArray(vPosition);

  glVertexAttribPointer(1, 2, GL_FLOAT,
                        GL_FALSE, 0, BUFFER_OFFSET(2*3*sizeof(GLfloat)));

  glEnableVertexAttribArray(1);

  GLuint sloc = glGetUniformLocation(program, "mySampler");
  glUniform1i(sloc, 0);

  int x,y,n; …
Run Code Online (Sandbox Code Playgroud)

opengl texture-mapping

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

在Django模型中表示URL的最佳方法是什么?

我在想这样的事情:

url = models.CharField(max_length=2047)
Run Code Online (Sandbox Code Playgroud)

有没有一种解决方案对于ORM / SQL会更有效?

django

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

如何在字符串列表中查找匹配的字符串

我正在学习c ++,并想知道下面做的最好或最惯用的方法是什么.我有一个已知的已接受字符串列表,这些字符串对于程序来说是不变的.我想知道提供给函数的字符串是否在我接受的字符串列表中.我提出了:

bool match(const char* foo, const char* bar) {
    return strcmp(foo, bar) == 0;
}

bool thingIsValid(const char* thing) {
    return match("foo", thing) || match("bar", thing) || match("baz", thing);
}

...
thingIsValid(someArg.c_str());
...
Run Code Online (Sandbox Code Playgroud)

这种方法似乎更像是我的C语言.在其他语言中,我可能只有一个列表并在该列表上执行.contains(thing).人们通常如何在C++中做到这一点?

c++

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

C++插入运算符(<<)是否修改了值?

我有一个返回double数组的函数.在我的调试器中,我阻止了数组,看到它的值是{6.5,1.5}.但是,当我将阵列打印到cout时,我看到"6.5,3.30525e + 230".我的猜测是,要么改变我的价值观,要么我没有正确格式化

double *result;

result = haar1d(series, 2, seriesAverage);
Run Code Online (Sandbox Code Playgroud)

- >在这里的断点处,我看到result [0] == 6.5和result [1] == 1.5

for(int i = 0; i < 2; i++)
{
    cout << result[i] << ",";
}
Run Code Online (Sandbox Code Playgroud)

修正:这是我最终的结果.

vector<double> haar1d(vector<double> vec, double seriesAverage)
{
vector<double> transVec(vec.size(), 0);
vector<double>::size_type length = vec.size();

if(vec[0] == seriesAverage)
{
    return vec;
}

int diffFromAvgs = length / 2;

for(int i = 0; i < length; i += 2)
{
    double pairAverage = (vec[i] + vec[i + 1]) …
Run Code Online (Sandbox Code Playgroud)

c++

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

标签 统计

c++ ×2

django ×2

cordova ×1

django-mptt ×1

ios ×1

opengl ×1

python ×1

texture-mapping ×1