小编dig*_*doo的帖子

无法使用 Kotlin 1.7.10

我在 IntelliJ IDEA 中有一个 Kotlin 项目(不针对 Android),目前可以使用 Kotlin 1.6.10 正常编译。当我更改为 1.7.10 时,出现以下错误:

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'jwotd'.
> Could not resolve all artifacts for configuration ':classpath'.
   > Could not resolve org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.0.
     Required by:
         project :
      > The consumer was configured to find a runtime of a component compatible with Java 8, packaged as a jar, and its dependencies declared externally. However we cannot choose between the following variants …
Run Code Online (Sandbox Code Playgroud)

intellij-idea gradle kotlin

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

Git快速合并:有没有机会找到这个人的责任?

假设有一个功能分支'my-feature'.在我开发这个功能时,有人将它从'my-feature'合并到'master'中.因为它是一个快进合并,所以没有提交.我所做的一些改变还没有为主人做好准备,当它被推到掌握时它打破了相当多的测试.然而,由于这些变化显然是由我做出的,我被指责,而不是那个进行快速合并的人(无论是谁).

有没有机会找出谁将'my-feature'合并为'master',即使它是一个快速合并?我怎样才能防止将来发生这种情况?

git reflog显然只显示本地发生的事情.我们正在使用gitlab服务器,但我还没有找到一种方法来检查gitlab的存储库的reflog.有任何想法吗?

git merge fast-forward gitlab

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

如何在Visual Studio 2012中禁用F12以调试应用程序

如果我的应用程序在调试模式下在Visual Studio下运行时按F12,WM_KEYDOWN永远不会到达我的事件循环,但它会立即触发断点.是否可以禁用此功能,或将其重新分配给另一个不那么冲突的热键(例如CTRL + F12)?我认为必须是一个注册表项,但我找不到它...

任何帮助是极大的赞赏!

debugging breakpoints hotkeys visual-studio-2012

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

如何让Visual Studio 2012灰显掉ifdef而不是调暗它

在我们的代码中有很多段落都是ifdef'ed.使用以前版本的Visual Studio,它们已经变灰了.但是,使用Visual Studio 2012时,它们不再灰显,而是变暗,即这些段落显示语法高亮方案的所有颜色,但颜色饱和度较低.微软的程序员实现这一点必须认为这非常酷,但实际上它很难判断一个段落是活动的还是非活动的.

有没有人找到一种方法来欺骗Visual Studio 2012使用旧的方式来显示非活动段落?

谢谢你的回复

syntax-highlighting visual-studio-2012

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

如何判断 git 分支在压缩后是否已完全合并

当使用 合并分支时--squash,git 似乎不再能够确定分支是否已完全合并。如何使用现有的 git 命令快速检查这一点?

要重现,请创建一个新的 git 存储库:

$ mkdir tmp
$ cd tmp
$ git init
$ echo "bla" > ans
$ git add .
$ git commit -m "First commit"
Run Code Online (Sandbox Code Playgroud)

创建new-branch带有提交的分支:

$ git checkout -b new-branch
$ echo "blabla" >> ans
$ echo "blupp" > zwa
$ git add .
$ git commit -m "Commit on new-branch"
Run Code Online (Sandbox Code Playgroud)

创建another-branch带有提交的分支:

$ git checkout master
$ git checkout -b another-branch
$ echo "test" >> ans …
Run Code Online (Sandbox Code Playgroud)

git merge git-squash

7
推荐指数
2
解决办法
1981
查看次数

无法在OS X中开始使用kext开发

我正在尝试做Apple的"内核扩展"教程.我创建了一个项目文件,创建了Info.plist,构建了它,使用kextlibs来学习依赖关系,将它们添加到Info.plist中,重建,复制到/ tmp,使用kextutil来测试它.到目前为止一切都很好.但是,当我尝试加载kext时,我的启动/停止/探测功能似乎永远不会被调用.我的IOLog消息没有出现在/var/log/system.log中.

实际上,system.log没有显示任何内容.在使用sysctl -w debug.kextlog = 0x0007780E激活kext日志记录后,kernel.log执行了.kernel.log说:"Kext ch.digorydoo.driver.XinputDevice成功解决了依赖关系." 然后:"刷新未加载的kexts和其他未使用的数据." 也许我的班级会立刻变得脸红?

