Failed to choose DirectX12 adapter - kotlin

I'm using the Intellij IDE for Kotlin. I was trying the compose UI tutorial and when I ran a basic program I get this message 'Failed to choose DirectX12 Adapter. The window opens and appears to be working. What do I need to do to choose the adapter?
import androidx.compose.material.MaterialTheme
import androidx.compose.desktop.ui.tooling.preview.Preview
import androidx.compose.material.Button
import androidx.compose.material.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.window.Window
import androidx.compose.ui.window.application
#Composable
#Preview
fun App() {
var text by remember { mutableStateOf("Hello, World!") }
MaterialTheme {
Button(onClick = {
text = "Hello, Desktop!"
}) {
Text(text)
}
}
}
I used the dxdiag command and it appears DirectX 12 is installed.
System Information
Time of this report: 2/9/2023, 22:18:43
Machine name: DESKTOP-JQ7CR2F
Machine Id: {B31A9997-C49B-4C8D-84B7-67A3C21C6D33}
Operating System: Windows 10 Home 64-bit (10.0, Build 19044) (19041.vb_release.191206-1406)
Language: English (Regional Setting: English)
System Manufacturer: To Be Filled By O.E.M.
System Model: To Be Filled By O.E.M.
BIOS: BIOS Date: 07/27/15 17:53:10 Ver: 04.06.05 (type: BIOS)
Processor: Intel(R) Core(TM) i5-4590 CPU # 3.30GHz (4 CPUs), ~3.3GHz
Memory: 8192MB RAM
Available OS Memory: 8128MB RAM
Page File: 14425MB used, 8359MB available
Windows Dir: C:\Windows
DirectX Version: DirectX 12
DX Setup Parameters: Not found
User DPI Setting: 96 DPI (100 percent)
System DPI Setting: 96 DPI (100 percent)
DWM DPI Scaling: Disabled
Miracast: Not Available
Microsoft Graphics Hybrid: Not Supported
DirectX Database Version: 1.0.8
DxDiag Version: 10.00.19041.2075 64bit Unicode
DxDiag Notes
Display Tab 1: No problems found.
Display Tab 2: No problems found.
Sound Tab 1: No problems found.
Sound Tab 2: No problems found.
Sound Tab 3: No problems found.
Sound Tab 4: No problems found.
Input Tab: No problems found.
DirectX Debug Levels
Direct3D: 0/4 (retail)
DirectDraw: 0/4 (retail)
DirectInput: 0/5 (retail)
DirectMusic: 0/5 (retail)
DirectPlay: 0/9 (retail)
DirectSound: 0/5 (retail)
DirectShow: 0/6 (retail)
Display Devices
Card name: NVIDIA GeForce 210
Manufacturer: NVIDIA
Chip type: GeForce 210
DAC type: Integrated RAMDAC
Device Type: Full Device (POST)
Device Key: Enum\PCI\VEN_10DE&DEV_0A65&SUBSYS_082E196E&REV_A2
Device Status: 0180200A

Related

cx_freeze and PyQt5 build error when building the project

I'm having issues getting cx_freeze to build my program, so I started afresh and discovered the issue was with PyQt5. I stripped down the code to this
import os
import sys
from PyQt5 import QtWidgets
print("program ran!")
The setup.py looks like this:
from setuptools import find_packages
from cx_Freeze import setup, Executable
options = {
'build_exe': {
'includes': [
],
'packages': [
'PyQt5.QtCore', 'PyQt5.QtGui', 'PyQt5.QtWidgets'
],
'excludes': [
]
}
}
executables = [
Executable('test2.py',
base=None,
targetName='program.exe')
]
setup(
name='program',
packages=find_packages(),
version='0.1',
description='PCPRo 2022',
executables=executables,
options=options
)
I build the program using the command python setup.py build
When I run the resulting .exe I get the error:
Fatal Python error: _PyInterpreterState_Get(): no current thread state
Python runtime state: unknown
If I remove the line from PyQt5 import QtWidgets and rebuild, the program runs as expected.
I am using Python 3.7.4 [MSC v.1916 64 bit (AMD64)] on win32

React Native - Failed to parse declaration in styled-components

