« first day (2605 days earlier)      last day (1710 days later) » 

00:00
RELOAD! There are 6768 unanswered questions (89.8837% answered)
00:39
0
Q: New to Python, Simple Countdown Timer. How could I have done it better?

Meeko SorianoBeginner level script for a countdown timer. Would appreciate if you could point the things I could do to be more efficient. Basically, I would want to check if current day is either "workday"(Mon - Wed) or "freeday"(Thur-Sun) and achieve the following. If its workday, and current hour is workin...

 
2 hours later…
02:49
2
Q: Crawling website and downlowding records. How can I convert the code to page oriented coding and will it be more pythonic?

sangharshI am relatively new to python. Amateur learner. working on Python 3.8 and Selenium I have re-written following code. I posted previous code HERE and received several useful suggestions. On basis of that following updated code was written. Now, the code works fine. Much better than previous. But, ...

0
Q: Set data structure

user366312The following data structure is meant for manipulating algebraic/mathematical sets. Kindly review it for design and efficiency. public interface ISet<T>: ICloneable, IEnumerable<T>, IList<T> { IEnumerable<T> Union(IEnumerable<T> set2); IEnumerable<T> Difference(IEnumerable<T> set2); ...

 
4 hours later…
06:38
It seems that your code currently works, and you are looking to improve it. Generally these questions are too opinionated for this site, but you might find better luck at CodeReview.SE. Remember to read their requirements as they are a bit more strict than this site. — Богдан Опир 34 secs ago
07:06
0
Q: Reviewing the file download controller in spring rest

dghtrIn my project, so this controller is working perfectly, my objective is to read the log file from the server which is created on daily basis, so I have to read the log file which is heavier in size around maybe 2GB, so my question is that please review the below code and advise my is my code is s...

07:44
Monking
07:56
\o
08:33
Monking
@brug Yes, although they aren't worth as much as the 'real' delete votes you get later at 20k.
Note the difference between the first user and the other 2's votes.
monking
08:53
@Mast FWIW that's one of the 2k privileges not the 10k one.
I forgot deletion at 10k was even a privilege you get, cause it's made obsolete by the roomba.
@Peilonrayz Are you sure? I think reviewing suggested edits are a 2k privilege, deleting questions is 10k and expanded deletion is 20k.
> Aside from reviewing suggested edits, the low quality posts queue is also made available.
It's the last paragraph of 2k
Hmmm, yes, of-course.
The 10k delete votes are quite limited in that they'll only work on questions that pretty much should've been roomba'd by that time.
Yeah, it's pretty hidden.
09:17
I was a bit out of the loop since I don't visit SO a lot
but holy shoot.. Clap/ Thanks emoji !
0
Q: TV Characters - Beginner

snow_razerThis program basically displays a list of TV characters and you can kill them off by random, or bring them back by name. It uses the choice function in the module random. I've defined a couple of functions so that the 'while loop' looks a little more cleaner. In two of the functions, bring_back a...

@ankii But everyone's in the loop /s
@Peilonrayz Claps ;)
Don't remind me how fast the network is going downhill with that loop of theirs.
when they added the history of a post.. I was like, thanks! I need it sometimes to see vote history
09:23
I'm surprised you didn't respond with "👏🙏"
then they added tooltips for voting.. I was not happy.. it interferes for people with more than a couple hundred reps
now the sidebar is even more cluttered with emojis and their tooltips
@ankii What, the timeline? That had been a hidden feature for years.
@Mast now it's a click away. Earlier I had to guess the URL keyword and its position.
@Mast I didn't realize how old it was
Jan 26 '15 at 14:55, by rolfl
How many of you are aware of the hidden timeline feature for questions on Stack Exchange?
@Peilonrayz emoji picker on desktop isn't comfortable..
09:28
@ankii I'm assuming you're on mac? I get them through my terminal emulator for some reason it has an emoji picker
is that zsh ? or iterm2 ?
yes I have a Mac and I have to do a "ctrl + cmd + space" then type the name and then double click on the emoji to type it
Like iterm2 but I use kitty (not KiTTY)
I'm not a power user of terminal for some reason
it's used only for installing stuff
I mostly use it to run Python (from CR) and for emojis... Windows has tainted me :(
09:50
terminal all day every day for me :)
mostly since I don't care much for git GUIs and file navigation is rare enough that having an open terminal is sufficiently quick to get me anywhere I want with tabcompletion...
0
Q: Powershell XML search performance

