on-internet

Laravel Vue.js application not running

I have a serious problem on running Laravel + Vue.js new applications. I tried that on a 50% developed app and also on a brand new Laravel instalation and that shows the same error. After installing the Laravel and going into php artisan serve i start a common routine to start Vue.js within that Laravel application, which means NPM RUN INSTALL and right after NPM RUN DEV. This is what the errors show me: I have tried all possible solutions found on previous posts on Stack Overflow and Github but the error persists. I have a node version 10.15.1 and the latest Laravel scaffold. Any thoughts on

Join the discussion →

Pytest running very slow for project

My pytest setup is running very slow, especially during collection phase. So I have put up a pytest setup for my Django project, and each Django app's test-files are located in its own folder, i.e., the tree looks as follows root | +--a | | | +--tests | | | +--conftest.py | +--testAa.py | +--testBa.py +--b | | | +--tests | | | +--conftest.py | +--testAb.py | +--testBb.py ... pytest.ini The pytest.ini file specifies where to look for the tests and has the following content [pytest] DJANGO_SETTINGS_MODULE = project.project.settings.test python_files = tests.py test_*.py *_tests.py addopts = --re

Join the discussion →

Is there an efficient way to build up regression model on panel data?

I have two-dimensional data, including frequent crime type in certain regions and corresponding house prices along the year. I want to understand possible association between crime frequency in certain regions and house price fluctuation. Initially, I tried to use linear regression to do that, but it didn't work well. Now I want to try PCA analysis on my data, but it is still not efficient to me to grab meaningful results. How can I perform efficient PCA analysis on panel data for the purpose of doing regression? any efficient workaround to make this happen? Data: Because my data is bit long i

Join the discussion →

How To Set Global Random Seed in Python

Like in R, I would like to set a random seed globally for the entire script/session, instead of having to call the random seed function every time I execute a function or run a model. I am aware that sci-kit learn uses the numpy RNG, but also could not find a way to set it globally. I have read several posts here on this topic, such as this one: Differences between numpy.random and random.random in Python It explains the difference between the two RNG classes, but not how to set it globally. Is there no way of doing this except for calling the random seed EVERY time I want the output to be the

Join the discussion →

How do I setup tnsnames.ora in asp.net core web application?

I have a small asp.net core 2.2 app that should access an oracle db; I'm using NuGet Oracle.ManagedDataAccess.Core (2.18.6), and it just works on my machine. When I deploy it to the windows server with IIS, I place a tnsnames.ora file in app's directory and again it just works. Now I want to use a shared tnsnames.ora file. I have tried web.config like following (recipy from StackOverflow/Google answers to similar questions). <?xml version="1.0" encoding="utf-8"?> <configuration> <configSections> <section name="oracle.manageddataaccess.client" type="OracleInternal.Common.ODPMSectionHandler, Ora

Join the discussion →

Does Slack support Markdown tables?

I want to send a Markdown table to Slack with its postMessage API, but I got raw content in Slack instead of a rendered table. Does Slack support Markdown tables? Ir is there any other way to present tabular data in Slack? I know Slack doesn't support HTML. I tried chat.postMessage and files.upload, also formatting text with fixed column length but it looks kind of ugly, so I am figuring out a way to make it look better. Here is my HTTP request code, content-type is JSON: url : https://slack.com/api/chat.postMessage body : { "channel": "RKAID4I", "text": " | Tables | Are | Cool | |---------- |

Join the discussion →

Laravel form route not defined

I am trying to send a route the old way, without using Blade's {{}} tags. I am encountering a problem, because the framework throws my route as not defined. Can someone help me? This is my form tag: <form method="POST" action="{{ route('store') }}"> My route Route::post('store', 'Controller@store'); My controller (the function name might help you undertand) public function store(Request $request){ return redirect('/XXXXX/home'); } The error is always: Route [store] not defined. (View:

Join the discussion →

GuzzleHTTP returns 404 on existing page

My Guzzle POST request to https://api.scarif.dev/auth gives back a 404, while the page exists through Postman, or browser, or javascript. It should return a 200 with a 401 message, but Guzzle gives back a 404. In both POST and GET mode that is. I've tried multiple Client setups, including different headers and disabling SSL verification, but without any success. Now I've copied the exact same headers that made it work in postman, but still no success. I've been searching through google and stackoverflow, but couldn't find an answer that fixed my problem. Request in PHP: <?php $client = new Cli

Join the discussion →

Search a database table using any word from a multi-word search term with CodeIgniter's query builder [duplicate]

