« first day (2635 days earlier)      last day (1368 days later) » 

12:00 AM
RELOAD! There are 6840 unanswered questions (89.8545% answered)
 
0
Q: Receiving a user's registration submission and inserting row into database #2

user13477176I asked this question before and mickmackusa and Your Common Sense gave me some good answers. I went over them and made as much changes as I could because some of the code didn't work properly for me. So again i want to know if this is a good way to have my registration code for people to sign up...

0
Q: why does this work?

molo32why does this work? 1-how does this code to execute the functions paint () and draww () without calling paint () and draww (); 2-because setBounds (0, 0.240, 240); you don't need windows.setBounds (0, 0.240, 240); ? 3-why is new draww () instantiated in a variable? import java.awt.Color; import j...

0
Q: circular array queue

user227557 public class CircularArrayQueue<T> implements QueueADT<T> { private int front; private int rear; private int count; T[] queue; private final int DEFAULT_CAPACITY = 20; public CircularArrayQueue () { front = 1; rear = 0; count = 0; ...

 
@CaptainObvious ಠ_ಠ I suspect the OP didn't write that code, given all the questions about how it works...
 
 
1 hour later…
1:14 AM
0
Q: Liquid includes Share Page

S0AndS0This week I published a project that aims to enable sharing Jekyll built pages on various social media platforms, without unnecessarily degrading client privacy; ie. it does not call-out to those third-party sites unless a client actively clicks a share link. Currently supported sites are: Faceb...

 
2:46 AM
you can use this community codereview.stackexchange.com for reviewing your code. — Soroosh Sorkhani 55 secs ago
 
0
Q: Reload configs in memory basis on a trigger efficiently

dragons(following up from here) I am working on a little project where I need to scan all the config files present in a folder on the disk and load it in memory. Below are the steps: On the disk there is already a default Records folder which has all the default config files present. This is to fallbac...

 
3:49 AM
Monking
 
4:04 AM
0
Q: State Machine with pre-vaidation

J. DoeI'm developing a feature that has to execute ordered async task. However it's possible that the system has to rollback to perform pre-validation tasks which include AuthStep1 and AuthStep2. I've created two state machines to retain current internal state/sequence. These solves problem because if ...

 
Monking
 
4:52 AM
0
Q: Swift Struct-based Factory Pattern

Richard RobinsonUsing SwiftUI, I have multiple different Views which only differ in some style-based variables. So, I created a Protocol CardView to condense all the similarities in one entity. The Protocol itself inherits from View and implements most of the functionality including var body. It also has several...

0
Q: How can I represent a given memory pattern in C, rather than a mathematical value, for endian-independant code?

user227432Again, still trying to interpret a boolean value from an input string. Len should never exceed 8. I just learned about endians and how they will make this not work on different endians, because my integer literals like 0x65736c6166 will have a different memory layout on different endians, but Wor...

 
Ben Popper on July 21, 2020
What’s the overlap between a four-year CS degree and the skills you actually need to land your first coding job?
 
Seems like this question belongs to the code review stack exchange (codereview.stackexchange.com) rather than here. — Roy2012 42 secs ago
 
5:40 AM
1
Q: Memoizing a tree's parent pointers in Python

Mark KaravanI have a simple binary tree that has no parent pointers. class Node: def __init__(self, val=0, left=None, right=None): self.val = val self.left = left self.right = right class Tree: def __init__(self, root=None): self.root = root I need to traverse the tr...

1
Q: How can I make this code for copying 1-5 bytes less redundant?

user227432uint64_t Word = 0; I changed: memcpy(&Word, StrIn, Len); To: switch (Len) { case 1: Word = *StrIn; break; case 2: Word = *(uint16_t*)StrIn; break; case 3: Word = *(uint16_t*)StrIn|((uint32_t)(*StrIn)<<16); break; case 4: Wo...

 
6:27 AM
@CaptainObvious That looks familiar...
 
6:52 AM
0
Q: College Billing System - Java

Ashwin GounderI developed a college fee report generator application using Java with internet as referance,but now I need you guys help in making it more obvious and a sturdy application as I am a rookie to Java Swing. import javax.swing.*; import java.awt.*; import java.awt.event.ActionEvent; import java.awt....

 
7:09 AM
I did not know this was possible in comments:
@CauanKazama But the answer is because of ohm's law. $$\color{red}{\boxed{\text{Make ohm's law part of your intuition}}}$$ — Andy aka 17 hours ago
2
Just tested it, works on CR just the same.
I see possibilities.
MathJAX power.
 