Pragmatic PraxisI am working on a utility to manage shared content libraries for Work from Home scenarios. Basically I have libraries of thousands of Autodesk Revit family files, and I want to host those files on AWS S3, and then manage a local copy of the library based on what is hosted on S3. To that end I hav...

-1
Q: Popup alert even when a site deletes the alert function | bypass

nakEA website fully filter the alert function from his website, and replace it with an empty string, but I want to bypass it and still popup an alert, I am trying to solve an XSS challenge, and I figure out that the site identify the double "l" char, and fully removes the string. http://alertmywebsit...

10:16
0
Q: How to get quaternions from RYP angles in c++ in ROS

Dhruv GuptaI looked here: http://wiki.ros.org/tf2/Tutorials/Quaternions but the code was unclear on how to execute? #include <tf2/LinearMath/Quaternion.h> tf2::Quaternion myQuaternion; myQuaternion.setRPY( 0, 0, 0 ); // Create this quaternion from roll/pitch/yaw (in radians) ROS_INFO_STREAM(q); // Print t...

10:56
-1
Q: How do I organize csv data by category using the regex module?

Dorky PorkNewbie programmer here and I'm desperate for help. This class is killing me and I need some expert advice. Our instructor gave us a scenario and wants us to figure it out. Attached is a screenshot of the csv data and below that is a template of code that we're supposed to work with. He wants us t...

11:10
We're not going to migrate this to Information Security, but you could re-post it there on your own risk. If we would migrate and the migration would be rejected, it would still end up here. Most of us are not familiar enough with Information Security's scope to determine whether your question would be a good fit there. It's definitely not a good fit here. — Mast 14 secs ago
@Mast I just noticed I can't delete a question when it's open. So I guess only diamond moderators can delete open spam. Best we can do is just flag.
One more VTC, will reject migration.
@Peilonrayz 5 spam flags will take care of that.
Considering how many users can cast spam flags, that's not usually a problem.
@Mast Off-topic feature request?
@Mast Fortunately flagging is a very low rep privilege
@Peilonrayz At least.
It's not working yet and already asking for a rewrite. Hardly a request for review.
Oh I failed to read "but I'm struggling to figure out how to remove elements." the first time
It's been rejected now :)
@pacmaninbw Closed. Looks like they show two messages again
@Peilonrayz I'm glad they are willing to show 2 again.
almost a code only answer
11:58
@pacmaninbw Yea.
Fixed, thanks.
@Mast Your edit changed the code to be the same as in the OP.
12:19
@Peilonrayz I know I should've left that bloody answer alone when I encountered it.
There was a suggested edit, things spiralled down.
Just nuke that answer from high orbit please.
Where's my coffee...
See? This is why community moderation is important. People make mistakes, people make mistakes while correcting the mistakes and together we can make it all good again.
Morn king
Monking @Morwenn
Apparently one of my Q&As here has almost become a reference implementation for an algorithm
It's very fun
Congrats!
That means that having a decent explanation alongside the code helps :p
12:25
I never doubted that :-)
Hallowed be the MathJax support
I see you're also coming close to 20k.
Very slowly
Making question upvotes worth 10 points instead of 5 probably made a difference
Probably.
I'm currently working on a... linked list implementation
12:30
Oh
Well, if you make it a magnificent one, we can refer to it in all answers on the upcoming hundreds of linked list questions.
I need to use a linked list in a sorting algorithm (I'm very original there), but the standard one performs a bunch of allocations
My use case is a bit specific and I know exactly how many nodes I'll need to allocate, so I'm trying to make one where I reuse nodes
I've seen what you can do with sorts when you put your mind to it, so I'm looking forward to it.
So far it's hacked together and not working
that sounds like the mess of basically static type checking code I'm currently writing in javascript
and yes, the irony is not lost on me
@Morwenn All my code looks like that the first day.
12:35
@Vogel612 why no TypeScript?
I don't really see a meaningful difference between TypeScript and Javascript in this particular case
because I don't have a good way to translate types that are basically arbitrarily defined at runtime into something that can be worked with at compile time
0
Q: C++ multithreading logger class

asmmoI have designed a logger class to log messages to a file. It uses an independent thread to log the messages save to a queue previously using the main thread. I want to receive reviews about it. #include <iostream> #include <queue> #include <mutex> #include <condition_variable> #include <fstream> ...

that looks like it'd make for a punny bug report
3
12:48
^^
~ it’s Saturday “and it’s hot hot hot” 🎵🎶
Monking
13:04
@SᴀᴍOnᴇᴌᴀ Bug?
@SᴀᴍOnᴇᴌᴀ WAT?
13:27
0
Q: Single Responsibility Principles (SRP) for Retail Payment Shop

Steve NgaiI have this example in C# which implement SRP. public interface ICanOperateWithCash { void AcceptCash(); void DispenseChange(); } public interface ICanPayViaCreditCard { void ChargeCard(TicketDetails ticketDetails, PaymentDetails paymentDetails); } public class BankGateway : ICanPay...

13:47
So far my code doesn't work at all :')
Monking
0
Q: Caesar Cipher, done in Ruby