我的类出现在kextstat的末尾,但有0个引用.与ioclasscount相同.在ioreg,我的班级没有出现.

我已经将IOProviderClass设置为IOResources,所以它应该始终有一个引用,对吧?我已正确设置IOMatchCategory.

有什么帮助吗?!!?!非常感谢!

编辑:这是我的Info.plist:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>CFBundleDevelopmentRegion</key>
    <string>English</string>
    <key>CFBundleExecutable</key>
    <string>${EXECUTABLE_NAME}</string>
    <key>CFBundleName</key>
    <string>${PRODUCT_NAME}</string>
    <key>CFBundleIconFile</key>
    <string></string>
    <key>CFBundleIdentifier</key>
    <string>ch.digorydoo.driver.${PRODUCT_NAME:rfc1034identifier}</string>
    <key>CFBundleInfoDictionaryVersion</key>
    <string>6.0</string>
    <key>CFBundlePackageType</key>
    <string>KEXT</string>
    <key>CFBundleSignature</key>
    <string>????</string>
    <key>CFBundleVersion</key>
    <string>1.0.0</string>
    <key>IOKitPersonalities</key>
    <dict>
        <key>Generic Xinput Gamepad</key>
        <dict>
            <key>CFBundleIdentifier</key>
            <string>ch.digorydoo.driver.${PRODUCT_NAME:rfc1034identifier}</string>
            <key>IOProviderClass</key>
            <string>IOResources</string>
            <key>IOMatchCategory</key>
            <string>ch_digorydoo_driver_XinputDevice</string>
            <key>IOClass</key>
            <string>ch_digorydoo_driver_XinputDevice</string>
            <key>IOKitDebug</key>
            <integer>65535</integer>
        </dict>
    </dict>
    <key>OSBundleLibraries</key>
    <dict>
        <key>com.apple.kpi.iokit</key>
        <string>10.8</string>
        <key>com.apple.kpi.libkern</key>
        <string>10.8</string>
        <key>com.apple.kpi.mach</key>
        <string>10.8</string>
    </dict>
</dict>
</plist>
Run Code Online (Sandbox Code Playgroud)

macos kernel iokit kernel-extension

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

从 URL 获取 blob 并写入文件

我正在尝试fetch从服务器获取一些二进制数据 (MP3),然后将其存储在一个文件中:

var fs = require ('fs');
var fetch = require ('node-fetch');

fetch (
   audioUrl,
   {
      method: 'GET',
      headers: { 'Accept': '*/*' }
   }
)
.then ((res) => res.blob())
.then ((blob) => {
    console.log ('Blob size: ', blob.size);

    fs.writeFile (
        `filename.mp3`,
        blob,  // BUG HERE
        (err) => {
            if (err) {
                console.log (`Error writing audio ${audioIdx}`, err);
            }
        }
    );
})
Run Code Online (Sandbox Code Playgroud)

问题标记为BUG HERE。我将一个 blob 传递给fs,它不理解 blob,只是简单地写入[object Blob]. 我还尝试了以下方法:

blob                                // writes [object …
Run Code Online (Sandbox Code Playgroud)

blob fs node.js fetch-api

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

无法识别的依赖符号

我在 IntelliJ IDEA 中有一个多项目 Kotlin 项目。无论是从 IDE 还是从控制台,它都可以正常编译和运行。但是,我的 gradle 文件存在问题:IDEA 抱怨“无法识别的依赖符号”以及其他类型的错误。

这是子项目 build.gradle 文件之一:

apply plugin: 'org.jetbrains.kotlin.jvm'
apply plugin: 'application'

sourceSets {
    main {
        java.srcDirs "src/java"
    }
}

java {
    sourceCompatibility = JavaVersion.VERSION_1_8
    targetCompatibility = JavaVersion.VERSION_1_8
}

test {
    useJUnitPlatform()
}

jar.dependsOn test

dependencies {
    implementation platform('org.jetbrains.kotlin:kotlin-bom')

    // All of the following lines show errors:
    implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.6.4"
    testImplementation "org.jetbrains.kotlin:kotlin-test"
    testImplementation 'org.junit.jupiter:junit-jupiter:5.8.1'
}
Run Code Online (Sandbox Code Playgroud)

这很烦人,因为这样我就看不到我使用的库是否已过时。

此外,一些 gradle 任务即使运行良好也无法正确识别:

