INTRODUCTION:
(You can skip the introduction, it's a little explanation of my technical skills and the problem I have)
As you can see in the title, the problem is really complex (I think?). It's hard for me to explain the problem with my poor English skills. So I will start with a simplificatio...
I had this question in an interview recently. Given a sorted array of integers, return a list of those integers squared, with the squares sorted. So given an array of these numbers:
-5, -3, 1, 2, 4
the result should be this:
1 4 9 16 25
I came up with this solution using Java 8 streams, b...
I started learning from the book: head first design patterns. As I am trying out different programs in the book, I am compiling them in this one demo app. Below is the code for its driver function. Can anyone guide me with any improvements to the program (related to style, programming, formatting...
The following bash script was made to retrieve some local repository information in order to be used to display a condensed git status in terminal PS1 prompt.
It does some simple grep's string manipulation over (git status) --short version text to display 6 repository status: Commits ahead, ...
I wrote a code that accepts the output of rcon users command on the CS 1.6 console and notifies me if players other than the ones mentioned in the whitelist.csv are playing and the names of the blacklisted players that are currently playing. The program requires 3 files as inputs:
1) A text fil...
I have built this Generic Graph traverser, I have this implemented with DFS, I feel it will work equally fine with BFS too.
What do you think of this implementation?
I want help in reviewing the Visitor interface.
Should I have Generics in it or just use the base Object?
public abstract cla...
this is my first post here so please excuse any errors made in my post since I am new to this. For one of my assignments in school, I have the following prompt:
Acme Parts runs a small factory and employs workers who are paid one of three hourly rates depending on their shift: first shift, $...
Just for practice purposes, I written a basic client sided login/signup system that allows you to make an account, and then log into the account from my webpage. What it does is append to an object known as database for every new account made, and when you sign in, it loops through the database a...
There's JSON Schema. And if you use JSON RPC its kinda self documenting. Potentially developers could be responsible for maintaining both sides of a channel and updating them in unison (deployment would be a challenge). But likely the API should be defined in an external doc that must be updated. You really need a version control / codereview / build system that blocks checkins without proper collateral like docs. — tdelaney30 secs ago
@SᴀᴍOnᴇᴌᴀ Experiment: take a look at meta.SE for a few days, see how much crap gets posted there and what information is provided while asking a question there. Then ask yourself: do people even read?
suppose i have a vector containing n elements. I want to find out the number of previous elements greater than its element at present index i . I mean i want to find A[i]>A[j] && i
constraints : 1<=t <=1000 , 1<=n <=10^5 , 1<=A[i]<=10^5
My code:
#include<bits/stdc++.h>
using namespace std;...
Im working on a login script verification code using the password_verify function. But somehow the code shows an error on ELSE statement.
My code:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>Login</title>
<link rel="stylesheet" href="css/style.css"/>
</head>
<body>
<...
1.2. Pure javascript never gets deprecated or shut down and I'm very curious to understand how things work. 4. I think I'll give up on that idea, the file separation. Yesterday I started with my own approach which you can see here: codereview.stackexchange.com/questions/243325/… The setup at the top is a mess but the example below it looks fine to me. It starts to look like a Vue component even if that was not my goal. — Jens Törnell32 secs ago
My application consist of two threads.
One - is running http server with aiohttp
Second thread is asking another web resource about current currency.
So there are two threads with asyncronous requests.
But I was struggling to run my http-server in another thread, I found solution here
I nee...
I want to calculate the correlation time. First I calculate the auto-correlation function:
$$
\chi(t) = \frac{1}{t_{max}-t}\sum\limits_{t'=0}^{t_{max}-t}m(t')m(t'+t) -\frac{1}{t_{max}-t}\sum\limits_{t'=0}^{t_{max}-t}m(t')\frac{1}{t_{max}-t}\sum\limits_{t'=0}^{t_{max}-t}m(t'+t)\sim e^{-t/\tau}
$$...
I want to create a MVVM-C project, but also adequately test it. Naturally I want to create such a project that can access a Network Service.
Any comments or thoughts on this approach?
DependencyFactory:
protocol Factory {
var networkManager: HTTPManagerProtocol { get }
func makeInitial...
@Mast (Strange I got no ping for that) That's in a different block "The Overflow Blog" where the "Featured on Meta" block is full. Like we could try to move one of our questions to the 'hot on meta' block. (by unfeaturing it) But I want no part in that.
@Mast Strange, and ofc the OPs decision always goes through... :/ Thank you SE
This question appears to be off-topic because it is a code review request. This might be better suited to the Code Review Stack Exchange site. Before posting there be sure to read their FAQ to ensure that your question meets their guidelines. — John Conde33 secs ago
I have a following table in a flask app
class Price(db.Model):
__tablename__ = "prices"
id = db.Column(db.Integer, primary_key=True)
country_code = db.Column(db.String(2), nullable=False)
value = db.Column(db.Float(precision=2), nullable=False)
start = db.Column(db.DateTime(t...
Honestly, I have the suspicion that when this hits code review that'll be exactly the feedback I get. Still, like you said, it's interesting. — Doug Hughes54 secs ago
I was building some library code and i ended up with a design and involved some marker / marker:ish interfaces. Wanted to get input if there might be better way of doing this (or if my current design is acceptable due to circumstances). Below is an illustration of the current design, simplified ....
As you haven't got an issue with your code, this is probably not the place to post this. Try Code Review. Saying that, I suspect one of your issues is that you are making a lot of calls to DB. Try importing the data (either to memory or to a sheet) and then performing the updates — Zac30 secs ago
I am a beginner in Python, as you will see looking at my notes.
This is a program that simulates seat booking in a cinema for example.
The program stores the users name as a key and the seat(s) they have chosen in a dictionary as key-value
pairs. How can I improve this program. I have used one fu...
Create a class Account with the attributes:
accountId int accountType String balance int The method public
boolean withdraw(int) used to calculate the current balance of the
respective account. Before that it should enough balance. If there is
enough balance, deduct the amount ...
I am trying to read an input file containing two sentences on new line. I have to write a code to rotate every word in a sentence to the right side and write to output.txt file. For example, input.txt file contains following:
Hello World.
Welcome to java programming.
Let's say "Hello" has inde...
I have a graph G=(V,E). A list of nodes NODE subset of V. I want to find out all the neighbor nodes of each node in NODE and add edge if those neighbors have distance greater than 2. Is there any other efficient way of writing those loops to reduce the time complexity of this code so that complex...
@Peilonrayz Perhaps "they've" been exploring "holes in the ground"... perhaps the May activity was just checking various sites where the Yearling badge was awarded or reputation earned
darnit I did a double ping to Peilonrayz :/
I'm too used to Slack where I edit messages with ease
@SᴀᴍOnᴇᴌᴀ Thank you for the review did you saw anything that could be improved and what caused you to make you rollback. — Syed Mohammad Sannan1 min ago
@SᴀᴍOnᴇᴌᴀ Hmm, I think if you put the second sentence after the third it'd be easier to understand. You can read it as 1&2 are 'connected' or 2&3 are 'connected', where the other sentance is independent.
Background
About the Fleissner-Grille
The Fleissner-Grille is a really easy possibility to encrypt text.
You just have to take a grid of size n*n with (n*n)/4 holes (example). You then just write one letter in one hole. After you've filled every hole with a letter, you just turn the grille by 9...
I am new to javascript so I am not sure if it's bad practice to nest a for loops inside of each other.
This script simply takes a poorly organised menu and rebuilds it. Should I make a separate function for the nested for of loop or is it okay to nest it like I have done below?
Everything works...
Answers that do not contain a review should be flagged VLQ, not NAA. Yet, sometimes I can't flag an answer VLQ because it's upvoted too far. Is a moderator flag my only option here?
Specifically, this answer by a user that should know better.
Thanks @peilonrayz for this comment - I considered reviewing it but would rather focus on unanswered questions, including a potential follow-up question as I was alluding to
@SyedMohammadSannan Please understand not all contributors you meet on a question are going to review the code. Incessantly asking for a review when that's not the topic of the comments is, to me, very distasteful. — Peilonrayz4 hours ago
No problem. That seems like a good game plan. (Aside, I didn't know you could ping people with lower case instead of an uppercase letter. Making me wonder if @SamOnela works...)
@Mast Sounds like a good idea, I'll do that in a bit.
Read some good advice about implementing singletons. But personally, I believe singletons should be avoided as strenuously as global variables (which singletons are). — Fred Larson43 secs ago
I am trying to learn how to effectively use error handling in my code. To do this, I have created a class called 'main.py' which reads the value of a specified curve at a specified date. The code in this module is the following:
from data_reader import read_curve
from datetime import datetime, t...
I do power electronics nowadays, and we deal with cos(phi) regularly. I can imagine wanting that phi to be in a variable that's actually φ. θ isn't much different.
Except we do a lot in Excel so everything is referenced by cell anyway.
Wait, we could use named cells. The amount of carnage that would cause is limitless.
@Peilonrayz On my work PC I'm actually using UK interpunction because it allows me to use the Del/. key on the numeric pad to put in whats-it-called-again...
doubles?
Non-whole numbers.
But in the Netherlands the default is to use a comma there.
Yeah, it's really strange that there's a divide over decimal points and thousands. I used to get German Pepsi bottles and the 0,5l was always strange to read. More so than seeing German.
/// <summary>
/// Keeping my fortune in Decimals to avoid the round-off errors.
/// </summary>
class PiggyBank {
protected decimal MyFortune;
public void AddPenny() {
MyFortune = Decimal.Add(MyFortune, .01m);
}
Hi Rebecca, welcome to StackOverflow. I'll note that this question may not be the best fit for this site which aims more to have questions with concrete answers and this one is more soliciting a range of opinions. A good place for it might be on the code review stackexchange — George Mauer32 secs ago
I am currently doing the MIT beginners course for python coding. I have a question (already kindly answered on this site) about the longest string in alphabetical order.
Take the answer below (by dingalapadum):
prevChar = ""
currentString = ""
longestString = ""
for char in inputString:
...
output is not printing can you spot error please
I tried to create linked list and insert and view the data but there is not output being printed
class node:
def __init__(self,data):
self.data=data
self.next=None;
class linkedlist:
def __init__(self):
self.start=None;
def...
@Peilonrayz Multiple majors aren't that hard if they have overlapping requirements. That's part of why I have a double major in math and computer science.
I'm new GO coder (stared this Sunday) coming from different backgrounds, I wrote the below code based on my understanding of Go within these couple of days, and impacted of my experience in other languages, I like to share for Go experts review/comments and feedback.
package main
import (
"...
yeah, I'm presuming you saw the end of Reinderien's answer which mentions the missing call to calculate_spectral_and_broadband_OSA and the OP confirming that the call was skipped when posted on CR, so adding the call led to AI
I see. It seems there's some discussion regarding this subject here, including a reasonable explanation why it's not supported. Then I suggest you post a working version into the Code Review Stack Exchange using the CancellationToken and the CancellationTokenSource as explained above, even if it's not the most efficient version, it's a better place to be guided in that kind of review. — rph5 secs ago