michael.zechIt's an assignment from the Odin Project. Here's my implementation: #!/usr/bin/env ruby def caesar_cipher(str, shift) low_alpha = ("a".."z").to_a high_alpha = ("A".."Z").to_a length_alpha = low_alpha.length chars = str.split("") ciphered = "" chars.each do |char| ...

@pacmaninbw since it has helped my answer get more views than most of my PHP answers I might say it’s a feature 😁
Code probably has fewer issues but still doesn't work
I knew that implementing a linked list would be an experience of frustration
@SᴀᴍOnᴇᴌᴀ I should search the internet for "When is a bug a feature" :)
How many up votes have you gotten out of it?
@Morwenn It shouldn't be, is it double linked or single linked, are there any special features?
@pacmaninbw I know that I need N nodes at most, so I allocate an array of N nodes and maintain a linked list of used nodes and a linked list of free nodes in that array
It's a doubly linked list
Don't allocate them as an array, or if you do, don't treat it as an array after you do, maintain a list of available nodes that aren't used in the list, when you use one move it from one list to another.
14:47
Well, more like it's actually a doubly linked list, but the way pointers are rewired inside to keep track of the free nodes makes that substructure a singly linked list
@SᴀᴍOnᴇᴌᴀ Huh...
I don't treat them as an array, I only do that to allocate a single contiguous block of memory and avoid having allocations all over the place
If you were doing this in C, I would suggest allocating the large block once and then freeing it, the allocating the nodes as necessary, but I'm sure that isn't the case here. In C the process would hold onto all the allocated memory and certain system calls in malloc wouldn't be made because the memory was available.
I don't know the underlying mechanism for memory allocation in C++ for new.
@Morwenn Do you have a free list and a used list?
0
Q: How to sort and search in javascript large set

oderflaThe array "scores" tells the total points for each person involved in a contest. So for example: User A: 100 points User B: 90 points User C: 90 points User D: 80 points User E: 75 points User F: 60 points According to above scores we also have this ranking: User A: #1 User B: #2 User C: #2 Us...

I've got a bunch of nodes + a sentinel node, a pointer to the first free and first used element, used elements go first_used <-> a <-> b <-> ... <-> sentinel_node and free elements go like first_free -> a -> b -> ... -> sentinel_node
I apologize for the interruption.
@Morwenn Is there a reason why it needs to be contiguous?
No Problem. I processing the data @Morwenn is giving me.
@brug Doing a new causes overhead, that she is trying to avoid.
^
If I can allocate all my nodes once, it's better than N allocations (or more)
ahhh
15:13
@brug when you use the container classes in C++, they allocate more than 1 cell when they are created to reduce overhead, in C# at least 4 are allocated the first time, 6 the next time and capacity * 1.5 every time after that.
Also it can have very heavy performance advantages to have a contiuguous block of memory you're accessing
I don't know what the magic numbers are in C++ and it may depend on implementation.
Doesn't a vector track used and unused elements for you? So if you have a std::vector<Node> and the Node contain a pointer to next or last you can remove elements and the vector will keep track of unused elements for you?
it does, but the backing array isn't really great for reordering
Linked Lists have a huge advantage there because you don't actually need to move the data around
but she's already using an array under the hood of her linked list
15:17
Not as an array. She's just allocating a block of nodes all at once.
ohh nevermind. vector has to resize when elements are removed but the LL doesn't
not resize
yes, but the ordering of the elements in the list is not related to where they are stored in the array
I use an array of nodes, but the nodes and therefore the value they contain never move
shift
I do that because I need iterator stability for my algorithm
Otherwise I wouldn't bother using a list
15:19
I actually recently considered implementing an ordered hash map in java using a similar technique but then decided it was waaaaayyy too much effort to do that.
15:48
Hey, I eventually got it to work
Unsurprisingly I had made one or two small mistakes regarding the order in which I reassign pointers, etc.
Bravo!!
Still abysmally slow but the difference is visible
16:47
wow how is heap_sort three orders of magnitude faster?
17:02
I’m voting to close this question because improving an existing, task-specific program is off topic. Try Code Review. — ivan_pozdeev 24 secs ago
17:29
(1) Please research your problem-solving algorithms. You chose a slow data structure and a slow algorithm. (2) Profile your code before posting -- use the available tools to find out where your code is slow. (3) Post in the appropriate group -- CodeReview, rather than StackOverflow. — Prune 48 secs ago
0
Q: Java script if statement and sound.play() function

