小编Mar*_*lle的帖子

使用ClickOnce发布时,Visual Studio会一直询问FTP密码

我在FTP服务器上发布我的应用程序.我将FTP帐户信息(URL,用户和密码)提供给Visual Studio,但每次单击"立即发布"按钮时,它都会一直询问我FTP密码.

为什么VS不会自动填写我的密码?

ftp clickonce publishing visual-studio

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

按下控制键时RichTextBox选择错误

我在RichTextBox中有一个非常奇怪的文本选择错误:

我创建以下简单形式:

public partial class Form1 : Form
{
    public Form1()
{
    InitializeComponent();
    }

    private void Form1_Load(object sender, EventArgs e)
    {
        richTextBox1.Text = "Tempore quo primis auspiciis in mundanum fulgorem surgeret victura dum erunt homines Roma, ut augeretur sublimibus incrementis, foedere pacis aeternae Virtus convenit atque Fortuna plerumque dissidentes, quarum si altera defuisset, ad perfectam non venerat summitatem.";
    }
}
Run Code Online (Sandbox Code Playgroud)

启动应用程序时,我可以选择RichTextBox中的文本,直到我按下控制键.

RichTextBox的就不再可选,直到我点击应用程序之外几次.

我听说有关AutoWordSelection的愚蠢错误,但我尝试了这个伎俩没有成功.

我在Windows 8上使用Framework .Net v4.

有没有人对此有所了解?

c# richtextbox selection

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

更改 docker-compose.yml 中的端口

我正在按照官方文档学习如何使用docker-composehttps : //docs.docker.com/compose/gettingstarted/

浏览到http://myserver.com:5000 时,我得到了预期的结果:

Hello World! I have been seen 1 times.
Run Code Online (Sandbox Code Playgroud)

我想将监听端口更改为 5001 修改docker-compose.yml文件如下:

version: '2'
  services:
    web:
      build: .
      ports:
       - "5001:5001"
      volumes:
       - .:/code
      depends_on:
       - redis
    redis:
      image: redis
Run Code Online (Sandbox Code Playgroud)

Unfortunately, after stop and removing the container (with 'docker-compose down') and start it again (with 'docker-compose up -d'), the connection to http://myserver.com:5001 is refused.

Any idea?

port docker-compose

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

Web IDE工具

有谁知道它是否存在允许直接从Web应用程序开发Web应用程序的Web IDE?W3School网站允许用HTML或javascript编写一小段代码,但还有另一个面向项目的解决方案吗?

html javascript ide

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

多重采样在独占模式下不起作用

我想在绘制三角形时启用多重采样,如下图所示: 在此输入图像描述

我在另一个问题中找到了一种与SlimDX有关的方法,但它不能在独占模式下工作.

这是我的代码:

