« first day (1994 days earlier)      last day (2009 days later) » 

12:00 AM
RELOAD! There are 5750 unanswered questions (89.7283% answered)
 
 
2 hours later…
1:31 AM
0
Q: A multithreaded, growable vector with immutable elements, which has wait-free reads

Tim DiekmannI wrote a small vector with a few lines of unsafe Rust. The idea is to have a vector, which can be read from simultaneously, but it needs the ability to grow. To realize that, the storage is organized in pages. As page, I use arrayvec: const ELEMENTS_PER_PAGE: usize = 1024; type Page<T> = Arra...

 
2:02 AM
If you have working code and are just looking for people to review it for improvements, you should be asking on Code Review instead. That's exactly the purpose for which it was created. This site is for questions about problem code. — Ken White 44 secs ago
 
2:49 AM
0
Q: how to find the largest difference between numbers in array? Java

nebur RBI am trying to write an algorithm which takes the values in an array and tries to find the largest number and then calculate the largest difference between numbers. The largest num part works but the largest dif does not.Currently what I wrote screws up and I don't know why... the largest dif sho...

 
3:06 AM
-1
Q: Python Text RPG (Help/Suggestions)

Nick LachanceSo I have been wanting to work on a solo programming project after trying to learn for the past 10 months. Right now I am working on this Texted Based RPG. I made a complete version that was awful, but I completed it. I got some feedback from a friend and I am now stuck on the code. I am not sure...

0
Q: Implementing Rabin Karp String matching

Sumit SagarI am learning algorithms and have implemented the Rabin Karp algorithm. Can anyone please suggest the implementation is correct or not? I didn't implemented rolling HashCode, does it still count as correct? this algorithm got accepted in https://leetcode.com/problems/implement-strstr but its 7m...

 
3:53 AM
0
Q: How to make a clock-like counting system