Mayank sainiI've made a button by which the playing audio will suppose to stop when the 's' in the loop reaches the value of 50 but if statement starts working before The 's' reaches the value of 50. I need help guys. Here's my code: setInterval(function () { var sound = new Audio("../audio/audio.mp3

0
Q: Converting pandas Column to a Datetime Column

d3lt4_papaI wanted to ask if this is the correct, recommended way of converting a column's entries to datetime objects. I implemented the solution given here: https://stackoverflow.com/questions/17134716/convert-dataframe-column-type-from-string-to-datetime-dd-mm-yyyy-format However, when I implement that ...

17:49
Thank you for the feedback. I will repost this in CodeReview, and delete this post. But this is the dataset I have to work with, so I can't change the original data structure. — samman 9 secs ago
0
Q: Index of Alphabetic Anagram (With duplicates)

Leo oeLHere is my working code for words without duplicates: from math import factorial from operator import mul from functools import reduce from collections import Counter def listPosition(word): # if len(word) == len(set(word)): # n_perms = factorial(len(word)) # else: # dups...

0
Q: How to speed up my script or find a more time feasible way to reach objective (modifying a list of values using another list)

sammanI'm trying to modify a list, using only built in python modules, but I've been having some problems doing so in a time efficient manner. I have a list of entries: #final_list3 -1S-HA 4.477 -1S-C 173.726 -1S-CA 58.16 -1S-CB 64.056 0H-N 120.402 0H-HA 4.725 0H-C 174.33 0H-CA 55.353 0H-CB 31.166 0H-H...

18:18
@Vogel612 Yep, the Ford-Johnson merge-insertion sort is incredibly slow
That's the cost of trying to perform the smaller amount of comparisons possible
There's probably still room for improvement
But even then it's probably not possible to make it competitive as a standard sort
The first one is the implementation on CR here, which uses std::list with std::allocator, the second one uses the libstdc++ bitmap_allocator extension, and the last one uses my new list implementation
Compared to the original std::allocator implementation it's incredibly fast
And I probably can change the algorithm to reuse the list memory even more, so this might become even faster in the future
Yet still abysmally slow haha
19:02
@Morwenn Proprietary code?
0
Q: Inheritance Challenge 2 - Employees, Bosses and Trainees in C#

Milliorn Inheritance Challenge 2 - Employees, Bosses and Trainees Create a main class with a Main Method, then a base class Employee with the properties Name, FirstName, Salary and the methods Work() and Pause(). Create a deriving class boss with the propertie CompanyCar and the method Lead(). Create...

Does anyone have any idea why this is marked as spam? Sure, it's off-topic, but not spam.
@pacmaninbw no?
19:18
@Mast That's odd. I think it's a false positive from SE's auto spam quality control stuff
1
Q: Generating unique 2D numpy arrays with 2 adjacent row elements swapped while using BFS in Python

OldGrogSo I have a 12 x 6 2D numpy array for input which consists of 7 possible board objects (characters from 'abcdefg'). From a 2D numpy array I wish to generate all the possible unique 2D arrays, in whose parent array 2 adjacent elements in each row have been swapped. In the worst case this means 60 ...

19:43
@Morwenn At the moment, just wondering.
1
Q: C++ threaded task manager

Alkis LekakisI've been writing a little task manager in C++ in my spare time. It's also the first time I am posting here for a review, I hope someone can spot any mistakes. There's still a lot to implement and optimise, but the idea is for this to be a task manager that optionally uses any platform-dependent ...

possible answer invalidation by user366312 on question by user366312: codereview.stackexchange.com/posts/244246/revisions
@Duga Looks fine. Some trailing white space and one empty line.
20:12
-1
Q: Is there a faster way to copy two bytes?

user226527Is this: memcpy(CurrPtr, "\"", 2); Or this: *CurrPtr = '"'; *CurrPtr+1 = 0; Faster? Or is there a third, even faster way? I was thinking about something like this: *(unsigned short)CurrPtr = 34; // *(unsigned short*)"\"" is 34 Is that a good choice?

You might want to try asking on Code Reviewuser just now
Welcome to StackOverflow! This question better fits for Code Review because it doesn't have any problems and you are looking for improvements. — Asocia 47 secs ago
@pacmaninbw I'm tempted to flag that (on CR not chat). But I'm not really sure what a moderator would do with that information.
Already flagged.
One of the questions belongs to an account that has been temporarily suspended for 10 years.
@pacmaninbw :O Ok, ok. Now I see something a moderator could do with that information.
It seems to be the same person that I have been complaining about for 3 or 4 days.
20:35
0
Q: LeetCode 146: LRU Cache

EmmaI'm posting my C++ code for LeetCode's LRU Cache. If you have time and would like to review, please do so. Thank you! Problem Design and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations: get and put. get(key) - Get the value (will alway...

I can't find a proper name for my new list data structure
array_list would make it sound like Java's ArrayList
ListOnTopOfArray
What could/should be apparently is that's it's got a capacity fixed at construction time
@Morwenn Can you please add your vote to close codereview.stackexchange.com/questions/244280/…
sure
20:49
Thank you.
@DerKommissar @skiwi they are back codereview.stackexchange.com/questions/244280/…
Need one more to close.
2
Q: How to speed up this IP sweep, Port scanner python

Scott MI am looking for a way to speed up my basic IP scanner/port scanner in Python 3.8. My IP portion works, the port scan work, I just want to speed it up, in a format that someone learning python would understand. #testing scanner.py import socket import subprocess import sys from datetime import d...

-1
Q: downloading pdf using python

chocoSo i am a beginner at this and i have been trying to scrap data from this website, I have tried using different code and looked up for help on different sites but couldnt get through.This is my code: from selenium import webdriver import requests from bs4 import BeautifulSoup as soup from urllib...

1
Q: LeetCode 146: LRU Cache ||

EmmaI'm posting my Python 3 code for LeetCode's LRU Cache. If you have time and would like to review, please do so. Thank you! Problem Design and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations: get and put. get(key) - Get the value (will ...

21:11
I asked this on code review, and I was told that it was off topic there and that I should ask it here. — user226527 20 secs ago
There is a code review site. You could check if the question would be on topic there instead. — ADyson 31 secs ago
0
Q: LeetCode 146: LRU Cache III

EmmaI'm posting my Java code for LeetCode's LRU Cache. If you have time and would like to review, please do so. Thank you! Problem Design and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations: get and put. get(key) - Get the value (will alwa...

21:44
0
Q: Game that works like a safe vault

Gustavo Storii need to make a game that the person who is playing has to guess all combinations in sequence in order to open the safe vault. Also every time the player guess a wrong number it has to go back to the beggining. The passwords have to be these numbers in sequence 01 91 33 42 85. Everytime you get ...

0
Q: Server in Python

me4gqpI'm looking for a code review and code improvement for my own small server. The server accepts the requests: User Join,User Leave,User Text Notify Group Join, Group Leave, Group Notify Request Time. The syntax for User Join/Left Group Join/Left: ** DSLP-3.0 User Join NameOfUser DSLP-Body ** The ...

@CaptainObvious These seem to be three different solutions to the same problem. I have no problems here.
@Peilonrayz At least it's not all in one question this time.
22:07
1
Q: c# Efficient solution: Sequence generator for a pattern

user226533This is an interview question to generate the below pattern of numbers in a sequence, which is: 12.34, 23.45, 45.67, 78.910, 1112.1314, 1617.1819, 2223.2425, 2930.3132, 3738.3940, 4647.4849, 5657.5859, 6768.6970, 7980.8182, 9293.9495, 106107.108109, 121122.123124 We can use starting seed number a...

@CaptainObvious Deleted by Community.
I think you may be onto something here. This does seem very very fishy
Does SE ever block users from a specific IP?
I don't know the ins and outs but I recall there being mechanisms in place to prevent this on suspended accounts.
If the user is circumventing that then that's a big no-no
22:45
possible answer invalidation by user366312 on question by user366312: codereview.stackexchange.com/posts/244246/revisions
22:56
@Duga Rolled back.
User added a later edit which is ok.
I guess you're more lenient than I am here pacmaninbw :)
23:46
@Peilonrayz That's a switch
:)
>:( /s
LOL
Gotta go, working on an email for a deployment, the person deploying doesn't know what files and folders to use.
TTYL
Gniknom

« first day (2605 days earlier)      last day (1710 days later) »