Recent Questions - Stack Overflow |
- How to do class balancing with Pandas?
- Script. Delete temp mozilla firefox
- React multicheckbox how can I set defaultCheck?
- How do automatically measure memory consumption during the tests in VisualStudio?
- Send email when Appwrite database gets update
- I don't know how to fix it ;/
- Search through laravel relationship with filtered date
- Refresh token is working, but showing error message- React Native
- Redis multi Key or multi Hash field
- Is it possible to somehow define create_thread in PyCord
- Undefined reference errors in Qt Creator | OpenCV
- React - Module not found, For packages inside the installed packages, when requirting express
- Use CSS filter: invert(1) to show black image on white background
- How i can positioning the placeholder in the dropdown MultiSelect input (photo below)
- What actually is int in int main void in c?
- Determining types of memory used by Spring Boot application causing an OOM kill
- Laravel exception while checking if a collection is empty
- C# Foreach Usage
- How to load an external font in p5js?
- Problem : Delete PVC (Persistent Volume Claim) Kubernetes Status Terminating
- How to create a dropdown menu with sections? [duplicate]
- CdpVersionFinder findNearestMatch WARNING: Unable to find an exact match for CDP version 100, so returning the closest version found: 99 with Selenium
- Use dropdown selection in URL
- Sending push notification to windows 10 systems
- How to automate outlook with python [closed]
- Regex to match emojis that can be validly combined with skin tone modifiers?
- How to disable clicks on DotView?
- Multiple records update validation with the entire data set
- How can create merge adapter class in android kotlin
- Android: Issue with transparent activity
How to do class balancing with Pandas? Posted: 19 Apr 2022 02:57 AM PDT I have 2 classes, 0 and 1. I have a csv file with header "sentence,label". The problem is that my dataset is not balanced at all. It has 1000 1's and 9000 0's. I would like to have almost the same number of rows with each class. Is there any way in Pandas that does that? For example, one of the ways would be to copy each row of label 1 multiple times, but I do not know how. I would like to have a most possible balanced dataframe at the end. |
Script. Delete temp mozilla firefox Posted: 19 Apr 2022 02:57 AM PDT The point is that I have to create a script for my school that deletes all the temporary ones from Mozilla Firefox, with a batch script in Windows 10. The most complex thing about this is that the mozilla path has a folder that has a different "Prefix" on each computer, in my case it is wvbrz602.default-release. (Ruta completa sería: C:\Users\dmarmol\AppData\Local\Mozilla\Firefox\Profiles\wvbrz602.default-release) What I have done has been a loop that iterates for each user and stores it in the variable in which it iterates "%%a" In this way I obtain each user, once each user is obtained, I do a dir obtaining the prefix of the containing folder of the Firefox profile of each user in a .txt document (Since the prefix is different for each user) After that prefix obtained in the .txt of each user I add it to a variable (The problem is that, apparently they don't like it) And finally I make a del of the temporary of each user. This is my code: *@ECHO on SETLOCAL EnableDelayedExpansion rem TASKKILL /F /IM mozilla.exe /T for /f %%a in ('dir c:\Users /b') do>%%a.txt ( dir /b "C:\Users%%a\AppData\Local\Mozilla\Firefox\Profiles*.default-release" set /p contenedorFor=<"%%a".txt del C:\Users%%a\AppData\Local\Mozilla\Firefox\Profiles%contenedorFor%\cache2 ) exit /b 0* I show a snapshot of the exit the code. https://i.stack.imgur.com/Lfe2p.png I hope can find the solution with they help. :) Regards. |
React multicheckbox how can I set defaultCheck? Posted: 19 Apr 2022 02:57 AM PDT I have a from 2 steps. Second step is about options about car. I have multi checkboxes. When I changed to page to first and then again second, I want to see checked which I choosed firstly. When I click to back button I saved array of checkboxes to localStorage. I used useEffect to get them, and then I used it for defaultCheck. It is working. When I add new option, it is working, updating array. NO. when I want to remove defaultChecked, array is not updating. Could you help me about it? |
How do automatically measure memory consumption during the tests in VisualStudio? Posted: 19 Apr 2022 02:56 AM PDT I have a lot of tests based on the Google Test framework. All tests were built in Release mode, and when I manually run the separate test under the "Visual Studio" on "Diagnostic Tool Window" (Ctrl+Alt+F2) in the "Process Memory" chart I can see the maximum heap memory consumption. Is there exist way, to log memory consumption automatically for each running test? All I need to know is the maximum amount of memory that each test used during the execution. |
Send email when Appwrite database gets update Posted: 19 Apr 2022 02:56 AM PDT How to trigger notification on Appwrite when a record is added to my database? The same function exists in Firebase, but in the paied plan . |
Posted: 19 Apr 2022 02:56 AM PDT let target; (!args[0]) ? (target = message.member) : (target = message.mentions.members.first() || message.guild.members.cache.get(args[0])) if (!target) { const uzy = await message.guild.members.fetch({ query: console.log(target.user.tag) Cannot read properties of undefined (reading 'tag') |
Search through laravel relationship with filtered date Posted: 19 Apr 2022 02:56 AM PDT i search data 1 (this exist in database) within date range of 13-04-2022 to 14-04-2022 (there is no data in this date range). From this query that i used on my controller still return the data that contains a keyword that i search for (data 1). What i wanted is to return collection of data with the range of the date filter (which is nothing since i dont have any data from that date range). How to solve this problem? is there any best practices that i could implement for this search within the filtered date? this is my back-end : this is my sql |
Refresh token is working, but showing error message- React Native Posted: 19 Apr 2022 02:56 AM PDT I am struggling to find out the issue with my refresh token mechanism. I have a some problem that I can't fix. Refresh token is working, but it showing an alert 'somthingWentWrong' but the application is still in a good state and working properly. Here is my code, please tell me where is my mistake? } }; }; |
Redis multi Key or multi Hash field Posted: 19 Apr 2022 02:56 AM PDT i have about 300k row data like this Session:Hist:[account] Session:Hist:100000 Session:Hist:100001 Session:Hist:100002 ..... Each have 5-10 childs [session]:[time] b31c2a43-e61b-493a-b8d4-ff0729fe89de:1846971068807 5552daa2-c9f6-4635-8a7c-6f027b4aa1a3:1846971065461 ..... I have 2 options:
My Redis have 1 master, 4-5 Slave, so the question is which options is better for performance, thanks for your help! |
Is it possible to somehow define create_thread in PyCord Posted: 19 Apr 2022 02:56 AM PDT Hello I encountered the error 'Message' object has no attribute 'create_thread' Code: |
Undefined reference errors in Qt Creator | OpenCV Posted: 19 Apr 2022 02:56 AM PDT I linked OpenCV to Qt Creator with the help of this guide. However while compiling a simple code to read and display the image, I am getting undefined reference errors.
These are the errors I am getting while building the file. Using Windows 10, MinGW 7.3.0 32-bit C and C++ compiler. |
React - Module not found, For packages inside the installed packages, when requirting express Posted: 19 Apr 2022 02:56 AM PDT Hello I tried to install the express package in a react project But when I import the package inside the app.js using: I get 30 errors all saying where x are differnt packages like This is the app.js code when I run it without the require line it works fine And inside my I even tried to create a new blank project for this and I had the same problem |
Use CSS filter: invert(1) to show black image on white background Posted: 19 Apr 2022 02:57 AM PDT I have a circle graphics to span across half black & half white background color generated by CSS. I would like to have the effects that the colors in the area of the circle covered turns white to black, and turns black to white (invert the color). The effects should look like this: However, the white background color side is incorrect right now. How can I modify the codes in order to make the white area covered by the circle turns black? p.s. in the real scenario, the circle will be replaced by a complex shape. Here is the snippet: |
How i can positioning the placeholder in the dropdown MultiSelect input (photo below) Posted: 19 Apr 2022 02:57 AM PDT Figma drop down multiselect design above jsx layout code react, thanks for any ideas It is possible to change the position depending on the number of selected items |
What actually is int in int main void in c? Posted: 19 Apr 2022 02:57 AM PDT What actually does |
Determining types of memory used by Spring Boot application causing an OOM kill Posted: 19 Apr 2022 02:57 AM PDT I have a container running on Kubernetes with a Spring Boot application. The code configures a few REST controllers and saves some data to an H2 file through JPA. I'd say the main dependencies here are:
When monitoring memory utilization, I can see that it is increasing very slowly and eventually causes an OOM kill. Some relevant configuration of the container/JVM:
I extracted some Prometheus metrics when the container first started: And also after the container had been running for about a week: From these, it seems to me that there's no leak in the memory managed by the JVM. I also checked I can only guess that something is using native memory in the JVM (no other process is running inside the container), but is there any way I can determine if this is the case? |
Laravel exception while checking if a collection is empty Posted: 19 Apr 2022 02:56 AM PDT In my laravel application I'm trying to check if a collection is empty. I am using laravel's But when I try to run this, it gives me following exception...
How can I check if this collection is not empty? I'm using laravel 9 Update My companies collection looks like this |
Posted: 19 Apr 2022 02:56 AM PDT I want to use 2 variables and iterate over different objects with a single line foreach, If I wanted to do it with python I could use as follows. but I want to do the same thing with c#, how can I do it? |
How to load an external font in p5js? Posted: 19 Apr 2022 02:56 AM PDT I tried changing the font in P5.js to a Minecraft font, like in the reference with My code: Now the problem, when I'm trying to load Index.html, it's just showing "Loading..." and in the console it's printing out three error messages: Access to XMLHttpRequest at 'file:///C:/Users/User/Desktop/p5jsProjects/test/MinecraftRegular-Bmg3.otf' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, chrome-untrusted, https. Font could not be loaded ./MinecraftRegular-Bmg3.otf GET file:///C:/Users/User/Desktop/p5jsProjects/test/MinecraftRegular Bmg3.otf net::ERR_FAILED Does anyone have an idea how to fix this, or how I can load a font differently? Edit: I don't want to make my own web server or something, because the code is on my own pc. And I think I will have to start the web server when ever I start my pc, to just visit my website. Also, I tried uploading the font file to google drive and then using the download link in 'loadFont()'. Then the console is saying, that: |
Problem : Delete PVC (Persistent Volume Claim) Kubernetes Status Terminating Posted: 19 Apr 2022 02:57 AM PDT Basically, I have a problem deleting my but I get every time the same Terminating Status. Also, when I delete the PVC the console is stuck in the deleting process. Capacity: 10Gi Storage Class: rook-cephfs Access Modes: RWX Here is the status in my terminal:
Thank You for your answers, Stack Community :) |
How to create a dropdown menu with sections? [duplicate] Posted: 19 Apr 2022 02:56 AM PDT |
Posted: 19 Apr 2022 02:57 AM PDT I created a bunch of scripts which worked fine in December 2021. I'm running them now and a few of them execute and pass but suddenly the execution stops and it shows the scripts are failed and skipped as follows: Maven dependency: My chrome version is 100.0.4896.127 Chrome driver version is 100.0.4896.60 Appreciate if anyone could help. |
Posted: 19 Apr 2022 02:57 AM PDT I'm following the answer here to use the selection from a dropdown in a URL. I am using asp.net core, using: To do the redirect The script below (from the link above) works great, except if you select an item from the dropdown then select a different one (and on and on), it appends both to the URL. I tried scrubbing the parameter in question (using params.delete) but it's not working: Is there a way to get the above script to work how I envision, or a better way to do this? Thank you |
Sending push notification to windows 10 systems Posted: 19 Apr 2022 02:56 AM PDT i want when a certain logic is met on a server for it to send toast notifications to multiple workstations on a closed lan using python. I am able to easily generate toast notifications on a system locally using win10toast but i want to able to send the notification over a local network to another system. So from what i have understood, i have to use wns, i did find python-wns but it is really light on explanation, if there is a good write up of how to use it that would be excellent. is there another package better suited for this. my other idea which for some reason seems really dumb but might work is, on all the workstations have them check a file on the server constantly as soon as the file gets populated, just do a local toast.(i am not sure why this is dumb but feels like it) |
How to automate outlook with python [closed] Posted: 19 Apr 2022 02:56 AM PDT I need to respond to an approval email which sent from power automate approval action. Any advice. |
Regex to match emojis that can be validly combined with skin tone modifiers? Posted: 19 Apr 2022 02:56 AM PDT The JS code to detect emojis (in the usual sense of the term "emoji") is simply: Is there some equivalently simple way to detect emojis that can have skin tone modifiers validly added to them? A key requirement is that I don't have to update the regex over the years as more emojis are added, or existing emojis become skin-tone-able. Basically I'm wondering if there's something like a Notes:
|
How to disable clicks on DotView? Posted: 19 Apr 2022 02:56 AM PDT I am using a custom view from here. I want to disable user interactions with the view pager 2 using this: But, it moves when I click on a dot of that view. I tried to disable that using this: But, that does not seem to work. Then how can we disable clicks on it? |
Multiple records update validation with the entire data set Posted: 19 Apr 2022 02:57 AM PDT Currently, I have an endpoint that allows the update of multiple records. Before saving the changes to the database I need to validate the data that is being sent from the front end. I am having an issue with some kinds of validations that require checks against all the other records in the database table. (Ex: ate intervals overlaps/gaps, unique pairs checks). In these cases when I try to do the validations I have two sets of data
For the validations to be run correctly I need a way to merge the data in memory(the updated records) with the data in a database(original records + other data that is not currently being updated). Is there a good way of doing this that does not require loading everything on the memory and merging both datasets there? Another idea I am thinking of is to open a database transaction set the new data to the database and then when executing the gaps/overlap check queries use dirty read. I don't know if this is a good approach though. Extra notes: Another example In database I have these records saved: |Id| StartDate | EndDate | |-| -------- | -------------- | |1| 06/01/2022| 09/01/2022 | |2| 16/01/2022| 20/01/2022 | I need to check if there are any gaps between the dates. If there are I need to send a warning to the user(data in the database can be invalid - the application has old data and I can't do anything about that at the moment). The way I check for this right now is like by using the SQL below Using this SQL query when validating the third row (12/01/2022 - 15/01/2022) there will be a gap between dates 09/01/2022 and 12/01/2022. This issue would be fixed if instead of using union with a single row, to use it with all the rows send from the front-end but I can't figure out a way to do something like that. |
How can create merge adapter class in android kotlin Posted: 19 Apr 2022 02:56 AM PDT How can create merge adapter class in android Kotlin i have two class one class contain header other class contain image card how can create merge adapter class in kotlin Movie card adapter Header adapter fragment |
Android: Issue with transparent activity Posted: 19 Apr 2022 02:56 AM PDT Recently, on one of our production apps, transparent activity has stopped working. By this I mean that it became a black background instead of transparent. When I set activity's background color to solid one (i.e. red, green etc.), it's applied w/o issues. Probably the issue was caused by migration to AndroidX, but I don't have evidences for this. After many hours of debugging, testing and reading through related SO topics, I was finally able to identify circumstances, under which the issue is happening. My test environment is a very simple clean project with two activities (you can check full code under the link). Conditions for working state I'm able to make second activity transparent only if my 'themes.xml' file is very simple. You can see first activity in the background: Conditions for non-working state It's enough to add a simple style, even without items inside and with no parents, to cause background to be black instead of transparent: Here is my 'themes.xml': And 'AndroidManifest.xml': I hope someone will be able to help me getting technical explanation of this strange behavior. |
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