I am creating a CodeIgniter search for my bookshop project. It is okay with a single word search, but I am facing the problem when I search with multiple words. How I can fix this problem? MY controller public function search() { /*=== LOAD DYNAMIC CATAGORY ===*/ $this->load->model('admin_model'); $view['category'] = $this->admin_model->get_category(); /*==============================*/ $this->form_validation->set_rules('search_book', "Search",'required'); if($this->form_validation->run() == FALSE) { #...Redirected same page after action redirect($_SERVER['HTTP_REFERER']); } else { $query = $t

Join the discussion →

Your account does not have permission to create Developer ID Application certificates

Can anyone help me with the following error message? I have seen a few of these messages in Xcode (and on Stackoverflow) but not exactly this one. I have an admin role (but I am not the account holder). Does anyone know why Xcode has problems with the creation of the Developer ID Application certificate? In Xcode I signed in with the admin account but still no success. Any help is highly appreciated!

Join the discussion →

Uncaught PHP Exception Symfony\Component\HttpKernel\Exception\NotFoundHttpException: "No route found for "GET /"

I just started following a symfony 4 tutorial I set up the whole project with composer and got the index file showing up in browser http://127.0.0.1:8000/ I'm stuck on the very first Router/Controller/View example The route is not working properly or at all. I always get a 404 error. 1: 2: 3: <?php namespace App\Controller; use Symfony\Component\HttpFoundation\Response; class LuckyController { public function number() { $number = random_int(0, 100); return new Response( '<html><body>Lucky number: '.$number.'</body></html>' ); } } # the "app_lucky_number" route name is not important yet app_luc

Join the discussion →

How to mock API calls made within a React component being tested with Jest

I'm trying to mock a fetch() that retrieves data into a component. I'm using this as a model for mocking my fetches, but I'm having trouble getting it to work. I'm getting this error when I run my tests: babel-plugin-jest-hoist: The module factory of 'jest.mock()' is not allowed to reference any out-of-scope variables. Is there a way I can have these functions return mock data instead of actually trying to make real API calls? Code utils/getUsers.js Returns users with roles mapped into each user. const getUsersWithRoles = rolesList => fetch(`/users`, { credentials: "include" }).then(response =

Join the discussion →

FULLTEXT index matching problems with CodeIgniter Query Builder

I'm trying to create a fulltext search indexing based on CodeIgniter query builder and I got weird result which is said : Error Number: 1191</p><p>Can't find FULLTEXT index matching the column list</p><p>SELECT * FROM `posts` LEFT JOIN `post_reg_sub_cat` ON `post_reg_sub_cat`.`id`=`posts`.`regional` LEFT JOIN `post_reg_cat` ON `post_reg_cat`.`id_reg_cat`=`post_reg_sub_cat`.`id_reg_cat` WHERE `id_post` != '129' AND `post_reg_cat`.`reg_cat` = 'lampung' AND MATCH (title) AGAINST("saya-punya-3-pertanyaan-untuk-brigita-manohara") LIMIT 5</p><p>Filename: models/M_api.php</p><p>Line Number: 347 Howev

Join the discussion →

How to fix laravel composer update issue ( Illuminate\Foundation\ComposerScripts::postAutoloadDump failed to open stream: No such file or directory)

I'm currently working on a laravel project using an existing package for e-commerce functionality called Bagisto. I already downloaded the package files from the repository on GitHub and dopped the files inside xampp htdocs folder on my Ubuntu 18.04 OS. The problem happens after I launch composer update in the terminal inside my project directory I get this error message: Loading composer repositories with package information Updating dependencies (including require-dev) Nothing to install or update Generating optimized autoload files > Illuminate\Foundation\ComposerScripts::postAutoloadDump P

Join the discussion →

How to change PR merge commit message?

When pull requests are created, their commit message is always like "Merged PR### from {branch name} into {target branch name}" I keep amending commit messages and this is a bit tiring. I rely on the commit messages to keep track, so the automatic messages present a problem.

Join the discussion →

The process started from chrome location /usr/bin/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed for Selenium

I’m running a jupyter notebook on ubuntu server. I’m trying run the selenium code below using chromedriver. I’m getting the error below but if I run the line of code below in Ubuntu terminal it returns the output below. Does anyone know what the issue might be? I’m still pretty new to ubuntu. Ubuntu code: which google-chrome output: /usr/bin/google-chrome jupyter notebook code: driver = webdriver.Chrome(executable_path=os.path.abspath("/home/username/chromedriver"), chrome_options=chrome_options) error: --------------------------------------------------------------------------- WebDriverExcept

Join the discussion →

How do I make git add my code without recognizing it as a submodule?

I have two files, say FrontEnd and BackEnd in two separate git repos. I want to combine them into one repository, and copy-pasted them into a brand new repo. I get this error: hint: You've added another git repository inside your current repository. hint: Clones of the outer repository will not contain the contents of hint: the embedded repository and will not know how to obtain it. hint: If you meant to add a submodule, use: hint: hint: git submodule add <url> BackEnd hint: hint: If you added this path by mistake, you can remove it from the hint: index with: hint: hint: git rm --cached BackEn

Join the discussion →

Php equivalent of this function [closed]

I have this javascript function, I need to convert this to a php function function vwap(p) { if (p.length === 1 && Array.isArray(p[0])) p = p[0] if (!p.length) return 0 // formula: sum(num shares * share price)/(total shares) return p.reduce((s,x) => s + (x[0]*x[1]), 0) / p.reduce((s,x) => s + x[0], 0) || 0; } I tried below so far but I am struck function vwap($p) { if (empty($p)) { return 0; } for ($p as $s) { //unable to understand this part in js } } For testing purpose vwap([[5, 10], [13, 8.5], [10, 11]]) must return 9.66

Join the discussion →

How to correct Arraylist index out of bounds for length error in Java

I am writing a program for school which acts as a cash register. I am asking for input for prices of items and playing them into an ongoing ArrayList until the user enters -1 or 0. 0 is to re-enter the previous price in case of mistake and -1 terminates the loop. I am getting the java.lang.IndexOutOfBoundsException: Index 0 out of bounds for length 0 error when I try to run my code. I have to include a method called removeLastEntry(), which will remove the last price entered into the array upon a 0 being entered by the user. How can I ensure the array is populated and I am indeed removing the

Join the discussion →

Angular render complete event

What is the best way to capture a completed redraw/render event of an angular component? I want this to occur AFTER every time the component has re-rendered due to some input property changing. As far as I can see, ngOnChanges fires when any input property changes, but it fires before any subsequent component redraws occurs.

Join the discussion →

What does the TM_CCORR and TM_CCOEFF in opencv mean?

What does the TM_CCORR and TM_CCOEFF in opencv mean? I found that TM_CCORR stands for the correlation coefficient. However, the TM_CCOEFF seams also to be the correlation coefficient due to its naming. Do you know for what the abbrevations stand? TM_SQDIFF = Template Matching Square Difference TM_CCOEFF = Template Matching Correlation Coefficient ? TM_CCORR = Template Matching Correlation ???

Join the discussion →

How to check if screen lock is enabled in the settings using adb

I need to know how to check if any type of screen lock is enabled in the settings part of the device. I need to check this using an adb command (by using adb shell). I also need to know the type of lock applied. I have tried dumpsys but did not get any success. I want to know if the screen lock is enabled in the settings even if the device is currently unlocked, just check if any security is there, in any state.

Join the discussion →

Is there a way on ojAlgo to normalize a Matrix?

I am interested to know if there is a way to find a normalized form for a MatrixStore using the ojAlgo matrix library. Perhaps a routine or a task that once performed on a MatrixStore will cause each of the rows to have a mean of 0 and a standard deviation of 1. If one is familiar with sklearn, what I'm looking for is some function on ojAlgo that functions similarly like the preprocessing module on sklearn.

Join the discussion →

Using Jest expected mock function to have been called one time, but it was called zero times

I am new to the Jest testing framework and so I wan't too mock a function that returns a Promise to test my click event button. I am receiving an error that says my method has not been called but I have it defined below as a jest.fn() and expect it to be called once. Any help in solving this or some clarity on why my code is wrong. const props = { activitiesStore: { isFirst:false, isLast:false, isLaunching:false, isLoaded:false, currentActivityIndex:115, markLessonFinished:() => { }, setContent:{ description: "In the CompTIA A+ training course, you will learn the fundamentals of computer techn

Join the discussion →

How to read large zip files in pyspark

I do have n number of .zip files on s3, which I want to process and extract some data out of them. zip files contains a single json file. In Spark we can read .gz files, but I didn't find any way to read data within .zip files. Can someone please help me out how can I process large zip files over spark using python. I came across some options like newAPIHadoopFile, but didn't get any luck with them, nor found way to implement them in pyspark. Please note the zip files are >1G, some are of 20G as well. Below is code, which I used: import zipfile import io file_name = "s3 file path for zip file"

Join the discussion →
Older stories