I've been having issues making the HTML portions of the following PHP file display. I'm not expecting full functionality at all, I'm simply trying to make the labels and text areas show -- but instead, the site is completely blank. What am I doing wrong?
<body>
<?php
function validateinput($data,...
I created a simple guessing game where the player can choose whether the player is guessing the number or the computer.
If the player is guessing the number, then the computer will generate a random number between 1 to 100. Then, the player must guess the computer's number.
First, the player will...
N, M = 500, 2000
a = np.random.uniform(0, 1, (N, M))
k = np.random.randint(0, N, (N, N))
out = np.zeros((N, M))
for i in range(N):
for j in range(M):
out[k[i, j], j] += a[i, j]
Can this be made any faster?
@bitsapien I see CODEOWNERS offers code reviews to be triggered. Can you explain how to use it to restrict access to only a part of the repository? — Suma13 secs ago
I'm trying to create a maze with depth first search algorithm. the algorithms seems to be working fine but it remove the walls from the border when it's on even index node it remove the right and bottom wall and right and bottom wall when it's on odd node.
this.boxes is a 1d 40x40 array containin...
I have implemented this depth first search maze algorithms but i'm little confused about how to create borders around the maze. I move two steps at a time to create walls between them. Here the code
this.boxes is 1d array contains html elements that contains the index of box index based
grid is 1...
This is too vague. We're not going to double-check it for you (especially as we don't even know what tests you've already run and what the exact results were). And "improve" is meaningless - we've no idea what your criteria for that are. As I've just explained, we're not a testing or code review service. — ADyson16 secs ago
I have surrounded my initials with a circle. This is intended to be a re-usable component in a responsive layout. (When it is re-used the text will always be two letters, and the font won't change. It behaves sensibly when the browser zooms in and out, but I haven't yet considered if a different ...
I am building a doctor appointment app with Django and Django Rest Framework. The app will have the functionality for secretaries to add appointments to a Doctor's calendar, and each Doctor may have more than one clinic (and multiple secretaries).
I build this Calendar Model to store the availabi...
I have intermediate experience as a programmer in Python and was recently introduced to static code analysis tools and their relationship to code coverage, which if done right, should provide a rough idea of how many tests should be written to test the code.
Since this is a new topic for me, I st...
Welcome to being a programmer! Your code has an error. You are putting questions.question into the HTML. But questions is an array of questions. You might be able to do questions[0].question and that will work. Once your quiz is working, why not submit it to the code review stack exchange? — speciesUnknown41 secs ago
coders are in general not keen on going through lines of code without knowing what to look for. Rewrite your question such that it becomes obvious as soon as possible before jumping in code. Also consider posting this question at codereview SO sister site. (see text balloon next to "rep" and "?" upper-right corner. — ZF007just now
I have put together this blogging application with Express, EJS and MongoDB.
There is a public, front-end part and a dashboard. In index.js I have:
// Bring the Dashboard
const dashboardRoute = require("./routes/admin/dashboard");
// Register Dashboard Routes
app.use('/dashboard', dashboardRoute...
Does the query...
SELECT *
FROM dbo.[company$Customer] AS cu
LEFT OUTER JOIN dbo.[company$Customer] AS cu_billto
ON cu.[Bill-to Customer No_] != ''
AND cu_billto.No_ = cu.[Bill-to Customer No_]
WHERE cu.timestamp > @max_ts
OR cu_billto.timestamp > @max_ts
... p...
I have a big python data-frame and I am trying to add a column to it with average number of missing values by row. I have inherited some code that is working but I'd like to reduce memory usage by removing intermediary values.
Here is a toy exemple :
students = [ ('jack', np.NaN, 'Sydeny' , 'Aust...
This program takes text input and evaluates the expression.
This is meant to be an exercise.
I reinvented a stack class though I know C++ provides one in the standard library but it isn"t meant for production use but to solidify my knowledge on linked list data structure
I also made an infix post...
Note: This is simply for test and I do not plan on using for malicious reasons, just educational purposes
from selenium import webdriver
from time import sleep
driver = webdriver.Chrome("C:\\Users\\Abdul_szuzdge\\Downloads\\chromedriver_win32\\chromedriver.exe")
Numbers = ['10', '20', '40', '30...
Why use a / 10 instead of a coordinate? This mandelbrot function is a simplified version of what I've written, but it seems odd to pass a single integer into a function that should be expecting a complex number. — Carcigenicate21 secs ago
If you have working code, and want to make it better, consider asking at codereview.stackexchange.com — kojirojust now
@Ryan You don't think that asking us to look through all of this code and tell you "notable things you should change" is a whole code review? — GrumpyCrouton27 secs ago
This is a follow-up question for A recursive_transform for std::vector with various return type. Thanks to G. Sliepen provide further review suggestions. After digging into the topic of achieving a more generic recursive_transform function in both various output type and various container type, I...
Let's assume I have a socket that feeds me an array of five items, none of which have unique keys. Let's also assume that that data changes very very often, like every 300ms or so. This would be the shape of the data:
const data = [
{
name: "John Brun",
avatar:
"https://upload.wik...
This is my prime sieve based on the Sieve of Eratosthenes.
import itertools
sieve = itertools.count(2)
primes = []
nprime = 0
for _ in range(10000):
nprime = next(sieve)
primes.append(nprime)
sieve = filter(eval(f"lambda x: x % {nprime} != 0"), sieve)
On my computer this code takes 1...
I was trying to update a page but I did not understand how it source code was working since the first developer obfuscated it and now he is dead. I tried my best by making some comment on the code since it was not commented. I did by best but I still don't understand what the code is supposed to...
Impressive algorithm approach, I can open a question for it on Stack Overflow or Code Review if you wish and accept your answer, but this question (as stated) was about speeding up a general computation — OverLordGoldDragon22 secs ago
I VTC'd on Code Review because it's off-topic there. I haven't VTC'd here yet because the question is salvageable if you (1) add a bit more context - how is the function called (2) remove the "How to improve it" part (which is too opinion-based for SO) — CertainPerformance48 secs ago
I told my wife I got a "Nice Question" badge last week for the recent meta post about lowering the close vote threshold - she asked if she should start giving me badges for things she asks me to do :)
@Samathingamajig when suggesting users post on CR it would be great if there was also a suggestion like "Please read the relevant help center pages like 'What topics can I ask about here?' and 'How do I ask a good question?". In the current form the post above would likely be closed as off-topic because the code is not embedded and might be considered not working as intended. — Sᴀᴍ Onᴇᴌᴀ19 secs ago
Bit of a pointless program (at the moment). It's intended more as practice for myself rather than anything else.
General idea is that you add details of a particular cat or dog, and it'll update a TreeView. A dog or cat can then be removed based on their assigned number.
Many thing I wasn't too ...
I am working on an application that is required to be constantly running, and as a requirement should make multiple attempts for particular processes such as web API/database calls, just in case network connectivity goes down for a moment, or something similar.
In this case, I'm constantly having...
I want to organize mapping for my Angular app so that code structure would clear for other developers and I want to have as less code as possible.
I have an api service that is responsible for communicating with API. I create separate data services, which utilize the api service, to get backend d...
https://leetcode.com/problems/number-of-enclaves/
Given a 2D array A, each cell is 0 (representing sea) or 1 (representing land)
A move consists of walking from one land square 4-directionally to another land square, or off the boundary of the grid.
Return the number of land squares in the grid f...