instruction
stringlengths
0
30k
|javascript|reactjs|
I am having an "Introduction to AI" course and we were assigned to do a mini project about a simple expert system using AIMA library in python (from the book AI: Modern Approach). I am having some difficulties in writing FOL knowledge base rules in this library particularly, in class they didn't provide us with enough ...
Be careful to implement a solution that will not prepend `#` to an empty array. A good general solution should also not create an unnecessary trailing space. Ideally, a robust generalized solution should work regardless of the delimited value characters. This will never generate any unwanted characters. Split the ...
null
{"Voters":[{"Id":26742,"DisplayName":"Sani Huttunen"},{"Id":367865,"DisplayName":"Ouroborus"},{"Id":62576,"DisplayName":"Ken White"}],"SiteSpecificCloseReasonIds":[16]}
As of MongoDB 6.x it is possible to use relative path as data and log directory (not with tilde). For the below configuration (as an example), if the server is started from bin directory, it uses the data directory and the logs in the mentioned log file. This is useful in cases of automated installation of MongoDB ...
To get the data set as insert commands without root user - using different user pg_dump -U <dbUser> -a <DB schema> --column-inserts --data-only > backup.sql data will be backed up into a backup.sql file
You can do this using yup.lazy() to dynamically define the schema based on the value of type. Here's how you can modify your schema code ``` const schema = yup.object({ questions: yup.array().of( yup.lazy((value) => yup.object().shape({ subject: yup.string().required('Subject is required'...
Unable to ping remote websites from an ipV6 only ubuntu ec2 Instance
I created a tic tac toe game and want to use GPT as player 2 but I keep getting errors. import sys import random import openai from PyQt5.QtWidgets import QApplication, QMainWindow, QPushButton, QMessageBox # Set your API key here api_key = "YOUR_API_KEY" # Initialize the OpenAI API client openai.ap...
How can I use open ai api key for my tic tac toe game
|python|api|openai-api|
null
|python|scipy|permutation|t-test|scipy.stats|
|python|mathematical-optimization|linear-programming|or-tools|
I had this same issue when I deployed the problem was with the redirection from Vervel so what I did was make a vercel.json file and added `{"rewrites": [{"source":"/(.*)", "destination": "/"}]}`
If the above solutions dont work for you, disabling GPG check worked for me immediately, since I could not make other suggestions work in the moment. I edited the `sudo vim /etc/yum.repos.d//etc/mysql-community.repo` Then scroll to where you will find mysql version causing issues for me was 5.7 ``` [mysql57...
{"OriginalQuestionIds":[78210393],"Voters":[{"Id":2937831,"DisplayName":"jakevdp","BindingReason":{"GoldTagBadge":"python"}}]}
I'm learning c++ for micro-controller programming. I've used python before. I prefer to learn JavaScript at the same time and use Node.js framework because of its big community. Or should I go for Django framework? Or another language and framework altogether? Which one has a better job market? My main g...
Which language I should use for back-end development?
|backend|javascript|jobs|python|
How can I type within a search box and have the letters I type turn bold from suggested words? For example, I type "he" in search bar and it looks like this as I type: **he**lp. Also, if I type in "lp" the text should appear: he**lp**. I have some code written already and I just want to add this functionality to it,...
Find the sum of the numbers in the sequence
|c++|string|sum|char|numbers|
null
One option to add images to your axis text would be to use the `ggtext` package which allows to add images to the axis text using an `<img>` and by using `ggtext::element_markdown()` for the axis text. However, I haven't found an option to center align the text and the image for the y axis text. Instead, for the y axi...
null
``` package main import "fmt" func square(c chan int) { fmt.Println("[square] reading") num := <-c fmt.Println("[square] before writing") c <- num * num fmt.Println("[square] after writing") } func cube(c chan int) { fmt.Println("[cube] reading") num := <-c fmt.Println("[cube] before writing"...
{"Voters":[{"Id":3689450,"DisplayName":"VLAZ"},{"Id":1940850,"DisplayName":"karel"},{"Id":546871,"DisplayName":"AdrianHHH"}],"SiteSpecificCloseReasonIds":[13]}
Print Preview Multiple Sheets - **Column** - You need to pass a 1D array without the use of the `Array` function. You can use the late-bound version of the `Transpose` worksheet function to convert the 2D array to a 1D array using the following: Dim wb As Workbook: Set wb = ThisWorkbook Dim My...
I do a lot of Javascript programming that checks for the presence of something (library, window, socket) before executing code. if (foo()) { do this thing } Sometimes `foo()` gets set only once, but then I will check it over and over again during execution. React's `useRef()` is an good exampl...
Do conditional checks cause bottlenecks in Javascript?
|javascript|performance|optimization|
My application is a learning platform which lets users to upskill themselves in basic areas of computers specifically for South East Asian nations.<br> I am using **Azure AD B2C** for user management and using **Identity Experience Framework (Custom policies)**. <br> Anyone can register at **<https://skillourfutu...
B2C Login is showing me an error page after entering credentials. When clicked on Sign in button, it's logging me in without asking for creds
|azure-ad-b2c|azure-ad-b2c-custom-policy|
Need to calculate Matrix exponential with Tailor series with MPI matrix is small 3 x 3 for example Meanwhile ``` vector<vector<double>> matrixMult(const vector<vector<double>>& A, const vector<vector<double>>& B) { int n = A.size(); vector<vector<double>> C(n, vector<double>(n, 0)); for (int i = 0;...
Attempted to use the below code to cause the GitHub actions to start when the release tag is published, but it isn't working. ```yaml name: Update Values on Release on: release: types: [ published ] # Trigger only on published releases jobs: update_values: runs-on: ubuntu-latest steps: ...
null
Using Conditional Formatting does not restrict the automation.<br> Rather than colouring the cells in Pandas and writing to Excel you are just colouring the cells in Excel instead, using Openpyxl to apply Conditional Formatting.<br> It shouldn't be any different unless you have a need to access the DataFrame with sty...
Why is the main goroutine not blocked after write in unbuffered channel?
|go|
null
To achieve the menu popup functionality, you should prefer using `checkbox input` of HTML alongside with the `:checked` CSS property. Try following the given example: <!-- begin snippet: js hide: false console: true babel: false --> <!-- language: lang-css --> body { user-select: none; } ...
Input a string and print the sum of the numbers in the string Input: abc123kjewd456 Output: 579 I want code it with pointer in string, array, loop, and lots of way, Can you help me use the best way? I can give you full of subject: Securing user information today is a problem for every compu...
Recognising what you say about timestamps, **ImageMagick** has exactly such a feature. First, an example. Here I create two images with identical pixels but a timestamp at least 1 second different: convert -size 600x100 gradient:magenta-cyan 1.png sleep 2 convert -size 600x100 gradient:magenta-cyan ...
How to bold matched letters when typing in search box using javascript?
|javascript|autocomplete|searchbar|bold|
I recently upgraded my application from Laravel 10 to Laravel 11 using Laravel Shift. After the upgrade I noticed that my private channels with Pusher are no longer authenticating. The error logs in Pusher's console contain are filled with "Auth info required to subscribe to private-users.2". I noticed that in L...
Laravel 11 - Private channel authorization failing after upgrade from Laravel 10
|broadcasting|laravel-11|
null
|javascript|vercel|
I want to iterate a chunk of code across columns in a dataframe, to create a new matrix of results. I am getting stuck with how to iteratively create new objects and matrices using/named after values in a certain column (Site) in my dataframe, to then pass through to the following lines of code. The code I am want...
I have a blank project with nothing but a code snippet from Bootstraps horizontal gutters page https://getbootstrap.com/docs/5.3/layout/gutters/#horizontal-gutters I dont see any horizontal gaps, why is that? Vertical gutters only work... [image](https://i.stack.imgur.com/1uull.png) <div class="container tex...
Bootstrap horizontal gutters issue
|html|css|bootstrap-5|
null
I have a tree, implemented as a nested dictionary, and I need to come up with a way for the user to choose two nodes, one of which must be a descendant of the other. A simple drop-down would probably work, but I wanted to indent the options to clearly communicate which "child" option descends from which "parent" opt...
De-indenting the label of a <select> with with indented options
|javascript|html|select|parent-child|indentation|
https://www.php.net/manual/en/language.types.declarations.php#language.types.declarations.base.scalar > **Warning** Aliases for the above scalar types are not supported. Instead, they are treated as class or interface names. For example, using boolean as a parameter or return type will require an argument or retu...
{"OriginalQuestionIds":[44009037],"Voters":[{"Id":285587,"DisplayName":"Your Common Sense","BindingReason":{"GoldTagBadge":"php"}}]}
I created a tic tac toe game and want to use GPT as player 2 but I keep getting errors. ``` import sys import random import openai from PyQt5.QtWidgets import QApplication, QMainWindow, QPushButton, QMessageBox # Set your API key here api_key = "YOUR_API_KEY" # Initialize the OpenAI API client openai.api...
You can split your dataset ( `split(data, ~Race)` ) and work with 3 distance matrices instead of one. Though this is bit more convenient with `sf` & `dplyr` where you can just group points by some attribute and then get the number of points within the distance from each of those locations. ``` r library(sf) #> Lin...
> In my project I am trying to use `net.sf.saxon.s9api.XsltTransformer` in multiple threads using synchronization in java because as per documentation An XsltTransformer must not be used concurrently in multiple threads. It is safe, however, to reuse the object within a single thread to run the same stylesheet several ...
the problem i had was error on microsoft visiual, mention befor the error of wheel of panda, needed the package of that before install pandas with pip install. now after install the microsoft visiual then use pip install panda and then pip install transform i had no errors.
I've tried this: <p class="post-date"> <time datetime="2023-01-01" th:text="${#temporals.format(item.getCreatedDate(), 'dd-MM-yyyy HH:mm')}">Oct 5, 2023</time> </p> where `createdDate` is a `java.util.Date` but I am getting this error: 2024-03-30...
I am working on a practice project to create 3 separate pages that is Brand Page, Car Model Page and Car Model Variant detail page. I am working on a project with three models car brands, car model, car model variants When an user opens the Car model page they should see the list of variants in that car model ``...
Another way to do this is to inject the web socket server into a custom Jest environment. I had to do this due to `Websocket is not a constructor` error. In your jest.config.js file ``` ... testEnvironment: "./custom-dom-environment.", ... ``` custom-dom-environment.js ```js // my-custom-environme...
I haven't done anything in 68k assembly yet, so I can't vouch for it, but [Retro68](https://github.com/autc04/Retro68) should have a 68k-compatible version of GNU Assembler and the rest of the tooling needed to make Macintosh applications with it, given its description and my understanding of GCC's architecture: > A...
Here's a way to generate the arguments dynamically. This is written for Windows `msvcrt` but should work for `libc` as well: **test.cpp** ```c #include <stdio.h> #include <stdlib.h> int main(int argc, char* argv[]) { for(int i = 0; i < argc; ++i) printf("argv[%d] = \"%s\"\n", i, argv[i]); ...
I had similar problems with webpack 5 and http-proxy-middleware. The issue is webpack DevServer is using the `/ws` path, but my proxy and socket server were also using `/ws`. **Option 1** Before: proxy and socket server were using `/ws`. ```js const setupProxy = [ createProxyMiddleware('/api', options), ...
I'm struggling to solve the following problem. My window top left corner has negative coordinates when maximized (both x and y are -9), and it's size is actually bigger than the available area. I'm using WinAPI to get some platform specific features like Aero snap, so it becomes complicated to understand why exactly t...
|php|
Adding my own take here because none of the answers were acceptable to me: ```kotlin import kotlin.contracts.ExperimentalContracts import kotlin.contracts.InvocationKind import kotlin.contracts.contract private fun closeChain(items: List<AutoCloseable>) { try { items.last().close() } finally...
**Update:** I raised an issue for this problem on the official Github for this azure resource `azurerm_monitor_scheduled_query_rules_alert_v2` and seems that the Contributors were helpful & have fixed this issue and the new changes will be soon rolling out in the version `3.98.0` of the azurerm provider. The issu...
Remove the partition by clause and rank SELECT department_id, COUNT(employee_id) no_employee, RANK() OVER (ORDER BY COUNT(employee_id) DESC ) Rank_ FROM employees GROUP BY department_id; https://dbfiddle.uk/d227UwOW
Django-Cross Model Query 3 Models
|django|django-models|django-templates|
null
I am trying to have duplicate repository of my source but duplicate has certain modifications that the source repo won't have. I make these modifications using clean/smudge filters. I want my smudge filter to run once per commit, i.e. if a pull contains four commits then I want the smudge filter to run four times (per ...
Git smudge run once per checkout or per commit?
|git|git-filter|smudge|
On their [website](https://www.elastic.co/guide/en/elasticsearch/reference/current/knn-search.html) on knn retrieval, they have written > The filter is applied during the approximate kNN search to ensure that k matching documents are returned. This contrasts with a post-filtering approach, where the filter is applie...
How does Elasticsearch do attribute filtering during knn (vector-based) retrieval?
|elasticsearch|knn|information-retrieval|
Good morning, I'm redoing a demo and I have a compilation error,I have 3 exceptions which all have a link : threw exception with message: authorizationUri cannot be empty. ``` org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'securityConfig' defined in file [C:\Users\...
If the same network meta-analysis object is used for arguments x and y, reciprocal treatment estimates will be shown in the upper triangle https://search.r-project.org/CRAN/refmans/netmeta/html/netleague.html I really cannot understand and I wanna show reciprocal treatment estimates in the upper triangle
I have the following very simple page ``` <!DOCTYPE html> <html > <head> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <style> div {height : 1500px} </style> </head> <body> <div id="top" style='background-color: #ec8686;' > <h1>TOP DIV</h1> ...
Understanding Scroll Anchoring Behavoir
|javascript|html|css|scroll|infinite-scroll|
My flutter version 3.19. I use `chewie: ^1.7.5 `and `video_player: ^2.8.3` for playing a video in FlutteBut, the Android emulator shows meaningless video images on the phone screen. When I opened the page of the video, it played but didn't look expected butterfly video and not heard sound of it. Emulator s...
The proper `fish` version of that loop is: ``` for i in *.cue; chdman createcd -i $i -o (path change-extension chd $i); end ``` `fish` is *not* a Bourne-style shell like `sh` or `bash` or `zsh` and does not have the same syntax. Trying to treat it like it is in that family is of course not going work very well....
{"Voters":[{"Id":1255289,"DisplayName":"miken32"},{"Id":17562044,"DisplayName":"Sunderam Dubey"},{"Id":16217248,"DisplayName":"CPlus"}],"SiteSpecificCloseReasonIds":[11]}
I've downloaded **SFML-2.6.1** and created Xcode project from template on my **M1 Mac**. Although project is building, it can not run, raising this error in the **Xcode** terminal: ``` dyld[7793]: Library not loaded: @rpath/sfml-system.framework/Versions/2.6.1/sfml-system Referenced from: <1E3396AD-BA26-30F7-9...
The data structure for this is a Trie (Prefix Tree): ```php <?php class TrieNode { public $childNode = []; // Associative array to store child nodes public $endOfString = false; // Flag to indicate end of a string } class Trie { private $root; public function __construct() { $t...
Second code: <br> It doesn't work because it attempts to send and receive on the channel within the same main function, without goroutines. <br> Reason: The `for i := 0; i < cap(c); i++` loop starts sending values to the channel. When it sends the first value, it blocks, waiting for a receiver. The subsequent `for i ...
assumming that we wish to access the `job_id` within the job/command code: know that there's a much simpler way, just use `os.getenv("AZUREML_RUN_ID")` to get the RUN_ID
I'm hoping someone can help me get these two checkboxes with text side by side instead of top / bottom. Thanks! https://jsfiddle.net/j8y1x7q9/ <div class="checkbox-wrapper-33"> <label class="checkbox"> <input class="checkbox__trigger visuallyhidden" name="WAV" type="checkbox" checked />...