@SᴀᴍOnᴇᴌᴀ Regarding this. Considering anyone above 200 rep can still post questions without code blocks, I'm this close to saying the collateral damage is unfortunate but acceptable.
It's not ideal, not entirely fair either, but if it's going to stop 5-10 crap questions a day while also stopping 1 a month it shouldn't have, eh, it's a bit of a numbers game.
Got to do something to keep moderation manageable with increasing size.
I've written a simple web scraper in Python. As it is my first venture in Python, I'd like to ask for a code review from more experienced coders. All input is welcome.
A little bit of background:
I'm a huge fan of video games. In Japan, there is a company called Media Create which tracks all sa...
I created a graph to show the change in the percentage of questions answered over time and the first version fetched data from chat transcripts using PHP. The subdomain I have registered for my webspace doesn't offer HTTPS so the calls to file_get_contents() would fail when run there. Because of ...
I've been using flask-jwt-extended for my application and one of the problems I had was logging a session out and making sure the token is not usable anymore.
I've based my solution on the Blacklist and Token Revoking documentation page with a custom RevokedToken model:
from flask_sqlalchemy im...
I have a large data frame that I want to merge with another dataset. In order to do so i need to get the names of individuals into a certain format. The function below converts the name in 'column' to the desired format (mostly) and stores it in 'newColumn'.
My question is, is there a better (fa...
I wrote a simple example of stopping go rutines. But I think that this can be implemented better.
Please see my code
package main
import (
"fmt"
"time"
)
var chans = map[string]chan int{
"test1":make(chan int),
"test2":make(chan int),
"test3":make(chan int),
"test4":mak...
Here is my AC submittion. And I found a wired circumstances when I remove this line dumyHead->next = NULL; my submit will TLE.
I know if I don't set it to NULL it will cause a loop reference, but I use len as a counter to iterate over the list, so when len <= 0 the loop will stop. I run in my lo...
So I was trying to generate a quick test file. I wanted to have 5 columns and 15 rows of random numbers.
Naively I went like this:
import csv
import random
with open('fichiera.csv', 'w', newline='') as csvfile:
randomwriter = csv.writer(csvfile, delimiter=',',
quotech...
I am working on a calculator program for my class and im using methods and i have to take the entire equation in on one line and then separate it afterwards and that is where i am running in to a problem.
I mainly need help parsing my string in to a double
I have already made this code, if any...
hi I was wondering how efficient my code is creating custom indexof in javascript using regex instead of looping for the whole way in most solution I find and I believe this got O(1) since no loop is needed.
the idea is to use regex that put either the key or any list of word that is not key, th...
With all respect, I would decline such approach in the code review. It's misleading, causing non-obvious overload resolution, and not much help from compiler to figure out why that code breaks. It's too C-plus-plusish, sorry. — Yury Schkatula37 secs ago
I'd like to add computed property to observable array.
Would you let me know how to do it. I would like to add lineTotal computed property to each element of an array.
Here is my code:
function ItemsIndexViewModel(model, url) {
var self = this;
self.url = url;
self.items = ko.observableArray();...
This is a programming excercise from chapter 8 of a C learning book by K N King. The program should prompt a user for a message, and return it after translating it to B1ff speak. e.g A->4, b->8 etc
The program works as asked in the excercise, however how can I create a more efficient declaration...
Side note: your function uses 3 variables (src, inverse and tracker) but it has only 1 parameter (src). For that reason it would definitely not pass my code review, regardless of how you structure the ifs.... — Peter Bjust now
I have question regarding best practices. I've decided instead having config inside either app.config or xml file to have my config file inside sqllite file database. This config will contain basic information for specific class. Config will be managed from sqllite database browser. My question i...
I'm voting to close this question as off-topic because there are multiple fatal errors in the provided code and fixing one just surfaces another. There is no practical single answer that will fix this and it's not suitable for codereview.stackexchange.com in this state either. — Graham59 secs ago
So, I'm building export/import CSV helper. I have some performance issues in the code below. it takes me to parse CSV of 25,000 rows at 7 seconds.
If someone can help, it will be awesome!
public System.IO.Stream ParseContent<T>(IEnumerable<T> entities) where T : class
{
i...
(Follow-up question: Improved Van Emde Boas tree based map in Java)
For the experimental part of my MSc thesis I was working on van Emde Boas tree, and I have this:
package fi.helsinki.coderodde.searchheapbenchmark.support;
import java.util.Collection;
import java.util.Collections;
import java...
To recall what is a bin packing algorithm, a bin packing algorithm is an algorithm that optimises the number of bins of a certain size used to hold an arbitrary number of objects of varying size.
In my variant I also work with a second constraint that is the bins must hold a certain minimum size...
I'm required to perform a slight conversion on a string which contains html.
The conversion should transform a elements such that they become span elements. The conversion should also place the href attribute from the original a element into the span.
I have what I think is a working solution, ...
I wrote the Game Of Life algorithm with Go. There are a million ways that we can implement the algorithm, but I want to know is it implemented in good-way or not?
I wonder how can I improve the performance and the code quality?
package main
import (
"math"
"math/rand"
"strconv"
...
I am solving ROCK problem on SPOJ. I dont know why I am getting WA here. Tried many testcases.
#include <bits/stdc++.h>
using namespace std;
#define fastIO ios_base::sync_with_stdio(false);cin.tie(NULL)
#define pb push_back
#define mp make_pair
#define ll long long int
#define ull unsigned long...
Almost like this question here, I'm playing with some methods that may fail, but in my case, the method failing is not a exceptional case; it just means I need to try running it again.
The method I'm writing is inherently stochastic, so running it multiple times yields different results. Some ar...
Im working to implement some simple bigints functions for addition, multiplication and powers they work correctly but the larger the numbers the longer the time it takes.
For example 2^10000 takes a very long time
I will try to include all the funtions i'm using
char *ft_strnew(size_t size)
...
Need help if anyone could help me with the following in JavaScript
Depending on how many sexes you've hit, convert it to the following answers
1 = It became a six
2 = You got a pair
3 = You got three
4 = You got quote
5 = YATZY
The function should look like this:
function analysis (antSex) {...
Given a camelcase string and an index, return the subword of the string that includes that index, e.g.:
find_word('CamelCaseString', 6) -> 'Case'
find_word('ACamelCaseString', 0) -> 'A'
My code:
def find_word(s, index):
for i in range(index, 0, -1):
if s[i].isupper():
...
The problem: find and return the first nonrepeating character in a string, if the string does not have a nonrepeating character return an empty string. For purposes of finding the nonrepeating character it's case insensitive so 't' and 'T' appearing in the string would imply that that 't' and 'T...
GetValuesFromDB will fetch values from the DB and return a new object which will have SubStatus.
ProcessCounter is a class that defines SafeCounter for Processed, Passed, Failed and Skipped. The Construction set all of them to 0. scheduler defines the MaxDegreeOfParallelism.
GetValuesFromDB or D...
@avazula yeah I left an answer partly because nobody else had... it took the OP nearly a month to respond, which seems somewhat average for some users on CR (at least those I provide answers for)
I have a node tree structure that renders database information in the browser using vis.js - see this. I won't use the actual table entities, but suppose it's something like:
building
floor
office
room
In particular, I am wanting to write an object that holds an array of all the node details....
@Donald.McLean after 5 years there is one room that doesn't have a curtain up... I have a curtain and curtain rod to install but it hasn't been a priority
Our wedding anniversary is my wife's half-birthday. One of our daughters was born on the actual Memorial day and the other was born on our wedding anniversary.
We've had more warm days than we should've this winter. But that's not surprising since we had a major heat wave last summer which was the driest in 70 years or so.
@Donald.McLean We had our first date on May 4th. That sounds fancy, unless you know in the Netherlands that's Remembrance of the dead (similar to your Memorial Day, I think).
I have not included my code because this is not CodeReview SE. I am asking a specific question about suppressing a warning. My code and/or use-case is irrelevant. There are many ways to suppress many warnings, I am simply asking if one is known for suppressing runtime warnings. — Albert Renshaw27 secs ago
"is there a way to have all entries be 3 pairs and not the double or single pair at the bottom?" - yes, just filter the final list by the lengths of elements. And about "is there a better way to do this?" - if the code produces correct results, you can post it on codereview.stackexchange.com. For SO this kind of question is subjective and opinion-based, hence off-topic. — Georgy7 secs ago
I want to create a comment system.I came across
this :https://github.com/ionutvmi/master-comments-system
It works but I can see that they are some security flaws in it.Especially Sql injection And session hijacking .I wish to fix it but It will be difficult to do so alone as it is very long.Pl...
I just realized I have exactly 99 bottles of beer in my cellar. Tempted to put them on a wall or something.
4
@Feeds sigh
> This is code to allow me to post because coderreview.stackechange wont allow me to post unless there's atleast three lines of code
This is code to allow me to post because coderreview.stackechange wont allow me to post unless there's atleast three lines of code
This is code to allow me to post because coderreview.stackechange wont allow me to post unless there's atleast three lines of code
Not sure if that's ignorance, malice or stupidity, but how did OP expect that to end?
We got a shiny new blocking function in effect to make sure people don't post questions without posting code. Obviously you didn't get the hint. Since the feature is still fresh, can you help us improve it to make it more clear? Questions without code are not welcome on Code Review, as indicated in the help center (of which a link is provided when you try to submit a question without code). — Mast12 secs ago
I'm creating a service that will pull data from server, then load that data into a property to be used later on, then notify all component that the service "is ready". The idea of loading data into a property is so that components can query it synchronously (through some methods)
the problem tha...
Motla, IMO, the goal of printing without "knowing anything" about the variables or their values is tied to a certian approach using ?: and has troubles answered below. OTOH, if you are willing to achieve without "knowing anything" with another approach, consider _Generic. Example: Formatted print without the need to specify type matching specifiers. — chux6 secs ago
I have written a test automation program the recurses through all links under a page element. However, for some reason it is not preserving the parent URL info where a particular link's web response is checked. Please review the code below and let me know what step I need to take so that parentUr...
https://codepen.io/anon/pen/VqezzK
The mouseleave event is firing on the arrow, I was using mouseout, and was told i need to use mouseleave and it would fix the bubbling issue and that wouldnt occur anymore, i'm at a loss and not sure what to do.
slide.forEach(slide=>{
slide.addEventListe...
dont pass parameters by value when you dont need a copy int money(std::map<int, int> x) shoudl be int money(const std::map<int, int>& x) or better dont add up every single coin each time you add a single coin. I think this belongs to codereview.stackexchange.com — user46303581828 secs ago
On looking at the components(separatedBy separator: String) -> [String] method from the Swift Standard Library, I tried to come up with an implementation just for practice. Your comments are welcome to improve the same. Thanks.
Input:
func main() {
let sampleString = "Do not be sorry. Be ...
This is my first React/Redux project. I'm pulling down a list of Google Fonts, then displaying a list of 3 randomly selected ones. I want the list of random fonts to be populated automatically after the data is fetched, but also to be able to be triggered manually.
So, I've decided to put the f...
In Kimball data warehouse, reports contain a -1 row, to show the dimension is not available or existing currently. (this is an option rather than using null)
https://www.kimballgroup.com/2010/10/design-tip-128-selecting-default-values-for-nulls/
Kimball: "You can assign it to another special re...
The task:
You will be given several lines of messages containing data. You have to check for the validity of the lines. A valid line should be in the format: “s:{sender};r:{receiver};m--"{message}"”
sender – could contain any ascii character except for “;”
receiver – could contain any ascii ch...
I wrote my first project in Python and i would like to know is it correct? I prepared some guidelines i want to ask. (I know that i dont have any documentation yet )
Is my code compatible with PEP8 ?
Is my code compatible with ZenOfPython ?
Is my code compatible with OOP ?
Is my code easy to ex...
Problem: find the number of distinct amount of money a pile of coins can make.
The vector, coins, contains the values of the coins, and the corresponding vector, quantity, contains the number of coin there are (let's say coins = {1} and quantity = {5}, this means I have 5 pennies).
Although ...