Harry RobertsonI want to have a counter like that of a clock. When it reaches 60 minutes it instead goes to 00 and the hour changes. Instead it keeps counting up forever. The used code is HTML and javascript Relevant code: var hour = parseInt(prompt("Hour", "0"), 10); var minute = parseInt(prompt("Min...

 
 
3 hours later…
6:29 AM
Monking
 
7:22 AM
Once you have a std::vector<std::string> of arguments, you might find inspiration from Code Review; read Create a C style char** from a C++ vector<string> and its answers. — Toby Speight 13 secs ago
 
Monking
@ThomasWard It's Python. Have you tried pip install clear?
 
7:51 AM
0
Q: ASE Build Bulk Crystalline Structure error

Lucas CockellI need to build a BCC crystalline structure with 2 random atoms (between Hydrogen(1) and Iron (26)) and I need to use the 'ase.Atoms' and the 'set_atomic_numbers', and then calculate the angles between the atoms. But this is happening: Code: aCFC = 4.0 aCCC = 3.5 atom1ccc = np.random.randint...

 
8:22 AM
0
Q: Check if we can form a word across words in a sentence

Eugene YarmashI've come across a simple challenge: given a phrase, check if we can form the given word vertically by stacking words in rows. For example, we can form the word "boom" from this phrase:    every breath             you take every move       you make My Python code: def can_spell(s, w): word...

0
Q: Design pattern to validate class object field values

PrimI have PostgreSQL DB and I am using SQLAlchemy to sync data with my DB. For example I have a following declarative class which represents a news article obtained by parsing one of the news websites Base = declarative_base() class News(Base): __tablename__ = news id = Column(Integer, autoi...

 
8:38 AM
0
Q: Get Existing Record or Create New One

ChrisissorryThere are two scenarios in the business: New user signs up, contract needs to be created Existing user buys additional product, existing contract needs to be retrieved Now, at the moment both scenarios are handled by the same Controller logic and a method is used to handle both cases: $this->...

0
Q: Code for Voice Age in C# on Visual Studio?

IsobelI have just started Computer Science A-level and to help with possible coding projects I may do, I am making a voice recognition program in Visual Studio with C# to possibly incorporate into a chatbot. However, after only learning some C# in the last couple of weeks, when attempting to incorporat...

 
@Mast Haven't poked anyone about this yet. Thanks for the reminder
 
8:54 AM
0
Q: How to get value from a map

aladineHow could I get value of from a hash map in efficient way. I want to inspect an entry with key = "type" and retrieve its corresponding value. typedef std::unordered_map<std::string, int32_t> Row; for (const auto& pair : r) { if (pair.first == "type") { return pair.second; } } A for loop l...

 
9:09 AM
0
Q: Classify image embeddings on simple feed forward neural network

JayanthMy training data is of shape (2000, 2,128) and looks like [[[0 1 ....127][2 4 6 ......256]][[1 4 6 6 ..][3 6 7 8......]......]]] and the labels are of shape(2000,) and look like [1 0 0 ...] the main idea of my code is to classify a pair of images (represented by embeddings of length 128) if the...

 
9:56 AM
0
Q: C++ CLI Console Menu Statemachine

Samuel HabtuI am trying to find the best way(/most efficent way) to setup my console program's menu. The way I have it set up is that I have a Menu class and then I use a menu pointer called currentMenu and I just change where it is pointing to. it runs fairly well so far but I'd like to know what I could do...

0
Q: Design a class to have several attributes or one attribute as dictionary with many keys, Python3

auraI have class for calculating temperature of an object at different positions, based on ambient temperature. class BodyA: def __init__(self, ambient_temperature) self.amb_t = ambient_temperature self.pos1_t = self.amb_t + 1 self.pos2_t = self.amb_t * 2 self.pos...

 
10:27 AM
0
Q: PHP User management class

user9741470Here is my code for a class that is responsable to manage some common users task like registration, login and logout. It implement also a sub class that can be used to check the session of a logged in user. I've tested it and works fine, but I will improve it as soon as i can. If anyone is intere...

 
10:49 AM
A nice overview! May I suggest renaming the mutex's field to just mu and putting it above the variable it protects? This convention is not for some reason listed in the guide but is spelled explicitly in The Book ;-) Basically, a mutex variable (barring the need to have more than one in a struct is named mu and put above the set of fields it protects (all possibly preceded by a blank line). — kostix 53 secs ago
 
11:29 AM
@Vogel612 I have now poked someone about this, as usual, I assume 6-8 weeks until I get a response ...
 
11:41 AM
pos off-topic here, better for code review SE — ThisGuyHasTwoThumbs 38 secs ago
 
@Vogel612 Great.
Welcome to The 2nd Monitor @AmanMittal
You don't have the required reputation yet to speak in this chat.
 
0
Q: Filetype Filter Lua

ConPhotoSo I've got some script that will auto upload all new Camera files to FTP server. This works great but I'd just want to modify it to so that it only uploads the JPGs, and ignores other filetypes. I'm really out of my league tbh here, but guessing it'd look something like below. How can it get it...

0
Q: Mapping properties between two Objects of different structure

BattersSomething I've found myself having to do reasonably often is map properties from an Object (usually a heavily nested MongoDB document) to a different 'shape' to then pass it to a function call or API endpoint etc. Combine this with a development environment in which these 'shapes' are prone to ch...

 
12:03 PM
if your code is working, then this isn't really the place for it. We fix problems here or sometimes answer technical questions about how to solve something. You could consider whether your question is more suited to codereview.stackexchange.comADyson 13 secs ago
 
12:18 PM
1
Q: Please advise on a DDD modeling for a User Voice-like system

Phillippe SantanaI've taken on the challenge of modeling a simple User Voice-like system. High-level description: It's a portal for some SaaS users; They come and leave feature requests, suggestions, etc.; They should be able to vote/unvote for any suggestions; They can leave as many comments as they like on su...

 
 
1 hour later…
1:20 PM
0
Q: ServicBus QueueClient and TopicClient object resue

Pankaj RawatI'm writing Azure function using visual studio (multi-layers project), where I'm managing all Azure ServiceBus related code in one class. public class MessageBroker : IMessageBroker, IDisposable { private readonly IAppConfiguration appConfiguration; private TopicClient topicClient; p...

 
1:33 PM
@Mast Doesn't work, and if you'd read their post you'll notice it's something they wrote themselves:
> Additionally, the "clear" library that I imported is a custom library of my making which only prints out a ton of blank lines so the script "clears" and outputs are then at the bottom. If there is a better way of doing this please let me know.
Missing code is missing.
 
@ThomasWard But you reviewed it anyway?
 
@Mast with a huge "RED ALERT" section, yes. I also flagged it first, but nobody did anything with the flags.
which means nobody actually knows how to review.
(FYI: I'm a bit salty before coffee, don't take things at face value because I only just got some coffee)
 
@ThomasWard You don't say.
 
@Mast that said, you could just remove the clear library bits and everything works fine, the only function that clear provides is clear() and that's not really anything 'necessary' to review the rest of the functionality.
the only reason they wrote it I think is to "clear the screen" which is not really 'useful' per se, in my opinion, the rest of the code without the clear() bits functions properly.
i also hadn't had coffee yesterday when reviewing too.
'course a few more close votes would probably not hurt :P
 
@ThomasWard At the moment, it has none. While it has been looked at by multiple users who I hope know what they're doing.
 
1:39 PM
@Mast Well I cast a close vote flag and nothing happened. Maybe the mod flag will do something about it
and since people upvoted my comment indicating we need the complete code, I have to assume that whoever was doing reviews didn't actually cast a close vote.
so i mean...
But, if we remove the clear() call everything else functions right so shrugs
(Hopefully this coffee kicks in soon... or else I'll need another 3 cups)
 
So, Toby Speight and 200_success don't know how to spot an off-topic question? Is that what you're saying? Since I'm sure those two took a good look at it, according to the timeline.
 
i'm just tired and grumpy :p
 
@ThomasWard I think you need stronger coffee.
 
and i can't see the timeline apparently
@Mast I would be using deathwish coffee, but i ran out yesterday
and payday was just today so
 
@ThomasWard Can't see this?
 
1:42 PM
@Mast no direct link to it :p
because my userscript that gave me a link fubar'd with the site design changes
 
@ThomasWard There never is. It's one of those things you need to know how to find it.
 
indeed. I know how to find it but can't from my phone
and my userscript that gives me the link is broken
and i'm lazy and tired and need more coffee :P
 
I usually open the revision tree and replace revisions with timeline. That's all there is to it really.
 
@Mast I think you have more visibility than me, I don't see Toby on that list
only 200_success
 
@ThomasWard First Post review.
 
1:47 PM
E:Can'tSeeIt
probably because not enough rep :p
 
Or phone.
 
(1713 is too low for the review queues)
no, i'm looking at a computer right now
and don't see it
 
Ah, ok.
 
@ThomasWard That's the reason I didn't VTC it yesterday. It doesn't make much sense to close something if it's not needed.
 
Hi Andy, SO was not designed for code optimization, but rather trouble shooting with code. For code optimization head on over to Code Review Stack Exchanged_kennetz 5 secs ago
 
1:59 PM
@Peilonrayz That's also part of the reasoning I did the review. Part of me was going to remove 'clear' and say "WHy do you need this?" but then I realized I can't do that without seeing what it actually does.
unrelated: one coffee did not work, time for a second cup.
 
0
Q: World resource system for Adventure Game/RPG

RobertI'm beginning the long process of developing an Adventure Game/RPG and I was hoping to get some review on a resource system I'm coming up with. How it works is, a resource is generic to every resource in the world. Each resource will have a name, a random yield, and a random quality. So I've cr...

 
Does this code work? If so, this may be a better question for Code Review, but you should read their help center and make sure you're open to critiques of the entirety of your code. — Heretic Monkey 1 min ago
 
2:23 PM
0
Q: Stream operation with two dimensional array

AmitI am trying to find the best average score from below two dimensional array: String[][] scores = { { "Amit", "70" }, { "Arthit", "60" }, { "Peter", "60" }, { "Arthit", "100" } }; The output is: 80 (Arthit's score (60+100)/2) Till now I solved this problem with below approach, however I am loo...

 
2:38 PM
You might better research that kind of query on codereview.stackexchange.comCLR 46 secs ago
 
2:54 PM
I'm voting to close this question as off-topic because it belongs to codereview.stackexchange.comCyril Gandon 26 secs ago
 
0
Q: More efficient way of managing PySpark DataFrames?

WilsonI was successfully able to write a small script using PySpark to retrieve and organize data from a large .xml file. Being new to using PySpark, I am wondering if there is any better way to write the following code: import pyspark from pyspark.sql import SparkSession from pyspark.sql.functions im...

 
3:09 PM
Monking
 
Fix the destructor. Then ask for a review at codereview.stackexchange.com there are a couple of more issues. — Martin York 11 secs ago
 
3:25 PM
0
Q: Javascript run length encoding algorithm

BattersI have implemented a custom run length encoding algorithm that converts an m x n array into an p x (n+1) array. The extra column is to record counts. Probably easier to show through examples: encode = (array) => { // crude array equality function arrayEquals = (...arr) => { return ar...

 
posted on October 19, 2018 by CommitStrip

 
4:05 PM
@CommitStrip R2PO
 
0
Q: Testing application stability by throwing random diagnostic exceptions

t3chb0tI'd like to be able to better test application stability. Usually when you're doing this, you run the application and keep your fingers crossed that it won't crash when an error occurs (be it a missing file, no database connection or whatever service didn't work). The problem is that it's diffic...

 
@ThomasWard a word?
 
4:30 PM
possible answer invalidation by Phillippe Santana on question by Phillippe Santana: codereview.stackexchange.com/posts/205891/revisions
 
@Duga Rolled back one further.
 
4:44 PM
0
Q: Character pattern replacement using gsub, loops, and data.table

Anonymous cowardI was trying to see if data.table could speed up a gsub pattern matching function over a list. Data for reprex. It's a list of 3 data frames with some asterisks placed here and there. Each data frame is 6500 rows, 2 columns, and generally representative of my actual data. library(data.table) li...

 
@Vogel612 check your invs
 
lol you locked me out :D
 
fixed
kicks system around
 
They're limiting the playtesters to type A3 V stars, so the games will all end before the Sun consumes the Earth.
2
 
possible answer invalidation by Phillippe Santana on question by Phillippe Santana: codereview.stackexchange.com/posts/205891/revisions
 
4:59 PM
-1
Q: How do I perform cartesian product (or maybe string concatenation in this case) on arrays within dictionary values of different lengths?

Rehan AbdulExample: if I have a dictionary "1": ["Z", "B", "V"], "15": ["T", "C"], "2": ["W"], "55": ["E", "R", "K", "M"] and an input string of "1255", I have to write a function compute(dictionary: [String: [String]], input: String) {} such that the output should be printed as follows: ["ZWE", "...

0
Q: Speed up sorting algorithm in R: make one column "smaller" than the other

ClarinetistConsider the following sorting algorithm: df <- data.frame(food_1 = c("APPLE 1534", "PEAR 2525", "BANANA 3045", "WATERMELON 5000"), food_2 = c("ORANGE 2035", "BROCCOLI 5000", "BLUEBERRY 2000", "TOMATO 3000"), stringsAsFactors = FALSE) # Sorting for (i in 1:nrow...

 
5:11 PM
@Duga Next time you get a mod flag with a request for a lock.
@RMunroe And I thought Truck simulators took forever.
 
5:31 PM
@Mast Planning on mod-flagging @Duga, are we? :)
 
5:46 PM
1
Q: C# console calculator for 2 numbers at a time

BetraxI'm learning to code for fun, and just finished my first program. Idk what to think about it since I it's my first finished real code, but hey it works! I'm pretty sure that it can be written shorter or better than this. Right now it can only solve 1 problem at a time, but I'm going to make it s...

 
6:06 PM
@SimonForsberg lol, no
 
 
1 hour later…
7:25 PM
possible answer invalidation by Ludisposed on question by John. C03: codereview.stackexchange.com/posts/205716/revisions
 
 
0
Q: Finding All Cycles (Visiting any edge no more than once, Vertex may be visited more than once)

Jack Given the undirected graph above, find cycles 1->2->3->1 4->5->3->4 1->2->3->5->4->3->1 I tried using this pseudocode (from here) dfs(adj,node,visited): if (visited[node]): if (node == start): "found a path" return; visited[node]=YES; for child in adj[node]...

 
@Mast 120 billion people have not died on earth, but other than that - sure.
 
7:57 PM
I would recommend asking this on Code Review. This site is more for Broken code. CR.SE is for Working code like yours. — K.Dᴀᴠɪs 44 secs ago
 
8:08 PM
0
Q: MYSQL simple code can anyone tell me if is good relating to the time checks thanks =)

Adam Sever CREATE TABLE Appointments ( id INT AUTO_INCREMENT, barberID INT NOT NULL , customerID INT NOT NULL , barbershopID INT NOT NULL , date DATE NOT NULL , time TIME NOT NULL , appointment_length TIME DEFAULT 003000, #...

 
8:45 PM
@Mike-SMT Not sure what you mean. The thing that was wrong with the OP's code is still there. If there were other wrong things, I don't think they matter. We're a Q&A site, we answer specific questions. We're not Code Review. I'm planning to use this question as my go-to duplicate target for future questions, so I don't want there to be any irrelevant noise besides the issue the question is asking about. — Aran-Fey 52 secs ago
 
9:05 PM
Looking at Code Review - there are only 7 questions tagged VBA this month - leaving those here on SO isn't going to clutter up the place (and frankly those are some of the more-interesting questions that show up here) so asking folk to move them to a lightly-trafficked location isn't going to get them much help. Code can be technically "working" but still be capable of significant improvement: these things are part-and-parcel of learning to code well, and don't necessarily need to be partitioned off into a separate location. — Tim Williams 22 secs ago
 
9:57 PM
0
Q: City game that has a board and you can build stuff

Beginner coder123So, I'm a beginner programmer, and I'm working on my 2nd program (my first is a text RPG) and I have a little problem. This is my current program a = 0 b = 0 c = 0 d = 0 e = 0 f = 0 g = 0 h = 0 i = 0 j = 0 k = 0 l = 0 m = 0 n = 0 o = 0 p = 0 q = 0 r = 0 s = 0 t = 0 u = 0 v = 0 w = 0 x = 0 y = 0 ...

 
10:32 PM
i think this question should be part of code review stack exchange- codereview.stackexchange.comVinit 15 secs ago
 
10:44 PM
0
Q: Optimizing an Bootstrap 4 + JavaScript - Event Calendar

thekodesterHow would you improve this event calendar? The thing I'm trying to work on is how the next and previous function. Since they're the only jQuery and everything else is JavaScript. // all information require to create the calendar var months = ["January", "February", "March", "April", "May", "...

 
I'm voting to close this question as off-topic because it is asking for a code review (and this thus too broad / opinion based). It could probably be adjusted to be on topic for the code review stackexchange. — Quentin 5 secs ago
 

« first day (1994 days earlier)      last day (2009 days later) »