instruction stringlengths 0 30k ⌀ |
|---|
null |
I am using CLIPS for knowledge base systems, but I am facing a problem with understanding the following three types:
1- external-address
2- instance-name
3- instance-address
I read the following:
> external-address: address of external data structure returned by
> user-defined function (written in a lan... |
understand some of CLIPS primitive data type |
|c|clips|expert-system| |
If I have a real world coordinate and the x16 tile images from tileserver-gl how can i get the exact pixel for that coordinate?
I mean, if i have the lat and the lon i can get a tile image but then how can i get the exact pixel from the image?
My images are 256x256 in x16.
Thanks :)
I have tried to modify t... |
C expects an optional identifier (variable name). You have two options:
1. Specify an identifier:
```
struct student
{
int num;
char name[20];
float mark;
} s;
```
2. Leave out the identifier and define the variable separately:
```
struct student
{
... |
This answer takes advantage of the [OUTPUT][1] clause available in SQL Server. However, this is not necessary just seems a bit cleaner.
I would prefer to see some notion of a primary key on this data, but I'll assume you have a good reason for what you are doing.
Create relevant tables, and load inital data.
```... |
|javascript|jquery| |
Another way would be you assigning indices before making the train test split so then you also split the indices:
```python
X_train, X_test, y_train, y_test, indices_train, indices_test = train_test_split(X, y, indices, test_size=0.2, random_state=42)
```
|
You do not need python for simple cases just use the systems own tools.
The Unix Philosophy (DOS was too, but Windows CMD.exe is better). Is to write reusable blocks of commands to adapt to a specific case. You have to write any set of commands to suit your target thus only parts of the code need to be specific whil... |
import discord
import youtube_dl
from discord.ext import commands
from youtube_search import YoutubeSearch
from typing import Union
intents = discord.Intents.all()
#(commands)
bot = commands.Bot(command_prefix='!', intents=intents)
@bot.command()
async def join(ctx):
# Check if the user is in a v... |
Let's say I wanted to hint that a particular field of a dataclass should be a subclass of one class, but not the type itself. For a more concrete example:
```python
class Foo:
...
class Bar(Foo):
...
class Baz(Foo):
...
@dataclass
class Data:
foo_subclass_instance: StrictSubclassOf[Foo... |
Is it possible to type-hint a strict subclass of a given type? |
|python|type-hinting| |
I've installed nvidia-driver-535, and then reboot my ubuntu 22.04.
But I have an error like this:
```sh
[2172.336996] systemd-shutdown [1]: Syncing filesystems and block devices.
[2172.339443] systemd-shutdown [1]: Sending SIGTERM to remaining processes...
[2172.342697] systemd-journald [319]: Received SIGTERM f... |
null |
You may need to do callback to suspend conversion.
Here is a simple example of doing this:
```kotlin
suspend fun signInWithABC(): String = suspendCoroutine { continuation ->
abcApi.signIn(){ token, error ->
if (error != null) {
continuation.resume("Error")
} else {
... |
null |
I was getting an error that it could not find the source. I changed the script and fixed that, but now I get the following error:
> ( TypeError: Cannot read properties of undefined (reading 'range')
What am I doing wrong?
Here is my script:
function onEdit(e) {
addTimeStamp(e);
se... |
I coded a timer to last for 1 minute before the program continues, but the timer keeps on stopping at around 12 seconds and prevents the program from moving forward.
I read somewhere that the `time.sleep` function doesn't work if the system clock changes, and to replace it with `time.monotonic`, but doing that just... |
Unless your database location is `us-central1`, you must pass the database URL to `getInstance()`. Only then did it work for me, because I used to have the same problem! |
Here's a snippet courtesy of Firebase:
```
await FirebaseAuth.instance.signInWithPopup(GoogleAuthProvider());
```
Whenever I run this locally (```flutter run -d chrome```) and use my testing account that has 2-level authentication, I have to receive and enter an SMS confirmation code. This happens because each ... |
I don't know the entire explanation. But when i declare **flex** attribute in one of columns object, DataGrid will not create addition column and row. Just try it.
example:
<!-- begin snippet: js hide: false console: true babel: false -->
<!-- language: lang-js -->
const columns = [
{
... |
I tried to build this C++ CMake project as DLL.
Math.dll generated, but Math.lib did not generated.
This is source code.
Math.h
```cpp
#pragma once
// Shared library import/export macro
#ifdef _WIN32
#ifdef MATH_EXPORTS
#define MATH_API __declspec(dllexport)
#define MATH_TEMPLATE
#else
#define MATH_A... |
It is possible to decode using [BytesIO][1]:
import urllib, PyPDF2
from io import BytesIO
f = urllib.request.urlopen("https://mypdf.pdf").read()
pdf_bytes = BytesIO(f)
pdf_reader = PyPDF2.PdfFileReader(pdf_bytes)
[1]: https://docs.python.org/3/library/io.html |
No, it's just as undefined as calling the virtual function. The instance of `B` isn't constructed until after `A`s constructor completes so you can't call virtual functions on it.
One approach to fix this is to do a two stage construction, fully construct the class, and only then, call the virtual method:
```
clas... |
Firestore Angular integration |
|angular|firebase|google-cloud-firestore| |
I think you should replace onLoadData to onClick as IOS devices / IOS browsers need interaction to play a video. They dont let video to autoplay.
IOS has strict autoplay policies, please have a look at their webkit page.
Properly handle this promise
const video = videoRef.current;
if (video.pau... |
{"OriginalQuestionIds":[49211076],"Voters":[{"Id":14868997,"DisplayName":"Charlieface","BindingReason":{"GoldTagBadge":"sql-server"}}]} |
In 2024 the following syntax seems to work.
db.Debug().Where("stock IN ?", values).Find(&paintings)
Remove debug in production. |
It can be something like:
```cpp
class CharTrie final
{
public:
// (Code)
private:
// Trie__
// Structure representing a node in the trie.
struct Node final
{
std::unordered_map<char, std::unique_ptr<Node>> child_node{}; // Map of child nodes.
bool end_of_string... |
Firestore Angular integration error: Firestore has already been started and its settings can no longer be changed |
I was also facing similar issue for project https://github.com/eugenp/tutorials/tree/master/spring-web-modules/spring-rest-query-language .
Issue - parent and spring-rest-query-language module have source and target as java 8. But I wanted to run this with Intellij having openjdk 21. Few other modules were working ... |
The `--target web` outputs the code as an ES module. You can still use it without a bundler directly in the browser, but you need to mark script as a module.
```html
<html>
<head>
<meta content="text/html;charset=utf-8" http-equiv="Content-Type"/>
</head>
<body>
<!-- Note the usage of `type=modul... |
The way to do it is to run: ```flutter run -d chrome --web-port 5000``` |
This answer takes advantage of the [OUTPUT][1] clause available in SQL Server. However, this is not necessary just seems a bit cleaner.
I would prefer to see some notion of a primary key on this data, but I'll assume you have a good reason for what you are doing. However, this answer is predicated on the assumption ... |
discord music bot is connecting and accepting the url but its giving me no audio |
|discord|discord.py|audio-player| |
null |
--- ViewModel ---
public class ViewModel : ObservableObject
{
public ViewModel()
{
RequestCommand = new RelayCommand(RequestAsync);
}
private TaskNotifier<string> _requestTask;
public Task<string> RequestTask
{
get => _reques... |
{"Voters":[{"Id":10669010,"DisplayName":"Mister Jojo"},{"Id":943435,"DisplayName":"Yogi"},{"Id":11854986,"DisplayName":"Ken Lee"}]} |
Please note that Stack Overflow is an English only site. |
null |
Visual Studio Code - how to view previous searches? |
I had this issue, it was because I installed the package `polygon`, when I needed to install `polygon-api-client`.
Installing the correct package fixed it. |
You cannot achieve that with just flex box, you have to give max-width to container, [here][1] you can learn more.
By the way I recommends you to use grid layout in this case:
```html
<main className="mx-auto my-20 grid w-fit grid-cols-2 gap-5 bg-red-400 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5">
// content
... |
import discord
import youtube_dl
from discord.ext import commands
from youtube_search import YoutubeSearch
from typing import Union
intents = discord.Intents.all()
#(commands)
bot = commands.Bot(command_prefix='!', intents=intents)
@bot.command()
async def join(ctx):
# Check if the user is in a... |
I had this same issue - I set up a bare bones svelte / rollup / ts project , and it wouldn't build, complaining about `import App from App.svelte`. After a quick google, the solution seemed to be to add a `global.d.ts` file containing a reference to svelte types
/// <reference types="svelte" />
This fixed my bu... |
I got this data with Nulls in original_eur column.
| | event_id | category | rounds_bot_date | original_eur |
|---:|:-------------------------------------|:-----------|:--------------------|---------------:|
| 0 | 1 | Category 1 | 2024-03-25 00:00:00 | 200 |
| 1... |
For me, the authority configured in the API must match the authority configured in the client including the http/https. |
{"Voters":[{"Id":15261315,"DisplayName":"Chris"},{"Id":119527,"DisplayName":"Jonathon Reinhart"},{"Id":6752050,"DisplayName":"273K"}]} |
The other answer isn't wrong *per se*, but could be more specific.
Quite simply, the C++ standard explicitly imposes no requirements on the accuracy of floating-point operations or the numeric library functions like `std::pow`. They are *implementation-specific.*
The various standard library implementations<sup>1... |
I'm learning the TradingView api, but I got an error
```html
<div class="tradingview-widget-container" style="height:100%;width:100%">
<div id="technical-analysis-chart-demo" style="height:100%;width:100%;overflow: hidden;"></div>
<div class="tradingview-widget-copyright"><a href="https://www.tradi... |
TradingView widget.getStudyStyles is not a function |
|tradingview-api| |
so I built a jar file of my lib gdx project using the console command `gradlew desktop:dist` and it builds successfully. When I try to run it the program immediately crashes so I run it with a command line to get the console output and it seems that none of the assets are found so it fails. I use eclipse and it runs pe... |
I'm not sure if I understood your problem, I hope the following code helps.
```lang-hcl
variable "desired_zone" {
type = string
description = "Value of the desired DNS zone."
}
variable "dns_zone_names" {
type = list(string)
description = "List of DNS zones."
}
locals {
contains... |
I've done a workaround for this problem. Just create a fixed div that siblings the content, with height: 100vh, and width: 100vw. Also, set the z-index to be lower than all your content (in my case it's set to -10). The code would be like this.
<!-- begin snippet: js hide: false console: true babel: false -->
<!-... |
I am using Windows 10. I build the app (signed release apk and aab) through Android Studio UI successfully. I want to build Android app without launching Android Studuio. I read, that it can be build with `gradlew.bat` script, as for example `gradlew.bat assembleRelease`.
I have `cd` to the project folder, executed ... |
Can't run gradlew.bat on Windows |
|java|android-studio|gradlew| |
null |
null |
|azure-blob-storage| |
null |
```
rsi = ta.rsi(close, 14)
getSeriesVal(seriesName, nBack) =>
switch seriesName
"open" => open[nBack]
"high" => high[nBack]
"low" => low[nBack]
"close" => close[nBack]
"rsi" => rsi[nBack]
=> na
```
When trying the rsi from n backcandles at various indi... |
|pine-script|na|pine-script-v5| |
i followed this tutorial :https://docs.avaloniaui.net/docs/guides/platforms/rpi/running-on-raspbian-lite-via-drm
and
i use this display: https://www.amazon.de/Elegoo-Display-Monitor-Raspberry-Schnittstelle/dp/B01JRUH0CY
a 3,5 inch SPI Display
with a Raspberry Pi 4 and the offizial distro.
First i installed t... |
Touch calibration error when using Avalonia UI with Raspberry PI 4 (lite) DRM Mode |
|touch|embedded-linux|raspberry-pi4|avaloniaui|avalonia| |
null |
I'm working on my master's thesis, in which in want to use Overleaf Latex. I have some small experience in using Overleaf Latex, so I started by creating a new project and used a preamble one of my old colleagues had created for a prior project. For some reason I'm getting an error that I can't figure out how to solve.... |
I have a df such as :
data = {
'class': ['First', 'First', 'First', 'Second', 'Second', 'Second', 'Third', 'Third', 'Third'],
'who': ['child', 'man', 'woman', 'child', 'man', 'woman', 'child', 'man', 'woman'],
'survived': [5, 42, 89, 19, 8, 60, 25, 38, 56],
'Percentage': [10.2... |
My yaml consists of 2 stages and stage A & b.
one of the task under stage A has to install/uninstall the drivers and needs a system reboot.
Once the self-host agent is rebooted. I want to the agent to continue to listen to next stage B. Although my agent is up after reboot and ready for listening jobs. the build th... |
Use the scapy library in Python to read the file captured by Wireshark and then rewrite it into a new pacp file. After opening it again with Wireshark, some fields cannot be displayed.
This is code written in Python
from scapy.all import *
PKT_List = []
pkts = rdpcap("E:\test.pcap")
for p... |
Yes.
Import **requests** after **grequests**.
Here is an [open issue][1] about this.
```python
import grequests # noqa: F401
import requests
```
[1]: https://github.com/kennethreitz/grequests/issues/103 |
In order for Jackson to deserialize a Json, it either needs a default constructor or a method annotated with `@JsonCreator`. Without any of these two methods, Jackson is not able to instantiate an instance and raises an `InvalidDefinitionException`.
With a default constructor, Jackson first creates a default instanc... |
I would like to start by saying that I'm a beginner and I'm trying to learn React so please don't be too harsh if my question is dumb.
I'm trying to learn to animate my pages a bit, and I've seen that you can have a Drag and Drop feature on different elements on your page.
I've heard about libraries such as Reac... |
Lib GDX exported jar file does not detect assets |
|java|libgdx| |
I tried all answers none of them are working.
Here is https://codesandbox.io/p/github/AvinashDalvi89/react-cerbos-demo code playground is available.
https://github.com/AvinashDalvi89/react-cerbos-demo |
I'm currently deploying an application using `Django Channels` in Production environment.
The target application is based on the sample app from the official `django channel` documentation.
https://channels.readthedocs.io/en/latest/tutorial/index.html
I've confirmed that it works well in a production environment... |
Although Whisper’s transcription is highly accurate, there is always jargon (GPT) or non-standard spellings that make the transcript flawed (example: “Dave Prior” is a podcast host and transcription will spell his last name as “Pryor.”) What are some ways to improve transcription? |
How to improve Whisper speech to text |
|openai-whisper|transcription| |
There are three usual ways to improve Whisper transcription service:
1. Prompt Whisper (up to 244 tokens) with a word list. [\[1\]][1]
2. Post process the transcripts with a GPT that is promoted to revise the transcript and supplied with a word list (up to the GPT’s token limit)[\[2\]][1]
3. Fine tune the model... |
As mentioned in my previous answer change it to
Before:
(change)="onProductChange($event,i);
After:
(optionSelected)="onProductChange($event,i);
Also this change is needed
<input
formControlName="productname"
[id]="'productname_' + i"
... |
[I do **not** desire the review of any of the code in this question. Code present is purely for illustration purposes to demonstrate what I have come up with on my own. I am looking for a **performance optimization** pertaining to one **specific aspect** of an **algorithm**. Since potential improvements will be small, ... |
I tried to develop a chatbot using deep learning techniques and NLTK tools within the Python programming language. Initially, the chatbot performed satisfactorily when tested within the console environment, exhibiting no errors. However, upon attempting to deploy it onto a website, I encountered unexpected challenges. ... |
It sounds like you want an [index signature](https://www.typescriptlang.org/docs/handbook/2/objects.html#index-signatures), since "you don't know all the names of a type's properties ahead of time, but you do know the shape of the values." Instead of `{const: string}` you're looking for `{[k: string]: string}`, which m... |
|node.js|three.js|3d-model|threejs-editor| |
My mongodb data is looking like this
```
[{"_id":"66076517c835e00d55714b41","UMKC":{"users":{"professors":[],"students":[],"admins":[]}}}]
,{"_id":"66076517c835e00d55714b41","UNT":{"users":{"professors":[],"students":[],"admins":[]}}}]]
```
I want to update the users accroding to their roles. The data needs to... |
As the title says, the code works fine if the window is not resized, but when the window is resized, the code will make an error.
This is the code:
```
int width = frame.width;
int height = frame.height;
int row_pitch = frame.row_pitch;
unsigned char* data = frame.data;
int size = width * height * 4;
stat... |
Attempt to convert pData provided by Direct3d11 to buffer, but error when resize window |
|directx-11|screen-capture|direct3d11| |
null |
I know you can set keep-alive by using System property **`jdk.httpclient.keepalive.timeout`**, and this value is only read once when the class jdk.internal.net.http.ConnectionPool is loaded. Afterwards, [it cannot be changed anymore](https://stackoverflow.com/questions/53617574/how-to-keep-connection-alive-in-java-11-h... |
|java|httpclient|java-11|keep-alive|java-http-client| |