The same approach using stylesheet works normally
Environment
System:
OS: macOS 11.6
CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU # 2.60GHz
Memory: 1.03 GB / 16.00 GB
Shell: 5.8 - /bin/zsh
Binaries:
Node: 16.6.0 - ~/.nvm/versions/node/v16.6.0/bin/node
Yarn: 1.22.11 - ~/.nvm/versions/node/v16.6.0/bin/yarn
npm: 6.14.4 - ~/Projects/design-system/typography/node_modules/.bin/npm
Watchman: 2021.09.13.00 - /usr/local/bin/watchman
npmPackages:
styled-components: 5.1.0 => 5.1.0
Reproduction
import React from 'react';
import styled from 'styled-components/native';
import { View } from 'react-native';
const CustomText = styled.Text(({ theme }) => ({
fontFamily: 'Zapf Humanist 601',
}));
export default App = () => (
<View>
<CustomText>Your Text<CustomText>
</View>
);
Steps to reproduce
Copy ZapfHumanist601BT-Roman.ttf in your fonts folder (./src/assets/fonts)
Make a link font using npx react-native link
Apply a linked font in your text component
Expected Behavior
The font is expected to be applied in the style
Actual Behavior
Error: Failed to parse declaration "fontFamily: Zapf Humanist 601"
The font-weight property will not work fine in this situation.
You can put your fonts in src/assets/fonts directory:
src
|_ assets
|_ Montserrat-Bold.ttf
|_ Montserrat-Regular.ttf
// and so on for the rest of fonts file
And define the assets properties in the react-native.config.js file which is at the root of your project in this way:
module.exports = {
project: {
ios: {},
android: {},
},
assets: ['./src/assets/fonts/'],
};
Now, you can use the fonts in the styles like this (without define the weight property):
title : {
fontFamily: Montserrat-Regular
}

TextInput event onContentSizeChange not firing

I am trying to make my TextInput grow in height when the entered text reaches the second line. However I don't receive an event when my text gets wrapped to the second line (without using a new line character). This results in partial hiding of the text within the input.
From the documentation I can not find any event which returns content size besides onContentSizeChange.
I am testing on an Android device.
I can not upgrade React-Native, I am stuck on 0.58.1
class SomeComponent extends React.component
{
...
handleContentSizeChange = (event) => {
console.log('Handling contentSizeChange');
}
render() {
return (
<TextInput ... multiline={true} onContentSizeChange={this.handleContentSizeChange}/>
)
}
}
React Native Environment Info:
System:
OS: macOS 10.15.4
CPU: (8) x64 Intel(R) Core(TM) i7-6700HQ CPU # 2.60GHz
Memory: 882.73 MB / 16.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 11.8.0 - ~/.nvm/versions/node/v11.8.0/bin/node
Yarn: 1.5.1 - /usr/local/bin/yarn
npm: 6.5.0 - ~/.nvm/versions/node/v11.8.0/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 13.4, DriverKit 19.0, macOS 10.15, tvOS 13.4, watchOS 6.2
Android SDK:
API Levels: 21, 23, 26, 27, 28, 29
Build Tools: 27.0.0, 27.0.3, 28.0.0, 28.0.2, 28.0.3, 29.0.0
System Images: android-22 | Google APIs Intel x86 Atom, android-26 | Google Play Intel x86 Atom, chromeos-67 | Chrome OS 67
IDEs:
Xcode: 11.4.1/11E503a - /usr/bin/xcodebuild
npmPackages:
react: 16.6.3 => 16.6.3
react-native: 0.58.1 => 0.58.1
npmGlobalPackages:
react-native-cli: 2.0.1
You shouldn't need to use onContentSizeChange at all. The height should increase automatically as you type, provided you haven't fixed a height for the input or have limited it by fixed heights of the components around it.

Running simple QtWebEngine app on Raspberry Pi 2, page not showing