0
Q: Creating a Chart Worksheet from scratch with VBA / OOP Design

Jose CortezI recently posted some code for review, and am now looking to gather some feedback on my latest implementation with that code. Yes, I have fallen into the OOP rabbit hole (thanks Matthew Guindon) and am curious if my OOP approach is on the right track. Some background: I am creating a Chart Workb...

 
7:30 AM
@Mast It makes for some pretty disgusting comment sections.
 
7:44 AM
@Peilonrayz I thought it could make for some nicely formatted canned comments.
 
@Mast agreed, the problem is that it is so easy to see how it is done
 
thank you for your response. I shall try your suggestion. I have also submitted the same to code review. Hopefully, I be able to get the solution/tips soon. — sree_me 42 secs ago
 
8:03 AM
0
Q: Retry the preparedstatement batches if an exception (SQLException | BatchUpdateException) occurs - Java

sree_meI had a situation where my code was getting hit by the deadlock issue with SQL Server for some transactions. So, I implemented a retry logic to overcome the same. Now, I'm facing a new problem. The problem is, whenever it retries, the batch which was tried to execute will be empty/cleared after r...

 
What's your question? If you want people to review your currently working code, then this question is off topic here. CodeReview would be a better place for this question. — Lie Ryan 21 secs ago
 
8:17 AM
@Mast Yeah I think it could be used that way. But I've seen enough Math.SE comment sections to want MathJax to be permabanned from comment sections
 
lol
Yea, it looks a bit odd when there's a page full of formulae in a comment.
Then again, they make odd titles too.
4
Q: If $a_i\in\mathbb{R}$, $\omega^2+\omega+1=0$, and $\sum_{i=1}^n\frac{1}{a_i+\omega^k} =2\omega^{2k}$ for $k=1,2$, find $\sum_{i=1}^n\frac{1}{a_i+1}$.

Aditya In this question, $\omega$ is the complex cube root of $1$ and $a_i \in \mathbb R$. If $$\sum_{i=1}^n \frac{1}{a_i + \omega} =2\omega ^2$$ and $$\sum_{i=1}^n \frac{1}{a_i + \omega ^2} =2\omega\,,$$ then find $$\sum_{i=1}^n \frac{1}{a_i + 1}\,.$$ I think I have solved it correctly (answer is $...

Another remark, $\sum\limits_{i=1}^n \frac{1}{a_i+\omega}=2\omega^2$ and $\sum\limits_{i=1}^n \frac{1}{a_i +\omega^2}=2\omega$ are equivalent, since $\omega$ and $\omega^2$ are conjugate. $$2\omega^2=\overline{2\omega}= \overline{\sum\limits_{i=1}^n \frac{1}{a_i+\omega^2}}= \sum\limits_{i=1}^n \overline{\left(\frac{1}{a_i+\omega^2}\right)}= \sum\limits_{i=1}^n \frac{\overline{1}}{\overline{a_i+\omega^2}}=\\ \sum\limits_{i=1}^n \frac{1}{a_i+\overline{\omega^2}}= \sum\limits_{i=1}^n \frac{1}{a_i+\omega}$$ — rtybase yesterday
Yea, I was fairly sure both would fail to properly onebox.
 
I installed a MathJax chat plugin so half of it works. IDK if any of it does for you
But, ugh. No thanks >:(
 
8:33 AM
@Peilonrayz Without it it looks like gibberish.
 
IDK it looks like gibberish to me either way ;)
 
Hehe, there's that.
 
8:48 AM
You may consider asking on Stack Exchange Code Review. — Ole V.V. 1 min ago
 
9:15 AM
0
Q: I made a card guessing game in Java

fosionefI made a card guessing in Java. Problem: Three Card Monte This is the original "ball and cups" game where you try to find out which cup has the ball under it. You may play with three cups and a ball, three cards (two jacks and an ace), or three doors and a car. Basically, randomly select a cup t...

0
Q: Excessive (5-6) function parameters. Is there a better design?

JoeyboyIs there a better way to design this code? I have read that too many function parameters is a sign of poorly design code, and would love some feedback on this code. The functions Google Maps markers and update the state. Also any other feedback unrelated is welcome. Functions: // Initialising map...

 
 
1 hour later…
10:20 AM
Too many of these competition websites give the impression that you can learn programming in C++ by answering these (many times, non-trivial) data structures or algorithm questions. That certainly isn't the case -- most of the time, the code is a jumbled mess that would fail a code review in the real world, even if the answer "works". — PaulMcKenzie 25 secs ago
 
0
Q: Javascript Syntax-Highlighter for Java

Philipp WilhelmProject I wanted to create a syntax highlighter for Java by using HTML. It basically is using regex to find the parts that should be highlighted (at the moment: keywords, strings, comments, imports) and then uses HTML-tag to highlight the found parts. Result The website looks like this before ent...

 
11:25 AM
@Peilonrayz Request for opinion: should Python code using simple-salesforce, a Python interface to the Salesforce APEX API, be tagged or get its own tag?
And yes, we have Python+Salesforce questions.
 
Hmm, that's hard. I can think of reasons for and against. I'll mull over this a bit more :)
 
