Recent Questions - Stack Overflow |
- Cycles in a graph
- how to open a python project from anotther project
- Change SVG attribute (width, height, viewBox, and transform) to remove padding from the inner drawing
- tesseract not found error occuring in IDLE but not in terminal...I am very confused as to why
- Python String object does not support error
- Printing a 2 bytes packet
- How to run unit tests against a go web app?
- '<>' cannot be used with anonymous classes
- Problem with docker installation on 32 bit machine
- Label text out of frame in Tkinter
- What is the Time and space complexity of this Sorting Technique? Analyze it
- Is it possible to use Policy-based authorization in a Hosted Service?
- Firebase database set objects in favorite list
- Sum of all nodes in a binary tree giving incorrect output in JavaScript
- Transform this HTML/CSS/JS CODE to a React Component
- How is the result of the query using both filters in MongoDB even though only one is ever passed due to the if else statement?
- Cannot read json file downloaded from s3 bucket
- Can't put a space between output and input on the same line
- GET request gives 404 error express js even though I have a well defined route in my express server
- How to properly return null/empty object in C++?
- How to filter out number and . from text using Excel formula in excel
- Combine: rowwise(), mutate(), across(), for multiple functions
- How do I handle an error ''list index out of range" as an exception?
- Find intersection between a mask and a texture picture in python
- Firebase Realtime Rules: Allowing multiple Users Access to Data
- Is a good practice having a virtual environment in a different folder with python? [closed]
- Fast algorithm for sum of steps taken by the Euclidean algorithm over pairs of numbers under an upper bound
- C++ Display Character with Ansi Color Code
- ionic 5 (capacitor) gives NullInjectorError empty object Magnetometer can not access ionic-native functionality,
- How to use Amazon SNS api with c
Posted: 01 May 2021 08:09 AM PDT I have to find an algorithm that prints the number of cycles in a graph. the following example should print that the case only 1 cycle. |
how to open a python project from anotther project Posted: 01 May 2021 08:09 AM PDT I am trying to make a python3 project which is a personal assistant and when computer asks the user to choose what they would like: a calculator, email sender or the weather. i made separate projects for each of the functions the user could use and in my main project I want to open them up so the computer could run it. I tried using os.system because I read that somewhere but I don't really know how ,here is the code: please answer fast I need the help as soon as possible |
Posted: 01 May 2021 08:09 AM PDT I have an SVG (https://drive.google.com/open?id=1SBA2Xsi228agUO65FmtLwjg6Zuoq59-5) which is shifted. I have tried to change parameters such as width, height, viewBox, and transform attributes. I do not have a clear understanding of this area and it is not as simple as I estimated. I need to draw only the below part and remove the padding. |
tesseract not found error occuring in IDLE but not in terminal...I am very confused as to why Posted: 01 May 2021 08:09 AM PDT I am working on some OCR and chose to use tesseract as the library. So, I installed it using the pip command in the terminal and when I tested the library with a sample image it seems to be working fine(in the terminal). I have no idea why it wouldn't work in IDLE and python versions of the idle and terminal are the same down to the exact detail. Can someone help me with this? thanks! |
Python String object does not support error Posted: 01 May 2021 08:09 AM PDT I am learning python and while i was working on this exercise... student_scores = input("Input a list of student scores here ") for n in range(0, len(student_scores)): student_scores[n] = int(student_scores[n]) print(student_scores) highest_score = max(student_scores) print(highest_score) i got the below error: line 5, in student_scores[n] = int(student_scores[n]) TypeError: 'str' object does not support item assignment |
Posted: 01 May 2021 08:09 AM PDT There is a 2 bytes packet. And first 5 bits represent version, next 5 bits represent type and the last 6 bits represent value. And I am passing the packet as char* to a function(print_pak). And in that function I want to print the packet version, packet type and packet value. How can I do that? void print_pak(char* pak) { } |
How to run unit tests against a go web app? Posted: 01 May 2021 08:09 AM PDT What is the best way to run tests against a sizable web app? i.e. the app is web-based and the tests are command-line based. The web app starts and has lots of handlers, background daemons, etc. I'm trying to test the underlying code. Not the HTTP requests etc. |
'<>' cannot be used with anonymous classes Posted: 01 May 2021 08:09 AM PDT I moved my project in a new project with different foldels named (root\Model, rood\View, root\Control) The source moved from the old project has been moved all in "Model" folder. The source code is identical, in first project works propertly and in second project an error happened: "'<>' cannot be used with anonymous classes". The differences between first project and second project are just "subfolders" for classes and package on the top. Any suggest? Thanks |
Problem with docker installation on 32 bit machine Posted: 01 May 2021 08:09 AM PDT I've successfully installed docker on my Debian i686 machine with command |
Label text out of frame in Tkinter Posted: 01 May 2021 08:09 AM PDT I have the following issue. I created a frame with a scrollbar in tkinter. The frame has a label which takes information from a json file and it loads it there. Here's the code: The problem is that when a sentence is too long, it gets out of the frame, which is weird because I thought that these labels had an automatic system to detect when it gets out of the frame. Here's an example: The program took this text from the json file: What am I doing wrong? Thanks in advance! |
What is the Time and space complexity of this Sorting Technique? Analyze it Posted: 01 May 2021 08:09 AM PDT
|
Is it possible to use Policy-based authorization in a Hosted Service? Posted: 01 May 2021 08:08 AM PDT I have a ASP.Net Core 3.1 API that uses Policy-based authorization. The authorization is made in Authorization Handlers in a class library. I check authorization like this: Above code works fine in ASP.NET Core. But if I use the same code from a console app (Generic Host/Hosted Service) the handler is never called. I have registered the handler: and in the serviceCollection and I have called: The AddAuthorizationCore extension is located in a ASP.NET Core assembly so I guess it only works when using ASP.NET, not a Console app. Does anyone know if it is possible to use Authorization handlers in a console app? |
Firebase database set objects in favorite list Posted: 01 May 2021 08:08 AM PDT I have a problem clearing list in fragment. I need to clear the list when happening update in fragment. I already put it in different places but it does not help me. When update happens in fragment it show same list but that list also add elements from previous list. If I put list.clear(); in moment when it rakes arguments from firebase it did not give me needed effect, when I put it in onCreate() method then app give me error . } |
Sum of all nodes in a binary tree giving incorrect output in JavaScript Posted: 01 May 2021 08:08 AM PDT I am trying to solve the following problem. Problem statement: Given a binary tree, return the sum of the depth of all the nodes. For example, this is a binary tree. The depth of the node with value 2 is 1. Similarly, the Depth of node with value 4 is 2 etc... The total depth of all nodes is 16. I have written the following recursive solution which is giving me the incorrect output. My pseudocode is as follows : The code is as follows; My output is 22 but the correct output is 16. I am not understanding where I am getting wrong. Any help in understanding the problem, would be appreciated. Thanks in advance. |
Transform this HTML/CSS/JS CODE to a React Component Posted: 01 May 2021 08:08 AM PDT Can anybody help me convert this to a React component, I've been on it for hours with no hope of success. I'm relatively new to react and this has been particularly difficult for me. Sorry, and Thanks in advance. Can anybody help me convert this to a React component, I've been on it for hours with no hope of success. I'm relatively new to react and this has been particularly difficult for me. Sorry, and Thanks in advance. Can anybody help me convert this to a React component, I've been on it for hours with no hope of success. I'm relatively new to react and this has been particularly difficult for me. Sorry, and Thanks in advance. |
Posted: 01 May 2021 08:07 AM PDT So here's the code in question. I thought since it has if statements for each filter, it will only filter by one parameter, that being the one it finds first and skips the rest but when it actually makes the query later in the code somehow both filters are applied in the response. Am I missing something? Even console logging while calling it with two parameters results in only one property in the query object. |
Cannot read json file downloaded from s3 bucket Posted: 01 May 2021 08:09 AM PDT For context, I have a json file that I am reading in with the following code: Then, I modify this list based on some other information: I know that this del call is actually working properly because I can see the actual json file being modified. Then, I update this file in the bucket through these lines Reading the json file before updating the file works completely fine. Additionally, I can read from the json file if it is stored locally. However, in the case that I download the json file immediately from the bucket, the program crashes on Additionally, I've tried replacing the text in the downloaded json file with exactly what's in the local one, and it still crashes so I believe it is some file type issue with the S3 bucket. |
Can't put a space between output and input on the same line Posted: 01 May 2021 08:08 AM PDT After printing, if I write the name I get:
There is no space before John, even if I put the space in the output. How can I add a space before writing the name? |
GET request gives 404 error express js even though I have a well defined route in my express server Posted: 01 May 2021 08:08 AM PDT I am using Jquery's ajax request to get a JSON object from the server however when the request is invoked it gives a 404 error that looks like this:
As far as I am concerned all is done according to standard which is CRUD = Create:POST, Read:GET,Update:PUT and delete: DELETE. Please let me no of anything in my execution is wrong Here is the get request: This is the server side code: |
How to properly return null/empty object in C++? Posted: 01 May 2021 08:09 AM PDT I am Java developer and trying to solve a simple C++ task. In Java, if I want to return an empty/null object, to indicate that object is not found I just return null. Example: In C++ I have the following method It seems that if I declare a method like the above, returning NULL is not an option since the method doesn't return a pointer but rather a class. So what do I return to indicate that no person is found ? |
How to filter out number and . from text using Excel formula in excel Posted: 01 May 2021 08:09 AM PDT I have the following text cell values: I have written the below formula, but not able to filter the required data (starting cell no.: B2): Can anyone help me out with this! Expected Result: |
Combine: rowwise(), mutate(), across(), for multiple functions Posted: 01 May 2021 08:09 AM PDT This is somehow related to this question: In principle I try to understand how I have learned that Now with my actual case: I was able to do this task but I loose one column My df: Works not: Works, but I loose column |
How do I handle an error ''list index out of range" as an exception? Posted: 01 May 2021 08:07 AM PDT The thing is , that I am given some code and it is structured this way that we expect some accesses to not - initialised elements in the list. (I don't want to change the logic behind it, because it deals with some math concepts ). But I've been given the code in some other language and I want to do the same with python (handling this exception and let the program run). I then tried something else (after reading a similar stack overflow post) As you can see the error , persisted. |
Find intersection between a mask and a texture picture in python Posted: 01 May 2021 08:09 AM PDT I would like to find the intersection between my mask that it's like this: And the textured image: I wanted something like this, but without the blue line (it's just to see more the difference) and without the info in the borders: Thanks!!!! EDIT: That's my code by now: The problem is that the find_intersection function returns me this: It's gray with no texture, and what I need is the texture... |
Firebase Realtime Rules: Allowing multiple Users Access to Data Posted: 01 May 2021 08:08 AM PDT So I have my Database structured like this, the owner gets set when the group is created and the owner the should have the permission to add other Users to allowed so they can access and edit the data too. So my attempt were these rules but they dont work when I use the playground feature with a saved uid under owner or allowed: And would a User still be able to create a new group when these rules would work? Pictures of the Database and Errors: |
Is a good practice having a virtual environment in a different folder with python? [closed] Posted: 01 May 2021 08:08 AM PDT Is it any good having venv folder in a separated folder outside our project ?? I have google drive and always when I create new virtual environments I think it is a waste of storage when syncing it there. I'm thinking of creating virtual enviroments in a different folder which won't sync. |
Posted: 01 May 2021 08:08 AM PDT Note: This may involve a good deal of number theory, but the formula I found online is only an approximation, so I believe an exact solution requires some sort of iterative calculation by a computer. My goal is to find an efficient algorithm (in terms of time complexity) to solve the following problem for large values of n: Let R(a,b) be the amount of steps that the Euclidean algorithm takes to find the GCD of nonnegative integers a and b. That is, R(a,b) = 1 + R(b,a%b), and R(a,0) = 0. Given a natural number n, find the sum of R(a,b) for all 1 <= a,b <= n. For example, if n = 2, then the solution is R(1,1) + R(1,2) + R(2,1) + R(2,2) = 1 + 2 + 1 + 1 = 5. Since there are n^2 pairs corresponding to the numbers to be added together, simply computing R(a,b) for every pair can do no better than O(n^2), regardless of the efficiency of R. Thus, to improve the efficiency of the algorithm, a faster method must somehow calculate the sum of R(a,b) over many values at once. There are a few properties that I suspect might be useful:
Because of the first two properties, it is only necessary to find the sum of R(a,b) over pairs where a > b. I tried using this in addition to the third property in a method that computes R(a,b) only for pairs where a and b are also coprime in addition to a being greater than b. The total sum is then n plus the sum of (n / a) * ((2 * R(a,b)) + 1) over all such pairs (using integer division for n / a). This algorithm still had time complexity O(n^2), I discovered, due to Euler's totient function being roughly linear. I don't need any specific code solution, I just need to figure out the procedure for a more efficient algorithm. But if the programming language matters, my attempts to solve this problem have used C++. Side note: I have found that a formula has been discovered that nearly solves this problem, but it is only an approximation. Note that the formula calculates the average rather than the sum, so it would just need to be multiplied by n^2. If the formula could be expanded to reduce the error, it might work, but from what I can tell, I'm not sure if this is possible. |
C++ Display Character with Ansi Color Code Posted: 01 May 2021 08:09 AM PDT I can use ANSI color codes for strings like this: but not for individual characters that I have assigned as part of my 2D array of characters. My goal is to display: in a specific color. I have tried: and also The first gives an error because my array is of character data type, so I can't assign it to a string element. The second doesn't work because the ' ' is meant for single characters, and the ANSI code has more than one character. Any suggestions? This needs to transfer onto Linux by the way (on Terminal on my mac). |
Posted: 01 May 2021 08:07 AM PDT NullInjectorError: No provider for Magnetometer My goal is to read sensordata, like magnetometer. Using Ionic 5, Angular, capacitor android. You can find my project at https://github.com/kpproce/ionicMagnoMeter I can't get access to the magnetometer, because the object is empty. I did manage to access the camera, but this is standard available in the web version also... I understand that the magnetometer probably doesn't exist in the web app version. There are many instructions about plugins, but could not get them working followed instructions: https://ionicframework.com/docs/native/magnetometer To prepare: In the terminal VScode: Code used: ... export class HomePage { |
How to use Amazon SNS api with c Posted: 01 May 2021 08:08 AM PDT I have not been able to find documentation on how to use Amazon SNS API from just c. Can someone point me in the right direction? Is there a c build of the API or do I build from source? If so, how? I intend to use it with borland c++ compiler from command line. |
You are subscribed to email updates from Recent Questions - Stack Overflow. To stop receiving these emails, you may unsubscribe now. | Email delivery powered by Google |
Google, 1600 Amphitheatre Parkway, Mountain View, CA 94043, United States |
No comments:
Post a Comment