I compiled and installed QtWebEngine + QML plugins on Raspberry Pi 2 with Yocto recipes using information in this tutorial using Yocto dizzy branch and run the following script:
root#raspberrypi2:~# more chromium.qml
import QtQuick 2.1
import QtQuick.Controls 1.1
import QtWebEngine 0.9
ApplicationWindow {
width: 1280
height: 720
color: "lightgray"
visible: true
WebEngineView {
id: webview
url: "file:///home/root/hello.html"
anchors.fill: parent
}
}
Note that the IMPORT VERSION 0.9, not 1.0
I have tried both url: "file:///home/root/hello.html" and url: "https://duckduckgo.com" but all I am getting is a red screen with the black square mouse pointer.
root#raspberrypi2:~# more hello.html
<html>
<header><title>This is title</title></header>
<body>
Hello world
</body>
</html>
On the console:
root#raspberrypi2:~# /usr/bin/qt5/qmlscene -v -platform eglfs chromium.qml
[0605/163256:WARNING:resource_bundle.cc(280)] locale_file_path.empty()
[0605/163257:WARNING:proxy_service.cc(890)] PAC support disabled because there is no system implementation
[0605/163257:WARNING:resource_bundle.cc(280)] locale_file_path.empty()
PAC support disabled ... seems to be a none issue read here
UPDATE
I have followed this step-by-step tutorial (Poky fido branch) and then added qtwebengine (import QtWebEngine 1.0 this time) and qtwebengine-qmlplugins in my Yocto Image and created again my image with bitbake
When I booted and ran /usr/bin/qt5/qmlscene -v -platform eglfs chromium.qml I could see my HTML page.
I have tested a couple of dozen of websites and not all page show. So their might be a little more to it.
e.g.
http://wikipedia.com shows!!!
http://google.com doesn't show ???
http://https://stackoverflow.com/ shows!!!
http://facebook.com doesn't
Any further pointers are welcome
UPDATE 20160309
root#raspberrypi2:~/app# uname -a
Linux raspberrypi2 4.1.10 #1 SMP PREEMPT Wed Feb 17 16:51:44 CET 2016 armv7l GNU/Linux
root#raspberrypi2:~/app# lsb_release -a
LSB Version: core-4.1-noarch:core-4.1-arm
Distributor ID: poky
Description: Poky (Yocto Project Reference Distro) 2.0.1
Release: 2.0.1
Codename: jethro
QML
root#raspberrypi2:~/app# more chromium.qml
import QtQuick 2.1
import QtQuick.Controls 1.1
import QtWebEngine 1.0
ApplicationWindow {
width: 800
height: 600
color: "lightgray"
visible: true
WebEngineView {
id: webview
//url: "http://raspberrypi.stackexchange.com/" // PASS
//url: "http://google.com" // FAIL
//url: "http://video.webmfiles.org/big-buck-bunny_trailer.webm" // PASS but no Sound
//url: "https://youtube.com/" // FAIL
//url: "https://opentokrtc.com/anybots" // FAIL
//url: "http://speedof.me/" // PASS
url: "http://facebook.com" // FAIL
anchors.fill: parent
}
}
Maybe it is a little late but I tried to build QtWebEngine in Qt 5.6 alpha and it works properly for me on Raspberry Pi 2 for all the URLs you listed. This is a demo. Maybe they fixed something in QtWebEngine, so you can try 5.6-alpha.
Unfortunately, the branch jethro for meta-qt5 the qtwebengine caused many problems.
I was happy to see that in this branch master with chromium 45:
Branch jethro:
QT_MODULE BRANCH CHROMIUM = "40.0.2214-based"
Branch master:
QT_MODULE BRANCH CHROMIUM = "45-based"
I will try to build;)

Program with System.Timers.Timer runned via mono project causes high CPU load

I've noticed that programs where usage of System.Timers.Timer object appears is very CPU consumptive (almost 100percent for single CPU core).
I'm using Ubuntu 11.10, here is my version of mono:
mono -V
Mono JIT compiler version 2.10.5 (Debian 2.10.5-1)
Copyright (C) 2002-2011 Novell, Inc, Xamarin, Inc and Contributors. www.mono-project.com
TLS: __thread
SIGSEGV: altstack
Notifications: epoll
Architecture: amd64
Disabled: none
Misc: softdebug
LLVM: supported, not enabled.
GC: Included Boehm (with typed GC and Parallel Mark)
Here is sample program, which causes unexpected high CPU usage:
using System;
using System.Timers;
namespace MonoCPUTest
{
class Program
{
static Timer _refresh = new Timer();
static void Main(string[] args)
{
_refresh.Interval = 2000;
_refresh.AutoReset = true;
_refresh.Elapsed += (x, y) => refresh();
_refresh.Start();
while (true)
{
Console.WriteLine("loop");
System.Threading.Thread.Sleep(10000);
}
}
static void refresh()
{
Console.WriteLine("refresh");
}
}
}
Thank you very much for any help.
I've just tested (by copy pasting, compiling and executing your code) and cannot reproduce the issue, the CPU load is about 0. I'm using newer version of Mono, specifically the one compiled from the git tree couple days ago; so if there was an issue like that, it was fixed.
I guess upgrading your Mono is not possible without external PPA, but this is what should be done here if you are not forced to use this version for some other reason. You can also compile one from the source, which is as easy, as configure, make, make install ;)