截屏

我不知道为什么outputsoutputDir并且doFirst在上面的屏幕截图中显示为灰色。

我尝试了gradle同步、“使缓存无效并重新启动”、“修复IDE”,甚至重新导入项目,但无济于事。你知道这里发生了什么吗?

dependencies intellij-idea multi-project gradle kotlin

6
推荐指数
0
解决办法
3086
查看次数

Gdiplus DrawString通过远程桌面绘制透明文本

我正在将文本绘制到DIB部分的屏幕外位图,该位图深度为32位并使用alpha通道(ARGB).我将像素直接绘制到内存中.然后,我创建一个Gdiplus Graphics对象,将我的内存DC传递给它,并使用Graphics :: DrawString绘制文本.这在正常情况下工作正常.但是,在远程桌面上,渲染的文本是完全透明的,即不是绘制任何颜色像素,而是可以看到文本的位置.有谁知道为什么会这样,以及如何解决它?

这是我的drawString例程:

void SplashScreen::drawString (MyString &ivText, Gdiplus::RectF &r, 
  Gdiplus::ARGB c, Gdiplus::StringAlignment align, Gdiplus::Font &fnt,
  Gdiplus::Graphics &gfx)
  {
  Gdiplus::StringFormat fmt;
  fmt.SetAlignment (align);
  Gdiplus::SolidBrush brush (c);
  wchar_t *wstr = new wchar_t [ivText.length()+1];
  std::mbstowcs (wstr, ivText.cstr(), ivText.length()+1);
  gfx.DrawString (wstr, ivText.length(), &fnt, r, &fmt, &brush);
  delete wstr;
  }
Run Code Online (Sandbox Code Playgroud)

这就是我创建DIB的方式:

BITMAPV5HEADER bhd;
memset (&bhd, 0, sizeof (bhd));
bhd.bV5Size = sizeof (BITMAPV5HEADER);
bhd.bV5Width = nWidth;
bhd.bV5Height = -nHeight;  // negative height indicates top-down DIB
bhd.bV5Planes = 1;
bhd.bV5BitCount = 32;
bhd.bV5Compression = BI_BITFIELDS; …
Run Code Online (Sandbox Code Playgroud)

c++ gdi+ remote-desktop drawstring

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

吞噬了浏览器,tsify和reactify?

我使用的是gulpbrowserifytsify在打字稿项目。以下是我的摘录gulpfile.js

var browserified = function (filename, debug) {
  var b = browserify({
    entries: filename,
    debug: debug || false
  });
  b.plugin('tsify', {
    noImplicitAny: true,
    target: 'ES5'
  });
  b.transform('debowerify');
  return b.bundle();
};

gulp.task('rebuild', ['lint', 'less'], function() {
    var b = browserified ('./src/ts/main.ts', true);
    return buildSourceMaps (b);
});
Run Code Online (Sandbox Code Playgroud)

到目前为止,该方法有效。我想扩展它,以便我可以require响应JSX文件。首先,我尝试了(从我的TypeScript文件之一开始):

import Test = require ('../jsx/Test.jsx');
Run Code Online (Sandbox Code Playgroud)

但是,这不起作用,因为tsify在寻找TypeScript文件时会抱怨../jsx/Test.jsx.ts。因此,我使用以下技巧:

declare var require: any;
var Test = require ('../jsx/Test.jsx');
Run Code Online (Sandbox Code Playgroud)

如果Test.jsx是普通的JavaScript,则可以使用。如果Test.jsx包含TypeScript,它将失败,这是我期望的。到目前为止,如此清晰。 …

javascript typescript reactjs gulp react-jsx

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

如何使用 Win32 TextOut 绘制波浪形下划线

我正在编写一段代码,通过多次调用 TextOut 在屏幕上绘制文本。这是一个 C++ Win32 应用程序,我使用的是 Visual Studio 2012。在标记拼写错误等时,如何以 Word 的方式绘制波浪下划线?

TEXTMETRIC 有一个名为 tmUnderlined 的成员,它适用于普通下划线文本,但不适用于波浪下划线。我还发现微软的 RichEdit 控件支持波浪下划线,但我也不能使用它。

当然,我可以使用简单的正弦波创建一条路径,但在我这样做之前,我想检查是否有更标准的方法来做到这一点。

c++ winapi textout

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