@Peilonrayz Thanks, no hurry.
I was tempted to smack on them all until I saw it was already a synonym. Of-course, we can still change that...
 
The generic situation is "I am using a {library} to interface with {API} in {language}". I want to say "only tag with {library} and {language}" but then I'm thinking "what if someone known {API} they'd need to follow lots of tags". (think Brian Oakley) I'm then tempted to say "only tag with {API} and {language}" but then I'm thinking that may become a PITA if the ecosystem grows to the point that the libraries are vastly different than the API. I think just tag them with all three?
 
11:41 AM
@Peilonrayz The language has to be tagged regardless, so that's the easy part.
 
Hang on, is Salesforce APEX a REST API (like I thought) cause most of those questions don't have a language assigned to them... Wat
 
I'm tempted to agree, but that would need de-synonymizing Salesforce from Salesforce APEX, correct?
@Peilonrayz That starts out as a simple question but gets complicated really fast.
I think it's both an API and an environment of sorts.
 
Hmm, ok I think I need to look into this some more. Cause I know one thing is certain in life and that is the devils in the details, and I don't want to have to clean this up in a couple years time if I make a mistake here.
 
Same here.
 
This is so complicated. I think I'm starting to get it tho
 
12:04 PM
@Mast Me thinks we should have three Salesforce tags. salesforce-apex (the language) salesforce-lightning (a framework) and salesforce-rest (to encompass the REST APIs)
4
I think salesforce should not be a synonym to anything and should be blacklisted.
Might be a good idea to take this to meta to see if anyone with more Salesforce experience can help
 
I'll double check this in the evening and make a meta out of it.
For now I don't see a reason to disagree.
🙏
 
👏
 
12:51 PM
0
Q: Volunteer Signup Website Homepage

RedDragonWebDesignI'm doing an exercise where I pick a webpage and I code its front end (in HTML and CSS) from scratch, just by looking at it. I started off with an easy one. It would be great if somebody could review my code. What are the best units to use? I know px is discouraged. Should I replace them with em...

 
1:49 PM
If you are willing to share all of your code, and want a review of all aspects of the code, you should visit the help center of Code Review to see if your question is on-topic there. Refactoring code is an awfully broad subject for Stack Overflow. — Heretic Monkey 17 secs ago
 
2:03 PM
Does it work if you remove the spaces (e.g. between = and Excel)? Like shown at codereview.stackexchange.com/a/20395/212958 . — mjwills 18 secs ago
 
0
Q: Microsoft Windows tutorial code sets the same variable twice(not my code!).C++

