I've used Visual Studio code in Windows to write a number of Python scripts that carry out stochastic simulations of 3 biological systems. I have 6 Python scripts in total, each biological system has a script that simulates the system 5 times in parallel using the Python's multiprocessing library and another script that simulates the system 5 times sequentially. However, running the scripts using Visual Studio Code in Windows results in the Sequential scrips always being faster (Not what I want). There was some suggestion that the overhead of setting up parallel processes in an IDE might have
I need to verify that a method has been called on an object. So I make a spy of this object: obj = spyk(obj) And then I verify that a method has been called: verify(exactly = 1) { obj.f(3) } The test fails with the following error message: java.lang.AssertionError: Verification failed: call 1 of 1: obj(#2).f(eq(3))) was not called. However I can clearly see the method f being called: I can break in that method in debug mode I print out hello world from f() in that method and see it being printed. How do I use spies correctly in mockk? P.S. I tried doing val obj = spyk(obj()) but I get lateinit
I am trying to set the download directory of the Chromium Edge browser for selenium during automation. For Chrome I could achieve this using ChromeOptions like this: options.setExperimentalOption("download.default_directory", downloadFilepath); I need to do the same for the Chromium Edge browser. How to download the files inside a customized folder, rather than the default Downloads folder in our system
i am doing performence tests using Jmeter on Documentum's d2 application I've recorded a login and logout using blaze meter All the requests are in green but i get an error in the response body "Missing context(s) from session, re-connection required" , Anyone know whats happening? If there are any special params that needs to be passed
I've googled around a bit but I can't find anything regarding this, might be because I'm not exactly sure what causing the issue. I wanted to set a global value on the node.js global object. Just a simple string global.appRoot = path.resolve(__dirname) Since I'm using Typescript, my editor (Visual Studio Code) warned me that the property did not exist on type Global which makes sense. I went ahead and created a global.d.ts in my root folder with declare namespace NodeJS { export interface Global { appRoot: string; } } This worked perfectly and the editor tells me it's fine, but still breaks on
In my func component I am trying to use history.push in this way: import React, { useEffect } from 'react'; import { useHistory } from 'react-router-dom'; interface Props { question: Question; selectedAnswer: SelectedOption | undefined; } const LastScreen: React.FC<Props> = (props: Props) => { const history = useHistory(); ... useEffect(() => { if (progress === 100) { const id = uuid(); history.push({ pathname: `/p/${id}`, state: { userAnswers }, }); } }, [progress, userAnswers, history]); ... }; but it gives an error: Argument of type '{ pathname: string; state: { userAnswers: UserAnswers | u
i have look on this website how to install chronium: i have follow the instruction on this site https://raspi-tutorials.com/google-chrome-for-raspberry-pi/ but there is an error when i do this line sudo apt-get install chromium-browser --yes the original text of the error Les paquets suivants contiennent des dépendances non satisfaites : libc6-dev : Casse: libgcc-8-dev (< 8.4.0-2~) mais 8.3.0-6 devra être installé E: Erreur, pkgProblem::Resolve a généré des ruptures, ce qui a pu être causé par les paquets devant être gardés en l'état. the text with traduction of the error The following package
After reading multiple online posts about do_action()/add_action(), I would like to brief my understanding about them. Here I would only talk about action hooks, not about the filters. do_action() : Registers an action hook add_action() : adds a callback function to the registered hook. Now the questions are : 1> About add_action()/do_action() for existing hook : add_action( 'admin_enqueue_scripts', 'my_func'); In the above example the callback function my_func() is registered with the hook 'admin_enqueue_scripts'. Now whenever do_action('admin_enqueue_scripts') is called somewhere inside the
Context Are there commands to enhance the error message that is received such that python displays which .dll file it cannot find? For error: python test_cv2.py Traceback (most recent call last): File "test_cv2.py", line 1, in <module> import cv2 File "E:\Anaconda3\envs\py38\lib\site-packages\cv2\__init__.py", line 5, in <module> from .cv2 import * ImportError: DLL load failed while importing cv2: The specified module could not be found. (py38) E:\somepath> I would like to determine which .dll file is actually not being found. To do so, I downloaded and run DependenciesGui.exe from this reposi
I tried to follow every possible answer from Stack overflow and tried to follow exact same steps as mentioned in official doc. https://cx-oracle.readthedocs.io/en/latest/user_guide/installation.html I have python 3.8 64bit I have Windows server 2019 64 bit I downloaded Version 12.1.0.2.0 64bit oracle instant client. Tried with both Instant Client Package - Basic and Instant Client Package - Basic Light Set the path of the downloaded file to environment variable Path Restarted the system. import cx_Oracle dsn_tns = cx_Oracle.makedsn('XXX', 'PORT', service_name='XXX') conn = cx_Oracle.connect(us
Estoy revisando un proyecto asp.net con .Net Framework 4.0 y visual studio 2019, tengo el siguiente error: No se puede cargar el archivo o ensamblado 'file:///D:...\bin\stdole.dll' ni una de sus dependencias. Error de comprobación en la signatura del nombre seguro. Puede que se manipulara el archivo o que se firmara con firma retardada, pero no con la clave privada correcta. (Excepción de HRESULT: 0x80131045) Imagen del error:
I was pleased recently to discover that Bigquery hosts a dataset of SEC filings. I am unable to find the actual text of the filings in the dataset however! This seems so obvious I must be missing something. As an example, the 2018 Microsoft 10-K filing on the SEC website itself can be seen to have the 10-K text in which Item 7 includes the phrase "Management’s Discussion and Analysis of Financial Condition and Results". I searched for this phrase in the Dataset. First, the following query should pull all the text from this filing: SELECT * FROM `bigquery-public-data.sec_quarterly_financials.tx
I am trying to speed up my C program to spit out data faster. Currently I am using printf() to give some data to the outside world. It is a continuous stream of data, therefore I am unable to use return(data). How can I use write() or fwrite() to give the data out to the console instead of file? Overall my setup consist of program written in C and its output goes to the python script, where the data is processed further. I form a pipe: ./program_in_c | script_in_python This gives additional benefit on Raspberry Pi by using more of processor's cores.
Say I have the following two macro definitions: #define foo(X) 1 bar #define bar(X) 2 foo Why does foo(X)(Y)(Z) expand to 1 2 1 bar? According to the C99 standard 6.10.3.4 Rescanning and further replacement If the name of the macro being replaced is found during this scan of the replacement list (not including the rest of the source file’s preprocessing tokens), it is not replaced. Furthermore, if any nested replacements encounter the name of the macro being replaced, it is not replaced. These nonreplaced macro name preprocessing tokens are no longer available for further replacement even if t
Say I have the following two macro definitions: #define foo(X) 1 bar #define bar(X) 2 foo Why does foo(X)(Y)(Z) expand to 1 2 1 bar? According to the C99 standard 6.10.3.4 Rescanning and further replacement If the name of the macro being replaced is found during this scan of the replacement list (not including the rest of the source file’s preprocessing tokens), it is not replaced. Furthermore, if any nested replacements encounter the name of the macro being replaced, it is not replaced. These nonreplaced macro name preprocessing tokens are no longer available for further replacement even if t
I am trying to add GinIndex to my model however, I am getting an error when migrating: django.db.utils.ProgrammingError: data type character varying has no default operator class for access method "gin" HINT: You must specify an operator class for the index or define a default operator class for the data type. This is my model: class Post(models.Model): title = models.CharField(max_length=100) guid_url = models.CharField(max_length=255,unique=True, null=True) content = models.TextField(validators=[MaxLengthValidator(1200)]) author = models.ForeignKey(Profile, on_delete=models.CASCADE) date_pos
I've installed React via NPM and I'm having difficulty using CDN. I included the CDN scripts in the ./public/index.html file but when I use it in any component, it doesn't recognize the third-party package that I'm trying to use. <script src="https://cdnjs.cloudflare.com/ajax/libs/axios/0.19.2/axios.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/redux/4.0.5/redux.min.js"></script> Tried to use Axios but it doesn't work: axios.post("https://burger-builder-c5a0d.firebaseio.com/orders.json", order) .then(response=>{ alert("You ordered successfully!"); //shows an alert indic
I am mounting my component with an object $form which I need to access between requests. The data in $form is not secret, but should not be tampered with so I would like to make it a protected property. Though only public properties are preserved between requests leaving it exposed to front end. If possible, how can I prevent manipulation on this public property? I tried a check public function updating($key, $value) { if($key === 'form') return; } But I don't think that really does anything. Also, using sessions is not an alternative in my situation. Any ideas?
Is there a way to get the current project directory in flutter integration test? This is a basic test setup as an example. import 'dart:io'; import 'package:flutter_driver/driver_extension.dart'; import 'package:ivori/main.dart' as app; import 'package:glob/glob.dart'; void main() { // This line enables the extension. enableFlutterDriverExtension(); print("Where the working directory? ${Directory.current}"); print("What's under the current directory? ${Glob("*").listSync()}"); // Call the `main()` function of the app, or call `runApp` with // any widget you are interested in testing. app.main(
I am using Google maps in my xamarin forms app and I wanted to restrict the queryautocomplete by country. Following the GoogleMaps Places API docs https://developers.google.com/places/web-service/autocomplete the optional parameter components should do the trick, but it's not working for me. Looking up KFC while restricted by country let's say TUNISIA (TN) for example.. brings up search results from Germany, France and Indonesia. Even changing the parameters order does nothing. My query results are here. The url format I'm using: var response = await _httpClient.GetAsync($"api/place/queryautoc
I'm having some trouble finding info that describes how to update the code base automatically in Gitlab Scenario Let's imagine a developer working on a project commits some code, but forgets to format it before committing. The .gitlab-ci.yml can have a job that will check the formatting, and display an error/warning if found. Is it possible to update the git commit with the code formatted automatically? So the flow would be: Developer commits unformatted code to gitlab Git checks the code for formatting If an issue is found, git will run tool X to automatically format the code, and commit it w
Here is a short C file cu.c: int main(int argc, char **argv) { (void)argc; (void)argv; return 0; } When I compile it with OpenWatcom to a DOS .com file, the result is almost 3 KiB: $ owcc -bcom -mcmodel=t -fno-stack-check -Os -s -march=i86 -W -Wall -Wextra -o cu.com cu.c $ ls -l cu.com -rwxr-x--- 1 pts pts 2938 Jun 20 19:26 cu.com The smallest possible DOS .com file which does the same (just exits) is 1 byte long: it contains a single ret instruction (byte 0xc3). How can I compile my cu.c file (with possibly some modifications, I don't care about argc or argv) to a smaller DOS .com file, witho
I am using filebeat to push my logs to elasticsearch using logstash and the set up was working fine for me before. I am getting Failed to publish events error now. filebeat | 2020-06-20T06:26:03.832969730Z 2020-06-20T06:26:03.832Z INFO log/harvester.go:254 Harvester started for file: /logs/app-service.log filebeat | 2020-06-20T06:26:04.837664519Z 2020-06-20T06:26:04.837Z ERROR logstash/async.go:256 Failed to publish events caused by: write tcp YY.YY.YY.YY:40912->XX.XX.XX.XX:5044: write: connection reset by peer filebeat | 2020-06-20T06:26:05.970506599Z 2020-06-20T06:26:05.970Z ERROR pipeline/o
I was trying to solve the following problem: Draw a star pattern that increases in every step (1st step: 1 star, 2nd step: 2 stars). E.g. * ** I am not sure why my code is not showing any output when I am writing return? When I am writing print, it is giving me the star output but also giving me None. May I know why return or print are not working properly? I am using Python 3.7. My code is: def string(inp): for i in range (inp): return i*"*" print (string(5))
I am currently working on converting an Excel table with >100 calculated columns into a DAX table with similar calculated columns. Excel formulas refer to the columns by their column coordinates, e.g. 'sum = A2+B2', whereas DAX refers the column name in the formula, e.g. 'sum = Principal +Interest' When I try to convert the Excel version of sum=A2+B2, is there any way for me to find out A=Principal and B= Interest in the spreadsheet? I am talking about a table which has >50 non calculated columns and >100 calculated columns to be converted to comparable DAX model. Every time I look into a form
I have a topic "oranges" with 10 partitions, 2 consumers within 1 consumer group. I am using Spring Kafka. I need to re-read the data from time to time, and I need to reset the offsets. My listener implement ConsumerSeekAware and in the onPartitionsAssigned() I simply call callback#seekToBeginning. This works fine as in the log I see messages from Kafka Client API (2.3.1) saying: Resetting offset for partition oranges-X to offset 0. This happens for all partitions fine. However, effectively only the last partition is reset (9) and from time to time, if I get lucky the second one (1) too. All o
Hello so I've tried running this pip install -r requirements.txt command and the code I used was winpty python.exe -m pip install -r requirements.txt because my previous problem was the Permission Denied problem, and when I run winpty python.exe -m pip install -r requirements.txt command the system says says ERROR: Could not open requirements file: [Errno 2] No such file or directory: 'requirements.txt' in red font color, I've tried this previously with other gits and there was no problem, what could I have done wrong this time? is what Bash looked like when I ran the command I just covered so
I need to mock a static method. I know of two tools to help do this: PowerMockito and JMockit, both of which require usage of the @RunWith annotation. However, I've already used @RunWith for SpringRunner to set up some @Autowired dependencies, and it seems you can't use @RunWith twice. I see that PowerMockito has a PowerMockRunnerDelegate, which looks promising. But for various reasons, I'm stuck using JMockit for now. Is there a JMockit equivalent for this? I essentially need to mock a static method and set up @Autowired dependencies for my test at the same time.
I used curl in Joomla, curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data)); curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); curl_setopt($ch, CURLOPT_HTTPHEADER, array( 'Content-Type: application/json', 'X-API-KEY:' . $api_key, 'X-SANDBOX:' . $sandbox, )); but now I use HttpFactory for request to api: $options = array( 'Content-Type: application/json', 'X-API-KEY:' . $api_key, 'X-SANDBOX:' . $sandbox, ); $answer = $this->http->post($url,json_encode($data,true),$options); my result body is : Unsupported request content type application/x-www-form-urlencoded" why?
I would like to test a small React web app where I use the global fetch method. I tried to mock fetch in this way: global.fetch = jest.spyOn(global, 'fetch').mockImplementation(endpoint => Promise.resolve({ json: () => Promise.resolve(mockResponse) }) ); ... but the mock seems to be ignored, while the built-in fetch seems to be used: Error: connect ECONNREFUSED 127.0.0.1:80 ... looks like a failed call to the built-in fetch. I then tried to use jest.fn instead of jest.spyOn: global.fetch = jest.fn(endpoint => Promise.resolve({ json: () => Promise.resolve(mockResponse) }) ); ... and was surpris