void Form1_Load(object sender, EventArgs e)
{
    Direct3D d3d = new Direct3D();

    PresentParameters presentParams;

    presentParams.Windowed = false;
    presentParams.BackBufferFormat = Format.X8R8G8B8;
    presentParams.BackBufferWidth = 800;
    presentParams.BackBufferHeight = 600;
    presentParams.FullScreenRefreshRateInHertz = 60;
    presentParams.SwapEffect = SwapEffect.Copy;
    presentParams.BackBufferCount = 1;
    presentParams.PresentationInterval = PresentInterval.One;

    int multisampleQuality;
    Result result;
    if (d3d.CheckDeviceMultisampleType(adaptor, DeviceType.Hardware, Format.X8R8G8B8, false, MultisampleType.FourSamples, out multisampleQuality, out result))
    {
        if(multisampleQuality > 4)
        {
            presentParams.Multisample = multisampleType;
            presentParams.MultisampleQuality = 4;
        }
    }

    // Device creation
    Device device = new Device(d3d, adaptor, …
Run Code Online (Sandbox Code Playgroud)

c# directx multisampling slimdx

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

TTF_OpenFont()返回NULL

以下是事实:我在Ubuntu上使用代码块.我已经安装了SDL和SDL_ttf并已成功包含和链接它们.我想将文本渲染到字体的屏幕FreeSerif.

这是问题:当程序到达行TTF_OpenFont("FreeSerif.ttf,20")时,它返回NULL,如果传递给TTF_RenderText_Solid函数,则会导致段错误.我已将字体文件添加到项目中,但仍然无效.

这是代码:
TTF_Init();

TTF_Font *font = TTF_OpenFont("FreeSerif.ttf",20); //This returns NULL 

if(!font){printf("Unable to open font");exit(1);} //The program exits here
Run Code Online (Sandbox Code Playgroud)

macos ubuntu null qt sdl-ttf

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

C++ 代码生成的宏替代方案

我的设置模块有一些冗余代码:

#include <QSettings>

class MySettings
{
public:
    // param1
    void setParam1(QString param1) { _settings.setValue("param1", param1); }
    string param1() { return _settings.value("param1").toString(); }

    // param2
    void setParam2(int param2) { _settings.setValue("param2", param2); }
    int param2() { _settings.value("param2").toInt(); }

    // param3
    void setParam3(int param3) { _settings.setValue("param3", param3); }
    int param3() { _settings.value("param3").toInt(); }

private:
    QSettings _settings;
}
Run Code Online (Sandbox Code Playgroud)

我设法通过使用宏减少了要编写的代码量。以下是QString参数类型的示例:

#define INTSETTING(setter, getter) \
    void set##setter(QString getter) { settings.setValue(#getter, getter);} \
    QString getter() {return settings.value(#getter).toString();}
Run Code Online (Sandbox Code Playgroud)

因为我使用的是 C++,所以我知道宏的使用是不好的。我正在寻找更清洁的替代品。

我给出了一个 Qt 示例(QString),但这是一个更一般的问题。

编辑:

宏使上述类的定义更加简单:

class …
Run Code Online (Sandbox Code Playgroud)

c++ macros coding-style

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

Gruntjs与grunt-nodemon,watch和jshint

我正在尝试使用这3个插件运行GruntJS,因此它可以监视更改并首先:lint文件然后重新加载快速服务器.我在下面的配置问题是,如果jshint lint文件,nodemon不运行,反之亦然.

// Gruntfile.js

// our wrapper function (required by grunt and its plugins)
// all configuration goes inside this function
module.exports = function(grunt) {

  // ===========================================================================
  // CONFIGURE GRUNT ===========================================================
  // ===========================================================================
  grunt.initConfig({

    // get the configuration info from package.json ----------------------------
    // this way we can use things like name and version (pkg.name)
    pkg: grunt.file.readJSON('package.json'),

    // all of our configuration will go here

    // configure jshint to validate js files -----------------------------------
  jshint: {
      options: …
Run Code Online (Sandbox Code Playgroud)

node.js gruntjs nodemon

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

在 Windows gitlab ci 中无法识别 Git

我按照此处的说明配置了 gitlab 运行程序:https ://docs.gitlab.com/runner/install/windows.html

不幸的是,当我推送到我的存储库时,我的管道失败了:

Running with gitlab-runner 10.5.0 (80b03db9)
  on windows runner 79cb4019
Using Shell executor...
Running on WINSTD-45-13...
'"git"' is not recognized as an internal or external command,
operable program or batch file.
'"git"' is not recognized as an internal or external command,
operable program or batch file.
Cloning repository...
'"git"' is not recognized as an internal or external command,
operable program or batch file.
The system cannot find the path specified.
Checking out b05fd8be as master... …
Run Code Online (Sandbox Code Playgroud)

git gitlab-ci

5
推荐指数
3
解决办法
4745
查看次数

c ++如何将已创建的对象转换为unique_ptr

我有一个get函数,它返回一个MyClass名为的对象myObject:

MyClass myObject = something.get(id);
Run Code Online (Sandbox Code Playgroud)

我想将myObject转换为myObject,怎么做?

std::unique_ptr<MyClass>(&myObject); // Is this correct?
Run Code Online (Sandbox Code Playgroud)

c++ unique-ptr

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