Matias Characoded in c++, presumably using visual studio. template <class DERIVED_TYPE> class BaseWindow { public: static LRESULT CALLBACK WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { DERIVED_TYPE *pThis = NULL; if (uMsg == WM_NCCREATE) { CREA...

 
@CaptainObvious No
 
@Mast RBA
 
2:25 PM
This question might fit better at codereviewChris 34 secs ago
 
Monking
 
@CaptainObvious does anybody else see an error in Chrome when running that snippet?
 
2:44 PM
@SᴀᴍOnᴇᴌᴀ A loading error in FF.
> ‘https://stacksnippets.net/highlightSyntax.js’ failed
 
Strange. I only ever get things like that when I have NoScript enabled.
 
Preview isn't working for me at least.
As in, preview doesn't highlight the code but cuts out the code.
Pretty sure it's not supposed to do that.
 
Ah, the joys of not escaping input
 
Yes, I know HTML isn't Java.
But still.
This is like sending the programmer to the store and they return with 12 loaves of bread.
You better be specific.
 
@Mast Answer > Comment :)
 
2:51 PM
0
Q: Get all combination of selected k elements in n

user227988Given an array of colored balls. All balls are identical in shape and size and hence, two balls with same color are indistinguishable. Given an integer K and you need to choose a bundle of K balls from the array. How many different ways you can choose K such balls. Two ways are different if for a...

1
Q: Does my Python palindrome code follow the best practice?

dicompI want to improve my coding. For practice purposes I implemented a function that checks for palindromes: def palindrom(name): name_reversed = "" for buchstabe in name[::-1]: name_reversed += buchstabe return name.lower() == name_reversed.lower() print(palindrom("Tom")) pri...

0
Q: Yet another reflection library

Vladyslav MozhvyloTried to do my own implementation of reflection(introspection) for using in my next projects. Is it optimized at compile time? If no, how can I improve it? This macro is good interface for adapting structures for reflection? What features can(should) be added to make reflection(introspection) mor...

 
@Peilonrayz sigh
Fine
I know
There you go.
 
Thanks :)
 
@Mast I wish I could get upvotes that quick!
Let's make that one go hot....
 
3:13 PM
@SᴀᴍOnᴇᴌᴀ You have an empty block quote (saying here so you don't get an edit)
 
@Peilonrayz I just saw it and done fixed it
the whole markdown update got me messed up
 
Yeah, I've noticed a question that should be illegal. I press edit and it looks way different to how it does currently XD
 
I also forgot to close my supserscript tag .... doh!
 
3:39 PM
1
Q: DynamicArray class in C++

PythenxI am pretty new to C++ and I think I have some problems of keeping code clean and optimized, especially I have problems with writing comments. I just don't know when should I be explaining what I write. Any tips and advices will be hugely appreciated! Here's the code: #include <iostream> #include <...

 
Monking
 
4:11 PM
@SᴀᴍOnᴇᴌᴀ I wasn't even planning on reviewing that...
 
I know...
 
I may yet reach 12k this summer.
 
4:29 PM
@SᴀᴍOnᴇᴌᴀ @Mast @SᴀᴍOnᴇᴌᴀ @Peilonrayz what question are you referring to?
 
6 hours ago, by Captain Obvious
0
Q: Javascript Syntax-Highlighter for Java

Philipp WilhelmProject I wanted to create a syntax highlighter for Java by using HTML. It basically is using regex to find the parts that should be highlighted (at the moment: keywords, strings, comments, imports) and then uses HTML-tag to highlight the found parts. Result The website looks like this before ent...

 
@pacmaninbw before I answered, @Mast added his answer and got three upvotes within a couple mintes
minutes*
(bearing in mind Peilonrayz advised him to add an answer instead of a comment, as we were commenting, so there were many eyes on the post)
 
Which was Sam's fault because he asked whether there was a bug in it.
 
so I should ask if there are bugs more often...
 
5:27 PM
@SᴀᴍOnᴇᴌᴀ Only if you want to force @Mast to accumulate more rep points.
 
The world is in a constant conspiracy against the brave.
- Douglas MacArthur
Or Adams
Don't remember which.
One was a general and the other a writer.
 
0
Q: Converting a float to a fraction as a string

stonkilla4I was inspired by this video by Matt Parker to use the Farey Sequence to convert a float into a string representation of a fraction, how did I do? How well did I follow F# workflow and patterns (I'm new to the language)? Can it be done better, or rather, how would a "professional" F# developer wr...

 
6:04 PM
-2
Q: Python scraper for getting soccer data from sports-reference

QJ303This Python scraper code worked a couple weeks ago, but now that I want updated data, it no longer cooperates. Thank you in advance! from bs4 import BeautifulSoup import pandas as pd from h5py.h5o import link from unittest.mock import inplace # Start at 2014-15 b/c that is the first year that sp...

0
Q: C# consecutive and redundant null checks

Frederik HoeftI am working on a C# application and I want to support multiple themes, so I wrote a ThemeManager class that can check, load and apply a specific theme. A theme is considered valid, when all of it's member variables are set (not null). If a theme is invalid I want to throw an IncompleteThemeExcep...

0
Q: Format string processing similar to date or printf()

domssonI wrote a function that is supposed to take a format string similar to what date accepts and replace all format specifiers with strings provided by a callback function. Format specifiers are sequences of a % plus another character; %% for a literal % Replace the format specifier with the string ...

 
6:17 PM
@SᴀᴍOnᴇᴌᴀ @Peilonrayz 11 minutes ago.
Went Hot.
 
yes I saw - the hotness calculator showed it at ~114% in the 7th hour
and it still does
I'm slowly improving my understanding of that forumla
 
@SᴀᴍOnᴇᴌᴀ Does it take into account the hotness of other questions on the network?
IIRC that's also a factor nowadays.
Can't have 200 hot questions.
Doesn't seem to take the site-penalty into account.
 
> It does not include the per-site adjustment factors or the cumulative penalty for multiple questions from the same site, and so is not directly comparable across sites or with the "arbitrary hotness points" shown in the tooltips on the SE.com home page.
 
6:40 PM
@Mast Congrats on lots of rep :)
@SᴀᴍOnᴇᴌᴀ Did you meant to delete the comment under your answer?
 
@Peilonrayz yeah I was experimenting with the mathjax and thought I had deleted it already
 
@Peilonrayz Thanks. If it stays hot for a while I may just hit 12k this week instead of somewhere this summer.
 
@Mast Hopefully :)
 
