All Questions
19,884,088
questions
0
votes
0answers
2 views
Why do I get AttributeError when I run this code?
from collections import Counter
import re
s = open( 'filename.txt', 'r')
words = re.findall('\w+', s.lower())
c = Counter(words)
for word, freq in c.most_common(10):
print(word, ':' , freq)
...
0
votes
0answers
2 views
Element implicitly has an 'any' type because expression of type 'string' can't be used to index type {“1” : { “key”: string}; “2” : { “key”: string};}
I have a json file of ids as keys as such
"1" : { "key": "value"},
"2" : { "key": "value"},
I import this json in my class as data object ...
0
votes
0answers
2 views
When I free a struct, the data inside other struct delete too - C
Ok so so i know what the problem is, i just don`t know ho to fix it.
The code is pretty simple.
I`m saving the data from pkt inside pk.
Now i want to add the data in pk inside QM_ptr (this is a queue )...
0
votes
0answers
7 views
Python: Is there a Walrus Operator for slices of an object?
My question is, in all of the walrus examples, they use the whole object for the boolean, e.g.
if (x := len(s)) > 5:
print(x)
converts
x = len(s)
if x > 5:
print(x)
Is there a way to ...
0
votes
0answers
3 views
Application not being terminated after Service's onTaskRemoved() called
I have a Service that, when the task is removed (User swipes app from recent's tray), the MyService.onTaskRemoved() gets called. That then triggers closing connections + cleanup, and calling of ...
0
votes
0answers
3 views
Syntax error on getting multiple range VBA
Here is part of my code:
For n = 0 To maxCol Step 1
studentRange = ws.Range(Columns(n) & curRow Columns(n) & classRange)
totalStudents = Application.WorksheetFunction.Count(studentRange)
...
0
votes
0answers
4 views
How can I read recent messages from my telegram account in python?
I am trying to read the recent messages from my telegram account to automate replies..
import configparser
from telethon.sync import TelegramClient, utils
config = configparser.ConfigParser()
config....
0
votes
0answers
8 views
can i use query Selector all in this circumstance
<head>
<style>
.hiddenanswer { display:none;}
</style>
</head>
<body>
<div id = "allquestions">
<div class="questions&...
0
votes
0answers
5 views
Fast alternatives for `element.clientHeight` and `element.offsetHeight`
I need the element.clientHeight and element.offsetHeight of an HTMLElement, but calculating it is very slow, and especially, it takes for about 3 seconds my big element! Is there a fast alternative ...
-1
votes
0answers
12 views
Por que consigo o resultado de print(me['name']) e de ranked['tier] não? E como resolver?
Estou tentando retornar apenas o tier de ranked, porém dá este erro:
print(ranked['tier'])
TypeError: list indices must be integers or slices, not str.
Como resolver?
from riotwatcher import ...
0
votes
0answers
7 views
Node js - public subfolder
I have a node Js server wich was working fine but now can´t serve a file in a public sub folder. My code is:
.use(express.static(path.join(__dirname, 'public')),bodyParser
Can get files in public ...
0
votes
0answers
5 views
Tkinter gui not returning value
I am making a python gui for machine learning model for my project and the code work just fine until Here, validateLogin_2 is not returning any value and everything else is working just fine. Can ...
0
votes
0answers
4 views
How to change autocomplete highlight color in Rider
I am using Gruvbox Dark Hard Theme
The color of text that matched the autocomplete is almost invisible
How do I change the foreground color of this matched text?
I have also found some solution ...
1
vote
0answers
7 views
Protecting read/write access to/from a file from multiple threads
This is a follow on from a previous question here - I received some wonderful advice that helped me move my code along. For the next piece of the puzzle, I figured it warranted a new post - I hope ...
0
votes
0answers
7 views
How to get all dates up to a certain date?
I have a list of dates in python for example
dates = ["01/03/2010", "02/11/2010", "05/12/2010", "21/12/2010"]
in dd/mm/yyyy format. Then I have a cut-off date &...
0
votes
0answers
5 views
GeometryReader behavior in SwiftUI
I know that GeometryReader takes all spaces available
but Why they anchored theirs contents(child views) to topLeading corner?
This is my code
struct ContentView: View {
var body: some View {
...
0
votes
0answers
5 views
Save and delete UIImages from UIImagePickerController using iOS file system
I have a UICollectionView that uses a UIImagePicker. I want the filesystem to create a folder in "Documents" and save/delete the UIImages in it. The photoArray is currently what the ...
0
votes
0answers
8 views
Type 'URL' is not assignable to type 'string'
I'm getting this error. No idea from where.
theultimateprepper-api | Warning Implicitly using master branch https://deno.land/std/node/_fs/_fs_readlink.ts
theultimateprepper-api | Check file:///app/...
0
votes
0answers
5 views
Apache - Using ScriptAliasMatch to serve the home page for different URL paths
I have a website that uses Apache. In that website, I can go to mywebsite.com/2020/Summer/1 and my Angular code should process the 2020/Summer/1 part. It's not like a directory or anything, it's just ...
0
votes
0answers
3 views
HighCharts: Want to use different Data source during hc_tooltup building than data source used in X and Y axis in my R Shiny App
I want to use different data source while building hc_tooltip in my Line type Highchart. Its a custom tool tip. So just to summarize in case I am using dataSource1 in my hc_add_series like this ...
0
votes
0answers
4 views
How to reduce video size with Java's Monte Screen Recorder
I'm recording my screen using Monte Screen Recorder, but the output files are huge. I think I could reduce the file size using MP4 H.264 or maybe turning the video bit rate down somehow. However, I ...
0
votes
0answers
5 views
Laravel cviebrock/eloquent-sluggable put @ as prefix or filter it in route
Laravel version 7.0, I am using cviebrock/eloquent-sluggable package.
What I want is to put @ as prefix to the username.
I included Sluggable trait in User model and set like this.
public function ...
0
votes
0answers
4 views
MonoGame / VS - PNG as Texture2D displaying as wrong color?
I'm using MonoGame in Visual Studio 2019 for Mac.
I was following this Microsoft tutorial to make a little iOS program where a character walks toward wherever you touch.
I completed the tutorial and ...
0
votes
0answers
7 views
How to predict a winner in a 5v5 game using tensorflow?
I have data from a 5v5 player game that looks like this:
map1,ally1,ally2,ally3,ally4,ally5,enemy1,enemy2,enemy3,enemy4,enemy5,winner
For example:
Jaguar Falls,Androxus,Tiberius,Khan,Jenos,Seris,Inara,...
0
votes
0answers
6 views
How to not refresh a page when a button is pressed
I have been working on a like/unlike function on my django project in which a user can like like a post and if so the user can dislike it like in instagram. Now to finish with this part of the project ...
0
votes
0answers
5 views
How do I put my output print the keywords* in alphabetical order (abc) instead of backwards(zyx)? This is a binary search tree implementation in java
class bst{
Node root; // a Node object
public class Node{
String keyword;
Record record;
int size; //number of keywords
Node l; //left node
Node r; //right node
private ...
0
votes
2answers
12 views
Filter with Combining and Negating Conditions with AND, OR, and NOT in T-SQL
I want to filter the table based on some combination of conditions. Please refer the below code:
SELECT COUNT(*)
FROM #New
WHERE (
(
ClientSource_No <> 283
...
-1
votes
0answers
7 views
Adding a prefix parameter to an array parameter
I am trying to add a prefix to an array, and they are both parameters in a function. the array has 10 items and I need, in each item, to add the prefix to the item of the array. Then, I need to return ...
0
votes
0answers
5 views
How Class can change another class implementation without inherit it
I am trying to pass OCP 8 and I face this code which can override a class method on the fly as it treats it as abstract or interface
package xxx.xxx.ClassC;
public class ClassC{
public void print()...
0
votes
0answers
5 views
Why is this .responseToString function saying that it isn't a function?
So I have a Typescript interface IResponse:
interface IResponse {
responseToString(): string;
}
export default IResponse;
I then have 2 classes implementing it, RestResponse and HTMLResponse:
...
0
votes
1answer
14 views
Is this gradient design the entire background image or a separate image in CSS?
I'm trying to recreate a website with these type of designs, but I can't figure out if this is a fixed background image and they just positioned the logos inside of it, or is this a separate image ...
0
votes
0answers
9 views
laravel with sqlite ignore value of column when use where() function
laravel with sqlite ignore value of column when use where() function like this
User::where('id', 22)->first();
the value (22) of id is ignored and sql statment show as below after using DB::...
0
votes
0answers
8 views
How to find the center point of Transform Rotate when animating with CSS?
I'm trying to make a menu that rotates 45 degrees when hovering, should get bigger in height and should also stay in the original center point. I got all of that done expcept for the div staying in ...
0
votes
0answers
7 views
Assistance needed to solve the issue with Maven shaded plugin issue whenever sonarqube dependencies are added
If any one can help I am facing a strange issue, when ever I add the command for sonarqube analysis along with some edits to to POM files
<groupId>org.sonarsource.scanner.maven</groupId>
...
0
votes
0answers
7 views
Is it possible to customize sankey node width in plotly?
I've been trying to modify sankey default node width with no results.
Thanks!
0
votes
0answers
5 views
How do you move rust snafu error enum into a module and use it from another module?
I'm breaking up a huge file into modules, things worked before I broke it up, now the Snafu error handling won't compile.
util.rs:
#[derive(Debug, Snafu)]
pub enum Error {
#[snafu(display("...
0
votes
0answers
5 views
how to fix the php 500 internal server error? trying to connect to database
I am trying to create a user account system using a database on my new website, but I keep getting this error:
GET https://www.myurlname.com 500 (Internal Server Error)
also, I am using GoDaddy Cpanel ...
0
votes
0answers
3 views
potato quality audio coming from bot
When I play audio through my bot it sounds really bad, I have a fast internet connection, so what could be causing this? Im running my bot on a Raspberry Pi 3. Im using FFMpeg. Could the RPI be ...
0
votes
0answers
10 views
Center a grouped bar chart in R (ggplot2)
So I'm making a group bar chart about the prevalence of pre-existing conditions among age groups. As expected, younger people do not have as many conditions as older people, so there are some groups ...
0
votes
0answers
4 views
Spring start failed only Debian OS
I've Spring App. When I run it local MacOS app sucesful start. But if I try start it on Debian 9 then I get error with it description.
MacOS:
java version "1.8.0_181" Java(TM) SE Runtime ...
0
votes
0answers
6 views
Check if a component is an instance of React.ReactElement<any> in a child map
I have a component that loops through children and wraps them in a div. I am trying to add an exclusion to that, but running into an issue where I can't check if the child is a ReactElement or not (...
0
votes
0answers
4 views
Kitura gives me ambiguous type of expression in nested structs
Im starting with Kitura framework to migrate my current node.js backend to swift and im starting by implementing all the routes with mocked data.
Im working with raw routes because i find them more ...
0
votes
0answers
3 views
Can't uninstall Android studio; All files got moved around
when trying to update android studio to the latest folder, I somehow got all the files moved around. Now android can't be uninstalled or reinstalled. I tried to move the files back, but it comes up ...
0
votes
1answer
13 views
Sort a nested list in python
I am trying to sort a nested list in Python in O(n log n) time. I am not sure how to go about it, some help would be appreciated. The inner lists are being sorted by its sum.
My list:
[10, 7, [4,5], [...
0
votes
0answers
5 views
i tried all available solution but still cant find the proper solution. i got the error while building react native application
FAILURE: Build failed with an exception.
What went wrong:
Could not determine the dependencies of task ':app:installDebug'.
java.io.IOException: The filename, directory name, or volume label syntax ...
0
votes
0answers
13 views
loop with moving dataframe filter
I want to loop a filter over a data set. For context my data looks like this:
I want a moving filter for loop which incrementally increases by 1 and prints One h per all the day in each numpy array ...
0
votes
0answers
12 views
How to manage special cases?
I have some function that needs to return a non-negative integer after doing some calculation. However, there is some special cases where this calculation is not possible. I decided to "flag"...
-2
votes
0answers
9 views
How can I avoid overriding an existing pyserial connection?
I'm trying to connect several physical devices via USB interfaces on a Raspberri Pi 4. I've created a class for each device. The constructor scans the USB ports to determine where the device is, e.g.
...
0
votes
0answers
5 views
Typescript Mocha Testing, How to solve TypeError: is not a function?
Currently I have the following class:
import * as winston from 'winston';
const { combine, timestamp, printf, label, json} = winston.format;
import {isEmpty, isNil} from 'lodash';
import {Log} from './...
1
vote
0answers
16 views
How does this Math.random() code work when used with brackets?
What is the order of operation in this code?
Does it start with the brackets, then multiply the result by the value generated by Math.random() then finally it adds the min variable?
function randTime(...

