问题列表 - 第27829页

VisualHG图标未出现在VS2010解决方案资源管理器中

有人管理过这个问题吗?所有其他Mercurial设施在VS内部工作正常.

mercurial visual-studio-2010 visualhg

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

类中的公共结构

我是C++的新手,让我说我有两个类:CreatureHuman:

/* creature.h */
class Creature {
private:
public:
    struct emotion {
        /* All emotions are percentages */
        char joy;
        char trust;
        char fear;
        char surprise;
        char sadness;
        char disgust;
        char anger;
        char anticipation;
        char love;
    };
};

/* human.h */
class Human : Creature {

};
Run Code Online (Sandbox Code Playgroud)

我在我的主要功能中有这个main.cpp:

Human foo;
Run Code Online (Sandbox Code Playgroud)

我的问题是:我怎样才能设定foo的情绪?我试过这个:

foo->emotion.fear = 5;
Run Code Online (Sandbox Code Playgroud)

但是GCC给了我这个编译错误:

错误:' - >'的基本操作数有非指针类型'人'

这个:

foo.emotion.fear = 5;
Run Code Online (Sandbox Code Playgroud)

得到:

错误:'struct Creature :: emotion'是无法访问的
错误:在此上下文中
出错:无效使用'struct Creature :: emotion'

谁能帮我?谢谢


PS不,我没有忘记 …

c++ struct class

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

使用Python进行文件加密

有没有办法用Python加密文件(.zip,.doc,.exe,......任何类型的文件)?

我看了一堆Python的加密库,包括pycrypto和ezpycrypto,但据我所知他们只提供字符串加密.

python encryption

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

帮助通过C和/或汇编优化C#功能

我有这个C#方法,我正在尝试优化:

// assume arrays are same dimensions
private void DoSomething(int[] bigArray1, int[] bigArray2)
{
    int data1;
    byte A1, B1, C1, D1;
    int data2;
    byte A2, B2, C2, D2;
    for (int i = 0; i < bigArray1.Length; i++)
    {
        data1 = bigArray1[i];
        data2 = bigArray2[i];

        A1 = (byte)(data1 >> 0);
        B1 = (byte)(data1 >> 8);
        C1 = (byte)(data1 >> 16);
        D1 = (byte)(data1 >> 24);

        A2 = (byte)(data2 >> 0);
        B2 = (byte)(data2 >> 8);
        C2 = (byte)(data2 >> 16);
        D2 …
Run Code Online (Sandbox Code Playgroud)

c c# optimization assembly

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

每个用户同时有2个不同的php请求

我有一个有2页的网站,(home_page.php和action_page.php)Action页面需要​​aprx.2分钟完全加载(服务器端需要2分钟).但是,如果用户在加载操作页面时单击主页链接,则浏览器不会转到主页,直到操作页面完全加载.如果在新选项卡中打开主页,则相同.

首先是什么原因?(bowser?php?apache?)我该如何避免这种情况?

谢谢

php browser apache url

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

SVG缩放文本以适应容器

这可能是一个非常简单的问题,但是如何让SVG中的文本拉伸以适应其容器?

我不在乎它是否因拉伸太长或太长而看起来很难看,但它需要适合它的容器并尽可能大.

谢谢

xml xhtml svg viewbox

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

如何解开整个文件夹?

我有一个git版本的文件夹.我想取消它,即删除.git元数据,我该怎么做?

谢谢

git

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

需要有关Android TableLayout对齐的帮助

我正在尝试使用TableLayout构建计算器布局,但最后两行未与布局的其余部分对齐.我的布局XML有问题吗?

我想要做的事情在HTML中更容易实现(<td>colspanrowspan),所以我应该尝试将其转换为WebView吗?

代码如下:( 截图)

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">
    <EditText
        android:id="@+id/EditText01"
        android:layout_height="wrap_content"
        android:layout_width="fill_parent" />
    <TableLayout
        android:layout_height="fill_parent"
        android:layout_width="fill_parent"
        android:stretchColumns="*">
        <TableRow
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:layout_weight="1">
            <Button
                android:id="@+id/Button08"
                android:textSize="16pt"
                android:text="^"
                android:layout_weight="1"
                android:layout_height="fill_parent"
                android:layout_width="wrap_content" />
            <Button
                android:id="@+id/Button09"
                android:text="÷"
                android:textSize="16pt"
                android:layout_height="fill_parent"
                android:layout_weight="1"
                android:layout_width="wrap_content" />
            <Button
                android:id="@+id/Button10"
                android:text="×"
                android:textSize="16pt"
                android:layout_height="fill_parent"
                android:layout_weight="1"
                android:layout_width="wrap_content" />
            <Button
                android:id="@+id/Button11"
                android:textSize="16pt"
                android:text="-"
                android:layout_weight="1"
                android:layout_height="fill_parent"
                android:layout_width="wrap_content" />
        </TableRow>
        <TableRow
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:layout_weight="2">
            <LinearLayout
                android:layout_width="wrap_content"
                android:layout_height="fill_parent"
                android:orientation="vertical"
                android:layout_weight="1">
                <Button
                    android:id="@+id/Button01"
                    android:text="7"
                    android:textSize="16pt"
                    android:layout_weight="1"
                    android:layout_height="wrap_content" …
Run Code Online (Sandbox Code Playgroud)

android tablelayout

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

是否可以同时访问多个对象实例的类的静态方法?

例:

ThisClass.staticMethod(Object... parameters);
Run Code Online (Sandbox Code Playgroud)

将由其他对象的多个实例同时访问.

当它们同时使用相同的静态方法时,是否会与其他对象有任何依赖关系?

java

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

新的一天开始时,我可以收到通知吗?

在Cocoa,是否有我可以注册的通知,通知我,新的一天开始时 - 早上00:00:00:01?

cocoa

12
推荐指数
4
解决办法
3368
查看次数