-1
Q: Project Euler #18: incorrect answer

WebRookieI am currently going through the Project Euler challenges, I have chosen to solve them in Javascript as I'm well versed in it and I feel comfortable using it. I reached Problem #18 and wrote this script to solve it: // This is the raw text as it was copied from https://projecteuler.net/proble...

 
7:01 PM
@CaptainObvious CNWAI
my current code doesnt work as intended — Johnny3020 2 hours ago
 
"I have tried this", does it work? — Mast 5 hours ago
If there had only been a reply.
The SO post was edited in reply, yea, that's not something I get notified of.
 
 
7:40 PM
1
Q: Tar file utility - Rust

DarendalI've been working on building a Rust version of GNU tar following the spec here. As of right now, I've got the binary accepting a single argument, the path to the file/directory to tar, which is passed to a separate library which does the heavy lifting. The library handles building the Tar record...

0
Q: Improvement to Luhn-Checksum Algorithm in Java

elauserI just made a small Luhn Checksum validator Description of Luhn Checksum Every number in the Integer gets added individually together, but every second digit gets instead doubled and added. If the doubled number is over ten each individual digit gets added. It works, but is there a way to make it...

0
Q: Avoid duplicate code in java for Logging

VasanthPlease refer the given below code . I have written this logic for logging. But this piece of code , getting replicate the for all fields logging( last name, dob,city,state , pincode ...etc), Here only validation logic going to differ , where as logging functionality will be remaining the same. Ca...

 
8:15 PM
possible answer invalidation by dragons on question by dragons: codereview.stackexchange.com/posts/245784/revisions
 
@Duga Odd. Rolled back.
 
@Mast I wasn't updating code to add feedback. I realized I added a wrong name of a class in my question and thats what I changed. I didn't change anything to add from the answer. It was just a class name change to real one. — dragons 6 mins ago
I've been in that boat before
 
That's unfortunate, please don't touch it. — Mast 10 secs ago
@SᴀᴍOnᴇᴌᴀ Again, and again, and again.
I've sailed the seven seas in that boat alone, and many others.
I was still working on a meta question.
Oh, btw, SO has 2 new mods.
 
