小编Unk*_*337的帖子

输入组 - 两个输入彼此靠近

如何使输入组涉及两个输入?

<div class="input-group">
    <input type="text" class="form-control" placeholder="MinVal">
    <input type="text" class="form-control" placeholder="MaxVal">
</div>
Run Code Online (Sandbox Code Playgroud)

这不起作用,它们是水平的而不是内联的

twitter-bootstrap twitter-bootstrap-3

65
推荐指数
7
解决办法
12万
查看次数

OpenGL中出现奇怪的GL_INVALID_OPERATION错误

glClearColor( 1.0f, 1.0f, 1.0f, 1.0f );

AttachVertexShader( shader, "szescian_vs.glsl" );
AttachFragmentShader( shader, "szescian_fs.glsl" );
LinkProgram( shader );

glBindVertexArray( vertexVAO );

glGenBuffers( 1, &positionBuffer );

glGenBuffers( 1, &positionBuffer );
glBindBuffer( GL_ARRAY_BUFFER, positionBuffer );
glBufferData( GL_ARRAY_BUFFER, sizeof( position ), position, GL_STATIC_DRAW );
positionLoc = glGetAttribLocation( shader, "inPosition" );
glEnableVertexAttribArray ( positionLoc );
glVertexAttribPointer ( positionLoc, 3, GL_FLOAT, GL_FALSE, 0, ( void* ) 0 ); //here gDEBugger GL breaks on OpenGL Error
Run Code Online (Sandbox Code Playgroud)

这是我的初始化函数的一部分,我真的不知道为什么gDEBugger打破了它,有人可以为我解释一下吗?

中断原因OpenGL错误中断glVertexAttribPointer(0,3,GL_FLOAT,FALSE,0,0x00000000)错误代码
GL_INVALID_OPERATION错误描述在当前状态下不允许指定的操作.忽略违规功能,除了设置错误标志外没有任何副作用.*在执行功能前停止

这是休息信息.

c++ opengl opengl-3

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

c ++ 11 vs c ++ - 枚举差异

//c++03
enum Something
{
    S1 = 0,
    S2,
    SCOUNT
};
int arr[SCOUNT];

//c++11
enum class Something
{
    S1 = 0,
    S2,
    SCOUNT
};
int arr[(int) Something::SCOUNT];
Run Code Online (Sandbox Code Playgroud)

在这种情况下如何在不将枚举计数转换为int的情况下使用枚举?

c++ enums c++11 strongly-typed-enum

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

包裹在表格单元格内部

我使用最新的twitter bootstrap,我在表格单元格中有预标签的麻烦,如果行太长,它应该创建水平滚动但不会发生.

http://jsfiddle.net/52VtD/6958/没有预先的例子

<div class="row">
    <div class="container">
        <div class="col-md-3" style="border: 1px solid red;">
            this is col-md-3? yes :)
            <table class="table">
                <thead>
                    <tr><th>author</th><th>content</th></tr>
                </thead>
                <tbody>
                    <tr><td>somebody</td><td></td></tr>
                </tbody>
            </table>
        </div>
        <div class="col-md-9" style="border: 1px solid black;">test</div>
    </div>
</div>
Run Code Online (Sandbox Code Playgroud)

http://jsfiddle.net/52VtD/6959/以前的例子

<div class="row">
    <div class="container">
        <div class="col-md-3" style="border: 1px solid red;">
            this is col-md-3? no :(
            <table class="table">
                <thead>
                    <tr><th>author</th><th>content</th></tr>
                </thead>
                <tbody>
                    <tr><td>somebody</td><td>why I cannot wrap it?<br/><pre>&lt;?php<br/>class A<br/>{<br/>    function foo()<br/>    {<br/>        if (isset($this)) {<br/>            echo '$this is defined (';<br/>            echo get_class($this);<br/>            echo …
Run Code Online (Sandbox Code Playgroud)

css3 twitter-bootstrap twitter-bootstrap-3

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

C++继承,怎么解决这个?

我怎么解决这个问题?我想执行适当的方法.有什么方法可以解决这个问题吗?我想在一个循环中执行方法.

class Base
{
public:
    void something() {}
};

class Child : public Base
{
public:
    void something() {}
};

class SecondChild : public Base
{
public:
    void something() {}
};

std::vector<Base*> vbase;

Child * tmp = new Child();

vbase.push_back((Base*) tmp);

SecondChild * tmp2 = new SecondChild();

vbase.push_back((Base*) tmp);

for (std::vector<Base*>::iterator it = vbase.begin(); it != vbase.end(); it++)
{
    //here's problem, I want to execute proper method "something", but only I can do is execute Base::something;
    (*it)->something();
}
Run Code Online (Sandbox Code Playgroud)

当我有很多基类的孩子时,我不知道如何施放类型.

c++ inheritance

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

I18n如何使用date()?

如何使用date()在kohana 3中起诉i18n?

echo date('l jS F Y h:i:s A');
Run Code Online (Sandbox Code Playgroud)

我不知道如何翻译日名,月名等...

php kohana-3

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

删除类内部

我遇到了一些奇怪的问题。我在类方法内部使用删除运算符,我想知道如何解决这个问题。

这是代码:

#include <iostream>

using namespace std;

class A
{
    public:
        int a;

        ~A() {
            cout << "call ~A()" << endl;
        }

        void action()
        {
            /* code here */
            delete this; //this line depends on some if statements
            /* code here */
        }

        void test2() {
            cout << "call test2()" <<  a << endl;
        }

        void test() {
            a = 10;
            cout << "call test()" << endl;

            action();

            //how can I check if data is deleted?
            test2();
        }
};

int …
Run Code Online (Sandbox Code Playgroud)

c++ class delete-operator

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