Categories
Mastering Development

How to use a cut in prolog to find the number of daughters?

Exercise: Observe the family structure below where each person has a gender specification as their third parameter (m = male, f = female). Use a cut to write the predicate numDaughters(L, Count) in such a way that family(Husband, Wife, Kids), numDaughters([Husband, Wife|Kids],X) lists each family in the database and the number of daughters in each […]

Categories
User Help

ERROR: Unable to open rules file “C:\snort\etc\snort3-app-detect.rules”: No such file or directory —- Snort on Windows Server 2019

I am currently setting up Snort on Windows Server 2019. I have set the RULE_PATH and SO_RULE_PATH to their absolute location, as advised by the comment within snort.conf. However, when I run the following command to test the configuration: snort -c C:\snort\etc\snort.conf -l C:\snort\log -i1 -T I get the following error: ERROR: C:\snort\etc\snort3-app-detect.rules(0) Unable to […]

Categories
Mastering Development

How to handle clients connexion with autobahn websocket?

I’m working on a program that sends text msg and images to another computer through a websocket (using autobahn) whenever I detect a certain event in a video. The problem is that I only the detect the event once. I have tried to pause the program before stopping it or sending a close handshake from […]

Categories
Mastering Development

Chart.js not to be begin in Y-Axis

this is what the code looks like right now With an 1st image preview currently using Chart.js. Please give me some insights on how my data chart not to begin in Y axis. ACTUAL RESULT of the Code below. var ctx = document.getElementById(‘myChart’).getContext(‘2d’); var myChart = new Chart(ctx, { type: ‘line’, data: { labels: [<?php […]

Categories
Database Development

postgres is choosing wrong index even with STATISTICS 1000

I have a table test_monika with 300k records. Simple query is not using index test_monika_rank_idx instead it is using primary key index test_monika_pkey. Actual rows returned are 1. The planner with current execution plan thinks that the estimated rows are 299996. I am using statistics of 1000 which are maximum. How to resolve this issue. […]

Categories
Mastering Development

If I have a list of facts about flights, how do I write a predict to return distance and expense for each trip from one city to other city

Need to find the predicate for below flight data as i am at very basic level of learning prolog 1] journey_dist(P,Q,[T,R]): the predicate returns the distance R for each trip T from city P and Q (one by one). The output is a list with first element the trip (which is a list) and second […]

Categories
Cryptocurrency Ethereum Mastering Development

UniswapV2 addLiquidityETH() reverting when trying to deploy to ganache locally

I’m trying to locally deploy a contract similar to sushiswap, but I keep getting a revert from addLiquidityETH(), no message other than VM Exception while processing transaction: revert //module.exports = function(deployer) {}; const SushiToken = artifacts.require("SushiToken"); const MasterChef = artifacts.require("MasterChef"); const SushiBar = artifacts.require("SushiBar"); const UniswapFactory = artifacts.require("UniSwapV2Factory"); const UniswapRouter = artifacts.require("UniswapV2Router02"); const MockERC20 = […]

Categories
Mastering Development

Parallelization Of Insertion Sort With openMP, compared to serial version, gives very spiky results

Context Hello! I was finishing up a slight hands on experience with POSIX pthreads, and OpenMP, trying to compare the both with the serial implementation of Insertion Sort, trying to see which one performs well on what kind of inputs. The results I got were weird to say the least. Maybe it could be that […]

Categories
Mastering Development

setAttribute is not a function in JS

script23.js:17 Uncaught TypeError: a.setAttribute is not a function at script23.js:17 Pls help me I want endeless this photos And when i click on stop everything is stoping. HTML <img> <button onclick="a()">Start</button> <button onclick="b()">Stop</button> <script src="script23.js"></script> JS function a(){ var a=document.getElementsByTagName("img")[0] a.setAttribute("src","https://image.freepik.com/free-photo/image-human-brain_99433-298.jpg"); setTimeout(function(){ a.removeAttribute("src"); a.setAttribute("src","https://helpx.adobe.com/content/dam/help/en/stock/how-to/visual-reverse-image-search/jcr_content/main-pars/image/visual-reverse-image-search-v2_intro.jpg") },3000); } var b=document.getElementsByTagName("img")[0]; setTimeout(function(){ b.removeAttribute("src"); b.setAttribute("src","https://cdn.pixabay.com/photo/2015/04/23/22/00/tree-736885__340.jpg") },6000); setInterval(function(){ a.setAttribute("src","https://image.freepik.com/free-photo/image-human-brain_99433-298.jpg"); setTimeout(function(){ […]

Categories
Database Development

Window Function – SUM() OVER (PARTITION BY … ORDER BY …)

i wish you all stay healthy and safe in this unprecedented circumstance. i am a newbie and asking my very first question in here. i have following dataset. green: original data. yellow: values that i want to calculate. red: dummy row that is manually added to set up starting point? PureAsk = MAX(Ask – PreviousBalance, […]