8:30 PM
> The Stranger:
I guess that's the way the whole durned human comedy keeps perpetuatin' itself.
 
Expats also has a new mod.
@SᴀᴍOnᴇᴌᴀ Tempted to quote The charge of the light brigade in reply, but that's going to bite me in the future.
 
@Mast Wow noɥʇʎԀʎzɐɹƆ wasn't last
 
@Peilonrayz Protestors.
 
IKR, pretty strange still IMO
 
Good chance Yvette had a lot of votes too.
 
8:35 PM
I'd have thought she would have been on the results. But it seems they dealt with that
 
Yup, STV can deal with that pretty easily.
 
there was this:
124
Q: Leaving the site and the network - mid election is not the best, but there's no point in staying

YvetteThis post is a copy of Time to say goodbye - one less moderator with some customisations for Stack Overflow. At the writing of this post I am running in the 12th moderator election and am a moderator and the second highest ranking contributor on Pets. I have previously been an elected moderator o...

I happened to see that earlier today
 
@SᴀᴍOnᴇᴌᴀ Seems like they've deleted all the replies Mast got bar one
 
Jul 18 at 12:57, by Mast
Sooo, MSO has a new tag: election-withdrawal.
@Mast Can only guess from the outside - there have been 2 groups around Yvette: One which supports her, and an other who is, let's say, very critical of her. Things get nasty. Members of one group flag everything the other group does that relates to Yvette, comments either as unfriendly or unkind, or as no longer needed (depending on the group). Moderators have to step in, deleting comments. People ask about deleted comments. In the middle is Yvette, who just want her old position back - which was promised at the time she left. — Johannes Kuhn Jul 18 at 16:41
I try to stay away from SO. Best of luck to their new shovellers.
@Peilonrayz For the record, I'm still working on it.
It's still evening.
 
@Mast No problem, :) I'd rather you take a week and have a good post then rush things :)
 
8:42 PM
If you give me a week, it might still get finished an hour before the deadline.
 
I've written up an answer for my perspective of the above comments in chat, so we have a record of it in some sort if you want to cut that out
@Mast lol, that's so true
for me too
 
@Peilonrayz Ok, I'll leave out the suggestion then, you can post the suggestion from the starwall as an answer and all will be fine again.
It was your suggestion anyway.
 
I don't really mind who posts it just as long as it's there. gist.github.com/Peilonrayz/9bc242be59289018ed8ca1f81de898b5
I expanded on it a bit, but it was mostly just formatting
 
9:03 PM
0
Q: The [Salesforce] ecosystem

MastWhile hunting for my next zombie to take down, I encountered the following question: Patient Appointment CSV to insert records using simple_salesforce A question that seemed well written, almost complete, except this part: from simple_salesforce import Salesforce Turns out there's a Python REST ...

 
@Mast Ty :)
 
@Peilonrayz You too.
 
9:25 PM
1
Q: The [Salesforce] ecosystem

MastWhile hunting for my next zombie to take down, I encountered the following question: Patient Appointment CSV to insert records using simple_salesforce A question that seemed well written, almost complete, except this part: from simple_salesforce import Salesforce Those are not user-defined funct...

 
9:40 PM
-1
Q: ReactJS - code organization, best practices and more

SnirkaI have finished my first kind-of big first react application from scratch. I built a sorting visulizer, right now it has only one sorting algorithm but i am planning to add more. I used react-hooks in this project. Furthermore this is the first time i styled something completely alone so i would ...

 
"so if there is something wrong that i am doing i would like to hear about it and how can i change it" Check here please! — πάντα ῥεῖ 12 mins ago
 
10:28 PM
0
Q: LeetCode 1453: Maximum Number of Darts Inside of a Circular Dartboard

EmmaI'm posting my code for a LeetCode problem. If you'd like to review, please do so. Thank you for your time! Problem You have a very large square wall and a circular dartboard placed on the wall. You have been challenged to throw darts into the board blindfolded. Darts thrown at the wall are repre...

 

« first day (2635 days earlier)      last day (1368 days later) »